diff --git a/.gitattributes b/.gitattributes old mode 100755 new mode 100644 diff --git a/.gitignore b/.gitignore index d6efbc5..2077465 100755 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +# Ignore IDE-specific configs +.project +.settings/ # Ignore Gradle project-specific cache directory .gradle # Ignore Gradle build output directory diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock new file mode 100755 index 0000000..8259a74 --- /dev/null +++ b/.speakeasy/gen.lock @@ -0,0 +1,98 @@ +lockVersion: 2.0.0 +id: fd2a78ee-286d-4e3c-ab3c-507a8f89f511 +management: + docChecksum: 5e4ef027bc51f54368e8b1607b77c098 + docVersion: 1.0.0 + speakeasyVersion: internal + generationVersion: 2.230.1 + releaseVersion: 0.2.0 + configChecksum: 48eaf6c69a1dc3ba2106693091b64145 + repoURL: https://github.com/ding-live/ding-java.git + repoSubDirectory: . + published: true +features: + java: + core: 3.2.2 + examples: 2.81.3 + flattening: 2.81.1 + globalSecurity: 2.81.2 + globalServerURLs: 2.82.1 + serverIDs: 2.81.1 +generatedFiles: + - lib/src/main/java/live/ding/dingSdk/SDKConfiguration.java + - lib/src/main/java/live/ding/dingSdk/Otp.java + - lib/src/main/java/live/ding/dingSdk/Lookup.java + - lib/src/main/java/live/ding/dingSdk/Ding.java + - .gitattributes + - gradle/wrapper/gradle-wrapper.jar + - gradle/wrapper/gradle-wrapper.properties + - gradlew + - gradlew.bat + - lib/build.gradle + - lib/src/main/java/live/ding/dingSdk/utils/DateTimeDeserializer.java + - lib/src/main/java/live/ding/dingSdk/utils/DateTimeSerializer.java + - lib/src/main/java/live/ding/dingSdk/utils/FormMetadata.java + - lib/src/main/java/live/ding/dingSdk/utils/HTTPClient.java + - lib/src/main/java/live/ding/dingSdk/utils/HTTPRequest.java + - lib/src/main/java/live/ding/dingSdk/utils/HeaderMetadata.java + - lib/src/main/java/live/ding/dingSdk/utils/JSON.java + - lib/src/main/java/live/ding/dingSdk/utils/Metadata.java + - lib/src/main/java/live/ding/dingSdk/utils/MultipartFormMetadata.java + - lib/src/main/java/live/ding/dingSdk/utils/PathParamsMetadata.java + - lib/src/main/java/live/ding/dingSdk/utils/QueryParameters.java + - lib/src/main/java/live/ding/dingSdk/utils/QueryParamsMetadata.java + - lib/src/main/java/live/ding/dingSdk/utils/RequestBody.java + - lib/src/main/java/live/ding/dingSdk/utils/RequestMetadata.java + - lib/src/main/java/live/ding/dingSdk/utils/Security.java + - lib/src/main/java/live/ding/dingSdk/utils/SecurityMetadata.java + - lib/src/main/java/live/ding/dingSdk/utils/SerializedBody.java + - lib/src/main/java/live/ding/dingSdk/utils/SpeakeasyHTTPClient.java + - lib/src/main/java/live/ding/dingSdk/utils/SpeakeasyHTTPSecurityClient.java + - lib/src/main/java/live/ding/dingSdk/utils/SpeakeasyMetadata.java + - lib/src/main/java/live/ding/dingSdk/utils/Types.java + - lib/src/main/java/live/ding/dingSdk/utils/Utils.java + - settings.gradle + - lib/src/main/java/live/ding/dingSdk/models/operations/CheckResponse.java + - lib/src/main/java/live/ding/dingSdk/models/operations/CreateAutenticationResponse.java + - lib/src/main/java/live/ding/dingSdk/models/operations/RetryResponse.java + - lib/src/main/java/live/ding/dingSdk/models/operations/LookupRequest.java + - lib/src/main/java/live/ding/dingSdk/models/operations/LookupResponse.java + - lib/src/main/java/live/ding/dingSdk/models/shared/Code.java + - lib/src/main/java/live/ding/dingSdk/models/shared/ErrorResponse.java + - lib/src/main/java/live/ding/dingSdk/models/shared/CreateCheckResponseStatus.java + - lib/src/main/java/live/ding/dingSdk/models/shared/CreateCheckResponse.java + - lib/src/main/java/live/ding/dingSdk/models/shared/CreateCheckRequest.java + - lib/src/main/java/live/ding/dingSdk/models/shared/Status.java + - lib/src/main/java/live/ding/dingSdk/models/shared/CreateAuthenticationResponse.java + - lib/src/main/java/live/ding/dingSdk/models/shared/DeviceType.java + - lib/src/main/java/live/ding/dingSdk/models/shared/CreateAuthenticationRequest.java + - lib/src/main/java/live/ding/dingSdk/models/shared/RetryAuthenticationResponseStatus.java + - lib/src/main/java/live/ding/dingSdk/models/shared/RetryAuthenticationResponse.java + - lib/src/main/java/live/ding/dingSdk/models/shared/RetryAuthenticationRequest.java + - lib/src/main/java/live/ding/dingSdk/models/shared/LineType.java + - lib/src/main/java/live/ding/dingSdk/models/shared/LookupResponse.java + - lib/src/main/java/live/ding/dingSdk/models/shared/Security.java + - docs/models/operations/CheckResponse.md + - docs/models/operations/CreateAutenticationResponse.md + - docs/models/operations/RetryResponse.md + - docs/models/operations/LookupRequest.md + - docs/models/operations/LookupResponse.md + - docs/models/shared/Code.md + - docs/models/shared/ErrorResponse.md + - docs/models/shared/CreateCheckResponseStatus.md + - docs/models/shared/CreateCheckResponse.md + - docs/models/shared/CreateCheckRequest.md + - docs/models/shared/Status.md + - docs/models/shared/CreateAuthenticationResponse.md + - docs/models/shared/DeviceType.md + - docs/models/shared/CreateAuthenticationRequest.md + - docs/models/shared/RetryAuthenticationResponseStatus.md + - docs/models/shared/RetryAuthenticationResponse.md + - docs/models/shared/RetryAuthenticationRequest.md + - docs/models/shared/LineType.md + - docs/models/shared/LookupResponse.md + - docs/models/shared/Security.md + - docs/sdks/ding/README.md + - docs/sdks/otp/README.md + - docs/sdks/lookup/README.md + - USAGE.md diff --git a/README.md b/README.md index 0344610..226b0bf 100755 --- a/README.md +++ b/README.md @@ -2,26 +2,26 @@ The Ding Java library provides convenient access to the Ding API from applications written in the Java language. - + +## SDK Installation -# SDK Installation - -## Gradle +### Gradle ```groovy -implementation 'live.ding.dingSdk:ding:0.1.0' +implementation 'live.ding.dingSdk:ding:0.2.0' ``` - - + ## SDK Example Usage - + +## SDK Example Usage -# Send a code +### Send a code Send an OTP code to a user's phone number. + ```java package hello.world; @@ -35,12 +35,15 @@ public class Application { public static void main(String[] args) { try { Ding sdk = Ding.builder() - .setSecurity(new Security("YOUR_API_KEY"){{ + .setSecurity(new Security( + "YOUR_API_KEY"){{ apiKey = "YOUR_API_KEY"; }}) .build(); - live.ding.dingSdk.models.shared.CreateAuthenticationRequest req = new CreateAuthenticationRequest("eae192ab-9e1e-4b21-b5b1-bfcb79a32fcc", "+1234567890"){{ + live.ding.dingSdk.models.shared.CreateAuthenticationRequest req = new CreateAuthenticationRequest( + "eae192ab-9e1e-4b21-b5b1-bfcb79a32fcc", + "+1234567890"){{ appRealm = "string"; appVersion = "string"; callbackUrl = "http://silly-credit.name"; @@ -50,9 +53,10 @@ public class Application { ip = "97.139.118.123"; isReturningUser = false; osVersion = "string"; + }}; - CreateAutenticationResponse res = sdk.otp.createAutentication(req); + live.ding.dingSdk.models.operations.CreateAutenticationResponse res = sdk.otp.createAutentication(req); if (res.createAuthenticationResponse != null) { // handle response @@ -64,10 +68,11 @@ public class Application { } ``` -# Check a code +### Check a code Check that a code entered by a user is valid. + ```java package hello.world; @@ -80,14 +85,18 @@ public class Application { public static void main(String[] args) { try { Ding sdk = Ding.builder() - .setSecurity(new Security("YOUR_API_KEY"){{ + .setSecurity(new Security( + "YOUR_API_KEY"){{ apiKey = "YOUR_API_KEY"; }}) .build(); - live.ding.dingSdk.models.shared.CreateCheckRequest req = new CreateCheckRequest("e0e7b0e9-739d-424b-922f-1c2cb48ab077", "123456", "8f1196d5-806e-4b71-9b24-5f96ec052808"); + live.ding.dingSdk.models.shared.CreateCheckRequest req = new CreateCheckRequest( + "e0e7b0e9-739d-424b-922f-1c2cb48ab077", + "123456", + "8f1196d5-806e-4b71-9b24-5f96ec052808"); - CheckResponse res = sdk.otp.check(req); + live.ding.dingSdk.models.operations.CheckResponse res = sdk.otp.check(req); if (res.createCheckResponse != null) { // handle response @@ -99,9 +108,10 @@ public class Application { } ``` -# Retry an authentication +### Perform a retry + +Perform a retry if a user has not received the code. -Retry an authentication if a user has not received the code. ```java package hello.world; @@ -115,14 +125,17 @@ public class Application { public static void main(String[] args) { try { Ding sdk = Ding.builder() - .setSecurity(new Security("YOUR_API_KEY"){{ + .setSecurity(new Security( + "YOUR_API_KEY"){{ apiKey = "YOUR_API_KEY"; }}) .build(); - live.ding.dingSdk.models.shared.RetryAuthenticationRequest req = new RetryAuthenticationRequest("a74ee547-564d-487a-91df-37fb25413a91", "3c8b3a46-881e-4cdd-93a6-f7f238bf020a"); + live.ding.dingSdk.models.shared.RetryAuthenticationRequest req = new RetryAuthenticationRequest( + "a74ee547-564d-487a-91df-37fb25413a91", + "3c8b3a46-881e-4cdd-93a6-f7f238bf020a"); - RetryResponse res = sdk.otp.retry(req); + live.ding.dingSdk.models.operations.RetryResponse res = sdk.otp.retry(req); if (res.retryAuthenticationResponse != null) { // handle response @@ -133,27 +146,41 @@ public class Application { } } ``` + + + +## Available Resources and Operations + +### [otp](docs/sdks/otp/README.md) + +* [check](docs/sdks/otp/README.md#check) - Check a code +* [createAutentication](docs/sdks/otp/README.md#createautentication) - Send a code +* [retry](docs/sdks/otp/README.md#retry) - Perform a retry + +### [lookup](docs/sdks/lookup/README.md) + +* [lookup](docs/sdks/lookup/README.md#lookup) - Perform a phone number lookup + - + +## Server Selection - +## Server Selection -# Available Resources and Operations +### Select Server by Name -## [otp](docs/sdks/otp/README.md) +You can override the default server globally using the `setServer` option when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the names associated with the available servers: -- [check](docs/sdks/otp/README.md#check) - Check an authentication code -- [createAutentication](docs/sdks/otp/README.md#createautentication) - Create an authentication -- [retry](docs/sdks/otp/README.md#retry) - Retry an authentication +| Name | Server | Variables | +| ----- | ------ | --------- | +| `production` | `https://api.ding.live/v1` | None | -## [lookup](docs/sdks/lookup/README.md) -- [lookup](docs/sdks/lookup/README.md#lookup) - Lookup a phone number - - +### Override Server URL Per-Client - +The default server can also be overridden globally using the `setServerURL` option when initializing the SDK client instance. For example: + diff --git a/RELEASES.md b/RELEASES.md index b2c0a2b..da8cbc8 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -6,4 +6,12 @@ Based on: - OpenAPI Doc 1.0.0 - Speakeasy CLI 1.116.0 (2.185.0) https://github.com/speakeasy-api/speakeasy ### Generated -- [java v0.1.0] . \ No newline at end of file +- [java v0.1.0] . + +## 2024-01-09 00:17:59 +### Changes +Based on: +- OpenAPI Doc 1.0.0 +- Speakeasy CLI 1.134.0 (2.230.1) https://github.com/speakeasy-api/speakeasy +### Generated +- [java v0.2.0] . \ No newline at end of file diff --git a/USAGE.md b/USAGE.md old mode 100755 new mode 100644 index 9eb0a4d..b3dcd3c --- a/USAGE.md +++ b/USAGE.md @@ -1,8 +1,9 @@ - + +### Send a code -## Send a code Send an OTP code to a user's phone number. + ```java package hello.world; @@ -16,12 +17,15 @@ public class Application { public static void main(String[] args) { try { Ding sdk = Ding.builder() - .setSecurity(new Security("YOUR_API_KEY"){{ + .setSecurity(new Security( + "YOUR_API_KEY"){{ apiKey = "YOUR_API_KEY"; }}) .build(); - live.ding.dingSdk.models.shared.CreateAuthenticationRequest req = new CreateAuthenticationRequest("eae192ab-9e1e-4b21-b5b1-bfcb79a32fcc", "+1234567890"){{ + live.ding.dingSdk.models.shared.CreateAuthenticationRequest req = new CreateAuthenticationRequest( + "eae192ab-9e1e-4b21-b5b1-bfcb79a32fcc", + "+1234567890"){{ appRealm = "string"; appVersion = "string"; callbackUrl = "http://silly-credit.name"; @@ -31,9 +35,10 @@ public class Application { ip = "97.139.118.123"; isReturningUser = false; osVersion = "string"; - }}; - CreateAutenticationResponse res = sdk.otp.createAutentication(req); + }}; + + live.ding.dingSdk.models.operations.CreateAutenticationResponse res = sdk.otp.createAutentication(req); if (res.createAuthenticationResponse != null) { // handle response @@ -45,10 +50,11 @@ public class Application { } ``` +### Check a code -## Check a code Check that a code entered by a user is valid. + ```java package hello.world; @@ -61,14 +67,18 @@ public class Application { public static void main(String[] args) { try { Ding sdk = Ding.builder() - .setSecurity(new Security("YOUR_API_KEY"){{ + .setSecurity(new Security( + "YOUR_API_KEY"){{ apiKey = "YOUR_API_KEY"; }}) .build(); - live.ding.dingSdk.models.shared.CreateCheckRequest req = new CreateCheckRequest("e0e7b0e9-739d-424b-922f-1c2cb48ab077", "123456", "8f1196d5-806e-4b71-9b24-5f96ec052808"); + live.ding.dingSdk.models.shared.CreateCheckRequest req = new CreateCheckRequest( + "e0e7b0e9-739d-424b-922f-1c2cb48ab077", + "123456", + "8f1196d5-806e-4b71-9b24-5f96ec052808"); - CheckResponse res = sdk.otp.check(req); + live.ding.dingSdk.models.operations.CheckResponse res = sdk.otp.check(req); if (res.createCheckResponse != null) { // handle response @@ -80,9 +90,10 @@ public class Application { } ``` +### Perform a retry + +Perform a retry if a user has not received the code. -## Retry an authentication -Retry an authentication if a user has not received the code. ```java package hello.world; @@ -96,14 +107,17 @@ public class Application { public static void main(String[] args) { try { Ding sdk = Ding.builder() - .setSecurity(new Security("YOUR_API_KEY"){{ + .setSecurity(new Security( + "YOUR_API_KEY"){{ apiKey = "YOUR_API_KEY"; }}) .build(); - live.ding.dingSdk.models.shared.RetryAuthenticationRequest req = new RetryAuthenticationRequest("a74ee547-564d-487a-91df-37fb25413a91", "3c8b3a46-881e-4cdd-93a6-f7f238bf020a"); + live.ding.dingSdk.models.shared.RetryAuthenticationRequest req = new RetryAuthenticationRequest( + "a74ee547-564d-487a-91df-37fb25413a91", + "3c8b3a46-881e-4cdd-93a6-f7f238bf020a"); - RetryResponse res = sdk.otp.retry(req); + live.ding.dingSdk.models.operations.RetryResponse res = sdk.otp.retry(req); if (res.retryAuthenticationResponse != null) { // handle response @@ -114,4 +128,4 @@ public class Application { } } ``` - \ No newline at end of file + \ No newline at end of file diff --git a/docs/models/operations/CheckResponse.md b/docs/models/operations/CheckResponse.md old mode 100755 new mode 100644 index 163c3b5..4ef8aca --- a/docs/models/operations/CheckResponse.md +++ b/docs/models/operations/CheckResponse.md @@ -9,4 +9,4 @@ | `createCheckResponse` | [live.ding.dingSdk.models.shared.CreateCheckResponse](../../models/shared/CreateCheckResponse.md) | :heavy_minus_sign: | OK | | `errorResponse` | [live.ding.dingSdk.models.shared.ErrorResponse](../../models/shared/ErrorResponse.md) | :heavy_minus_sign: | Bad Request | | `statusCode` | *Integer* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/CreateAutenticationResponse.md b/docs/models/operations/CreateAutenticationResponse.md old mode 100755 new mode 100644 index f12950c..534a09e --- a/docs/models/operations/CreateAutenticationResponse.md +++ b/docs/models/operations/CreateAutenticationResponse.md @@ -9,4 +9,4 @@ | `createAuthenticationResponse` | [live.ding.dingSdk.models.shared.CreateAuthenticationResponse](../../models/shared/CreateAuthenticationResponse.md) | :heavy_minus_sign: | OK | | `errorResponse` | [live.ding.dingSdk.models.shared.ErrorResponse](../../models/shared/ErrorResponse.md) | :heavy_minus_sign: | Bad Request | | `statusCode` | *Integer* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/LookupRequest.md b/docs/models/operations/LookupRequest.md old mode 100755 new mode 100644 index 806ecca..2e2fec8 --- a/docs/models/operations/LookupRequest.md +++ b/docs/models/operations/LookupRequest.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `customerUuid` | *String* | :heavy_check_mark: | N/A | -| `lookupRequest` | [live.ding.dingSdk.models.shared.LookupRequest](../../models/shared/LookupRequest.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `customerUuid` | *String* | :heavy_check_mark: | N/A | +| `phoneNumber` | *String* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/LookupResponse.md b/docs/models/operations/LookupResponse.md old mode 100755 new mode 100644 index cf41c11..daf75b4 --- a/docs/models/operations/LookupResponse.md +++ b/docs/models/operations/LookupResponse.md @@ -9,4 +9,4 @@ | `errorResponse` | [live.ding.dingSdk.models.shared.ErrorResponse](../../models/shared/ErrorResponse.md) | :heavy_minus_sign: | Bad Request | | `lookupResponse` | [live.ding.dingSdk.models.shared.LookupResponse](../../models/shared/LookupResponse.md) | :heavy_minus_sign: | OK | | `statusCode` | *Integer* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/RetryResponse.md b/docs/models/operations/RetryResponse.md old mode 100755 new mode 100644 index 549829a..d6a8658 --- a/docs/models/operations/RetryResponse.md +++ b/docs/models/operations/RetryResponse.md @@ -9,4 +9,4 @@ | `errorResponse` | [live.ding.dingSdk.models.shared.ErrorResponse](../../models/shared/ErrorResponse.md) | :heavy_minus_sign: | Bad Request | | `retryAuthenticationResponse` | [live.ding.dingSdk.models.shared.RetryAuthenticationResponse](../../models/shared/RetryAuthenticationResponse.md) | :heavy_minus_sign: | OK | | `statusCode` | *Integer* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/shared/Code.md b/docs/models/shared/Code.md old mode 100755 new mode 100644 index 644f21d..237dc6d --- a/docs/models/shared/Code.md +++ b/docs/models/shared/Code.md @@ -1,5 +1,21 @@ # Code +A machine-readable code that describes the error. Possible values are: + * `invalid_phone_number` - This is not a valid E.164 number. + * `internal_server_error` - An internal server error occurred. + * `bad_request` - The request was malformed. + * `account_invalid` - The provided customer UUID is invalid. + * `negative_balance` - You have a negative balance. + * `invalid_line` - Ding does not support this type of phone number. + * `unsupported_region` - Ding does not support this region yet. + * `invalid_auth_uuid` - The provided authentication UUID is invalid. + * `blocked_number` - The phone number is in the blocklist. + * `invalid_app_version` - The provided application version is invalid. + * `invalid_os_version` - The provided OS version is invalid. + * `invalid_device_model` - The provided device model is invalid. + * `invalid_device_id` - The provided device ID is invalid. + + ## Values diff --git a/docs/models/shared/CreateAuthenticationRequest.md b/docs/models/shared/CreateAuthenticationRequest.md old mode 100755 new mode 100644 index f044bea..8c28d06 --- a/docs/models/shared/CreateAuthenticationRequest.md +++ b/docs/models/shared/CreateAuthenticationRequest.md @@ -3,16 +3,16 @@ ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | -| `appRealm` | *String* | :heavy_minus_sign: | The Android SMS Retriever API hash code that identifies your app. This allows you to automatically retrieve and fill the OTP code on Android devices. | | -| `appVersion` | *String* | :heavy_minus_sign: | The version of your app. | | -| `callbackUrl` | *String* | :heavy_minus_sign: | A webhook URL to which delivery statuses will be sent. | | -| `customerUuid` | *String* | :heavy_check_mark: | Your customer UUID, which can be found in the API settings in the dashboard. | | -| `deviceId` | *String* | :heavy_minus_sign: | Unique identifier for the user's device. For Android, this corresponds to the ANDROID_ID and for iOS, this corresponds to the identifierForVendor. | | -| `deviceModel` | *String* | :heavy_minus_sign: | The model of the user's device. | | -| `deviceType` | [live.ding.dingSdk.models.shared.DeviceType](../../models/shared/DeviceType.md) | :heavy_minus_sign: | The type of device the user is using. | | -| `ip` | *String* | :heavy_minus_sign: | The IP address of the user's device. | | -| `isReturningUser` | *Boolean* | :heavy_minus_sign: | Whether the user is a returning user on your app. | | -| `osVersion` | *String* | :heavy_minus_sign: | The version of the user's operating system. | | -| `phoneNumber` | *String* | :heavy_check_mark: | An E.164 formatted phone number to send the OTP to. | +1234567890 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `appRealm` | *String* | :heavy_minus_sign: | The Android SMS Retriever API hash code that identifies your app. This allows you to automatically retrieve and fill the OTP code on Android devices. | | +| `appVersion` | *String* | :heavy_minus_sign: | The version of your application. | | +| `callbackUrl` | *String* | :heavy_minus_sign: | A webhook URL to which delivery statuses will be sent. | | +| `customerUuid` | *String* | :heavy_check_mark: | Your customer UUID, which can be found in the API settings in the dashboard. | | +| `deviceId` | *String* | :heavy_minus_sign: | Unique identifier for the user's device. For Android, this corresponds to the `ANDROID_ID` and for iOS, this corresponds to the `identifierForVendor`. | | +| `deviceModel` | *String* | :heavy_minus_sign: | The model of the user's device. | | +| `deviceType` | [live.ding.dingSdk.models.shared.DeviceType](../../models/shared/DeviceType.md) | :heavy_minus_sign: | The type of device the user is using. | | +| `ip` | *String* | :heavy_minus_sign: | The IP address of the user's device. | | +| `isReturningUser` | *Boolean* | :heavy_minus_sign: | Whether the user is a returning user on your app. | | +| `osVersion` | *String* | :heavy_minus_sign: | The version of the user's device operating system. | | +| `phoneNumber` | *String* | :heavy_check_mark: | An E.164 formatted phone number to send the OTP to. | +1234567890 | \ No newline at end of file diff --git a/docs/models/shared/CreateAuthenticationResponse.md b/docs/models/shared/CreateAuthenticationResponse.md old mode 100755 new mode 100644 index 0b9d66f..2a8e813 --- a/docs/models/shared/CreateAuthenticationResponse.md +++ b/docs/models/shared/CreateAuthenticationResponse.md @@ -5,9 +5,9 @@ A successful response to an authentication creation request. ## Fields -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -| `authenticationUuid` | *String* | :heavy_minus_sign: | A unique identifier for the authentication that you can use on the /check and /retry endpoints. | -| `createdAt` | [OffsetDateTime](https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html) | :heavy_minus_sign: | N/A | -| `expiresAt` | [OffsetDateTime](https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html) | :heavy_minus_sign: | The time at which the authentication expires and can no longer be checked or retried. | -| `status` | [live.ding.dingSdk.models.shared.Status](../../models/shared/Status.md) | :heavy_minus_sign: | The status of the authentication. | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `authenticationUuid` | *String* | :heavy_minus_sign: | A unique identifier for the authentication that you can use on the /check and /retry endpoints. | +| `createdAt` | [OffsetDateTime](https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html) | :heavy_minus_sign: | N/A | +| `expiresAt` | [OffsetDateTime](https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html) | :heavy_minus_sign: | The time at which the authentication expires and can no longer be checked or retried. | +| `status` | [live.ding.dingSdk.models.shared.Status](../../models/shared/Status.md) | :heavy_minus_sign: | The status of the authentication. Possible values are:
* `pending` - The OTP code is being sent.
* `rate_limited` - This user is rate-limited and cannot receive another code.
* `spam_detected` - This attempt is flagged as spam. Go to the dashboard for more details.
| \ No newline at end of file diff --git a/docs/models/shared/CreateCheckRequest.md b/docs/models/shared/CreateCheckRequest.md old mode 100755 new mode 100644 diff --git a/docs/models/shared/CreateCheckResponse.md b/docs/models/shared/CreateCheckResponse.md old mode 100755 new mode 100644 index dd9b098..22a2b29 --- a/docs/models/shared/CreateCheckResponse.md +++ b/docs/models/shared/CreateCheckResponse.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | -| `authenticationUuid` | *String* | :heavy_minus_sign: | The UUID of the corresponding authentication. | | -| `status` | [live.ding.dingSdk.models.shared.CreateCheckResponseStatus](../../models/shared/CreateCheckResponseStatus.md) | :heavy_minus_sign: | A status representing the result of the check. | valid | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `authenticationUuid` | *String* | :heavy_minus_sign: | The UUID of the corresponding authentication. | | +| `status` | [live.ding.dingSdk.models.shared.CreateCheckResponseStatus](../../models/shared/CreateCheckResponseStatus.md) | :heavy_minus_sign: | The status of the check. Possible values are:
* `valid` - The code is valid.
* `invalid` - The code is invalid.
* `without_attempt` - No attempt was sent yet, so a check cannot be completed.
* `rate_limited` - The authentication was rate limited and cannot be checked.
* `already_validated` - The authentication has already been validated.
* `expired_auth` - The authentication has expired and cannot be checked.
| valid | \ No newline at end of file diff --git a/docs/models/shared/CreateCheckResponseStatus.md b/docs/models/shared/CreateCheckResponseStatus.md old mode 100755 new mode 100644 index c7d672e..0edf21a --- a/docs/models/shared/CreateCheckResponseStatus.md +++ b/docs/models/shared/CreateCheckResponseStatus.md @@ -1,6 +1,13 @@ # CreateCheckResponseStatus -A status representing the result of the check. +The status of the check. Possible values are: + * `valid` - The code is valid. + * `invalid` - The code is invalid. + * `without_attempt` - No attempt was sent yet, so a check cannot be completed. + * `rate_limited` - The authentication was rate limited and cannot be checked. + * `already_validated` - The authentication has already been validated. + * `expired_auth` - The authentication has expired and cannot be checked. + ## Values diff --git a/docs/models/shared/DeviceType.md b/docs/models/shared/DeviceType.md old mode 100755 new mode 100644 diff --git a/docs/models/shared/ErrorResponse.md b/docs/models/shared/ErrorResponse.md old mode 100755 new mode 100644 index f7137fa..733bea7 --- a/docs/models/shared/ErrorResponse.md +++ b/docs/models/shared/ErrorResponse.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `code` | [live.ding.dingSdk.models.shared.Code](../../models/shared/Code.md) | :heavy_minus_sign: | N/A | invalid_phone_number | -| `docUrl` | *String* | :heavy_minus_sign: | A link to the documentation that describes the error. | https://docs.ding.live/api/error-handling#invalid_phone_number | -| `message` | *String* | :heavy_minus_sign: | N/A | +0 is not a valid phone number | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `code` | [live.ding.dingSdk.models.shared.Code](../../models/shared/Code.md) | :heavy_minus_sign: | A machine-readable code that describes the error. Possible values are:
* `invalid_phone_number` - This is not a valid E.164 number.
* `internal_server_error` - An internal server error occurred.
* `bad_request` - The request was malformed.
* `account_invalid` - The provided customer UUID is invalid.
* `negative_balance` - You have a negative balance.
* `invalid_line` - Ding does not support this type of phone number.
* `unsupported_region` - Ding does not support this region yet.
* `invalid_auth_uuid` - The provided authentication UUID is invalid.
* `blocked_number` - The phone number is in the blocklist.
* `invalid_app_version` - The provided application version is invalid.
* `invalid_os_version` - The provided OS version is invalid.
* `invalid_device_model` - The provided device model is invalid.
* `invalid_device_id` - The provided device ID is invalid.
| invalid_phone_number | +| `docUrl` | *String* | :heavy_minus_sign: | A link to the documentation that describes the error. | https://docs.ding.live/api/error-handling#invalid_phone_number | +| `message` | *String* | :heavy_minus_sign: | A human-readable message that describes the error. | +0 is not a valid phone number | \ No newline at end of file diff --git a/docs/models/shared/LineType.md b/docs/models/shared/LineType.md old mode 100755 new mode 100644 diff --git a/docs/models/shared/LookupRequest.md b/docs/models/shared/LookupRequest.md deleted file mode 100755 index 2055629..0000000 --- a/docs/models/shared/LookupRequest.md +++ /dev/null @@ -1,8 +0,0 @@ -# LookupRequest - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | -| `phoneNumber` | *String* | :heavy_minus_sign: | An E.164 formatted phone number to lookup. | +1234567890 | \ No newline at end of file diff --git a/docs/models/shared/LookupResponse.md b/docs/models/shared/LookupResponse.md old mode 100755 new mode 100644 diff --git a/docs/models/shared/RetryAuthenticationRequest.md b/docs/models/shared/RetryAuthenticationRequest.md old mode 100755 new mode 100644 diff --git a/docs/models/shared/RetryAuthenticationResponse.md b/docs/models/shared/RetryAuthenticationResponse.md old mode 100755 new mode 100644 index 3e684f2..d8ea5a3 --- a/docs/models/shared/RetryAuthenticationResponse.md +++ b/docs/models/shared/RetryAuthenticationResponse.md @@ -3,10 +3,10 @@ ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | -| `authenticationUuid` | *String* | :heavy_minus_sign: | The UUID of the corresponding authentication. | | -| `createdAt` | [OffsetDateTime](https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html) | :heavy_minus_sign: | N/A | | -| `nextRetryAt` | [OffsetDateTime](https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html) | :heavy_minus_sign: | The time at which the next retry will be available. | | -| `remainingRetry` | *Long* | :heavy_minus_sign: | The number of retries remaining. | 3 | -| `status` | [live.ding.dingSdk.models.shared.RetryAuthenticationResponseStatus](../../models/shared/RetryAuthenticationResponseStatus.md) | :heavy_minus_sign: | The status of the authentication. | approved | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `authenticationUuid` | *String* | :heavy_minus_sign: | The UUID of the corresponding authentication. | | +| `createdAt` | [OffsetDateTime](https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html) | :heavy_minus_sign: | N/A | | +| `nextRetryAt` | [OffsetDateTime](https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html) | :heavy_minus_sign: | The time at which the next retry will be available. | | +| `remainingRetry` | *Long* | :heavy_minus_sign: | The number of remaining retries. | 3 | +| `status` | [live.ding.dingSdk.models.shared.RetryAuthenticationResponseStatus](../../models/shared/RetryAuthenticationResponseStatus.md) | :heavy_minus_sign: | The status of the retry. Possible values are:
* `approved` - The retry was approved and a new code was sent.
* `denied` - The retry was denied.
* `no_attempt` - No attempt was sent yet, so a retry cannot be completed.
* `rate_limited` - The authentication was rate limited and cannot be retried.
* `expired_auth` - The authentication has expired and cannot be retried.
* `already_validated` - The authentication has already been validated.
| approved | \ No newline at end of file diff --git a/docs/models/shared/RetryAuthenticationResponseStatus.md b/docs/models/shared/RetryAuthenticationResponseStatus.md old mode 100755 new mode 100644 index 496d319..9d4682a --- a/docs/models/shared/RetryAuthenticationResponseStatus.md +++ b/docs/models/shared/RetryAuthenticationResponseStatus.md @@ -1,6 +1,13 @@ # RetryAuthenticationResponseStatus -The status of the authentication. +The status of the retry. Possible values are: + * `approved` - The retry was approved and a new code was sent. + * `denied` - The retry was denied. + * `no_attempt` - No attempt was sent yet, so a retry cannot be completed. + * `rate_limited` - The authentication was rate limited and cannot be retried. + * `expired_auth` - The authentication has expired and cannot be retried. + * `already_validated` - The authentication has already been validated. + ## Values diff --git a/docs/models/shared/Security.md b/docs/models/shared/Security.md old mode 100755 new mode 100644 diff --git a/docs/models/shared/Status.md b/docs/models/shared/Status.md old mode 100755 new mode 100644 index 43254b1..3e69cd9 --- a/docs/models/shared/Status.md +++ b/docs/models/shared/Status.md @@ -1,6 +1,10 @@ # Status -The status of the authentication. +The status of the authentication. Possible values are: + * `pending` - The OTP code is being sent. + * `rate_limited` - This user is rate-limited and cannot receive another code. + * `spam_detected` - This attempt is flagged as spam. Go to the dashboard for more details. + ## Values diff --git a/docs/sdks/ding/README.md b/docs/sdks/ding/README.md old mode 100755 new mode 100644 index 90a3864..a836de0 --- a/docs/sdks/ding/README.md +++ b/docs/sdks/ding/README.md @@ -3,7 +3,7 @@ ## Overview -Ding: The OTP API allows you to send authentication codes to your users using their phone numbers +Ding: The OTP API allows you to send authentication codes to your users using their phone numbers. ### Available Operations diff --git a/docs/sdks/lookup/README.md b/docs/sdks/lookup/README.md old mode 100755 new mode 100644 index a4e0344..82ca6d5 --- a/docs/sdks/lookup/README.md +++ b/docs/sdks/lookup/README.md @@ -7,11 +7,11 @@ Retrieve up-to-date metadata about a specific phone number ### Available Operations -* [lookup](#lookup) - Lookup a phone number +* [lookup](#lookup) - Perform a phone number lookup ## lookup -Lookup a phone number +Perform a phone number lookup ### Example Usage @@ -21,21 +21,19 @@ package hello.world; import live.ding.dingSdk.Ding; import live.ding.dingSdk.models.operations.LookupRequest; import live.ding.dingSdk.models.operations.LookupResponse; -import live.ding.dingSdk.models.shared.LookupRequest; import live.ding.dingSdk.models.shared.Security; public class Application { public static void main(String[] args) { try { Ding sdk = Ding.builder() - .setSecurity(new Security("YOUR_API_KEY"){{ + .setSecurity(new Security( + "YOUR_API_KEY"){{ apiKey = "YOUR_API_KEY"; }}) .build(); - LookupResponse res = sdk.lookup.lookup("6e93aa15-9177-4d09-8395-b69ce50db1c8", new LookupRequest(){{ - phoneNumber = "+1234567890"; - }}); + live.ding.dingSdk.models.operations.LookupResponse res = sdk.lookup.lookup("6e93aa15-9177-4d09-8395-b69ce50db1c8", "string"); if (res.lookupResponse != null) { // handle response @@ -49,10 +47,10 @@ public class Application { ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `customerUuid` | *String* | :heavy_check_mark: | N/A | -| `lookupRequest` | [live.ding.dingSdk.models.shared.LookupRequest](../../models/shared/LookupRequest.md) | :heavy_minus_sign: | N/A | +| Parameter | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `customerUuid` | *String* | :heavy_check_mark: | N/A | +| `phoneNumber` | *String* | :heavy_check_mark: | N/A | ### Response diff --git a/docs/sdks/otp/README.md b/docs/sdks/otp/README.md old mode 100755 new mode 100644 index ffd2f55..2de0a43 --- a/docs/sdks/otp/README.md +++ b/docs/sdks/otp/README.md @@ -7,13 +7,13 @@ Send OTP codes to your users using their phone numbers. ### Available Operations -* [check](#check) - Check an authentication code -* [createAutentication](#createautentication) - Create an authentication -* [retry](#retry) - Retry an authentication +* [check](#check) - Check a code +* [createAutentication](#createautentication) - Send a code +* [retry](#retry) - Perform a retry ## check -Check an authentication code +Check a code ### Example Usage @@ -29,14 +29,18 @@ public class Application { public static void main(String[] args) { try { Ding sdk = Ding.builder() - .setSecurity(new Security("YOUR_API_KEY"){{ + .setSecurity(new Security( + "YOUR_API_KEY"){{ apiKey = "YOUR_API_KEY"; }}) .build(); - live.ding.dingSdk.models.shared.CreateCheckRequest req = new CreateCheckRequest("e0e7b0e9-739d-424b-922f-1c2cb48ab077", "123456", "8f1196d5-806e-4b71-9b24-5f96ec052808"); + live.ding.dingSdk.models.shared.CreateCheckRequest req = new CreateCheckRequest( + "e0e7b0e9-739d-424b-922f-1c2cb48ab077", + "123456", + "8f1196d5-806e-4b71-9b24-5f96ec052808"); - CheckResponse res = sdk.otp.check(req); + live.ding.dingSdk.models.operations.CheckResponse res = sdk.otp.check(req); if (res.createCheckResponse != null) { // handle response @@ -62,7 +66,7 @@ public class Application { ## createAutentication -Create an authentication +Send a code ### Example Usage @@ -79,12 +83,15 @@ public class Application { public static void main(String[] args) { try { Ding sdk = Ding.builder() - .setSecurity(new Security("YOUR_API_KEY"){{ + .setSecurity(new Security( + "YOUR_API_KEY"){{ apiKey = "YOUR_API_KEY"; }}) .build(); - live.ding.dingSdk.models.shared.CreateAuthenticationRequest req = new CreateAuthenticationRequest("eae192ab-9e1e-4b21-b5b1-bfcb79a32fcc", "+1234567890"){{ + live.ding.dingSdk.models.shared.CreateAuthenticationRequest req = new CreateAuthenticationRequest( + "eae192ab-9e1e-4b21-b5b1-bfcb79a32fcc", + "+1234567890"){{ appRealm = "string"; appVersion = "string"; callbackUrl = "http://silly-credit.name"; @@ -94,9 +101,10 @@ public class Application { ip = "97.139.118.123"; isReturningUser = false; osVersion = "string"; - }}; - CreateAutenticationResponse res = sdk.otp.createAutentication(req); + }}; + + live.ding.dingSdk.models.operations.CreateAutenticationResponse res = sdk.otp.createAutentication(req); if (res.createAuthenticationResponse != null) { // handle response @@ -122,7 +130,7 @@ public class Application { ## retry -Retry an authentication +Perform a retry ### Example Usage @@ -138,14 +146,17 @@ public class Application { public static void main(String[] args) { try { Ding sdk = Ding.builder() - .setSecurity(new Security("YOUR_API_KEY"){{ + .setSecurity(new Security( + "YOUR_API_KEY"){{ apiKey = "YOUR_API_KEY"; }}) .build(); - live.ding.dingSdk.models.shared.RetryAuthenticationRequest req = new RetryAuthenticationRequest("a74ee547-564d-487a-91df-37fb25413a91", "3c8b3a46-881e-4cdd-93a6-f7f238bf020a"); + live.ding.dingSdk.models.shared.RetryAuthenticationRequest req = new RetryAuthenticationRequest( + "a74ee547-564d-487a-91df-37fb25413a91", + "3c8b3a46-881e-4cdd-93a6-f7f238bf020a"); - RetryResponse res = sdk.otp.retry(req); + live.ding.dingSdk.models.operations.RetryResponse res = sdk.otp.retry(req); if (res.retryAuthenticationResponse != null) { // handle response diff --git a/gen.yaml b/gen.yaml index 2dec495..5187179 100644 --- a/gen.yaml +++ b/gen.yaml @@ -1,29 +1,14 @@ -configVersion: 1.0.0 -management: - docChecksum: b8a9cbd146aa1183c110d3a9672c46b4 - docVersion: 1.0.0 - speakeasyVersion: 1.116.0 - generationVersion: 2.185.0 +configVersion: 2.0.0 generation: - comments: - disableComments: false - omitDescriptionIfSummaryPresent: false + sdkClassName: Ding + usageSnippets: + optionalPropertyRendering: withExample + fixes: + nameResolutionDec2023: false baseServerURL: "" flattenGlobalSecurity: true - repoURL: https://github.com/ding-live/ding-csharp.git - sdkClassName: Ding - singleTagPerOp: false - tagNamespacingDisabled: false -features: - java: - core: 3.0.2 - examples: 2.81.3 - flattening: 2.81.1 - globalSecurity: 2.81.1 - globalServerURLs: 2.82.0 - serverIDs: 2.81.1 java: - version: 0.1.0 + version: 0.2.0 artifactID: dingSdk companyEmail: hello@ding.live companyName: Ding @@ -43,5 +28,3 @@ java: ossrhURL: https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ outputModelSuffix: output projectName: ding - published: true - repoSubDirectory: . diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar old mode 100755 new mode 100644 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties old mode 100755 new mode 100644 diff --git a/lib/build.gradle b/lib/build.gradle old mode 100755 new mode 100644 index 9a47510..26c8369 --- a/lib/build.gradle +++ b/lib/build.gradle @@ -56,7 +56,7 @@ publishing { maven(MavenPublication) { groupId = 'live.ding' artifactId = 'dingSdk' - version = '0.1.0' + version = '0.2.0' from components.java diff --git a/lib/src/main/java/live/ding/dingSdk/Ding.java b/lib/src/main/java/live/ding/dingSdk/Ding.java old mode 100755 new mode 100644 index 7d1d1e0..a4e9a73 --- a/lib/src/main/java/live/ding/dingSdk/Ding.java +++ b/lib/src/main/java/live/ding/dingSdk/Ding.java @@ -8,7 +8,7 @@ import live.ding.dingSdk.utils.SpeakeasyHTTPClient; /** - * Ding: The OTP API allows you to send authentication codes to your users using their phone numbers + * Ding: The OTP API allows you to send authentication codes to your users using their phone numbers. */ public class Ding { /** diff --git a/lib/src/main/java/live/ding/dingSdk/Lookup.java b/lib/src/main/java/live/ding/dingSdk/Lookup.java old mode 100755 new mode 100644 index 08fd0ac..a43097f --- a/lib/src/main/java/live/ding/dingSdk/Lookup.java +++ b/lib/src/main/java/live/ding/dingSdk/Lookup.java @@ -10,7 +10,6 @@ import live.ding.dingSdk.utils.HTTPClient; import live.ding.dingSdk.utils.HTTPRequest; import live.ding.dingSdk.utils.JSON; -import live.ding.dingSdk.utils.SerializedBody; /** * Retrieve up-to-date metadata about a specific phone number @@ -24,34 +23,21 @@ public Lookup(SDKConfiguration sdkConfiguration) { } /** - * Lookup a phone number + * Perform a phone number lookup * @param customerUuid + * @param phoneNumber * @return the response from the API call * @throws Exception if the API call fails */ - public live.ding.dingSdk.models.operations.LookupResponse lookup(String customerUuid) throws Exception { - return this.lookup(customerUuid, null); - } - - /** - * Lookup a phone number - * @param customerUuid - * @param lookupRequest - * @return the response from the API call - * @throws Exception if the API call fails - */ - public live.ding.dingSdk.models.operations.LookupResponse lookup(String customerUuid, live.ding.dingSdk.models.shared.LookupRequest lookupRequest) throws Exception { - live.ding.dingSdk.models.operations.LookupRequest request = new live.ding.dingSdk.models.operations.LookupRequest(customerUuid); - request.lookupRequest=lookupRequest; + public live.ding.dingSdk.models.operations.LookupResponse lookup(String customerUuid, String phoneNumber) throws Exception { + live.ding.dingSdk.models.operations.LookupRequest request = new live.ding.dingSdk.models.operations.LookupRequest(customerUuid, phoneNumber); String baseUrl = this.sdkConfiguration.serverUrl; - String url = live.ding.dingSdk.utils.Utils.generateURL(baseUrl, "/lookup"); + String url = live.ding.dingSdk.utils.Utils.generateURL(live.ding.dingSdk.models.operations.LookupRequest.class, baseUrl, "/lookup/{phone_number}", request, null); HTTPRequest req = new HTTPRequest(); - req.setMethod("POST"); + req.setMethod("GET"); req.setURL(url); - SerializedBody serializedRequestBody = live.ding.dingSdk.utils.Utils.serializeRequestBody(request, "lookupRequest", "json"); - req.setBody(serializedRequestBody); req.addHeader("Accept", "application/json"); req.addHeader("user-agent", this.sdkConfiguration.userAgent); @@ -69,12 +55,11 @@ public live.ding.dingSdk.models.operations.LookupResponse lookup(String customer HttpResponse httpRes = client.send(req); String contentType = httpRes.headers().firstValue("Content-Type").orElse("application/octet-stream"); - - live.ding.dingSdk.models.operations.LookupResponse res = new live.ding.dingSdk.models.operations.LookupResponse(contentType, httpRes.statusCode()) {{ + + live.ding.dingSdk.models.operations.LookupResponse res = new live.ding.dingSdk.models.operations.LookupResponse(contentType, httpRes.statusCode(), httpRes) {{ lookupResponse = null; errorResponse = null; }}; - res.rawResponse = httpRes; if (httpRes.statusCode() == 200) { if (live.ding.dingSdk.utils.Utils.matchContentType(contentType, "application/json")) { diff --git a/lib/src/main/java/live/ding/dingSdk/Otp.java b/lib/src/main/java/live/ding/dingSdk/Otp.java old mode 100755 new mode 100644 index afd0823..1f3bdb8 --- a/lib/src/main/java/live/ding/dingSdk/Otp.java +++ b/lib/src/main/java/live/ding/dingSdk/Otp.java @@ -25,7 +25,7 @@ public Otp(SDKConfiguration sdkConfiguration) { } /** - * Check an authentication code + * Check a code * @param request the request object containing all of the parameters for the API call * @return the response from the API call * @throws Exception if the API call fails @@ -48,12 +48,11 @@ public live.ding.dingSdk.models.operations.CheckResponse check(live.ding.dingSdk HttpResponse httpRes = client.send(req); String contentType = httpRes.headers().firstValue("Content-Type").orElse("application/octet-stream"); - - live.ding.dingSdk.models.operations.CheckResponse res = new live.ding.dingSdk.models.operations.CheckResponse(contentType, httpRes.statusCode()) {{ + + live.ding.dingSdk.models.operations.CheckResponse res = new live.ding.dingSdk.models.operations.CheckResponse(contentType, httpRes.statusCode(), httpRes) {{ createCheckResponse = null; errorResponse = null; }}; - res.rawResponse = httpRes; if (httpRes.statusCode() == 200) { if (live.ding.dingSdk.utils.Utils.matchContentType(contentType, "application/json")) { @@ -74,7 +73,7 @@ else if (httpRes.statusCode() == 400) { } /** - * Create an authentication + * Send a code * @param request the request object containing all of the parameters for the API call * @return the response from the API call * @throws Exception if the API call fails @@ -97,12 +96,11 @@ public live.ding.dingSdk.models.operations.CreateAutenticationResponse createAut HttpResponse httpRes = client.send(req); String contentType = httpRes.headers().firstValue("Content-Type").orElse("application/octet-stream"); - - live.ding.dingSdk.models.operations.CreateAutenticationResponse res = new live.ding.dingSdk.models.operations.CreateAutenticationResponse(contentType, httpRes.statusCode()) {{ + + live.ding.dingSdk.models.operations.CreateAutenticationResponse res = new live.ding.dingSdk.models.operations.CreateAutenticationResponse(contentType, httpRes.statusCode(), httpRes) {{ createAuthenticationResponse = null; errorResponse = null; }}; - res.rawResponse = httpRes; if (httpRes.statusCode() == 200) { if (live.ding.dingSdk.utils.Utils.matchContentType(contentType, "application/json")) { @@ -123,7 +121,7 @@ else if (httpRes.statusCode() == 400) { } /** - * Retry an authentication + * Perform a retry * @param request the request object containing all of the parameters for the API call * @return the response from the API call * @throws Exception if the API call fails @@ -146,12 +144,11 @@ public live.ding.dingSdk.models.operations.RetryResponse retry(live.ding.dingSdk HttpResponse httpRes = client.send(req); String contentType = httpRes.headers().firstValue("Content-Type").orElse("application/octet-stream"); - - live.ding.dingSdk.models.operations.RetryResponse res = new live.ding.dingSdk.models.operations.RetryResponse(contentType, httpRes.statusCode()) {{ + + live.ding.dingSdk.models.operations.RetryResponse res = new live.ding.dingSdk.models.operations.RetryResponse(contentType, httpRes.statusCode(), httpRes) {{ retryAuthenticationResponse = null; errorResponse = null; }}; - res.rawResponse = httpRes; if (httpRes.statusCode() == 200) { if (live.ding.dingSdk.utils.Utils.matchContentType(contentType, "application/json")) { diff --git a/lib/src/main/java/live/ding/dingSdk/SDKConfiguration.java b/lib/src/main/java/live/ding/dingSdk/SDKConfiguration.java old mode 100755 new mode 100644 index d6c3d93..f2f0045 --- a/lib/src/main/java/live/ding/dingSdk/SDKConfiguration.java +++ b/lib/src/main/java/live/ding/dingSdk/SDKConfiguration.java @@ -15,9 +15,9 @@ class SDKConfiguration { public String server; public String language = "java"; public String openapiDocVersion = "1.0.0"; - public String sdkVersion = "0.1.0"; - public String genVersion = "2.185.0"; - public String userAgent = "speakeasy-sdk/java 0.1.0 2.185.0 1.0.0 "; + public String sdkVersion = "0.2.0"; + public String genVersion = "2.230.1"; + public String userAgent = "speakeasy-sdk/java 0.2.0 2.230.1 1.0.0 live.ding.dingSdk"; } \ No newline at end of file diff --git a/lib/src/main/java/live/ding/dingSdk/models/operations/CheckResponse.java b/lib/src/main/java/live/ding/dingSdk/models/operations/CheckResponse.java old mode 100755 new mode 100644 index 7da9423..0c6f8f4 --- a/lib/src/main/java/live/ding/dingSdk/models/operations/CheckResponse.java +++ b/lib/src/main/java/live/ding/dingSdk/models/operations/CheckResponse.java @@ -64,8 +64,9 @@ public CheckResponse withRawResponse(HttpResponse rawResponse) { return this; } - public CheckResponse(@JsonProperty("ContentType") String contentType, @JsonProperty("StatusCode") Integer statusCode) { + public CheckResponse(@JsonProperty("ContentType") String contentType, @JsonProperty("StatusCode") Integer statusCode, @JsonProperty("RawResponse") HttpResponse rawResponse) { this.contentType = contentType; this.statusCode = statusCode; + this.rawResponse = rawResponse; } } diff --git a/lib/src/main/java/live/ding/dingSdk/models/operations/CreateAutenticationResponse.java b/lib/src/main/java/live/ding/dingSdk/models/operations/CreateAutenticationResponse.java old mode 100755 new mode 100644 index 3d30746..6f0feeb --- a/lib/src/main/java/live/ding/dingSdk/models/operations/CreateAutenticationResponse.java +++ b/lib/src/main/java/live/ding/dingSdk/models/operations/CreateAutenticationResponse.java @@ -64,8 +64,9 @@ public CreateAutenticationResponse withRawResponse(HttpResponse rawRespo return this; } - public CreateAutenticationResponse(@JsonProperty("ContentType") String contentType, @JsonProperty("StatusCode") Integer statusCode) { + public CreateAutenticationResponse(@JsonProperty("ContentType") String contentType, @JsonProperty("StatusCode") Integer statusCode, @JsonProperty("RawResponse") HttpResponse rawResponse) { this.contentType = contentType; this.statusCode = statusCode; + this.rawResponse = rawResponse; } } diff --git a/lib/src/main/java/live/ding/dingSdk/models/operations/LookupRequest.java b/lib/src/main/java/live/ding/dingSdk/models/operations/LookupRequest.java old mode 100755 new mode 100644 index 25a7991..929555d --- a/lib/src/main/java/live/ding/dingSdk/models/operations/LookupRequest.java +++ b/lib/src/main/java/live/ding/dingSdk/models/operations/LookupRequest.java @@ -17,15 +17,16 @@ public LookupRequest withCustomerUuid(String customerUuid) { return this; } - @SpeakeasyMetadata("request:mediaType=application/json") - public live.ding.dingSdk.models.shared.LookupRequest lookupRequest; + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=phone_number") + public String phoneNumber; - public LookupRequest withLookupRequest(live.ding.dingSdk.models.shared.LookupRequest lookupRequest) { - this.lookupRequest = lookupRequest; + public LookupRequest withPhoneNumber(String phoneNumber) { + this.phoneNumber = phoneNumber; return this; } - public LookupRequest(@JsonProperty("customer-uuid") String customerUuid) { + public LookupRequest(@JsonProperty("customer-uuid") String customerUuid, @JsonProperty("phone_number") String phoneNumber) { this.customerUuid = customerUuid; + this.phoneNumber = phoneNumber; } } diff --git a/lib/src/main/java/live/ding/dingSdk/models/operations/LookupResponse.java b/lib/src/main/java/live/ding/dingSdk/models/operations/LookupResponse.java old mode 100755 new mode 100644 index 4eff97b..0d8e052 --- a/lib/src/main/java/live/ding/dingSdk/models/operations/LookupResponse.java +++ b/lib/src/main/java/live/ding/dingSdk/models/operations/LookupResponse.java @@ -64,8 +64,9 @@ public LookupResponse withRawResponse(HttpResponse rawResponse) { return this; } - public LookupResponse(@JsonProperty("ContentType") String contentType, @JsonProperty("StatusCode") Integer statusCode) { + public LookupResponse(@JsonProperty("ContentType") String contentType, @JsonProperty("StatusCode") Integer statusCode, @JsonProperty("RawResponse") HttpResponse rawResponse) { this.contentType = contentType; this.statusCode = statusCode; + this.rawResponse = rawResponse; } } diff --git a/lib/src/main/java/live/ding/dingSdk/models/operations/RetryResponse.java b/lib/src/main/java/live/ding/dingSdk/models/operations/RetryResponse.java old mode 100755 new mode 100644 index 8ca0421..7c66efd --- a/lib/src/main/java/live/ding/dingSdk/models/operations/RetryResponse.java +++ b/lib/src/main/java/live/ding/dingSdk/models/operations/RetryResponse.java @@ -64,8 +64,9 @@ public RetryResponse withRawResponse(HttpResponse rawResponse) { return this; } - public RetryResponse(@JsonProperty("ContentType") String contentType, @JsonProperty("StatusCode") Integer statusCode) { + public RetryResponse(@JsonProperty("ContentType") String contentType, @JsonProperty("StatusCode") Integer statusCode, @JsonProperty("RawResponse") HttpResponse rawResponse) { this.contentType = contentType; this.statusCode = statusCode; + this.rawResponse = rawResponse; } } diff --git a/lib/src/main/java/live/ding/dingSdk/models/shared/Code.java b/lib/src/main/java/live/ding/dingSdk/models/shared/Code.java old mode 100755 new mode 100644 index 677d337..4134eb6 --- a/lib/src/main/java/live/ding/dingSdk/models/shared/Code.java +++ b/lib/src/main/java/live/ding/dingSdk/models/shared/Code.java @@ -6,6 +6,23 @@ import com.fasterxml.jackson.annotation.JsonValue; +/** + * Code - A machine-readable code that describes the error. Possible values are: + * * `invalid_phone_number` - This is not a valid E.164 number. + * * `internal_server_error` - An internal server error occurred. + * * `bad_request` - The request was malformed. + * * `account_invalid` - The provided customer UUID is invalid. + * * `negative_balance` - You have a negative balance. + * * `invalid_line` - Ding does not support this type of phone number. + * * `unsupported_region` - Ding does not support this region yet. + * * `invalid_auth_uuid` - The provided authentication UUID is invalid. + * * `blocked_number` - The phone number is in the blocklist. + * * `invalid_app_version` - The provided application version is invalid. + * * `invalid_os_version` - The provided OS version is invalid. + * * `invalid_device_model` - The provided device model is invalid. + * * `invalid_device_id` - The provided device ID is invalid. + * + */ public enum Code { INVALID_PHONE_NUMBER("invalid_phone_number"), INTERNAL_SERVER_ERROR("internal_server_error"), diff --git a/lib/src/main/java/live/ding/dingSdk/models/shared/CreateAuthenticationRequest.java b/lib/src/main/java/live/ding/dingSdk/models/shared/CreateAuthenticationRequest.java old mode 100755 new mode 100644 index c11d779..3b92641 --- a/lib/src/main/java/live/ding/dingSdk/models/shared/CreateAuthenticationRequest.java +++ b/lib/src/main/java/live/ding/dingSdk/models/shared/CreateAuthenticationRequest.java @@ -23,7 +23,7 @@ public CreateAuthenticationRequest withAppRealm(String appRealm) { } /** - * The version of your app. + * The version of your application. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("app_version") @@ -58,7 +58,7 @@ public CreateAuthenticationRequest withCustomerUuid(String customerUuid) { } /** - * Unique identifier for the user's device. For Android, this corresponds to the ANDROID_ID and for iOS, this corresponds to the identifierForVendor. + * Unique identifier for the user's device. For Android, this corresponds to the `ANDROID_ID` and for iOS, this corresponds to the `identifierForVendor`. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("device_id") @@ -118,7 +118,7 @@ public CreateAuthenticationRequest withIsReturningUser(Boolean isReturningUser) } /** - * The version of the user's operating system. + * The version of the user's device operating system. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("os_version") diff --git a/lib/src/main/java/live/ding/dingSdk/models/shared/CreateAuthenticationResponse.java b/lib/src/main/java/live/ding/dingSdk/models/shared/CreateAuthenticationResponse.java old mode 100755 new mode 100644 index 3f92a51..da93a14 --- a/lib/src/main/java/live/ding/dingSdk/models/shared/CreateAuthenticationResponse.java +++ b/lib/src/main/java/live/ding/dingSdk/models/shared/CreateAuthenticationResponse.java @@ -56,7 +56,11 @@ public CreateAuthenticationResponse withExpiresAt(OffsetDateTime expiresAt) { } /** - * The status of the authentication. + * The status of the authentication. Possible values are: + * * `pending` - The OTP code is being sent. + * * `rate_limited` - This user is rate-limited and cannot receive another code. + * * `spam_detected` - This attempt is flagged as spam. Go to the dashboard for more details. + * */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") diff --git a/lib/src/main/java/live/ding/dingSdk/models/shared/CreateCheckRequest.java b/lib/src/main/java/live/ding/dingSdk/models/shared/CreateCheckRequest.java old mode 100755 new mode 100644 diff --git a/lib/src/main/java/live/ding/dingSdk/models/shared/CreateCheckResponse.java b/lib/src/main/java/live/ding/dingSdk/models/shared/CreateCheckResponse.java old mode 100755 new mode 100644 index 4c8fc39..99e2675 --- a/lib/src/main/java/live/ding/dingSdk/models/shared/CreateCheckResponse.java +++ b/lib/src/main/java/live/ding/dingSdk/models/shared/CreateCheckResponse.java @@ -23,7 +23,14 @@ public CreateCheckResponse withAuthenticationUuid(String authenticationUuid) { } /** - * A status representing the result of the check. + * The status of the check. Possible values are: + * * `valid` - The code is valid. + * * `invalid` - The code is invalid. + * * `without_attempt` - No attempt was sent yet, so a check cannot be completed. + * * `rate_limited` - The authentication was rate limited and cannot be checked. + * * `already_validated` - The authentication has already been validated. + * * `expired_auth` - The authentication has expired and cannot be checked. + * */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") diff --git a/lib/src/main/java/live/ding/dingSdk/models/shared/CreateCheckResponseStatus.java b/lib/src/main/java/live/ding/dingSdk/models/shared/CreateCheckResponseStatus.java old mode 100755 new mode 100644 index 0178786..ff47c80 --- a/lib/src/main/java/live/ding/dingSdk/models/shared/CreateCheckResponseStatus.java +++ b/lib/src/main/java/live/ding/dingSdk/models/shared/CreateCheckResponseStatus.java @@ -7,7 +7,14 @@ import com.fasterxml.jackson.annotation.JsonValue; /** - * CreateCheckResponseStatus - A status representing the result of the check. + * CreateCheckResponseStatus - The status of the check. Possible values are: + * * `valid` - The code is valid. + * * `invalid` - The code is invalid. + * * `without_attempt` - No attempt was sent yet, so a check cannot be completed. + * * `rate_limited` - The authentication was rate limited and cannot be checked. + * * `already_validated` - The authentication has already been validated. + * * `expired_auth` - The authentication has expired and cannot be checked. + * */ public enum CreateCheckResponseStatus { VALID("valid"), diff --git a/lib/src/main/java/live/ding/dingSdk/models/shared/DeviceType.java b/lib/src/main/java/live/ding/dingSdk/models/shared/DeviceType.java old mode 100755 new mode 100644 diff --git a/lib/src/main/java/live/ding/dingSdk/models/shared/ErrorResponse.java b/lib/src/main/java/live/ding/dingSdk/models/shared/ErrorResponse.java old mode 100755 new mode 100644 index bf733ce..486e66a --- a/lib/src/main/java/live/ding/dingSdk/models/shared/ErrorResponse.java +++ b/lib/src/main/java/live/ding/dingSdk/models/shared/ErrorResponse.java @@ -10,6 +10,23 @@ public class ErrorResponse { + /** + * A machine-readable code that describes the error. Possible values are: + * * `invalid_phone_number` - This is not a valid E.164 number. + * * `internal_server_error` - An internal server error occurred. + * * `bad_request` - The request was malformed. + * * `account_invalid` - The provided customer UUID is invalid. + * * `negative_balance` - You have a negative balance. + * * `invalid_line` - Ding does not support this type of phone number. + * * `unsupported_region` - Ding does not support this region yet. + * * `invalid_auth_uuid` - The provided authentication UUID is invalid. + * * `blocked_number` - The phone number is in the blocklist. + * * `invalid_app_version` - The provided application version is invalid. + * * `invalid_os_version` - The provided OS version is invalid. + * * `invalid_device_model` - The provided device model is invalid. + * * `invalid_device_id` - The provided device ID is invalid. + * + */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") public Code code; @@ -31,6 +48,9 @@ public ErrorResponse withDocUrl(String docUrl) { return this; } + /** + * A human-readable message that describes the error. + */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") public String message; diff --git a/lib/src/main/java/live/ding/dingSdk/models/shared/LineType.java b/lib/src/main/java/live/ding/dingSdk/models/shared/LineType.java old mode 100755 new mode 100644 diff --git a/lib/src/main/java/live/ding/dingSdk/models/shared/LookupRequest.java b/lib/src/main/java/live/ding/dingSdk/models/shared/LookupRequest.java deleted file mode 100755 index 600edd7..0000000 --- a/lib/src/main/java/live/ding/dingSdk/models/shared/LookupRequest.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - */ - -package live.ding.dingSdk.models.shared; - -import com.fasterxml.jackson.annotation.JsonInclude.Include; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - - -public class LookupRequest { - /** - * An E.164 formatted phone number to lookup. - */ - @JsonInclude(Include.NON_ABSENT) - @JsonProperty("phone_number") - public String phoneNumber; - - public LookupRequest withPhoneNumber(String phoneNumber) { - this.phoneNumber = phoneNumber; - return this; - } - - public LookupRequest(){} -} diff --git a/lib/src/main/java/live/ding/dingSdk/models/shared/LookupResponse.java b/lib/src/main/java/live/ding/dingSdk/models/shared/LookupResponse.java old mode 100755 new mode 100644 diff --git a/lib/src/main/java/live/ding/dingSdk/models/shared/RetryAuthenticationRequest.java b/lib/src/main/java/live/ding/dingSdk/models/shared/RetryAuthenticationRequest.java old mode 100755 new mode 100644 diff --git a/lib/src/main/java/live/ding/dingSdk/models/shared/RetryAuthenticationResponse.java b/lib/src/main/java/live/ding/dingSdk/models/shared/RetryAuthenticationResponse.java old mode 100755 new mode 100644 index a27c45a..68bd5de --- a/lib/src/main/java/live/ding/dingSdk/models/shared/RetryAuthenticationResponse.java +++ b/lib/src/main/java/live/ding/dingSdk/models/shared/RetryAuthenticationResponse.java @@ -53,7 +53,7 @@ public RetryAuthenticationResponse withNextRetryAt(OffsetDateTime nextRetryAt) { } /** - * The number of retries remaining. + * The number of remaining retries. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("remaining_retry") @@ -65,7 +65,14 @@ public RetryAuthenticationResponse withRemainingRetry(Long remainingRetry) { } /** - * The status of the authentication. + * The status of the retry. Possible values are: + * * `approved` - The retry was approved and a new code was sent. + * * `denied` - The retry was denied. + * * `no_attempt` - No attempt was sent yet, so a retry cannot be completed. + * * `rate_limited` - The authentication was rate limited and cannot be retried. + * * `expired_auth` - The authentication has expired and cannot be retried. + * * `already_validated` - The authentication has already been validated. + * */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") diff --git a/lib/src/main/java/live/ding/dingSdk/models/shared/RetryAuthenticationResponseStatus.java b/lib/src/main/java/live/ding/dingSdk/models/shared/RetryAuthenticationResponseStatus.java old mode 100755 new mode 100644 index 715270e..5980bcb --- a/lib/src/main/java/live/ding/dingSdk/models/shared/RetryAuthenticationResponseStatus.java +++ b/lib/src/main/java/live/ding/dingSdk/models/shared/RetryAuthenticationResponseStatus.java @@ -7,7 +7,14 @@ import com.fasterxml.jackson.annotation.JsonValue; /** - * RetryAuthenticationResponseStatus - The status of the authentication. + * RetryAuthenticationResponseStatus - The status of the retry. Possible values are: + * * `approved` - The retry was approved and a new code was sent. + * * `denied` - The retry was denied. + * * `no_attempt` - No attempt was sent yet, so a retry cannot be completed. + * * `rate_limited` - The authentication was rate limited and cannot be retried. + * * `expired_auth` - The authentication has expired and cannot be retried. + * * `already_validated` - The authentication has already been validated. + * */ public enum RetryAuthenticationResponseStatus { APPROVED("approved"), diff --git a/lib/src/main/java/live/ding/dingSdk/models/shared/Security.java b/lib/src/main/java/live/ding/dingSdk/models/shared/Security.java old mode 100755 new mode 100644 diff --git a/lib/src/main/java/live/ding/dingSdk/models/shared/Status.java b/lib/src/main/java/live/ding/dingSdk/models/shared/Status.java old mode 100755 new mode 100644 index 1abacd2..818008c --- a/lib/src/main/java/live/ding/dingSdk/models/shared/Status.java +++ b/lib/src/main/java/live/ding/dingSdk/models/shared/Status.java @@ -7,7 +7,11 @@ import com.fasterxml.jackson.annotation.JsonValue; /** - * Status - The status of the authentication. + * Status - The status of the authentication. Possible values are: + * * `pending` - The OTP code is being sent. + * * `rate_limited` - This user is rate-limited and cannot receive another code. + * * `spam_detected` - This attempt is flagged as spam. Go to the dashboard for more details. + * */ public enum Status { PENDING("pending"), diff --git a/lib/src/main/java/live/ding/dingSdk/utils/DateTimeDeserializer.java b/lib/src/main/java/live/ding/dingSdk/utils/DateTimeDeserializer.java old mode 100755 new mode 100644 diff --git a/lib/src/main/java/live/ding/dingSdk/utils/DateTimeSerializer.java b/lib/src/main/java/live/ding/dingSdk/utils/DateTimeSerializer.java old mode 100755 new mode 100644 diff --git a/lib/src/main/java/live/ding/dingSdk/utils/FormMetadata.java b/lib/src/main/java/live/ding/dingSdk/utils/FormMetadata.java old mode 100755 new mode 100644 diff --git a/lib/src/main/java/live/ding/dingSdk/utils/HTTPClient.java b/lib/src/main/java/live/ding/dingSdk/utils/HTTPClient.java old mode 100755 new mode 100644 diff --git a/lib/src/main/java/live/ding/dingSdk/utils/HTTPRequest.java b/lib/src/main/java/live/ding/dingSdk/utils/HTTPRequest.java old mode 100755 new mode 100644 diff --git a/lib/src/main/java/live/ding/dingSdk/utils/HeaderMetadata.java b/lib/src/main/java/live/ding/dingSdk/utils/HeaderMetadata.java old mode 100755 new mode 100644 diff --git a/lib/src/main/java/live/ding/dingSdk/utils/JSON.java b/lib/src/main/java/live/ding/dingSdk/utils/JSON.java old mode 100755 new mode 100644 diff --git a/lib/src/main/java/live/ding/dingSdk/utils/Metadata.java b/lib/src/main/java/live/ding/dingSdk/utils/Metadata.java old mode 100755 new mode 100644 diff --git a/lib/src/main/java/live/ding/dingSdk/utils/MultipartFormMetadata.java b/lib/src/main/java/live/ding/dingSdk/utils/MultipartFormMetadata.java old mode 100755 new mode 100644 diff --git a/lib/src/main/java/live/ding/dingSdk/utils/PathParamsMetadata.java b/lib/src/main/java/live/ding/dingSdk/utils/PathParamsMetadata.java old mode 100755 new mode 100644 diff --git a/lib/src/main/java/live/ding/dingSdk/utils/QueryParameters.java b/lib/src/main/java/live/ding/dingSdk/utils/QueryParameters.java old mode 100755 new mode 100644 diff --git a/lib/src/main/java/live/ding/dingSdk/utils/QueryParamsMetadata.java b/lib/src/main/java/live/ding/dingSdk/utils/QueryParamsMetadata.java old mode 100755 new mode 100644 diff --git a/lib/src/main/java/live/ding/dingSdk/utils/RequestBody.java b/lib/src/main/java/live/ding/dingSdk/utils/RequestBody.java old mode 100755 new mode 100644 diff --git a/lib/src/main/java/live/ding/dingSdk/utils/RequestMetadata.java b/lib/src/main/java/live/ding/dingSdk/utils/RequestMetadata.java old mode 100755 new mode 100644 diff --git a/lib/src/main/java/live/ding/dingSdk/utils/Security.java b/lib/src/main/java/live/ding/dingSdk/utils/Security.java old mode 100755 new mode 100644 diff --git a/lib/src/main/java/live/ding/dingSdk/utils/SecurityMetadata.java b/lib/src/main/java/live/ding/dingSdk/utils/SecurityMetadata.java old mode 100755 new mode 100644 diff --git a/lib/src/main/java/live/ding/dingSdk/utils/SerializedBody.java b/lib/src/main/java/live/ding/dingSdk/utils/SerializedBody.java old mode 100755 new mode 100644 diff --git a/lib/src/main/java/live/ding/dingSdk/utils/SpeakeasyHTTPClient.java b/lib/src/main/java/live/ding/dingSdk/utils/SpeakeasyHTTPClient.java old mode 100755 new mode 100644 diff --git a/lib/src/main/java/live/ding/dingSdk/utils/SpeakeasyHTTPSecurityClient.java b/lib/src/main/java/live/ding/dingSdk/utils/SpeakeasyHTTPSecurityClient.java old mode 100755 new mode 100644 diff --git a/lib/src/main/java/live/ding/dingSdk/utils/SpeakeasyMetadata.java b/lib/src/main/java/live/ding/dingSdk/utils/SpeakeasyMetadata.java old mode 100755 new mode 100644 diff --git a/lib/src/main/java/live/ding/dingSdk/utils/Types.java b/lib/src/main/java/live/ding/dingSdk/utils/Types.java old mode 100755 new mode 100644 diff --git a/lib/src/main/java/live/ding/dingSdk/utils/Utils.java b/lib/src/main/java/live/ding/dingSdk/utils/Utils.java old mode 100755 new mode 100644 diff --git a/settings.gradle b/settings.gradle old mode 100755 new mode 100644