diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 2aee7a5..56b5b7e 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: 7b361cb9-7960-4aa9-aefb-1d3ff2bbe54b management: - docChecksum: 2e6d96fd26cc8e0abdaab86068eece08 + docChecksum: 25f4c1321324459bae1ae0e40bd9591e docVersion: 0.0.1 - speakeasyVersion: 1.441.0 - generationVersion: 2.460.1 - releaseVersion: 2.11.1 - configChecksum: 4dbc8b0c03d8d87de67a18174ef10571 + speakeasyVersion: 1.443.0 + generationVersion: 2.461.4 + releaseVersion: 2.11.2 + configChecksum: 76253325669ed6aa565b4a989880f552 repoURL: https://github.com/hathora/cloud-sdk-java.git repoSubDirectory: . published: true @@ -14,7 +14,7 @@ features: java: additionalDependencies: 0.1.0 constsAndDefaults: 0.1.1 - core: 3.32.0 + core: 3.32.1 deprecations: 2.81.1 downloadStreams: 0.1.1 flattening: 2.81.1 @@ -342,6 +342,8 @@ generatedFiles: - docs/models/shared/OrgMember.md - docs/models/shared/OrgMembersPage.md - docs/models/shared/OrgToken.md + - docs/models/shared/OrgToken2.md + - docs/models/shared/OrgTokenScopes.md - docs/models/shared/OrgTokenStatus.md - docs/models/shared/Organization.md - docs/models/shared/OrgsPage.md @@ -373,12 +375,15 @@ generatedFiles: - docs/models/shared/RoomStatus.md - docs/models/shared/RoomWithoutAllocations.md - docs/models/shared/RoomWithoutAllocationsCurrentAllocation.md + - docs/models/shared/Scope.md + - docs/models/shared/Scopes.md - docs/models/shared/Security.md - docs/models/shared/SetLobbyStateParams.md - docs/models/shared/StartingConnectionInfo.md - docs/models/shared/StartingConnectionInfoStatus.md - docs/models/shared/Status.md - docs/models/shared/TransportType.md + - docs/models/shared/Two.md - docs/models/shared/UpdateRoomConfigParams.md - docs/models/shared/UploadBodyParams.md - docs/models/shared/UsageLimits.md @@ -871,6 +876,8 @@ generatedFiles: - src/main/java/dev/hathora/cloud_sdk/models/shared/OrgMember.java - src/main/java/dev/hathora/cloud_sdk/models/shared/OrgMembersPage.java - src/main/java/dev/hathora/cloud_sdk/models/shared/OrgToken.java + - src/main/java/dev/hathora/cloud_sdk/models/shared/OrgToken2.java + - src/main/java/dev/hathora/cloud_sdk/models/shared/OrgTokenScopes.java - src/main/java/dev/hathora/cloud_sdk/models/shared/OrgTokenStatus.java - src/main/java/dev/hathora/cloud_sdk/models/shared/Organization.java - src/main/java/dev/hathora/cloud_sdk/models/shared/OrgsPage.java @@ -902,12 +909,15 @@ generatedFiles: - src/main/java/dev/hathora/cloud_sdk/models/shared/RoomStatus.java - src/main/java/dev/hathora/cloud_sdk/models/shared/RoomWithoutAllocations.java - src/main/java/dev/hathora/cloud_sdk/models/shared/RoomWithoutAllocationsCurrentAllocation.java + - src/main/java/dev/hathora/cloud_sdk/models/shared/Scope.java + - src/main/java/dev/hathora/cloud_sdk/models/shared/Scopes.java - src/main/java/dev/hathora/cloud_sdk/models/shared/Security.java - src/main/java/dev/hathora/cloud_sdk/models/shared/SetLobbyStateParams.java - src/main/java/dev/hathora/cloud_sdk/models/shared/StartingConnectionInfo.java - src/main/java/dev/hathora/cloud_sdk/models/shared/StartingConnectionInfoStatus.java - src/main/java/dev/hathora/cloud_sdk/models/shared/Status.java - src/main/java/dev/hathora/cloud_sdk/models/shared/TransportType.java + - src/main/java/dev/hathora/cloud_sdk/models/shared/Two.java - src/main/java/dev/hathora/cloud_sdk/models/shared/UpdateRoomConfigParams.java - src/main/java/dev/hathora/cloud_sdk/models/shared/UploadBodyParams.java - src/main/java/dev/hathora/cloud_sdk/models/shared/UsageLimits.java @@ -2150,6 +2160,8 @@ examples: "404": application/json: {"message": ""} "200": {} + "401": + application/json: {"message": ""} GetMetricsDeprecated: speakeasy-default-get-metrics-deprecated: parameters: diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 4dc3a75..4bf761d 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,20 +1,20 @@ -speakeasyVersion: 1.441.0 +speakeasyVersion: 1.443.0 sources: java-source: sourceNamespace: java-source - sourceRevisionDigest: sha256:b389e53e498d9cae15cdaf75f18f92d345dbde9a5d2b9c851e8993f0c49dc1ea - sourceBlobDigest: sha256:02eb3ea162a4bbca155f0e3df0133c20e7d6e301ed5b08797c8c5f6db8954a4f + sourceRevisionDigest: sha256:9772d7ba772ec937021772d76cabb88260be926e0efeaa6dc288de0d7ca56246 + sourceBlobDigest: sha256:a57710c3bbebaa23e495807ea511f7b91325070cb183738d6bc00bdbb25de1bc tags: - latest - - speakeasy-sdk-regen-1732061269 + - speakeasy-sdk-regen-1732234089 targets: hathora-java: source: java-source sourceNamespace: java-source - sourceRevisionDigest: sha256:b389e53e498d9cae15cdaf75f18f92d345dbde9a5d2b9c851e8993f0c49dc1ea - sourceBlobDigest: sha256:02eb3ea162a4bbca155f0e3df0133c20e7d6e301ed5b08797c8c5f6db8954a4f + sourceRevisionDigest: sha256:9772d7ba772ec937021772d76cabb88260be926e0efeaa6dc288de0d7ca56246 + sourceBlobDigest: sha256:a57710c3bbebaa23e495807ea511f7b91325070cb183738d6bc00bdbb25de1bc codeSamplesNamespace: code-samples-java-hathora-java - codeSamplesRevisionDigest: sha256:09835d3dd67d4f5ebf5071f4c86720b77195072f360c6328eb47eb408e65b6f2 + codeSamplesRevisionDigest: sha256:78b336593d3e8bbef9a4d8c5776c1c687aae1561c71a9d8d572e5935ee33edf9 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index 6dadd83..9401d6a 100755 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ The samples below show how a published SDK artifact is used: Gradle: ```groovy -implementation 'dev.hathora:cloud-sdk:2.11.1' +implementation 'dev.hathora:cloud-sdk:2.11.2' ``` Maven: @@ -43,7 +43,7 @@ Maven: dev.hathora cloud-sdk - 2.11.1 + 2.11.2 ``` diff --git a/RELEASES.md b/RELEASES.md index da0375b..61122ee 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -859,4 +859,14 @@ Based on: ### Generated - [java v2.11.1] . ### Releases -- [Maven Central v2.11.1] https://central.sonatype.com/artifact/dev.hathora/cloud-sdk/2.11.1 - . \ No newline at end of file +- [Maven Central v2.11.1] https://central.sonatype.com/artifact/dev.hathora/cloud-sdk/2.11.1 - . + +## 2024-11-22 00:08:05 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.443.0 (2.461.4) https://github.com/speakeasy-api/speakeasy +### Generated +- [java v2.11.2] . +### Releases +- [Maven Central v2.11.2] https://central.sonatype.com/artifact/dev.hathora/cloud-sdk/2.11.2 - . \ No newline at end of file diff --git a/build.gradle b/build.gradle index 562112b..39984cd 100644 --- a/build.gradle +++ b/build.gradle @@ -63,7 +63,7 @@ tasks.withType(Javadoc) { } group = "dev.hathora" -version = "2.11.1" +version = "2.11.2" sourcesJar { archiveBaseName = "cloud-sdk" @@ -101,7 +101,7 @@ publishing { maven(MavenPublication) { groupId = 'dev.hathora' artifactId = 'cloud-sdk' - version = '2.11.1' + version = '2.11.2' from components.java @@ -148,10 +148,11 @@ dependencies { testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1' implementation 'org.java-websocket:Java-WebSocket:1.5.6' + api 'com.fasterxml.jackson.core:jackson-annotations:2.17.2' implementation 'com.fasterxml.jackson.core:jackson-databind:2.17.2' implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.17.2' implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.17.2' - implementation 'org.openapitools:jackson-databind-nullable:0.2.6' + api('org.openapitools:jackson-databind-nullable:0.2.6') {exclude group: 'com.fasterxml.jackson.core', module: 'jackson-databind'} implementation 'org.apache.httpcomponents:httpclient:4.5.14' implementation 'org.apache.httpcomponents:httpmime:4.5.14' implementation 'commons-io:commons-io:2.15.1' diff --git a/docs/models/shared/CreateOrgToken.md b/docs/models/shared/CreateOrgToken.md index 0921ff4..760a204 100644 --- a/docs/models/shared/CreateOrgToken.md +++ b/docs/models/shared/CreateOrgToken.md @@ -5,4 +5,5 @@ | Field | Type | Required | Description | Example | | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | -| `name` | *String* | :heavy_check_mark: | Readable name for a token. Must be unique within an organization. | ci-token | \ No newline at end of file +| `name` | *String* | :heavy_check_mark: | Readable name for a token. Must be unique within an organization. | ci-token | +| `scopes` | [Optional\](../../models/shared/Scopes.md) | :heavy_minus_sign: | If not defined, the token has Admin access. | | \ No newline at end of file diff --git a/docs/models/shared/OrgToken.md b/docs/models/shared/OrgToken.md index e1abc4e..4ee578a 100644 --- a/docs/models/shared/OrgToken.md +++ b/docs/models/shared/OrgToken.md @@ -11,4 +11,5 @@ | `name` | *String* | :heavy_check_mark: | Readable name for a token. Must be unique within an organization. | ci-token | | `orgId` | *String* | :heavy_check_mark: | N/A | | | `orgTokenId` | *String* | :heavy_check_mark: | System generated unique identifier for an organization token. | org-token-af469a92-5b45-4565-b3c4-b79878de67d2 | +| `scopes` | [Optional\](../../models/shared/OrgTokenScopes.md) | :heavy_minus_sign: | If not defined, the token has Admin access. | | | `status` | [OrgTokenStatus](../../models/shared/OrgTokenStatus.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/shared/OrgToken2.md b/docs/models/shared/OrgToken2.md new file mode 100644 index 0000000..c3b5f7e --- /dev/null +++ b/docs/models/shared/OrgToken2.md @@ -0,0 +1,8 @@ +# OrgToken2 + + +## Values + +| Name | Value | +| ------- | ------- | +| `ADMIN` | admin | \ No newline at end of file diff --git a/docs/models/shared/OrgTokenScopes.md b/docs/models/shared/OrgTokenScopes.md new file mode 100644 index 0000000..50296dd --- /dev/null +++ b/docs/models/shared/OrgTokenScopes.md @@ -0,0 +1,4 @@ +# OrgTokenScopes + +If not defined, the token has Admin access. + diff --git a/docs/models/shared/Scope.md b/docs/models/shared/Scope.md new file mode 100644 index 0000000..b5f7d0d --- /dev/null +++ b/docs/models/shared/Scope.md @@ -0,0 +1,22 @@ +# Scope + + +## Values + +| Name | Value | +| ------------------------- | ------------------------- | +| `BILLING_READ_WRITE` | billing:read-write | +| `BUILDS_READ` | builds:read | +| `BUILDS_READ_WRITE` | builds:read-write | +| `DEPLOYMENTS_READ` | deployments:read | +| `DEPLOYMENTS_READ_WRITE` | deployments:read-write | +| `APPLICATIONS_READ` | applications:read | +| `APPLICATIONS_READ_WRITE` | applications:read-write | +| `PROCESSES_READ` | processes:read | +| `PROCESSES_READ_WRITE` | processes:read-write | +| `FLEETS_READ` | fleets:read | +| `FLEETS_READ_WRITE` | fleets:read-write | +| `ORGS_READ` | orgs:read | +| `ORGS_READ_WRITE` | orgs:read-write | +| `TOKENS_READ` | tokens:read | +| `TOKENS_READ_WRITE` | tokens:read-write | \ No newline at end of file diff --git a/docs/models/shared/Scopes.md b/docs/models/shared/Scopes.md new file mode 100644 index 0000000..c51bfdd --- /dev/null +++ b/docs/models/shared/Scopes.md @@ -0,0 +1,4 @@ +# Scopes + +If not defined, the token has Admin access. + diff --git a/docs/models/shared/Two.md b/docs/models/shared/Two.md new file mode 100644 index 0000000..5aec949 --- /dev/null +++ b/docs/models/shared/Two.md @@ -0,0 +1,8 @@ +# Two + + +## Values + +| Name | Value | +| ------- | ------- | +| `ADMIN` | admin | \ No newline at end of file diff --git a/docs/sdks/fleetsv1/README.md b/docs/sdks/fleetsv1/README.md index befc84b..3e9c850 100644 --- a/docs/sdks/fleetsv1/README.md +++ b/docs/sdks/fleetsv1/README.md @@ -69,10 +69,10 @@ public class Application { ### Errors -| Error Type | Status Code | Content Type | -| ---------------------- | ---------------------- | ---------------------- | -| models/errors/ApiError | 404, 422, 429, 500 | application/json | -| models/errors/SDKError | 4XX, 5XX | \*/\* | +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| models/errors/ApiError | 401, 404, 422, 429, 500 | application/json | +| models/errors/SDKError | 4XX, 5XX | \*/\* | ## getFleetRegion diff --git a/gen.yaml b/gen.yaml index be7ceea..c1699c4 100644 --- a/gen.yaml +++ b/gen.yaml @@ -13,7 +13,7 @@ generation: baseServerURL: "" flattenGlobalSecurity: true java: - version: 2.11.1 + version: 2.11.2 additionalDependencies: - testImplementation:org.junit.jupiter:junit-jupiter-api:5.8.1 - testRuntimeOnly:org.junit.jupiter:junit-jupiter-engine:5.8.1 diff --git a/src/main/java/dev/hathora/cloud_sdk/FleetsV1.java b/src/main/java/dev/hathora/cloud_sdk/FleetsV1.java index 58aaba3..fb56015 100644 --- a/src/main/java/dev/hathora/cloud_sdk/FleetsV1.java +++ b/src/main/java/dev/hathora/cloud_sdk/FleetsV1.java @@ -107,7 +107,7 @@ public GetFleetMetricsResponse getFleetMetrics( HttpResponse _httpRes; try { _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "404", "422", "429", "4XX", "500", "5XX")) { + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401", "404", "422", "429", "4XX", "500", "5XX")) { _httpRes = sdkConfiguration.hooks() .afterError( new AfterErrorContextImpl( @@ -163,7 +163,7 @@ public GetFleetMetricsResponse getFleetMetrics( Utils.extractByteArrayFromBody(_httpRes)); } } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "404", "422", "429", "500")) { + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401", "404", "422", "429", "500")) { if (Utils.contentTypeMatches(_contentType, "application/json")) { ApiError _out = Utils.mapper().readValue( Utils.toUtf8AndClose(_httpRes.body()), diff --git a/src/main/java/dev/hathora/cloud_sdk/SDKConfiguration.java b/src/main/java/dev/hathora/cloud_sdk/SDKConfiguration.java index 38aa870..f1fb27f 100644 --- a/src/main/java/dev/hathora/cloud_sdk/SDKConfiguration.java +++ b/src/main/java/dev/hathora/cloud_sdk/SDKConfiguration.java @@ -25,8 +25,8 @@ public Optional securitySource() { public int serverIdx = 0; private static final String LANGUAGE = "java"; public static final String OPENAPI_DOC_VERSION = "0.0.1"; - public static final String SDK_VERSION = "2.11.1"; - public static final String GEN_VERSION = "2.460.1"; + public static final String SDK_VERSION = "2.11.2"; + public static final String GEN_VERSION = "2.461.4"; private static final String BASE_PACKAGE = "dev.hathora.cloud_sdk"; public static final String USER_AGENT = String.format("speakeasy-sdk/%s %s %s %s %s", diff --git a/src/main/java/dev/hathora/cloud_sdk/models/shared/CreateOrgToken.java b/src/main/java/dev/hathora/cloud_sdk/models/shared/CreateOrgToken.java index a50ae31..135e154 100644 --- a/src/main/java/dev/hathora/cloud_sdk/models/shared/CreateOrgToken.java +++ b/src/main/java/dev/hathora/cloud_sdk/models/shared/CreateOrgToken.java @@ -7,11 +7,15 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import dev.hathora.cloud_sdk.utils.Utils; import java.lang.Override; import java.lang.String; +import java.lang.SuppressWarnings; import java.util.Objects; +import java.util.Optional; public class CreateOrgToken { @@ -22,11 +26,26 @@ public class CreateOrgToken { @JsonProperty("name") private String name; + /** + * If not defined, the token has Admin access. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("scopes") + private Optional scopes; + @JsonCreator public CreateOrgToken( - @JsonProperty("name") String name) { + @JsonProperty("name") String name, + @JsonProperty("scopes") Optional scopes) { Utils.checkNotNull(name, "name"); + Utils.checkNotNull(scopes, "scopes"); this.name = name; + this.scopes = scopes; + } + + public CreateOrgToken( + String name) { + this(name, Optional.empty()); } /** @@ -37,6 +56,15 @@ public String name() { return name; } + /** + * If not defined, the token has Admin access. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional scopes() { + return (Optional) scopes; + } + public final static Builder builder() { return new Builder(); } @@ -49,6 +77,24 @@ public CreateOrgToken withName(String name) { this.name = name; return this; } + + /** + * If not defined, the token has Admin access. + */ + public CreateOrgToken withScopes(Scopes scopes) { + Utils.checkNotNull(scopes, "scopes"); + this.scopes = Optional.ofNullable(scopes); + return this; + } + + /** + * If not defined, the token has Admin access. + */ + public CreateOrgToken withScopes(Optional scopes) { + Utils.checkNotNull(scopes, "scopes"); + this.scopes = scopes; + return this; + } @Override public boolean equals(java.lang.Object o) { @@ -60,24 +106,29 @@ public boolean equals(java.lang.Object o) { } CreateOrgToken other = (CreateOrgToken) o; return - Objects.deepEquals(this.name, other.name); + Objects.deepEquals(this.name, other.name) && + Objects.deepEquals(this.scopes, other.scopes); } @Override public int hashCode() { return Objects.hash( - name); + name, + scopes); } @Override public String toString() { return Utils.toString(CreateOrgToken.class, - "name", name); + "name", name, + "scopes", scopes); } public final static class Builder { - private String name; + private String name; + + private Optional scopes = Optional.empty(); private Builder() { // force use of static builder() method @@ -91,10 +142,29 @@ public Builder name(String name) { this.name = name; return this; } + + /** + * If not defined, the token has Admin access. + */ + public Builder scopes(Scopes scopes) { + Utils.checkNotNull(scopes, "scopes"); + this.scopes = Optional.ofNullable(scopes); + return this; + } + + /** + * If not defined, the token has Admin access. + */ + public Builder scopes(Optional scopes) { + Utils.checkNotNull(scopes, "scopes"); + this.scopes = scopes; + return this; + } public CreateOrgToken build() { return new CreateOrgToken( - name); + name, + scopes); } } } diff --git a/src/main/java/dev/hathora/cloud_sdk/models/shared/OrgToken.java b/src/main/java/dev/hathora/cloud_sdk/models/shared/OrgToken.java index 96925a0..04baa99 100644 --- a/src/main/java/dev/hathora/cloud_sdk/models/shared/OrgToken.java +++ b/src/main/java/dev/hathora/cloud_sdk/models/shared/OrgToken.java @@ -7,12 +7,16 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import dev.hathora.cloud_sdk.utils.Utils; import java.lang.Override; import java.lang.String; +import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.Objects; +import java.util.Optional; public class OrgToken { @@ -41,6 +45,13 @@ public class OrgToken { @JsonProperty("orgTokenId") private String orgTokenId; + /** + * If not defined, the token has Admin access. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("scopes") + private Optional scopes; + @JsonProperty("status") private OrgTokenStatus status; @@ -52,6 +63,7 @@ public OrgToken( @JsonProperty("name") String name, @JsonProperty("orgId") String orgId, @JsonProperty("orgTokenId") String orgTokenId, + @JsonProperty("scopes") Optional scopes, @JsonProperty("status") OrgTokenStatus status) { Utils.checkNotNull(createdAt, "createdAt"); Utils.checkNotNull(createdBy, "createdBy"); @@ -59,6 +71,7 @@ public OrgToken( Utils.checkNotNull(name, "name"); Utils.checkNotNull(orgId, "orgId"); Utils.checkNotNull(orgTokenId, "orgTokenId"); + Utils.checkNotNull(scopes, "scopes"); Utils.checkNotNull(status, "status"); this.createdAt = createdAt; this.createdBy = createdBy; @@ -66,8 +79,20 @@ public OrgToken( this.name = name; this.orgId = orgId; this.orgTokenId = orgTokenId; + this.scopes = scopes; this.status = status; } + + public OrgToken( + OffsetDateTime createdAt, + String createdBy, + String lastFourCharsOfKey, + String name, + String orgId, + String orgTokenId, + OrgTokenStatus status) { + this(createdAt, createdBy, lastFourCharsOfKey, name, orgId, orgTokenId, Optional.empty(), status); + } @JsonIgnore public OffsetDateTime createdAt() { @@ -105,6 +130,15 @@ public String orgTokenId() { return orgTokenId; } + /** + * If not defined, the token has Admin access. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional scopes() { + return (Optional) scopes; + } + @JsonIgnore public OrgTokenStatus status() { return status; @@ -156,6 +190,24 @@ public OrgToken withOrgTokenId(String orgTokenId) { return this; } + /** + * If not defined, the token has Admin access. + */ + public OrgToken withScopes(OrgTokenScopes scopes) { + Utils.checkNotNull(scopes, "scopes"); + this.scopes = Optional.ofNullable(scopes); + return this; + } + + /** + * If not defined, the token has Admin access. + */ + public OrgToken withScopes(Optional scopes) { + Utils.checkNotNull(scopes, "scopes"); + this.scopes = scopes; + return this; + } + public OrgToken withStatus(OrgTokenStatus status) { Utils.checkNotNull(status, "status"); this.status = status; @@ -178,6 +230,7 @@ public boolean equals(java.lang.Object o) { Objects.deepEquals(this.name, other.name) && Objects.deepEquals(this.orgId, other.orgId) && Objects.deepEquals(this.orgTokenId, other.orgTokenId) && + Objects.deepEquals(this.scopes, other.scopes) && Objects.deepEquals(this.status, other.status); } @@ -190,6 +243,7 @@ public int hashCode() { name, orgId, orgTokenId, + scopes, status); } @@ -202,6 +256,7 @@ public String toString() { "name", name, "orgId", orgId, "orgTokenId", orgTokenId, + "scopes", scopes, "status", status); } @@ -219,6 +274,8 @@ public final static class Builder { private String orgTokenId; + private Optional scopes = Optional.empty(); + private OrgTokenStatus status; private Builder() { @@ -267,6 +324,24 @@ public Builder orgTokenId(String orgTokenId) { return this; } + /** + * If not defined, the token has Admin access. + */ + public Builder scopes(OrgTokenScopes scopes) { + Utils.checkNotNull(scopes, "scopes"); + this.scopes = Optional.ofNullable(scopes); + return this; + } + + /** + * If not defined, the token has Admin access. + */ + public Builder scopes(Optional scopes) { + Utils.checkNotNull(scopes, "scopes"); + this.scopes = scopes; + return this; + } + public Builder status(OrgTokenStatus status) { Utils.checkNotNull(status, "status"); this.status = status; @@ -281,6 +356,7 @@ public OrgToken build() { name, orgId, orgTokenId, + scopes, status); } } diff --git a/src/main/java/dev/hathora/cloud_sdk/models/shared/OrgToken2.java b/src/main/java/dev/hathora/cloud_sdk/models/shared/OrgToken2.java new file mode 100644 index 0000000..6da757c --- /dev/null +++ b/src/main/java/dev/hathora/cloud_sdk/models/shared/OrgToken2.java @@ -0,0 +1,23 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +package dev.hathora.cloud_sdk.models.shared; + +import com.fasterxml.jackson.annotation.JsonValue; +import java.lang.String; + +public enum OrgToken2 { + ADMIN("admin"); + + @JsonValue + private final String value; + + private OrgToken2(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/dev/hathora/cloud_sdk/models/shared/OrgTokenScopes.java b/src/main/java/dev/hathora/cloud_sdk/models/shared/OrgTokenScopes.java new file mode 100644 index 0000000..2bbb95a --- /dev/null +++ b/src/main/java/dev/hathora/cloud_sdk/models/shared/OrgTokenScopes.java @@ -0,0 +1,101 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +package dev.hathora.cloud_sdk.models.shared; + + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import dev.hathora.cloud_sdk.utils.OneOfDeserializer; +import dev.hathora.cloud_sdk.utils.TypedObject; +import dev.hathora.cloud_sdk.utils.Utils.JsonShape; +import dev.hathora.cloud_sdk.utils.Utils.TypeReferenceWithShape; +import dev.hathora.cloud_sdk.utils.Utils; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.List; +import java.util.Objects; + +/** + * OrgTokenScopes - If not defined, the token has Admin access. + */ + +@JsonDeserialize(using = OrgTokenScopes._Deserializer.class) +public class OrgTokenScopes { + + @JsonValue + private TypedObject value; + + private OrgTokenScopes(TypedObject value) { + this.value = value; + } + + public static OrgTokenScopes of(List value) { + Utils.checkNotNull(value, "value"); + return new OrgTokenScopes(TypedObject.of(value, JsonShape.DEFAULT, new TypeReference>(){})); + } + + public static OrgTokenScopes of(OrgToken2 value) { + Utils.checkNotNull(value, "value"); + return new OrgTokenScopes(TypedObject.of(value, JsonShape.DEFAULT, new TypeReference(){})); + } + + /** + * Returns an instance of one of these types: + *
    + *
  • {@code java.util.List}
  • + *
  • {@code dev.hathora.cloud_sdk.models.shared.OrgToken2}
  • + *
+ * + *

Use {@code instanceof} to determine what type is returned. For example: + * + *

+     * if (obj.value() instanceof String) {
+     *     String answer = (String) obj.value();
+     *     System.out.println("answer=" + answer);
+     * }
+     * 
+ * + * @return value of oneOf type + **/ + public java.lang.Object value() { + return value.value(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrgTokenScopes other = (OrgTokenScopes) o; + return Objects.deepEquals(this.value.value(), other.value.value()); + } + + @Override + public int hashCode() { + return Objects.hash(value.value()); + } + + @SuppressWarnings("serial") + public static final class _Deserializer extends OneOfDeserializer { + + public _Deserializer() { + super(OrgTokenScopes.class, false, + TypeReferenceWithShape.of(new TypeReference() {}, JsonShape.DEFAULT), + TypeReferenceWithShape.of(new TypeReference>() {}, JsonShape.DEFAULT)); + } + } + + @Override + public String toString() { + return Utils.toString(OrgTokenScopes.class, + "value", value); + } + +} diff --git a/src/main/java/dev/hathora/cloud_sdk/models/shared/Scope.java b/src/main/java/dev/hathora/cloud_sdk/models/shared/Scope.java new file mode 100644 index 0000000..02ca0a4 --- /dev/null +++ b/src/main/java/dev/hathora/cloud_sdk/models/shared/Scope.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +package dev.hathora.cloud_sdk.models.shared; + +import com.fasterxml.jackson.annotation.JsonValue; +import java.lang.String; + +public enum Scope { + BILLING_READ_WRITE("billing:read-write"), + BUILDS_READ("builds:read"), + BUILDS_READ_WRITE("builds:read-write"), + DEPLOYMENTS_READ("deployments:read"), + DEPLOYMENTS_READ_WRITE("deployments:read-write"), + APPLICATIONS_READ("applications:read"), + APPLICATIONS_READ_WRITE("applications:read-write"), + PROCESSES_READ("processes:read"), + PROCESSES_READ_WRITE("processes:read-write"), + FLEETS_READ("fleets:read"), + FLEETS_READ_WRITE("fleets:read-write"), + ORGS_READ("orgs:read"), + ORGS_READ_WRITE("orgs:read-write"), + TOKENS_READ("tokens:read"), + TOKENS_READ_WRITE("tokens:read-write"); + + @JsonValue + private final String value; + + private Scope(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/dev/hathora/cloud_sdk/models/shared/Scopes.java b/src/main/java/dev/hathora/cloud_sdk/models/shared/Scopes.java new file mode 100644 index 0000000..7a21552 --- /dev/null +++ b/src/main/java/dev/hathora/cloud_sdk/models/shared/Scopes.java @@ -0,0 +1,101 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +package dev.hathora.cloud_sdk.models.shared; + + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import dev.hathora.cloud_sdk.utils.OneOfDeserializer; +import dev.hathora.cloud_sdk.utils.TypedObject; +import dev.hathora.cloud_sdk.utils.Utils.JsonShape; +import dev.hathora.cloud_sdk.utils.Utils.TypeReferenceWithShape; +import dev.hathora.cloud_sdk.utils.Utils; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.List; +import java.util.Objects; + +/** + * Scopes - If not defined, the token has Admin access. + */ + +@JsonDeserialize(using = Scopes._Deserializer.class) +public class Scopes { + + @JsonValue + private TypedObject value; + + private Scopes(TypedObject value) { + this.value = value; + } + + public static Scopes of(List value) { + Utils.checkNotNull(value, "value"); + return new Scopes(TypedObject.of(value, JsonShape.DEFAULT, new TypeReference>(){})); + } + + public static Scopes of(Two value) { + Utils.checkNotNull(value, "value"); + return new Scopes(TypedObject.of(value, JsonShape.DEFAULT, new TypeReference(){})); + } + + /** + * Returns an instance of one of these types: + *
    + *
  • {@code java.util.List}
  • + *
  • {@code dev.hathora.cloud_sdk.models.shared.Two}
  • + *
+ * + *

Use {@code instanceof} to determine what type is returned. For example: + * + *

+     * if (obj.value() instanceof String) {
+     *     String answer = (String) obj.value();
+     *     System.out.println("answer=" + answer);
+     * }
+     * 
+ * + * @return value of oneOf type + **/ + public java.lang.Object value() { + return value.value(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Scopes other = (Scopes) o; + return Objects.deepEquals(this.value.value(), other.value.value()); + } + + @Override + public int hashCode() { + return Objects.hash(value.value()); + } + + @SuppressWarnings("serial") + public static final class _Deserializer extends OneOfDeserializer { + + public _Deserializer() { + super(Scopes.class, false, + TypeReferenceWithShape.of(new TypeReference() {}, JsonShape.DEFAULT), + TypeReferenceWithShape.of(new TypeReference>() {}, JsonShape.DEFAULT)); + } + } + + @Override + public String toString() { + return Utils.toString(Scopes.class, + "value", value); + } + +} diff --git a/src/main/java/dev/hathora/cloud_sdk/models/shared/Two.java b/src/main/java/dev/hathora/cloud_sdk/models/shared/Two.java new file mode 100644 index 0000000..6cfcc2f --- /dev/null +++ b/src/main/java/dev/hathora/cloud_sdk/models/shared/Two.java @@ -0,0 +1,23 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +package dev.hathora.cloud_sdk.models.shared; + +import com.fasterxml.jackson.annotation.JsonValue; +import java.lang.String; + +public enum Two { + ADMIN("admin"); + + @JsonValue + private final String value; + + private Two(String value) { + this.value = value; + } + + public String value() { + return value; + } +}