{"id":27999034,"url":"https://github.com/dnsimple/dnsimple-java","last_synced_at":"2025-05-08T22:55:54.263Z","repository":{"id":16720545,"uuid":"68751169","full_name":"dnsimple/dnsimple-java","owner":"dnsimple","description":"The DNSimple API client for Java.","archived":false,"fork":false,"pushed_at":"2025-05-08T04:40:51.000Z","size":1048,"stargazers_count":9,"open_issues_count":1,"forks_count":6,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-05-08T22:55:44.269Z","etag":null,"topics":["api","api-client","dnsimple","dnsimple-api","dnsimple-policy-eng","dnsimple-policy-group-apiclient","dnsimple-policy-triage-application","java"],"latest_commit_sha":null,"homepage":"https://developer.dnsimple.com/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dnsimple.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2016-09-20T20:35:28.000Z","updated_at":"2025-05-08T02:23:42.000Z","dependencies_parsed_at":"2024-04-04T13:46:03.653Z","dependency_job_id":null,"html_url":"https://github.com/dnsimple/dnsimple-java","commit_stats":null,"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dnsimple%2Fdnsimple-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dnsimple%2Fdnsimple-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dnsimple%2Fdnsimple-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dnsimple%2Fdnsimple-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dnsimple","download_url":"https://codeload.github.com/dnsimple/dnsimple-java/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253160797,"owners_count":21863627,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","api-client","dnsimple","dnsimple-api","dnsimple-policy-eng","dnsimple-policy-group-apiclient","dnsimple-policy-triage-application","java"],"created_at":"2025-05-08T22:55:53.439Z","updated_at":"2025-05-08T22:55:54.252Z","avatar_url":"https://github.com/dnsimple.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DNSimple Java Client\n\nA Java client for the [DNSimple API v2](https://developer.dnsimple.com/v2/).\n\n[![Build Status](https://github.com/dnsimple/dnsimple-java/actions/workflows/ci.yml/badge.svg)](https://github.com/dnsimple/dnsimple-java/actions/workflows/ci.yml)\n\n## Requirements\n\nThis library is tested with Java 21+ (Temurin 21) and built for Java 21+ JVMs.\n\nYou must also have an activated DNSimple account to access the DNSimple API.\n\n## Installation\n\n### Maven\n\nAdd this dependency to your project's POM:\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.dnsimple\u003c/groupId\u003e\n  \u003cartifactId\u003ednsimple-java\u003c/artifactId\u003e\n  \u003cversion\u003eX.X.X\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n### Gradle\n\nAdd this dependency to your `build.gradle` file:\n\n```groovy\ncompile 'com.dnsimple:dnsimple-java:X.X.X'\n```\n\n## Usage\n\nThis library is a Java client you can use to interact with the [DNSimple API v2](https://developer.dnsimple.com/v2/).\n\nThe examples below demonstrate basic usage.\n\n```java\npackage myapp;\n\nimport com.dnsimple.Client;\nimport com.dnsimple.data.Account;\nimport com.dnsimple.data.User;\nimport com.dnsimple.data.WhoamiData;\nimport com.dnsimple.response.SimpleResponse;\n\npublic class MyApp {\n    public static void main(String[] args) {\n        Client client = new Client.Builder()\n                .sandbox()\n                .accessToken(\"YOUR-ACCESS-TOKEN\")\n                .extraUserAgent(\"your-user-agent\")\n                .build();\n        SimpleResponse\u003cWhoamiData\u003e response = client.identity.whoami();\n        Account account = response.getData().getAccount();\n        User user = response.getData().getUser();\n        System.out.println(\"Account: \" + (account != null ? account.getEmail() : \"N/A\"));\n        System.out.println(\"User: \" + (user != null ? user.getEmail() : \"N/A\"));\n    }\n}\n```\n\nThe user agent value will be prepended to additional user-agent information set by default in this library. While it is not strictly necessary to set the user agent, it is often helpful for the team at DNSimple when debugging, so please consider setting it.\n\n### List request options\n\nFor endpoints that support it, you can set options to filter, limit, and sort the results that the API produces thanks to the `ListOptions` class.\n\n```java\npackage myapp;\n\nimport com.dnsimple.Client;\nimport com.dnsimple.data.Certificate;\nimport com.dnsimple.request.ListOptions;\nimport com.dnsimple.response.ListResponse;\n\npublic class MyApp {\n  public static void main(String[] args) {\n    //...\n\n    // Use the ListOptions.Builder class to get an create a ListOptions object\n    ListOptions options = ListOptions.empty()\n                    .page(2, 10) // Get the second page of 10 items\n                    .sortAsc(\"state\") // Sort by state in ascendant order\n                    .filter(\"autoRenew\", \"true\"); // Filter certificates with enabled auto-renew\n    ListResponse\u003cCertificate\u003e response = client.certificates.listCertificates(1, \"1\", options);\n    //...\n  }\n}\n```\n\n## Sandbox Usage\n\nIf you would like to test in the [DNSimple sandbox environment](https://developer.dnsimple.com/sandbox/) then add the `sandbox()` builder method to your client:\n\n```java\npackage myapp;\n\nimport com.dnsimple.Dnsimple;\nimport com.dnsimple.Client;\n\npublic class MyApp {\n  public static void main(String[] args) {\n    Client client = new Client.Builder()\n                              .sandbox()\n                              .accessToken(\"YOUR-ACCESS-TOKEN\")\n                              .userAgent(\"your-user-agent\")\n                              .build();\n    // ...\n  }\n}\n```\n\nYou will need to ensure you are using an access token created in the sandbox environment. Production tokens will *not* work in the sandbox environment.\n\n## Stub for Testing\n\nWhen developing unit tests for your application, you should stub responses from this client to avoid making any network calls.\n\n## License\n\nCopyright (c) 2016-2024 DNSimple Corporation. This is Free Software distributed under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdnsimple%2Fdnsimple-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdnsimple%2Fdnsimple-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdnsimple%2Fdnsimple-java/lists"}