Skip to content

Commit

Permalink
ci: regenerated with OpenAPI Doc 1.0.0, Speakeasy CLI 1.185.0
Browse files Browse the repository at this point in the history
  • Loading branch information
speakeasybot committed Feb 21, 2024
1 parent b9e7742 commit 3031c61
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 47 deletions.
9 changes: 4 additions & 5 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
lockVersion: 2.0.0
id: fd2a78ee-286d-4e3c-ab3c-507a8f89f511
management:
docChecksum: 5e4ef027bc51f54368e8b1607b77c098
docChecksum: 01bd42610039f89b431afa7eb1a3c56c
docVersion: 1.0.0
speakeasyVersion: internal
generationVersion: 2.259.1
releaseVersion: 0.3.1
configChecksum: 3c314829d7606ab866ca72e4412c4999
generationVersion: 2.263.3
releaseVersion: 0.4.0
configChecksum: 42c8d1f652d0f14447f13f9cc3249d23
repoURL: https://github.com/ding-live/ding-java.git
repoSubDirectory: .
published: true
Expand All @@ -17,7 +17,6 @@ features:
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
Expand Down
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The Ding Java library provides convenient access to the Ding API from applicatio
### Gradle

```groovy
implementation 'live.ding.dingSdk:ding:0.3.1'
implementation 'live.ding.dingSdk:ding:0.4.0'
```
<!-- End SDK Installation [installation] -->

Expand Down Expand Up @@ -167,13 +167,14 @@ public class Application {

## Server Selection

### Select Server by Name
### Select Server by Index

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:
You can override the default server globally using the `setServerIndex` 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 indexes associated with the available servers:

| # | Server | Variables |
| - | ------ | --------- |
| 0 | `https://api.ding.live/v1` | None |

| Name | Server | Variables |
| ----- | ------ | --------- |
| `production` | `https://api.ding.live/v1` | None |



Expand Down
10 changes: 9 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,12 @@ Based on:
- OpenAPI Doc 1.0.0
- Speakeasy CLI 1.182.0 (2.259.1) https://github.com/speakeasy-api/speakeasy
### Generated
- [java v0.3.1] .
- [java v0.3.1] .

## 2024-02-21 12:56:03
### Changes
Based on:
- OpenAPI Doc 1.0.0
- Speakeasy CLI 1.185.0 (2.263.3) https://github.com/speakeasy-api/speakeasy
### Generated
- [java v0.4.0] .
2 changes: 1 addition & 1 deletion docs/models/shared/CreateCheckRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ |
| `authenticationUuid` | *String* | :heavy_check_mark: | The authentication UUID that was returned when you created the authentication. | |
| `checkCode` | *String* | :heavy_check_mark: | The code that the user entered. | 123456 |
| `customerUuid` | *String* | :heavy_check_mark: | Your customer UUID, which can be found in the API settings in the dashboard. | |
| `customerUuid` | *String* | :heavy_check_mark: | Your customer UUID, which can be found in the API settings in the Dashboard. | |
2 changes: 1 addition & 1 deletion docs/models/shared/ErrorResponse.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ generation:
baseServerURL: ""
flattenGlobalSecurity: true
java:
version: 0.3.1
version: 0.4.0
artifactID: dingSdk
companyEmail: hello@ding.live
companyName: Ding
Expand Down
2 changes: 1 addition & 1 deletion lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ publishing {
maven(MavenPublication) {
groupId = 'live.ding'
artifactId = 'dingSdk'
version = '0.3.1'
version = '0.4.0'

from components.java

Expand Down
39 changes: 13 additions & 26 deletions lib/src/main/java/live/ding/dingSdk/Ding.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,15 @@
* Ding: The OTP API allows you to send authentication codes to your users using their phone numbers.
*/
public class Ding {
/**
* AvailableServers contains identifiers for the servers available to the SDK.
*/
public enum AvailableServers {
/**
* PRODUCTION - The production Ding API server
*/
PRODUCTION("production");

public final String server;

private AvailableServers(String server) {
this.server = server;
}
}

/**
* SERVERS contains the list of server urls available to the SDK.
*/
public static final java.util.Map<AvailableServers, String> SERVERS = new java.util.HashMap<AvailableServers, String>() {{
put(AvailableServers.PRODUCTION, "https://api.ding.live/v1");
}};
public static final String[] SERVERS = {
/**
* The production Ding API server
*/
"https://api.ding.live/v1",
};

/**
* Send OTP codes to your users using their phone numbers.
Expand Down Expand Up @@ -96,13 +83,13 @@ public Builder setServerURL(String serverUrl, java.util.Map<String, String> para
}

/**
* Allows the overriding of the default server by name
* @param server The server to use for all requests.
* Allows the overriding of the default server by index
* @param serverIdx The server to use for all requests.
* @return The builder instance.
*/
public Builder setServer(AvailableServers server) {
this.sdkConfiguration.server = server.toString();
this.sdkConfiguration.serverUrl = SERVERS.get(server);
public Builder setServerIndex(int serverIdx) {
this.sdkConfiguration.serverIdx = serverIdx;
this.sdkConfiguration.serverUrl = SERVERS[serverIdx];
return this;
}

Expand All @@ -125,8 +112,8 @@ public Ding build() throws Exception {
}

if (this.sdkConfiguration.serverUrl == null || this.sdkConfiguration.serverUrl.isBlank()) {
this.sdkConfiguration.serverUrl = SERVERS.get(AvailableServers.PRODUCTION);
this.sdkConfiguration.server = AvailableServers.PRODUCTION.toString();
this.sdkConfiguration.serverUrl = SERVERS[0];
this.sdkConfiguration.serverIdx = 0;
}

if (this.sdkConfiguration.serverUrl.endsWith("/")) {
Expand Down
8 changes: 4 additions & 4 deletions lib/src/main/java/live/ding/dingSdk/SDKConfiguration.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ class SDKConfiguration {
public HTTPClient securityClient;
public Security security;
public String serverUrl;
public String server;
public int serverIdx = 0;
public String language = "java";
public String openapiDocVersion = "1.0.0";
public String sdkVersion = "0.3.1";
public String genVersion = "2.259.1";
public String userAgent = "speakeasy-sdk/java 0.3.1 2.259.1 1.0.0 live.ding.dingSdk";
public String sdkVersion = "0.4.0";
public String genVersion = "2.263.3";
public String userAgent = "speakeasy-sdk/java 0.4.0 2.263.3 1.0.0 live.ding.dingSdk";


}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public CreateCheckRequest withCheckCode(String checkCode) {
}

/**
* Your customer UUID, which can be found in the API settings in the dashboard.
* Your customer UUID, which can be found in the API settings in the Dashboard.
*/
@JsonProperty("customer_uuid")
public String customerUuid;
Expand Down

0 comments on commit 3031c61

Please sign in to comment.