From 06a5543533febfb21b574c5a83c212777ad3dad5 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Sat, 26 Oct 2024 00:08:45 +0000 Subject: [PATCH] ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.422.1 --- .speakeasy/gen.lock | 44 +- .speakeasy/workflow.lock | 12 +- README.md | 16 +- RELEASES.md | 12 +- build.gradle | 4 +- codeSamples.yaml | 18 +- .../operations/GetFleetMetricsRequest.md | 14 + ...Response.md => GetFleetMetricsResponse.md} | 4 +- .../operations/GetMetricsDeprecatedRequest.md | 13 + .../GetMetricsDeprecatedResponse.md | 11 + docs/models/operations/GetMetricsRequest.md | 13 - .../operations/GetProcessMetricsRequest.md | 13 + .../operations/GetProcessMetricsResponse.md | 11 + ...Name.md => DeprecatedProcessMetricName.md} | 4 +- .../shared/DeprecatedProcessMetricsData.md | 12 + docs/models/shared/FleetMetricName.md | 11 + docs/models/shared/FleetMetricsData.md | 11 + docs/models/shared/ProcessMetricName.md | 14 + .../{MetricsData.md => ProcessMetricsData.md} | 2 +- docs/sdks/authv1/README.md | 4 +- docs/sdks/billingv1/README.md | 2 +- docs/sdks/buildsv1/README.md | 8 +- docs/sdks/buildsv2/README.md | 24 +- docs/sdks/fleetsv1/README.md | 77 +++- docs/sdks/lobbiesv1/README.md | 2 +- docs/sdks/logsv1/README.md | 2 +- docs/sdks/metricsv1/README.md | 24 +- docs/sdks/processesv1/README.md | 4 +- docs/sdks/processesv2/README.md | 4 +- docs/sdks/processesv3/README.md | 62 ++- docs/sdks/roomsv2/README.md | 8 +- gen.yaml | 2 +- .../java/dev/hathora/cloud_sdk/AuthV1.java | 8 +- .../java/dev/hathora/cloud_sdk/BillingV1.java | 4 +- .../java/dev/hathora/cloud_sdk/BuildsV1.java | 4 +- .../java/dev/hathora/cloud_sdk/BuildsV2.java | 12 +- .../java/dev/hathora/cloud_sdk/FleetsV1.java | 187 +++++++++ .../dev/hathora/cloud_sdk/HathoraCloud.java | 6 + .../java/dev/hathora/cloud_sdk/LobbiesV1.java | 4 +- .../java/dev/hathora/cloud_sdk/LogsV1.java | 4 +- .../java/dev/hathora/cloud_sdk/MetricsV1.java | 47 ++- .../dev/hathora/cloud_sdk/ProcessesV1.java | 8 +- .../dev/hathora/cloud_sdk/ProcessesV2.java | 8 +- .../dev/hathora/cloud_sdk/ProcessesV3.java | 138 ++++++- .../java/dev/hathora/cloud_sdk/RoomsV2.java | 4 +- .../hathora/cloud_sdk/SDKConfiguration.java | 2 +- .../operations/GetFleetMetricsRequest.java | 383 ++++++++++++++++++ .../GetFleetMetricsRequestBuilder.java | 29 ++ ...onse.java => GetFleetMetricsResponse.java} | 68 ++-- .../GetMetricsDeprecatedRequest.java | 370 +++++++++++++++++ .../GetMetricsDeprecatedRequestBuilder.java | 29 ++ .../GetMetricsDeprecatedResponse.java | 252 ++++++++++++ .../operations/GetMetricsRequestBuilder.java | 29 -- ...est.java => GetProcessMetricsRequest.java} | 52 +-- .../GetProcessMetricsRequestBuilder.java | 29 ++ .../operations/GetProcessMetricsResponse.java | 252 ++++++++++++ .../operations/SDKMethodInterfaces.java | 18 +- ....java => DeprecatedProcessMetricName.java} | 7 +- ...java => DeprecatedProcessMetricsData.java} | 34 +- .../models/shared/FleetMetricName.java | 26 ++ .../models/shared/FleetMetricsData.java | 241 +++++++++++ .../models/shared/ProcessMetricName.java | 30 ++ .../models/shared/ProcessMetricsData.java | 284 +++++++++++++ 63 files changed, 2763 insertions(+), 268 deletions(-) create mode 100644 docs/models/operations/GetFleetMetricsRequest.md rename docs/models/operations/{GetMetricsResponse.md => GetFleetMetricsResponse.md} (93%) create mode 100644 docs/models/operations/GetMetricsDeprecatedRequest.md create mode 100644 docs/models/operations/GetMetricsDeprecatedResponse.md delete mode 100644 docs/models/operations/GetMetricsRequest.md create mode 100644 docs/models/operations/GetProcessMetricsRequest.md create mode 100644 docs/models/operations/GetProcessMetricsResponse.md rename docs/models/shared/{MetricName.md => DeprecatedProcessMetricName.md} (87%) create mode 100644 docs/models/shared/DeprecatedProcessMetricsData.md create mode 100644 docs/models/shared/FleetMetricName.md create mode 100644 docs/models/shared/FleetMetricsData.md create mode 100644 docs/models/shared/ProcessMetricName.md rename docs/models/shared/{MetricsData.md => ProcessMetricsData.md} (98%) create mode 100644 src/main/java/dev/hathora/cloud_sdk/models/operations/GetFleetMetricsRequest.java create mode 100644 src/main/java/dev/hathora/cloud_sdk/models/operations/GetFleetMetricsRequestBuilder.java rename src/main/java/dev/hathora/cloud_sdk/models/operations/{GetMetricsResponse.java => GetFleetMetricsResponse.java} (69%) create mode 100644 src/main/java/dev/hathora/cloud_sdk/models/operations/GetMetricsDeprecatedRequest.java create mode 100644 src/main/java/dev/hathora/cloud_sdk/models/operations/GetMetricsDeprecatedRequestBuilder.java create mode 100644 src/main/java/dev/hathora/cloud_sdk/models/operations/GetMetricsDeprecatedResponse.java delete mode 100644 src/main/java/dev/hathora/cloud_sdk/models/operations/GetMetricsRequestBuilder.java rename src/main/java/dev/hathora/cloud_sdk/models/operations/{GetMetricsRequest.java => GetProcessMetricsRequest.java} (84%) create mode 100644 src/main/java/dev/hathora/cloud_sdk/models/operations/GetProcessMetricsRequestBuilder.java create mode 100644 src/main/java/dev/hathora/cloud_sdk/models/operations/GetProcessMetricsResponse.java rename src/main/java/dev/hathora/cloud_sdk/models/shared/{MetricName.java => DeprecatedProcessMetricName.java} (79%) rename src/main/java/dev/hathora/cloud_sdk/models/shared/{MetricsData.java => DeprecatedProcessMetricsData.java} (86%) create mode 100644 src/main/java/dev/hathora/cloud_sdk/models/shared/FleetMetricName.java create mode 100644 src/main/java/dev/hathora/cloud_sdk/models/shared/FleetMetricsData.java create mode 100644 src/main/java/dev/hathora/cloud_sdk/models/shared/ProcessMetricName.java create mode 100644 src/main/java/dev/hathora/cloud_sdk/models/shared/ProcessMetricsData.java diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index ebb184bb..ebc84261 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: 7246ca0f7c1f27676a24e3bdfe2d3a45 + docChecksum: 21a416a1b30cc2a28c7e1d4dfa79202b docVersion: 0.0.1 - speakeasyVersion: 1.421.1 + speakeasyVersion: 1.422.1 generationVersion: 2.438.15 - releaseVersion: 2.10.9 - configChecksum: dca33630b00fa46b1caca4e2a5148da8 + releaseVersion: 2.10.10 + configChecksum: 6b7104325f5ea5f2d1544008b829b03e repoURL: https://github.com/hathora/cloud-sdk-java.git repoSubDirectory: . published: true @@ -145,6 +145,8 @@ generatedFiles: - docs/models/operations/GetDeploymentsV1DeprecatedResponse.md - docs/models/operations/GetDeploymentsV2DeprecatedRequest.md - docs/models/operations/GetDeploymentsV2DeprecatedResponse.md + - docs/models/operations/GetFleetMetricsRequest.md + - docs/models/operations/GetFleetMetricsResponse.md - docs/models/operations/GetFleetRegionRequest.md - docs/models/operations/GetFleetRegionResponse.md - docs/models/operations/GetFleetsRequest.md @@ -176,8 +178,8 @@ generatedFiles: - docs/models/operations/GetLogsForDeploymentResponse.md - docs/models/operations/GetLogsForProcessRequest.md - docs/models/operations/GetLogsForProcessResponse.md - - docs/models/operations/GetMetricsRequest.md - - docs/models/operations/GetMetricsResponse.md + - docs/models/operations/GetMetricsDeprecatedRequest.md + - docs/models/operations/GetMetricsDeprecatedResponse.md - docs/models/operations/GetOrgMembersRequest.md - docs/models/operations/GetOrgMembersResponse.md - docs/models/operations/GetOrgPendingInvitesRequest.md @@ -192,6 +194,8 @@ generatedFiles: - docs/models/operations/GetProcessInfoDeprecatedResponse.md - docs/models/operations/GetProcessInfoV2DeprecatedRequest.md - docs/models/operations/GetProcessInfoV2DeprecatedResponse.md + - docs/models/operations/GetProcessMetricsRequest.md + - docs/models/operations/GetProcessMetricsResponse.md - docs/models/operations/GetProcessRequest.md - docs/models/operations/GetProcessResponse.md - docs/models/operations/GetProcessesCountExperimentalRequest.md @@ -313,9 +317,13 @@ generatedFiles: - docs/models/shared/DeploymentV3.md - docs/models/shared/DeploymentV3Env.md - docs/models/shared/DeploymentsV3Page.md + - docs/models/shared/DeprecatedProcessMetricName.md + - docs/models/shared/DeprecatedProcessMetricsData.md - docs/models/shared/Env.md - docs/models/shared/ExposedPort.md - docs/models/shared/Fleet.md + - docs/models/shared/FleetMetricName.md + - docs/models/shared/FleetMetricsData.md - docs/models/shared/FleetRegion.md - docs/models/shared/FleetRegionConfig.md - docs/models/shared/FleetsPage.md @@ -331,9 +339,7 @@ generatedFiles: - docs/models/shared/LobbyV3.md - docs/models/shared/LobbyV3CreatedBy.md - docs/models/shared/LobbyVisibility.md - - docs/models/shared/MetricName.md - docs/models/shared/MetricValue.md - - docs/models/shared/MetricsData.md - docs/models/shared/NicknameObject.md - docs/models/shared/OrgMember.md - docs/models/shared/OrgMembersPage.md @@ -349,6 +355,8 @@ generatedFiles: - docs/models/shared/PlayerTokenObject.md - docs/models/shared/Process.md - docs/models/shared/ProcessExposedPort.md + - docs/models/shared/ProcessMetricName.md + - docs/models/shared/ProcessMetricsData.md - docs/models/shared/ProcessStatus.md - docs/models/shared/ProcessV2.md - docs/models/shared/ProcessV2ExposedPort.md @@ -605,6 +613,9 @@ generatedFiles: - src/main/java/dev/hathora/cloud_sdk/models/operations/GetDeploymentsV2DeprecatedRequest.java - src/main/java/dev/hathora/cloud_sdk/models/operations/GetDeploymentsV2DeprecatedRequestBuilder.java - src/main/java/dev/hathora/cloud_sdk/models/operations/GetDeploymentsV2DeprecatedResponse.java + - src/main/java/dev/hathora/cloud_sdk/models/operations/GetFleetMetricsRequest.java + - src/main/java/dev/hathora/cloud_sdk/models/operations/GetFleetMetricsRequestBuilder.java + - src/main/java/dev/hathora/cloud_sdk/models/operations/GetFleetMetricsResponse.java - src/main/java/dev/hathora/cloud_sdk/models/operations/GetFleetRegionRequest.java - src/main/java/dev/hathora/cloud_sdk/models/operations/GetFleetRegionRequestBuilder.java - src/main/java/dev/hathora/cloud_sdk/models/operations/GetFleetRegionResponse.java @@ -652,9 +663,9 @@ generatedFiles: - src/main/java/dev/hathora/cloud_sdk/models/operations/GetLogsForProcessRequest.java - src/main/java/dev/hathora/cloud_sdk/models/operations/GetLogsForProcessRequestBuilder.java - src/main/java/dev/hathora/cloud_sdk/models/operations/GetLogsForProcessResponse.java - - src/main/java/dev/hathora/cloud_sdk/models/operations/GetMetricsRequest.java - - src/main/java/dev/hathora/cloud_sdk/models/operations/GetMetricsRequestBuilder.java - - src/main/java/dev/hathora/cloud_sdk/models/operations/GetMetricsResponse.java + - src/main/java/dev/hathora/cloud_sdk/models/operations/GetMetricsDeprecatedRequest.java + - src/main/java/dev/hathora/cloud_sdk/models/operations/GetMetricsDeprecatedRequestBuilder.java + - src/main/java/dev/hathora/cloud_sdk/models/operations/GetMetricsDeprecatedResponse.java - src/main/java/dev/hathora/cloud_sdk/models/operations/GetOrgMembersRequest.java - src/main/java/dev/hathora/cloud_sdk/models/operations/GetOrgMembersRequestBuilder.java - src/main/java/dev/hathora/cloud_sdk/models/operations/GetOrgMembersResponse.java @@ -678,6 +689,9 @@ generatedFiles: - src/main/java/dev/hathora/cloud_sdk/models/operations/GetProcessInfoV2DeprecatedRequest.java - src/main/java/dev/hathora/cloud_sdk/models/operations/GetProcessInfoV2DeprecatedRequestBuilder.java - src/main/java/dev/hathora/cloud_sdk/models/operations/GetProcessInfoV2DeprecatedResponse.java + - src/main/java/dev/hathora/cloud_sdk/models/operations/GetProcessMetricsRequest.java + - src/main/java/dev/hathora/cloud_sdk/models/operations/GetProcessMetricsRequestBuilder.java + - src/main/java/dev/hathora/cloud_sdk/models/operations/GetProcessMetricsResponse.java - src/main/java/dev/hathora/cloud_sdk/models/operations/GetProcessRequest.java - src/main/java/dev/hathora/cloud_sdk/models/operations/GetProcessRequestBuilder.java - src/main/java/dev/hathora/cloud_sdk/models/operations/GetProcessResponse.java @@ -834,9 +848,13 @@ generatedFiles: - src/main/java/dev/hathora/cloud_sdk/models/shared/DeploymentV3.java - src/main/java/dev/hathora/cloud_sdk/models/shared/DeploymentV3Env.java - src/main/java/dev/hathora/cloud_sdk/models/shared/DeploymentsV3Page.java + - src/main/java/dev/hathora/cloud_sdk/models/shared/DeprecatedProcessMetricName.java + - src/main/java/dev/hathora/cloud_sdk/models/shared/DeprecatedProcessMetricsData.java - src/main/java/dev/hathora/cloud_sdk/models/shared/Env.java - src/main/java/dev/hathora/cloud_sdk/models/shared/ExposedPort.java - src/main/java/dev/hathora/cloud_sdk/models/shared/Fleet.java + - src/main/java/dev/hathora/cloud_sdk/models/shared/FleetMetricName.java + - src/main/java/dev/hathora/cloud_sdk/models/shared/FleetMetricsData.java - src/main/java/dev/hathora/cloud_sdk/models/shared/FleetRegion.java - src/main/java/dev/hathora/cloud_sdk/models/shared/FleetRegionConfig.java - src/main/java/dev/hathora/cloud_sdk/models/shared/FleetsPage.java @@ -852,9 +870,7 @@ generatedFiles: - src/main/java/dev/hathora/cloud_sdk/models/shared/LobbyV3.java - src/main/java/dev/hathora/cloud_sdk/models/shared/LobbyV3CreatedBy.java - src/main/java/dev/hathora/cloud_sdk/models/shared/LobbyVisibility.java - - src/main/java/dev/hathora/cloud_sdk/models/shared/MetricName.java - src/main/java/dev/hathora/cloud_sdk/models/shared/MetricValue.java - - src/main/java/dev/hathora/cloud_sdk/models/shared/MetricsData.java - src/main/java/dev/hathora/cloud_sdk/models/shared/NicknameObject.java - src/main/java/dev/hathora/cloud_sdk/models/shared/OrgMember.java - src/main/java/dev/hathora/cloud_sdk/models/shared/OrgMembersPage.java @@ -870,6 +886,8 @@ generatedFiles: - src/main/java/dev/hathora/cloud_sdk/models/shared/PlayerTokenObject.java - src/main/java/dev/hathora/cloud_sdk/models/shared/Process.java - src/main/java/dev/hathora/cloud_sdk/models/shared/ProcessExposedPort.java + - src/main/java/dev/hathora/cloud_sdk/models/shared/ProcessMetricName.java + - src/main/java/dev/hathora/cloud_sdk/models/shared/ProcessMetricsData.java - src/main/java/dev/hathora/cloud_sdk/models/shared/ProcessStatus.java - src/main/java/dev/hathora/cloud_sdk/models/shared/ProcessV2.java - src/main/java/dev/hathora/cloud_sdk/models/shared/ProcessV2ExposedPort.java diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 50f46c3d..663ada0b 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,9 +1,9 @@ -speakeasyVersion: 1.421.1 +speakeasyVersion: 1.422.1 sources: java-source: sourceNamespace: java-source - sourceRevisionDigest: sha256:c65dcf9d87cc7ce7d855a729251a1c48e05105a05c69fbc0c64bdc1f8af0a6e4 - sourceBlobDigest: sha256:4f8be32df07db1363406faf1b3655e237643c7e536ffa5d49c70e6da77147d71 + sourceRevisionDigest: sha256:5e452b25180f3f633df5c9b49542037e7549d735502f0a3deb1342c65bdc7948 + sourceBlobDigest: sha256:17d496af184c2a1507c89f3b3fc6068e830536d7ef6757a35fb6541a68f71bb3 tags: - latest - main @@ -11,10 +11,10 @@ targets: hathora-java: source: java-source sourceNamespace: java-source - sourceRevisionDigest: sha256:c65dcf9d87cc7ce7d855a729251a1c48e05105a05c69fbc0c64bdc1f8af0a6e4 - sourceBlobDigest: sha256:4f8be32df07db1363406faf1b3655e237643c7e536ffa5d49c70e6da77147d71 + sourceRevisionDigest: sha256:5e452b25180f3f633df5c9b49542037e7549d735502f0a3deb1342c65bdc7948 + sourceBlobDigest: sha256:17d496af184c2a1507c89f3b3fc6068e830536d7ef6757a35fb6541a68f71bb3 codeSamplesNamespace: code-samples-java-hathora-java - codeSamplesRevisionDigest: sha256:78eea36691867ad9746d6a85bdc6523102d8ba3943937eec21f69e9e84f9d3e4 + codeSamplesRevisionDigest: sha256:58b5b695a738ce88ccd4e55a268403ffdfec65b01b27cddc245a2d0630c3b68e workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index 61d65015..2b581080 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.10.9' +implementation 'dev.hathora:cloud-sdk:2.10.10' ``` Maven: @@ -43,7 +43,7 @@ Maven: dev.hathora cloud-sdk - 2.10.9 + 2.10.10 ``` @@ -202,9 +202,10 @@ Deleting a build that is actively build used by an app's deployment will cause f ### [fleetsV1()](docs/sdks/fleetsv1/README.md) -* [getFleetRegion](docs/sdks/fleetsv1/README.md#getfleetregion) -* [getFleets](docs/sdks/fleetsv1/README.md#getfleets) -* [updateFleetRegion](docs/sdks/fleetsv1/README.md#updatefleetregion) +* [getFleetMetrics](docs/sdks/fleetsv1/README.md#getfleetmetrics) - Gets metrics for a [fleet](https://hathora.dev/docs/concepts/hathora-entities#fleet) in a region. +* [getFleetRegion](docs/sdks/fleetsv1/README.md#getfleetregion) - Gets the configuration for a given [fleet](https://hathora.dev/docs/concepts/hathora-entities#fleet) in a region. +* [getFleets](docs/sdks/fleetsv1/README.md#getfleets) - Returns an array of [fleets](https://hathora.dev/docs/concepts/hathora-entities#fleet). +* [updateFleetRegion](docs/sdks/fleetsv1/README.md#updatefleetregion) - Updates the configuration for a given [fleet](https://hathora.dev/docs/concepts/hathora-entities#fleet) in a region. ### [~~lobbiesV1()~~](docs/sdks/lobbiesv1/README.md) @@ -241,9 +242,9 @@ Deleting a build that is actively build used by an app's deployment will cause f * [sendVerificationEmail](docs/sdks/managementv1/README.md#sendverificationemail) -### [metricsV1()](docs/sdks/metricsv1/README.md) +### [~~metricsV1()~~](docs/sdks/metricsv1/README.md) -* [getMetrics](docs/sdks/metricsv1/README.md#getmetrics) - Get metrics for a [process](https://hathora.dev/docs/concepts/hathora-entities#process) using `appId` and `processId`. +* [~~getMetricsDeprecated~~](docs/sdks/metricsv1/README.md#getmetricsdeprecated) - Get metrics for a [process](https://hathora.dev/docs/concepts/hathora-entities#process) using `appId` and `processId`. :warning: **Deprecated** ### [organizationsV1()](docs/sdks/organizationsv1/README.md) @@ -275,6 +276,7 @@ Deleting a build that is actively build used by an app's deployment will cause f * [createProcess](docs/sdks/processesv3/README.md#createprocess) - Creates a [process](https://hathora.dev/docs/concepts/hathora-entities#process) without a room. Use this to pre-allocate processes ahead of time so that subsequent room assignment via [CreateRoom()](https://hathora.dev/api#tag/RoomV2/operation/CreateRoom) can be instant. * [getLatestProcesses](docs/sdks/processesv3/README.md#getlatestprocesses) - Retrieve the 10 most recent [processes](https://hathora.dev/docs/concepts/hathora-entities#process) objects for an [application](https://hathora.dev/docs/concepts/hathora-entities#application). Filter the array by optionally passing in a `status` or `region`. * [getProcess](docs/sdks/processesv3/README.md#getprocess) - Get details for a [process](https://hathora.dev/docs/concepts/hathora-entities#process). +* [getProcessMetrics](docs/sdks/processesv3/README.md#getprocessmetrics) * [getProcessesCountExperimental](docs/sdks/processesv3/README.md#getprocessescountexperimental) - Count the number of [processes](https://hathora.dev/docs/concepts/hathora-entities#process) objects for an [application](https://hathora.dev/docs/concepts/hathora-entities#application). Filter by optionally passing in a `status` or `region`. * [stopProcess](docs/sdks/processesv3/README.md#stopprocess) - Stops a [process](https://hathora.dev/docs/concepts/hathora-entities#process) immediately. diff --git a/RELEASES.md b/RELEASES.md index b4a7274b..6a492b0d 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -789,4 +789,14 @@ Based on: ### Generated - [java v2.10.9] . ### Releases -- [Maven Central v2.10.9] https://central.sonatype.com/artifact/dev.hathora/cloud-sdk/2.10.9 - . \ No newline at end of file +- [Maven Central v2.10.9] https://central.sonatype.com/artifact/dev.hathora/cloud-sdk/2.10.9 - . + +## 2024-10-26 00:07:40 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.422.1 (2.438.15) https://github.com/speakeasy-api/speakeasy +### Generated +- [java v2.10.10] . +### Releases +- [Maven Central v2.10.10] https://central.sonatype.com/artifact/dev.hathora/cloud-sdk/2.10.10 - . \ No newline at end of file diff --git a/build.gradle b/build.gradle index f10b13a6..ce98d9c1 100644 --- a/build.gradle +++ b/build.gradle @@ -63,7 +63,7 @@ tasks.withType(Javadoc) { } group = "dev.hathora" -version = "2.10.9" +version = "2.10.10" sourcesJar { archiveBaseName = "cloud-sdk" @@ -101,7 +101,7 @@ publishing { maven(MavenPublication) { groupId = 'dev.hathora' artifactId = 'cloud-sdk' - version = '2.10.9' + version = '2.10.10' from components.java diff --git a/codeSamples.yaml b/codeSamples.yaml index fd18cf34..3d7dc438 100644 --- a/codeSamples.yaml +++ b/codeSamples.yaml @@ -165,6 +165,12 @@ actions: - "lang": "java" "label": "UpdateFleetRegion" "source": "package hello.world;\n\nimport dev.hathora.cloud_sdk.HathoraCloud;\nimport dev.hathora.cloud_sdk.models.errors.ApiError;\nimport dev.hathora.cloud_sdk.models.operations.UpdateFleetRegionRequest;\nimport dev.hathora.cloud_sdk.models.operations.UpdateFleetRegionResponse;\nimport dev.hathora.cloud_sdk.models.shared.FleetRegionConfig;\nimport dev.hathora.cloud_sdk.models.shared.Region;\nimport dev.hathora.cloud_sdk.models.shared.Security;\nimport java.lang.Exception;\n\npublic class Application {\n\n public static void main(String[] args) throws ApiError, Exception {\n\n HathoraCloud sdk = HathoraCloud.builder()\n .security(Security.builder()\n .hathoraDevToken(\"\")\n .build())\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n UpdateFleetRegionRequest req = UpdateFleetRegionRequest.builder()\n .fleetId(\"\")\n .region(Region.SINGAPORE)\n .fleetRegionConfig(FleetRegionConfig.builder()\n .cloudMinVcpus(513135)\n .build())\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .build();\n\n UpdateFleetRegionResponse res = sdk.fleetsV1().updateFleetRegion()\n .request(req)\n .call();\n\n // handle response\n }\n}" + - target: $["paths"]["/fleets/v1/fleets/{fleetId}/regions/{region}/metrics"]["get"] + update: + "x-codeSamples": + - "lang": "java" + "label": "GetFleetMetrics" + "source": "package hello.world;\n\nimport dev.hathora.cloud_sdk.HathoraCloud;\nimport dev.hathora.cloud_sdk.models.errors.ApiError;\nimport dev.hathora.cloud_sdk.models.operations.GetFleetMetricsRequest;\nimport dev.hathora.cloud_sdk.models.operations.GetFleetMetricsResponse;\nimport dev.hathora.cloud_sdk.models.shared.Region;\nimport dev.hathora.cloud_sdk.models.shared.Security;\nimport java.lang.Exception;\n\npublic class Application {\n\n public static void main(String[] args) throws ApiError, Exception {\n\n HathoraCloud sdk = HathoraCloud.builder()\n .security(Security.builder()\n .hathoraDevToken(\"\")\n .build())\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n GetFleetMetricsRequest req = GetFleetMetricsRequest.builder()\n .fleetId(\"\")\n .region(Region.LONDON)\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .build();\n\n GetFleetMetricsResponse res = sdk.fleetsV1().getFleetMetrics()\n .request(req)\n .call();\n\n if (res.fleetMetricsData().isPresent()) {\n // handle response\n }\n }\n}" - target: $["paths"]["/lobby/v3/{appId}/create"]["post"] update: "x-codeSamples": @@ -207,12 +213,6 @@ actions: - "lang": "java" "label": "SendVerificationEmail" "source": "package hello.world;\n\nimport dev.hathora.cloud_sdk.HathoraCloud;\nimport dev.hathora.cloud_sdk.models.errors.ApiError;\nimport dev.hathora.cloud_sdk.models.operations.SendVerificationEmailResponse;\nimport dev.hathora.cloud_sdk.models.shared.VerificationEmailRequest;\nimport java.lang.Exception;\n\npublic class Application {\n\n public static void main(String[] args) throws ApiError, Exception {\n\n HathoraCloud sdk = HathoraCloud.builder()\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n VerificationEmailRequest req = VerificationEmailRequest.builder()\n .userId(\"\")\n .build();\n\n SendVerificationEmailResponse res = sdk.managementV1().sendVerificationEmail()\n .request(req)\n .call();\n\n if (res.verificationEmailSuccess().isPresent()) {\n // handle response\n }\n }\n}" - - target: $["paths"]["/metrics/v1/{appId}/process/{processId}"]["get"] - update: - "x-codeSamples": - - "lang": "java" - "label": "GetMetrics" - "source": "package hello.world;\n\nimport dev.hathora.cloud_sdk.HathoraCloud;\nimport dev.hathora.cloud_sdk.models.errors.ApiError;\nimport dev.hathora.cloud_sdk.models.operations.GetMetricsRequest;\nimport dev.hathora.cloud_sdk.models.operations.GetMetricsResponse;\nimport dev.hathora.cloud_sdk.models.shared.Security;\nimport java.lang.Exception;\n\npublic class Application {\n\n public static void main(String[] args) throws ApiError, Exception {\n\n HathoraCloud sdk = HathoraCloud.builder()\n .security(Security.builder()\n .hathoraDevToken(\"\")\n .build())\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n GetMetricsRequest req = GetMetricsRequest.builder()\n .processId(\"cbfcddd2-0006-43ae-996c-995fff7bed2e\")\n .build();\n\n GetMetricsResponse res = sdk.metricsV1().getMetrics()\n .request(req)\n .call();\n\n if (res.metricsData().isPresent()) {\n // handle response\n }\n }\n}" - target: $["paths"]["/orgs/v1"]["get"] update: "x-codeSamples": @@ -273,6 +273,12 @@ actions: - "lang": "java" "label": "GetLatestProcesses" "source": "package hello.world;\n\nimport dev.hathora.cloud_sdk.HathoraCloud;\nimport dev.hathora.cloud_sdk.models.errors.ApiError;\nimport dev.hathora.cloud_sdk.models.operations.GetLatestProcessesResponse;\nimport dev.hathora.cloud_sdk.models.shared.ProcessStatus;\nimport dev.hathora.cloud_sdk.models.shared.Region;\nimport dev.hathora.cloud_sdk.models.shared.Security;\nimport java.lang.Exception;\nimport java.util.List;\n\npublic class Application {\n\n public static void main(String[] args) throws ApiError, Exception {\n\n HathoraCloud sdk = HathoraCloud.builder()\n .security(Security.builder()\n .hathoraDevToken(\"\")\n .build())\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n GetLatestProcessesResponse res = sdk.processesV3().getLatestProcesses()\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .status(List.of(\n ProcessStatus.STOPPED))\n .region(List.of(\n Region.FRANKFURT))\n .call();\n\n if (res.processV3s().isPresent()) {\n // handle response\n }\n }\n}" + - target: $["paths"]["/processes/v3/apps/{appId}/processes/process/{processId}/metrics"]["get"] + update: + "x-codeSamples": + - "lang": "java" + "label": "GetProcessMetrics" + "source": "package hello.world;\n\nimport dev.hathora.cloud_sdk.HathoraCloud;\nimport dev.hathora.cloud_sdk.models.errors.ApiError;\nimport dev.hathora.cloud_sdk.models.operations.GetProcessMetricsRequest;\nimport dev.hathora.cloud_sdk.models.operations.GetProcessMetricsResponse;\nimport dev.hathora.cloud_sdk.models.shared.Security;\nimport java.lang.Exception;\n\npublic class Application {\n\n public static void main(String[] args) throws ApiError, Exception {\n\n HathoraCloud sdk = HathoraCloud.builder()\n .security(Security.builder()\n .hathoraDevToken(\"\")\n .build())\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n GetProcessMetricsRequest req = GetProcessMetricsRequest.builder()\n .processId(\"cbfcddd2-0006-43ae-996c-995fff7bed2e\")\n .build();\n\n GetProcessMetricsResponse res = sdk.processesV3().getProcessMetrics()\n .request(req)\n .call();\n\n if (res.processMetricsData().isPresent()) {\n // handle response\n }\n }\n}" - target: $["paths"]["/processes/v3/apps/{appId}/processes/regions/{region}"]["post"] update: "x-codeSamples": diff --git a/docs/models/operations/GetFleetMetricsRequest.md b/docs/models/operations/GetFleetMetricsRequest.md new file mode 100644 index 00000000..344e8f39 --- /dev/null +++ b/docs/models/operations/GetFleetMetricsRequest.md @@ -0,0 +1,14 @@ +# GetFleetMetricsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `end` | *Optional\* | :heavy_minus_sign: | N/A | | +| `fleetId` | *String* | :heavy_check_mark: | N/A | | +| `metrics` | List\<[FleetMetricName](../../models/shared/FleetMetricName.md)> | :heavy_minus_sign: | Available metrics to query over time. | | +| `orgId` | *Optional\* | :heavy_minus_sign: | N/A | org-6f706e83-0ec1-437a-9a46-7d4281eb2f39 | +| `region` | [Region](../../models/shared/Region.md) | :heavy_check_mark: | N/A | | +| `start` | *Optional\* | :heavy_minus_sign: | Unix timestamp. Default is -1 hour from `end`. | | +| `step` | *Optional\* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/GetMetricsResponse.md b/docs/models/operations/GetFleetMetricsResponse.md similarity index 93% rename from docs/models/operations/GetMetricsResponse.md rename to docs/models/operations/GetFleetMetricsResponse.md index 7b194954..ef2abe24 100644 --- a/docs/models/operations/GetMetricsResponse.md +++ b/docs/models/operations/GetFleetMetricsResponse.md @@ -1,4 +1,4 @@ -# GetMetricsResponse +# GetFleetMetricsResponse ## Fields @@ -6,6 +6,6 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | | `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `metricsData` | [Optional\](../../models/shared/MetricsData.md) | :heavy_minus_sign: | Ok | +| `fleetMetricsData` | [Optional\](../../models/shared/FleetMetricsData.md) | :heavy_minus_sign: | Ok | | `statusCode` | *int* | :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_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/GetMetricsDeprecatedRequest.md b/docs/models/operations/GetMetricsDeprecatedRequest.md new file mode 100644 index 00000000..e26f8a1a --- /dev/null +++ b/docs/models/operations/GetMetricsDeprecatedRequest.md @@ -0,0 +1,13 @@ +# GetMetricsDeprecatedRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `appId` | *Optional\* | :heavy_minus_sign: | N/A | app-af469a92-5b45-4565-b3c4-b79878de67d2 | +| `end` | *Optional\* | :heavy_minus_sign: | Unix timestamp. Default is current time. | | +| `metrics` | List\<[DeprecatedProcessMetricName](../../models/shared/DeprecatedProcessMetricName.md)> | :heavy_minus_sign: | Available metrics to query over time. | | +| `processId` | *String* | :heavy_check_mark: | N/A | cbfcddd2-0006-43ae-996c-995fff7bed2e | +| `start` | *Optional\* | :heavy_minus_sign: | Unix timestamp. Default is -1 hour from `end`. | | +| `step` | *Optional\* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/GetMetricsDeprecatedResponse.md b/docs/models/operations/GetMetricsDeprecatedResponse.md new file mode 100644 index 00000000..85bfba8e --- /dev/null +++ b/docs/models/operations/GetMetricsDeprecatedResponse.md @@ -0,0 +1,11 @@ +# GetMetricsDeprecatedResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `deprecatedProcessMetricsData` | [Optional\](../../models/shared/DeprecatedProcessMetricsData.md) | :heavy_minus_sign: | Ok | +| `statusCode` | *int* | :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_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/GetMetricsRequest.md b/docs/models/operations/GetMetricsRequest.md deleted file mode 100644 index 2296b942..00000000 --- a/docs/models/operations/GetMetricsRequest.md +++ /dev/null @@ -1,13 +0,0 @@ -# GetMetricsRequest - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | -| `appId` | *Optional\* | :heavy_minus_sign: | N/A | app-af469a92-5b45-4565-b3c4-b79878de67d2 | -| `end` | *Optional\* | :heavy_minus_sign: | Unix timestamp. Default is current time. | | -| `metrics` | List\<[MetricName](../../models/shared/MetricName.md)> | :heavy_minus_sign: | Available metrics to query over time. | | -| `processId` | *String* | :heavy_check_mark: | N/A | cbfcddd2-0006-43ae-996c-995fff7bed2e | -| `start` | *Optional\* | :heavy_minus_sign: | Unix timestamp. Default is -1 hour from `end`. | | -| `step` | *Optional\* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/GetProcessMetricsRequest.md b/docs/models/operations/GetProcessMetricsRequest.md new file mode 100644 index 00000000..5fe34dbe --- /dev/null +++ b/docs/models/operations/GetProcessMetricsRequest.md @@ -0,0 +1,13 @@ +# GetProcessMetricsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `appId` | *Optional\* | :heavy_minus_sign: | N/A | app-af469a92-5b45-4565-b3c4-b79878de67d2 | +| `end` | *Optional\* | :heavy_minus_sign: | Unix timestamp. Default is current time. | | +| `metrics` | List\<[ProcessMetricName](../../models/shared/ProcessMetricName.md)> | :heavy_minus_sign: | Available metrics to query over time. | | +| `processId` | *String* | :heavy_check_mark: | N/A | cbfcddd2-0006-43ae-996c-995fff7bed2e | +| `start` | *Optional\* | :heavy_minus_sign: | Unix timestamp. Default is -1 hour from `end`. | | +| `step` | *Optional\* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/GetProcessMetricsResponse.md b/docs/models/operations/GetProcessMetricsResponse.md new file mode 100644 index 00000000..3313c720 --- /dev/null +++ b/docs/models/operations/GetProcessMetricsResponse.md @@ -0,0 +1,11 @@ +# GetProcessMetricsResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `processMetricsData` | [Optional\](../../models/shared/ProcessMetricsData.md) | :heavy_minus_sign: | Ok | +| `statusCode` | *int* | :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_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/shared/MetricName.md b/docs/models/shared/DeprecatedProcessMetricName.md similarity index 87% rename from docs/models/shared/MetricName.md rename to docs/models/shared/DeprecatedProcessMetricName.md index 69a16241..02822c07 100644 --- a/docs/models/shared/MetricName.md +++ b/docs/models/shared/DeprecatedProcessMetricName.md @@ -1,6 +1,4 @@ -# MetricName - -Available metrics to query over time. +# DeprecatedProcessMetricName ## Values diff --git a/docs/models/shared/DeprecatedProcessMetricsData.md b/docs/models/shared/DeprecatedProcessMetricsData.md new file mode 100644 index 00000000..41c25268 --- /dev/null +++ b/docs/models/shared/DeprecatedProcessMetricsData.md @@ -0,0 +1,12 @@ +# DeprecatedProcessMetricsData + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `activeConnections` | List\<[MetricValue](../../models/shared/MetricValue.md)> | :heavy_minus_sign: | N/A | +| `cpu` | List\<[MetricValue](../../models/shared/MetricValue.md)> | :heavy_minus_sign: | N/A | +| `memory` | List\<[MetricValue](../../models/shared/MetricValue.md)> | :heavy_minus_sign: | N/A | +| `rateEgress` | List\<[MetricValue](../../models/shared/MetricValue.md)> | :heavy_minus_sign: | N/A | +| `totalEgress` | List\<[MetricValue](../../models/shared/MetricValue.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/shared/FleetMetricName.md b/docs/models/shared/FleetMetricName.md new file mode 100644 index 00000000..e03b8b57 --- /dev/null +++ b/docs/models/shared/FleetMetricName.md @@ -0,0 +1,11 @@ +# FleetMetricName + + +## Values + +| Name | Value | +| ------------------------ | ------------------------ | +| `PROVISIONED_TOTAL` | provisionedTotal | +| `PROVISIONED_BARE_METAL` | provisionedBareMetal | +| `PROVISIONED_CLOUD` | provisionedCloud | +| `UTILIZED` | utilized | \ No newline at end of file diff --git a/docs/models/shared/FleetMetricsData.md b/docs/models/shared/FleetMetricsData.md new file mode 100644 index 00000000..c0b2b1b6 --- /dev/null +++ b/docs/models/shared/FleetMetricsData.md @@ -0,0 +1,11 @@ +# FleetMetricsData + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `provisionedBareMetal` | List\<[MetricValue](../../models/shared/MetricValue.md)> | :heavy_minus_sign: | N/A | +| `provisionedCloud` | List\<[MetricValue](../../models/shared/MetricValue.md)> | :heavy_minus_sign: | N/A | +| `provisionedTotal` | List\<[MetricValue](../../models/shared/MetricValue.md)> | :heavy_minus_sign: | N/A | +| `utilized` | List\<[MetricValue](../../models/shared/MetricValue.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/shared/ProcessMetricName.md b/docs/models/shared/ProcessMetricName.md new file mode 100644 index 00000000..40baffbb --- /dev/null +++ b/docs/models/shared/ProcessMetricName.md @@ -0,0 +1,14 @@ +# ProcessMetricName + +Available metrics to query over time. + + +## Values + +| Name | Value | +| -------------------- | -------------------- | +| `CPU` | cpu | +| `MEMORY` | memory | +| `RATE_EGRESS` | rateEgress | +| `TOTAL_EGRESS` | totalEgress | +| `ACTIVE_CONNECTIONS` | activeConnections | \ No newline at end of file diff --git a/docs/models/shared/MetricsData.md b/docs/models/shared/ProcessMetricsData.md similarity index 98% rename from docs/models/shared/MetricsData.md rename to docs/models/shared/ProcessMetricsData.md index d37c9484..b5febb2b 100644 --- a/docs/models/shared/MetricsData.md +++ b/docs/models/shared/ProcessMetricsData.md @@ -1,4 +1,4 @@ -# MetricsData +# ProcessMetricsData ## Fields diff --git a/docs/sdks/authv1/README.md b/docs/sdks/authv1/README.md index 900380d3..038b3e66 100644 --- a/docs/sdks/authv1/README.md +++ b/docs/sdks/authv1/README.md @@ -113,7 +113,7 @@ public class Application { | Error Type | Status Code | Content Type | | ---------------------- | ---------------------- | ---------------------- | -| models/errors/ApiError | 401, 404, 429 | application/json | +| models/errors/ApiError | 401, 404, 422, 429 | application/json | | models/errors/SDKError | 4XX, 5XX | \*/\* | ## loginNickname @@ -168,5 +168,5 @@ public class Application { | Error Type | Status Code | Content Type | | ---------------------- | ---------------------- | ---------------------- | -| models/errors/ApiError | 404, 429 | application/json | +| models/errors/ApiError | 404, 422, 429 | application/json | | models/errors/SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/billingv1/README.md b/docs/sdks/billingv1/README.md index 2e1bac4b..c069f022 100644 --- a/docs/sdks/billingv1/README.md +++ b/docs/sdks/billingv1/README.md @@ -293,5 +293,5 @@ public class Application { | Error Type | Status Code | Content Type | | ---------------------- | ---------------------- | ---------------------- | -| models/errors/ApiError | 401, 404, 429 | application/json | +| models/errors/ApiError | 401, 404, 422, 429 | application/json | | models/errors/SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/buildsv1/README.md b/docs/sdks/buildsv1/README.md index 53fd58d1..be290891 100644 --- a/docs/sdks/buildsv1/README.md +++ b/docs/sdks/buildsv1/README.md @@ -67,10 +67,10 @@ public class Application { ### Errors -| Error Type | Status Code | Content Type | -| ---------------------- | ---------------------- | ---------------------- | -| models/errors/ApiError | 401, 404, 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 | \*/\* | ## ~~deleteBuildDeprecated~~ diff --git a/docs/sdks/buildsv2/README.md b/docs/sdks/buildsv2/README.md index 67f3181d..70529696 100644 --- a/docs/sdks/buildsv2/README.md +++ b/docs/sdks/buildsv2/README.md @@ -69,10 +69,10 @@ public class Application { ### Errors -| Error Type | Status Code | Content Type | -| ---------------------- | ---------------------- | ---------------------- | -| models/errors/ApiError | 401, 404, 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 | \*/\* | ## ~~createBuildWithUploadUrlV2Deprecated~~ @@ -130,10 +130,10 @@ public class Application { ### Errors -| Error Type | Status Code | Content Type | -| ---------------------- | ---------------------- | ---------------------- | -| models/errors/ApiError | 401, 404, 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 | \*/\* | ## ~~createWithMultipartUploadsV2Deprecated~~ @@ -193,10 +193,10 @@ public class Application { ### Errors -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| models/errors/ApiError | 400, 401, 404, 429, 500 | application/json | -| models/errors/SDKError | 4XX, 5XX | \*/\* | +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| models/errors/ApiError | 400, 401, 404, 422, 429, 500 | application/json | +| models/errors/SDKError | 4XX, 5XX | \*/\* | ## ~~deleteBuildV2Deprecated~~ diff --git a/docs/sdks/fleetsv1/README.md b/docs/sdks/fleetsv1/README.md index 1a5b0d21..fa5516f9 100644 --- a/docs/sdks/fleetsv1/README.md +++ b/docs/sdks/fleetsv1/README.md @@ -3,14 +3,81 @@ ## Overview +Operations to manage and view a [fleet](https://hathora.dev/docs/concepts/hathora-entities#fleet). + ### Available Operations -* [getFleetRegion](#getfleetregion) -* [getFleets](#getfleets) -* [updateFleetRegion](#updatefleetregion) +* [getFleetMetrics](#getfleetmetrics) - Gets metrics for a [fleet](https://hathora.dev/docs/concepts/hathora-entities#fleet) in a region. +* [getFleetRegion](#getfleetregion) - Gets the configuration for a given [fleet](https://hathora.dev/docs/concepts/hathora-entities#fleet) in a region. +* [getFleets](#getfleets) - Returns an array of [fleets](https://hathora.dev/docs/concepts/hathora-entities#fleet). +* [updateFleetRegion](#updatefleetregion) - Updates the configuration for a given [fleet](https://hathora.dev/docs/concepts/hathora-entities#fleet) in a region. + +## getFleetMetrics + +Gets metrics for a [fleet](https://hathora.dev/docs/concepts/hathora-entities#fleet) in a region. + +### Example Usage + +```java +package hello.world; + +import dev.hathora.cloud_sdk.HathoraCloud; +import dev.hathora.cloud_sdk.models.errors.ApiError; +import dev.hathora.cloud_sdk.models.operations.GetFleetMetricsRequest; +import dev.hathora.cloud_sdk.models.operations.GetFleetMetricsResponse; +import dev.hathora.cloud_sdk.models.shared.Region; +import dev.hathora.cloud_sdk.models.shared.Security; +import java.lang.Exception; + +public class Application { + + public static void main(String[] args) throws ApiError, Exception { + + HathoraCloud sdk = HathoraCloud.builder() + .security(Security.builder() + .hathoraDevToken("") + .build()) + .appId("app-af469a92-5b45-4565-b3c4-b79878de67d2") + .build(); + + GetFleetMetricsRequest req = GetFleetMetricsRequest.builder() + .fleetId("") + .region(Region.LONDON) + .orgId("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39") + .build(); + + GetFleetMetricsResponse res = sdk.fleetsV1().getFleetMetrics() + .request(req) + .call(); + + if (res.fleetMetricsData().isPresent()) { + // handle response + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `request` | [GetFleetMetricsRequest](../../models/operations/GetFleetMetricsRequest.md) | :heavy_check_mark: | The request object to use for the request. | + +### Response + +**[GetFleetMetricsResponse](../../models/operations/GetFleetMetricsResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------- | ---------------------- | ---------------------- | +| models/errors/ApiError | 404, 422, 429, 500 | application/json | +| models/errors/SDKError | 4XX, 5XX | \*/\* | ## getFleetRegion +Gets the configuration for a given [fleet](https://hathora.dev/docs/concepts/hathora-entities#fleet) in a region. + ### Example Usage ```java @@ -68,6 +135,8 @@ public class Application { ## getFleets +Returns an array of [fleets](https://hathora.dev/docs/concepts/hathora-entities#fleet). + ### Example Usage ```java @@ -120,6 +189,8 @@ public class Application { ## updateFleetRegion +Updates the configuration for a given [fleet](https://hathora.dev/docs/concepts/hathora-entities#fleet) in a region. + ### Example Usage ```java diff --git a/docs/sdks/lobbiesv1/README.md b/docs/sdks/lobbiesv1/README.md index c62fd4ad..fae219db 100644 --- a/docs/sdks/lobbiesv1/README.md +++ b/docs/sdks/lobbiesv1/README.md @@ -181,5 +181,5 @@ public class Application { | Error Type | Status Code | Content Type | | ---------------------- | ---------------------- | ---------------------- | -| models/errors/ApiError | 404, 429 | application/json | +| models/errors/ApiError | 404, 422, 429 | application/json | | models/errors/SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/logsv1/README.md b/docs/sdks/logsv1/README.md index 744ae0c3..0c274f5f 100644 --- a/docs/sdks/logsv1/README.md +++ b/docs/sdks/logsv1/README.md @@ -124,7 +124,7 @@ public class Application { | Error Type | Status Code | Content Type | | ---------------------- | ---------------------- | ---------------------- | -| models/errors/ApiError | 401, 404, 429 | application/json | +| models/errors/ApiError | 401, 404, 422, 429 | application/json | | models/errors/SDKError | 4XX, 5XX | \*/\* | ## ~~getLogsForDeployment~~ diff --git a/docs/sdks/metricsv1/README.md b/docs/sdks/metricsv1/README.md index 6473c7f4..127e0370 100644 --- a/docs/sdks/metricsv1/README.md +++ b/docs/sdks/metricsv1/README.md @@ -7,12 +7,14 @@ Operations to get metrics by [process](https://hathora.dev/docs/concepts/hathora ### Available Operations -* [getMetrics](#getmetrics) - Get metrics for a [process](https://hathora.dev/docs/concepts/hathora-entities#process) using `appId` and `processId`. +* [~~getMetricsDeprecated~~](#getmetricsdeprecated) - Get metrics for a [process](https://hathora.dev/docs/concepts/hathora-entities#process) using `appId` and `processId`. :warning: **Deprecated** -## getMetrics +## ~~getMetricsDeprecated~~ Get metrics for a [process](https://hathora.dev/docs/concepts/hathora-entities#process) using `appId` and `processId`. +> :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. + ### Example Usage ```java @@ -20,8 +22,8 @@ package hello.world; import dev.hathora.cloud_sdk.HathoraCloud; import dev.hathora.cloud_sdk.models.errors.ApiError; -import dev.hathora.cloud_sdk.models.operations.GetMetricsRequest; -import dev.hathora.cloud_sdk.models.operations.GetMetricsResponse; +import dev.hathora.cloud_sdk.models.operations.GetMetricsDeprecatedRequest; +import dev.hathora.cloud_sdk.models.operations.GetMetricsDeprecatedResponse; import dev.hathora.cloud_sdk.models.shared.Security; import java.lang.Exception; @@ -36,15 +38,15 @@ public class Application { .appId("app-af469a92-5b45-4565-b3c4-b79878de67d2") .build(); - GetMetricsRequest req = GetMetricsRequest.builder() + GetMetricsDeprecatedRequest req = GetMetricsDeprecatedRequest.builder() .processId("cbfcddd2-0006-43ae-996c-995fff7bed2e") .build(); - GetMetricsResponse res = sdk.metricsV1().getMetrics() + GetMetricsDeprecatedResponse res = sdk.metricsV1().getMetricsDeprecated() .request(req) .call(); - if (res.metricsData().isPresent()) { + if (res.deprecatedProcessMetricsData().isPresent()) { // handle response } } @@ -53,13 +55,13 @@ public class Application { ### Parameters -| Parameter | Type | Required | Description | -| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | -| `request` | [GetMetricsRequest](../../models/operations/GetMetricsRequest.md) | :heavy_check_mark: | The request object to use for the request. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `request` | [GetMetricsDeprecatedRequest](../../models/operations/GetMetricsDeprecatedRequest.md) | :heavy_check_mark: | The request object to use for the request. | ### Response -**[GetMetricsResponse](../../models/operations/GetMetricsResponse.md)** +**[GetMetricsDeprecatedResponse](../../models/operations/GetMetricsDeprecatedResponse.md)** ### Errors diff --git a/docs/sdks/processesv1/README.md b/docs/sdks/processesv1/README.md index 8a27d37f..31a02586 100644 --- a/docs/sdks/processesv1/README.md +++ b/docs/sdks/processesv1/README.md @@ -125,7 +125,7 @@ public class Application { | Error Type | Status Code | Content Type | | ---------------------- | ---------------------- | ---------------------- | -| models/errors/ApiError | 401, 404, 429 | application/json | +| models/errors/ApiError | 401, 404, 422, 429 | application/json | | models/errors/SDKError | 4XX, 5XX | \*/\* | ## ~~getStoppedProcesses~~ @@ -184,5 +184,5 @@ public class Application { | Error Type | Status Code | Content Type | | ---------------------- | ---------------------- | ---------------------- | -| models/errors/ApiError | 401, 404, 429 | application/json | +| models/errors/ApiError | 401, 404, 422, 429 | application/json | | models/errors/SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/processesv2/README.md b/docs/sdks/processesv2/README.md index fdd26f24..bee64923 100644 --- a/docs/sdks/processesv2/README.md +++ b/docs/sdks/processesv2/README.md @@ -134,7 +134,7 @@ public class Application { | Error Type | Status Code | Content Type | | ---------------------- | ---------------------- | ---------------------- | -| models/errors/ApiError | 401, 404, 429 | application/json | +| models/errors/ApiError | 401, 404, 422, 429 | application/json | | models/errors/SDKError | 4XX, 5XX | \*/\* | ## ~~getProcessInfoV2Deprecated~~ @@ -257,7 +257,7 @@ public class Application { | Error Type | Status Code | Content Type | | ---------------------- | ---------------------- | ---------------------- | -| models/errors/ApiError | 401, 404, 429 | application/json | +| models/errors/ApiError | 401, 404, 422, 429 | application/json | | models/errors/SDKError | 4XX, 5XX | \*/\* | ## ~~stopProcessV2Deprecated~~ diff --git a/docs/sdks/processesv3/README.md b/docs/sdks/processesv3/README.md index b7519566..27246416 100644 --- a/docs/sdks/processesv3/README.md +++ b/docs/sdks/processesv3/README.md @@ -10,6 +10,7 @@ Operations to get data on active and stopped [processes](https://hathora.dev/doc * [createProcess](#createprocess) - Creates a [process](https://hathora.dev/docs/concepts/hathora-entities#process) without a room. Use this to pre-allocate processes ahead of time so that subsequent room assignment via [CreateRoom()](https://hathora.dev/api#tag/RoomV2/operation/CreateRoom) can be instant. * [getLatestProcesses](#getlatestprocesses) - Retrieve the 10 most recent [processes](https://hathora.dev/docs/concepts/hathora-entities#process) objects for an [application](https://hathora.dev/docs/concepts/hathora-entities#application). Filter the array by optionally passing in a `status` or `region`. * [getProcess](#getprocess) - Get details for a [process](https://hathora.dev/docs/concepts/hathora-entities#process). +* [getProcessMetrics](#getprocessmetrics) * [getProcessesCountExperimental](#getprocessescountexperimental) - Count the number of [processes](https://hathora.dev/docs/concepts/hathora-entities#process) objects for an [application](https://hathora.dev/docs/concepts/hathora-entities#application). Filter by optionally passing in a `status` or `region`. * [stopProcess](#stopprocess) - Stops a [process](https://hathora.dev/docs/concepts/hathora-entities#process) immediately. @@ -130,7 +131,7 @@ public class Application { | Error Type | Status Code | Content Type | | ---------------------- | ---------------------- | ---------------------- | -| models/errors/ApiError | 401, 404, 429 | application/json | +| models/errors/ApiError | 401, 404, 422, 429 | application/json | | models/errors/SDKError | 4XX, 5XX | \*/\* | ## getProcess @@ -189,6 +190,63 @@ public class Application { | models/errors/ApiError | 401, 404, 429 | application/json | | models/errors/SDKError | 4XX, 5XX | \*/\* | +## getProcessMetrics + +### Example Usage + +```java +package hello.world; + +import dev.hathora.cloud_sdk.HathoraCloud; +import dev.hathora.cloud_sdk.models.errors.ApiError; +import dev.hathora.cloud_sdk.models.operations.GetProcessMetricsRequest; +import dev.hathora.cloud_sdk.models.operations.GetProcessMetricsResponse; +import dev.hathora.cloud_sdk.models.shared.Security; +import java.lang.Exception; + +public class Application { + + public static void main(String[] args) throws ApiError, Exception { + + HathoraCloud sdk = HathoraCloud.builder() + .security(Security.builder() + .hathoraDevToken("") + .build()) + .appId("app-af469a92-5b45-4565-b3c4-b79878de67d2") + .build(); + + GetProcessMetricsRequest req = GetProcessMetricsRequest.builder() + .processId("cbfcddd2-0006-43ae-996c-995fff7bed2e") + .build(); + + GetProcessMetricsResponse res = sdk.processesV3().getProcessMetrics() + .request(req) + .call(); + + if (res.processMetricsData().isPresent()) { + // handle response + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | +| `request` | [GetProcessMetricsRequest](../../models/operations/GetProcessMetricsRequest.md) | :heavy_check_mark: | The request object to use for the request. | + +### Response + +**[GetProcessMetricsResponse](../../models/operations/GetProcessMetricsResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| models/errors/ApiError | 401, 404, 422, 429, 500 | application/json | +| models/errors/SDKError | 4XX, 5XX | \*/\* | + ## getProcessesCountExperimental Count the number of [processes](https://hathora.dev/docs/concepts/hathora-entities#process) objects for an [application](https://hathora.dev/docs/concepts/hathora-entities#application). Filter by optionally passing in a `status` or `region`. @@ -249,7 +307,7 @@ public class Application { | Error Type | Status Code | Content Type | | ---------------------- | ---------------------- | ---------------------- | -| models/errors/ApiError | 401, 404, 429 | application/json | +| models/errors/ApiError | 401, 404, 422, 429 | application/json | | models/errors/SDKError | 4XX, 5XX | \*/\* | ## stopProcess diff --git a/docs/sdks/roomsv2/README.md b/docs/sdks/roomsv2/README.md index 4471cafd..ee1e5e4f 100644 --- a/docs/sdks/roomsv2/README.md +++ b/docs/sdks/roomsv2/README.md @@ -463,7 +463,7 @@ public class Application { ### Errors -| Error Type | Status Code | Content Type | -| ---------------------- | ---------------------- | ---------------------- | -| models/errors/ApiError | 401, 404, 429, 500 | application/json | -| models/errors/SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| models/errors/ApiError | 401, 404, 422, 429, 500 | application/json | +| models/errors/SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/gen.yaml b/gen.yaml index d45e9755..0fcd693c 100644 --- a/gen.yaml +++ b/gen.yaml @@ -12,7 +12,7 @@ generation: baseServerURL: "" flattenGlobalSecurity: true java: - version: 2.10.9 + version: 2.10.10 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/AuthV1.java b/src/main/java/dev/hathora/cloud_sdk/AuthV1.java index 3a71c56d..26550cd2 100644 --- a/src/main/java/dev/hathora/cloud_sdk/AuthV1.java +++ b/src/main/java/dev/hathora/cloud_sdk/AuthV1.java @@ -267,7 +267,7 @@ public LoginGoogleResponse loginGoogle( HttpResponse _httpRes; try { _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401", "404", "429", "4XX", "5XX")) { + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401", "404", "422", "429", "4XX", "5XX")) { _httpRes = sdkConfiguration.hooks() .afterError( new AfterErrorContextImpl( @@ -323,7 +323,7 @@ public LoginGoogleResponse loginGoogle( Utils.extractByteArrayFromBody(_httpRes)); } } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401", "404", "429")) { + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401", "404", "422", "429")) { if (Utils.contentTypeMatches(_contentType, "application/json")) { ApiError _out = Utils.mapper().readValue( Utils.toUtf8AndClose(_httpRes.body()), @@ -427,7 +427,7 @@ public LoginNicknameResponse loginNickname( HttpResponse _httpRes; try { _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "404", "429", "4XX", "5XX")) { + if (Utils.statusCodeMatches(_httpRes.statusCode(), "404", "422", "429", "4XX", "5XX")) { _httpRes = sdkConfiguration.hooks() .afterError( new AfterErrorContextImpl( @@ -483,7 +483,7 @@ public LoginNicknameResponse loginNickname( Utils.extractByteArrayFromBody(_httpRes)); } } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "404", "429")) { + if (Utils.statusCodeMatches(_httpRes.statusCode(), "404", "422", "429")) { 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/BillingV1.java b/src/main/java/dev/hathora/cloud_sdk/BillingV1.java index 0ba966a5..43066d7c 100644 --- a/src/main/java/dev/hathora/cloud_sdk/BillingV1.java +++ b/src/main/java/dev/hathora/cloud_sdk/BillingV1.java @@ -690,7 +690,7 @@ public InitStripeCustomerPortalUrlResponse initStripeCustomerPortalUrl( HttpResponse _httpRes; try { _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401", "404", "429", "4XX", "5XX")) { + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401", "404", "422", "429", "4XX", "5XX")) { _httpRes = sdkConfiguration.hooks() .afterError( new AfterErrorContextImpl( @@ -746,7 +746,7 @@ public InitStripeCustomerPortalUrlResponse initStripeCustomerPortalUrl( Utils.extractByteArrayFromBody(_httpRes)); } } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401", "404", "429")) { + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401", "404", "422", "429")) { 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/BuildsV1.java b/src/main/java/dev/hathora/cloud_sdk/BuildsV1.java index 3e83b7b4..80c4eed9 100644 --- a/src/main/java/dev/hathora/cloud_sdk/BuildsV1.java +++ b/src/main/java/dev/hathora/cloud_sdk/BuildsV1.java @@ -140,7 +140,7 @@ public CreateBuildDeprecatedResponse createBuildDeprecated( HttpResponse _httpRes; try { _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401", "404", "429", "4XX", "500", "5XX")) { + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401", "404", "422", "429", "4XX", "500", "5XX")) { _httpRes = sdkConfiguration.hooks() .afterError( new AfterErrorContextImpl( @@ -196,7 +196,7 @@ public CreateBuildDeprecatedResponse createBuildDeprecated( Utils.extractByteArrayFromBody(_httpRes)); } } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401", "404", "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/BuildsV2.java b/src/main/java/dev/hathora/cloud_sdk/BuildsV2.java index e61d8e87..33f97afd 100644 --- a/src/main/java/dev/hathora/cloud_sdk/BuildsV2.java +++ b/src/main/java/dev/hathora/cloud_sdk/BuildsV2.java @@ -151,7 +151,7 @@ public CreateBuildV2DeprecatedResponse createBuildV2Deprecated( HttpResponse _httpRes; try { _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401", "404", "429", "4XX", "500", "5XX")) { + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401", "404", "422", "429", "4XX", "500", "5XX")) { _httpRes = sdkConfiguration.hooks() .afterError( new AfterErrorContextImpl( @@ -207,7 +207,7 @@ public CreateBuildV2DeprecatedResponse createBuildV2Deprecated( Utils.extractByteArrayFromBody(_httpRes)); } } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401", "404", "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()), @@ -320,7 +320,7 @@ public CreateBuildWithUploadUrlV2DeprecatedResponse createBuildWithUploadUrlV2De HttpResponse _httpRes; try { _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401", "404", "429", "4XX", "500", "5XX")) { + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401", "404", "422", "429", "4XX", "500", "5XX")) { _httpRes = sdkConfiguration.hooks() .afterError( new AfterErrorContextImpl( @@ -376,7 +376,7 @@ public CreateBuildWithUploadUrlV2DeprecatedResponse createBuildWithUploadUrlV2De Utils.extractByteArrayFromBody(_httpRes)); } } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401", "404", "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()), @@ -489,7 +489,7 @@ public CreateWithMultipartUploadsV2DeprecatedResponse createWithMultipartUploads HttpResponse _httpRes; try { _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "404", "429", "4XX", "500", "5XX")) { + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "404", "422", "429", "4XX", "500", "5XX")) { _httpRes = sdkConfiguration.hooks() .afterError( new AfterErrorContextImpl( @@ -545,7 +545,7 @@ public CreateWithMultipartUploadsV2DeprecatedResponse createWithMultipartUploads Utils.extractByteArrayFromBody(_httpRes)); } } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "404", "429", "500")) { + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "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/FleetsV1.java b/src/main/java/dev/hathora/cloud_sdk/FleetsV1.java index 305c92e4..4b554a10 100644 --- a/src/main/java/dev/hathora/cloud_sdk/FleetsV1.java +++ b/src/main/java/dev/hathora/cloud_sdk/FleetsV1.java @@ -7,6 +7,9 @@ import com.fasterxml.jackson.core.type.TypeReference; import dev.hathora.cloud_sdk.models.errors.ApiError; import dev.hathora.cloud_sdk.models.errors.SDKError; +import dev.hathora.cloud_sdk.models.operations.GetFleetMetricsRequest; +import dev.hathora.cloud_sdk.models.operations.GetFleetMetricsRequestBuilder; +import dev.hathora.cloud_sdk.models.operations.GetFleetMetricsResponse; import dev.hathora.cloud_sdk.models.operations.GetFleetRegionRequest; import dev.hathora.cloud_sdk.models.operations.GetFleetRegionRequestBuilder; import dev.hathora.cloud_sdk.models.operations.GetFleetRegionResponse; @@ -17,6 +20,7 @@ import dev.hathora.cloud_sdk.models.operations.UpdateFleetRegionRequest; import dev.hathora.cloud_sdk.models.operations.UpdateFleetRegionRequestBuilder; import dev.hathora.cloud_sdk.models.operations.UpdateFleetRegionResponse; +import dev.hathora.cloud_sdk.models.shared.FleetMetricsData; import dev.hathora.cloud_sdk.models.shared.FleetRegion; import dev.hathora.cloud_sdk.models.shared.FleetsPage; import dev.hathora.cloud_sdk.models.shared.Region; @@ -37,7 +41,11 @@ import java.util.List; import java.util.Optional; +/** + * Operations to manage and view a [fleet](https://hathora.dev/docs/concepts/hathora-entities#fleet). + */ public class FleetsV1 implements + MethodCallGetFleetMetrics, MethodCallGetFleetRegion, MethodCallGetFleets, MethodCallUpdateFleetRegion { @@ -49,16 +57,170 @@ public class FleetsV1 implements } + /** + * Gets metrics for a [fleet](https://hathora.dev/docs/concepts/hathora-entities#fleet) in a region. + * @return The call builder + */ + public GetFleetMetricsRequestBuilder getFleetMetrics() { + return new GetFleetMetricsRequestBuilder(this); + } + + /** + * Gets metrics for a [fleet](https://hathora.dev/docs/concepts/hathora-entities#fleet) in a region. + * @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 + */ + public GetFleetMetricsResponse getFleetMetrics( + GetFleetMetricsRequest request) throws Exception { + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + GetFleetMetricsRequest.class, + _baseUrl, + "/fleets/v1/fleets/{fleetId}/regions/{region}/metrics", + request, this.sdkConfiguration.globals); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + _req.addQueryParams(Utils.getQueryParams( + GetFleetMetricsRequest.class, + request, + this.sdkConfiguration.globals)); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "GetFleetMetrics", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "404", "422", "429", "4XX", "500", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "GetFleetMetrics", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "GetFleetMetrics", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "GetFleetMetrics", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetFleetMetricsResponse.Builder _resBuilder = + GetFleetMetricsResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + GetFleetMetricsResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + FleetMetricsData _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withFleetMetricsData(Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.extractByteArrayFromBody(_httpRes)); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "404", "422", "429", "500")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + ApiError _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.extractByteArrayFromBody(_httpRes)); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(_httpRes)); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.extractByteArrayFromBody(_httpRes)); + } + + + + /** + * Gets the configuration for a given [fleet](https://hathora.dev/docs/concepts/hathora-entities#fleet) in a region. + * @return The call builder + */ public GetFleetRegionRequestBuilder getFleetRegion() { return new GetFleetRegionRequestBuilder(this); } + /** + * Gets the configuration for a given [fleet](https://hathora.dev/docs/concepts/hathora-entities#fleet) in a region. + * @param fleetId + * @param region + * @return The response from the API call + * @throws Exception if the API call fails + */ public GetFleetRegionResponse getFleetRegion( String fleetId, Region region) throws Exception { return getFleetRegion(fleetId, Optional.empty(), region); } + /** + * Gets the configuration for a given [fleet](https://hathora.dev/docs/concepts/hathora-entities#fleet) in a region. + * @param fleetId + * @param orgId + * @param region + * @return The response from the API call + * @throws Exception if the API call fails + */ public GetFleetRegionResponse getFleetRegion( String fleetId, Optional orgId, @@ -190,14 +352,29 @@ public GetFleetRegionResponse getFleetRegion( + /** + * Returns an array of [fleets](https://hathora.dev/docs/concepts/hathora-entities#fleet). + * @return The call builder + */ public GetFleetsRequestBuilder getFleets() { return new GetFleetsRequestBuilder(this); } + /** + * Returns an array of [fleets](https://hathora.dev/docs/concepts/hathora-entities#fleet). + * @return The response from the API call + * @throws Exception if the API call fails + */ public GetFleetsResponse getFleetsDirect() throws Exception { return getFleets(Optional.empty()); } + /** + * Returns an array of [fleets](https://hathora.dev/docs/concepts/hathora-entities#fleet). + * @param orgId + * @return The response from the API call + * @throws Exception if the API call fails + */ public GetFleetsResponse getFleets( Optional orgId) throws Exception { GetFleetsRequest request = @@ -323,10 +500,20 @@ public GetFleetsResponse getFleets( + /** + * Updates the configuration for a given [fleet](https://hathora.dev/docs/concepts/hathora-entities#fleet) in a region. + * @return The call builder + */ public UpdateFleetRegionRequestBuilder updateFleetRegion() { return new UpdateFleetRegionRequestBuilder(this); } + /** + * Updates the configuration for a given [fleet](https://hathora.dev/docs/concepts/hathora-entities#fleet) in a region. + * @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 + */ public UpdateFleetRegionResponse updateFleetRegion( UpdateFleetRegionRequest request) throws Exception { String _baseUrl = this.sdkConfiguration.serverUrl; diff --git a/src/main/java/dev/hathora/cloud_sdk/HathoraCloud.java b/src/main/java/dev/hathora/cloud_sdk/HathoraCloud.java index 13019590..c6300edb 100644 --- a/src/main/java/dev/hathora/cloud_sdk/HathoraCloud.java +++ b/src/main/java/dev/hathora/cloud_sdk/HathoraCloud.java @@ -72,6 +72,9 @@ public class HathoraCloud { */ private final DiscoveryV2 discoveryV2; + /** + * Operations to manage and view a [fleet](https://hathora.dev/docs/concepts/hathora-entities#fleet). + */ private final FleetsV1 fleetsV1; private final LobbiesV1 lobbiesV1; @@ -187,6 +190,9 @@ public DiscoveryV2 discoveryV2() { return discoveryV2; } + /** + * Operations to manage and view a [fleet](https://hathora.dev/docs/concepts/hathora-entities#fleet). + */ public FleetsV1 fleetsV1() { return fleetsV1; } diff --git a/src/main/java/dev/hathora/cloud_sdk/LobbiesV1.java b/src/main/java/dev/hathora/cloud_sdk/LobbiesV1.java index 7a00537f..66a153ab 100644 --- a/src/main/java/dev/hathora/cloud_sdk/LobbiesV1.java +++ b/src/main/java/dev/hathora/cloud_sdk/LobbiesV1.java @@ -442,7 +442,7 @@ public ListActivePublicLobbiesDeprecatedV1Response listActivePublicLobbiesDeprec HttpResponse _httpRes; try { _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "404", "429", "4XX", "5XX")) { + if (Utils.statusCodeMatches(_httpRes.statusCode(), "404", "422", "429", "4XX", "5XX")) { _httpRes = sdkConfiguration.hooks() .afterError( new AfterErrorContextImpl( @@ -498,7 +498,7 @@ public ListActivePublicLobbiesDeprecatedV1Response listActivePublicLobbiesDeprec Utils.extractByteArrayFromBody(_httpRes)); } } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "404", "429")) { + if (Utils.statusCodeMatches(_httpRes.statusCode(), "404", "422", "429")) { 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/LogsV1.java b/src/main/java/dev/hathora/cloud_sdk/LogsV1.java index ecece0ac..9f477750 100644 --- a/src/main/java/dev/hathora/cloud_sdk/LogsV1.java +++ b/src/main/java/dev/hathora/cloud_sdk/LogsV1.java @@ -249,7 +249,7 @@ public GetLogsForAppResponse getLogsForApp( HttpResponse _httpRes; try { _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401", "404", "429", "4XX", "5XX")) { + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401", "404", "422", "429", "4XX", "5XX")) { _httpRes = sdkConfiguration.hooks() .afterError( new AfterErrorContextImpl( @@ -304,7 +304,7 @@ public GetLogsForAppResponse getLogsForApp( Utils.extractByteArrayFromBody(_httpRes)); } } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401", "404", "429")) { + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401", "404", "422", "429")) { 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/MetricsV1.java b/src/main/java/dev/hathora/cloud_sdk/MetricsV1.java index 619110b6..4138c3c0 100644 --- a/src/main/java/dev/hathora/cloud_sdk/MetricsV1.java +++ b/src/main/java/dev/hathora/cloud_sdk/MetricsV1.java @@ -7,11 +7,11 @@ import com.fasterxml.jackson.core.type.TypeReference; import dev.hathora.cloud_sdk.models.errors.ApiError; import dev.hathora.cloud_sdk.models.errors.SDKError; -import dev.hathora.cloud_sdk.models.operations.GetMetricsRequest; -import dev.hathora.cloud_sdk.models.operations.GetMetricsRequestBuilder; -import dev.hathora.cloud_sdk.models.operations.GetMetricsResponse; +import dev.hathora.cloud_sdk.models.operations.GetMetricsDeprecatedRequest; +import dev.hathora.cloud_sdk.models.operations.GetMetricsDeprecatedRequestBuilder; +import dev.hathora.cloud_sdk.models.operations.GetMetricsDeprecatedResponse; import dev.hathora.cloud_sdk.models.operations.SDKMethodInterfaces.*; -import dev.hathora.cloud_sdk.models.shared.MetricsData; +import dev.hathora.cloud_sdk.models.shared.DeprecatedProcessMetricsData; import dev.hathora.cloud_sdk.utils.HTTPClient; import dev.hathora.cloud_sdk.utils.HTTPRequest; import dev.hathora.cloud_sdk.utils.Hook.AfterErrorContextImpl; @@ -19,6 +19,7 @@ import dev.hathora.cloud_sdk.utils.Hook.BeforeRequestContextImpl; import dev.hathora.cloud_sdk.utils.Utils; import java.io.InputStream; +import java.lang.Deprecated; import java.lang.Exception; import java.lang.String; import java.net.http.HttpRequest; @@ -30,7 +31,7 @@ * Operations to get metrics by [process](https://hathora.dev/docs/concepts/hathora-entities#process). We store 72 hours of metrics data. */ public class MetricsV1 implements - MethodCallGetMetrics { + MethodCallGetMetricsDeprecated { private final SDKConfiguration sdkConfiguration; @@ -42,9 +43,11 @@ public class MetricsV1 implements /** * Get metrics for a [process](https://hathora.dev/docs/concepts/hathora-entities#process) using `appId` and `processId`. * @return The call builder + * @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible. */ - public GetMetricsRequestBuilder getMetrics() { - return new GetMetricsRequestBuilder(this); + @Deprecated + public GetMetricsDeprecatedRequestBuilder getMetricsDeprecated() { + return new GetMetricsDeprecatedRequestBuilder(this); } /** @@ -52,12 +55,14 @@ public GetMetricsRequestBuilder getMetrics() { * @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 + * @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible. */ - public GetMetricsResponse getMetrics( - GetMetricsRequest request) throws Exception { + @Deprecated + public GetMetricsDeprecatedResponse getMetricsDeprecated( + GetMetricsDeprecatedRequest request) throws Exception { String _baseUrl = this.sdkConfiguration.serverUrl; String _url = Utils.generateURL( - GetMetricsRequest.class, + GetMetricsDeprecatedRequest.class, _baseUrl, "/metrics/v1/{appId}/process/{processId}", request, this.sdkConfiguration.globals); @@ -68,7 +73,7 @@ public GetMetricsResponse getMetrics( SDKConfiguration.USER_AGENT); _req.addQueryParams(Utils.getQueryParams( - GetMetricsRequest.class, + GetMetricsDeprecatedRequest.class, request, this.sdkConfiguration.globals)); @@ -80,7 +85,7 @@ public GetMetricsResponse getMetrics( sdkConfiguration.hooks() .beforeRequest( new BeforeRequestContextImpl( - "GetMetrics", + "GetMetricsDeprecated", Optional.of(List.of()), sdkConfiguration.securitySource()), _req.build()); @@ -91,7 +96,7 @@ public GetMetricsResponse getMetrics( _httpRes = sdkConfiguration.hooks() .afterError( new AfterErrorContextImpl( - "GetMetrics", + "GetMetricsDeprecated", Optional.of(List.of()), sdkConfiguration.securitySource()), Optional.of(_httpRes), @@ -100,7 +105,7 @@ public GetMetricsResponse getMetrics( _httpRes = sdkConfiguration.hooks() .afterSuccess( new AfterSuccessContextImpl( - "GetMetrics", + "GetMetricsDeprecated", Optional.of(List.of()), sdkConfiguration.securitySource()), _httpRes); @@ -109,7 +114,7 @@ public GetMetricsResponse getMetrics( _httpRes = sdkConfiguration.hooks() .afterError( new AfterErrorContextImpl( - "GetMetrics", + "GetMetricsDeprecated", Optional.of(List.of()), sdkConfiguration.securitySource()), Optional.empty(), @@ -119,21 +124,21 @@ public GetMetricsResponse getMetrics( .headers() .firstValue("Content-Type") .orElse("application/octet-stream"); - GetMetricsResponse.Builder _resBuilder = - GetMetricsResponse + GetMetricsDeprecatedResponse.Builder _resBuilder = + GetMetricsDeprecatedResponse .builder() .contentType(_contentType) .statusCode(_httpRes.statusCode()) .rawResponse(_httpRes); - GetMetricsResponse _res = _resBuilder.build(); + GetMetricsDeprecatedResponse _res = _resBuilder.build(); if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { if (Utils.contentTypeMatches(_contentType, "application/json")) { - MetricsData _out = Utils.mapper().readValue( + DeprecatedProcessMetricsData _out = Utils.mapper().readValue( Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withMetricsData(Optional.ofNullable(_out)); + new TypeReference() {}); + _res.withDeprecatedProcessMetricsData(Optional.ofNullable(_out)); return _res; } else { throw new SDKError( diff --git a/src/main/java/dev/hathora/cloud_sdk/ProcessesV1.java b/src/main/java/dev/hathora/cloud_sdk/ProcessesV1.java index 28d8c992..50930898 100644 --- a/src/main/java/dev/hathora/cloud_sdk/ProcessesV1.java +++ b/src/main/java/dev/hathora/cloud_sdk/ProcessesV1.java @@ -278,7 +278,7 @@ public GetRunningProcessesResponse getRunningProcesses( HttpResponse _httpRes; try { _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401", "404", "429", "4XX", "5XX")) { + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401", "404", "422", "429", "4XX", "5XX")) { _httpRes = sdkConfiguration.hooks() .afterError( new AfterErrorContextImpl( @@ -334,7 +334,7 @@ public GetRunningProcessesResponse getRunningProcesses( Utils.extractByteArrayFromBody(_httpRes)); } } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401", "404", "429")) { + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401", "404", "422", "429")) { if (Utils.contentTypeMatches(_contentType, "application/json")) { ApiError _out = Utils.mapper().readValue( Utils.toUtf8AndClose(_httpRes.body()), @@ -437,7 +437,7 @@ public GetStoppedProcessesResponse getStoppedProcesses( HttpResponse _httpRes; try { _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401", "404", "429", "4XX", "5XX")) { + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401", "404", "422", "429", "4XX", "5XX")) { _httpRes = sdkConfiguration.hooks() .afterError( new AfterErrorContextImpl( @@ -493,7 +493,7 @@ public GetStoppedProcessesResponse getStoppedProcesses( Utils.extractByteArrayFromBody(_httpRes)); } } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401", "404", "429")) { + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401", "404", "422", "429")) { 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/ProcessesV2.java b/src/main/java/dev/hathora/cloud_sdk/ProcessesV2.java index bb056a4a..0c07ce86 100644 --- a/src/main/java/dev/hathora/cloud_sdk/ProcessesV2.java +++ b/src/main/java/dev/hathora/cloud_sdk/ProcessesV2.java @@ -290,7 +290,7 @@ public GetLatestProcessesV2DeprecatedResponse getLatestProcessesV2Deprecated( HttpResponse _httpRes; try { _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401", "404", "429", "4XX", "5XX")) { + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401", "404", "422", "429", "4XX", "5XX")) { _httpRes = sdkConfiguration.hooks() .afterError( new AfterErrorContextImpl( @@ -346,7 +346,7 @@ public GetLatestProcessesV2DeprecatedResponse getLatestProcessesV2Deprecated( Utils.extractByteArrayFromBody(_httpRes)); } } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401", "404", "429")) { + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401", "404", "422", "429")) { if (Utils.contentTypeMatches(_contentType, "application/json")) { ApiError _out = Utils.mapper().readValue( Utils.toUtf8AndClose(_httpRes.body()), @@ -608,7 +608,7 @@ public GetProcessesCountExperimentalV2DeprecatedResponse getProcessesCountExperi HttpResponse _httpRes; try { _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401", "404", "429", "4XX", "5XX")) { + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401", "404", "422", "429", "4XX", "5XX")) { _httpRes = sdkConfiguration.hooks() .afterError( new AfterErrorContextImpl( @@ -664,7 +664,7 @@ public GetProcessesCountExperimentalV2DeprecatedResponse getProcessesCountExperi Utils.extractByteArrayFromBody(_httpRes)); } } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401", "404", "429")) { + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401", "404", "422", "429")) { 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/ProcessesV3.java b/src/main/java/dev/hathora/cloud_sdk/ProcessesV3.java index 428fbb4b..77508448 100644 --- a/src/main/java/dev/hathora/cloud_sdk/ProcessesV3.java +++ b/src/main/java/dev/hathora/cloud_sdk/ProcessesV3.java @@ -13,6 +13,9 @@ import dev.hathora.cloud_sdk.models.operations.GetLatestProcessesRequest; import dev.hathora.cloud_sdk.models.operations.GetLatestProcessesRequestBuilder; import dev.hathora.cloud_sdk.models.operations.GetLatestProcessesResponse; +import dev.hathora.cloud_sdk.models.operations.GetProcessMetricsRequest; +import dev.hathora.cloud_sdk.models.operations.GetProcessMetricsRequestBuilder; +import dev.hathora.cloud_sdk.models.operations.GetProcessMetricsResponse; import dev.hathora.cloud_sdk.models.operations.GetProcessRequest; import dev.hathora.cloud_sdk.models.operations.GetProcessRequestBuilder; import dev.hathora.cloud_sdk.models.operations.GetProcessResponse; @@ -24,6 +27,7 @@ import dev.hathora.cloud_sdk.models.operations.StopProcessRequest; import dev.hathora.cloud_sdk.models.operations.StopProcessRequestBuilder; import dev.hathora.cloud_sdk.models.operations.StopProcessResponse; +import dev.hathora.cloud_sdk.models.shared.ProcessMetricsData; import dev.hathora.cloud_sdk.models.shared.ProcessStatus; import dev.hathora.cloud_sdk.models.shared.ProcessV3; import dev.hathora.cloud_sdk.models.shared.Region; @@ -48,6 +52,7 @@ public class ProcessesV3 implements MethodCallCreateProcess, MethodCallGetLatestProcesses, MethodCallGetProcess, + MethodCallGetProcessMetrics, MethodCallGetProcessesCountExperimental, MethodCallStopProcess { @@ -277,7 +282,7 @@ public GetLatestProcessesResponse getLatestProcesses( HttpResponse _httpRes; try { _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401", "404", "429", "4XX", "5XX")) { + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401", "404", "422", "429", "4XX", "5XX")) { _httpRes = sdkConfiguration.hooks() .afterError( new AfterErrorContextImpl( @@ -333,7 +338,7 @@ public GetLatestProcessesResponse getLatestProcesses( Utils.extractByteArrayFromBody(_httpRes)); } } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401", "404", "429")) { + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401", "404", "422", "429")) { if (Utils.contentTypeMatches(_contentType, "application/json")) { ApiError _out = Utils.mapper().readValue( Utils.toUtf8AndClose(_httpRes.body()), @@ -514,6 +519,131 @@ public GetProcessResponse getProcess( + public GetProcessMetricsRequestBuilder getProcessMetrics() { + return new GetProcessMetricsRequestBuilder(this); + } + + public GetProcessMetricsResponse getProcessMetrics( + GetProcessMetricsRequest request) throws Exception { + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + GetProcessMetricsRequest.class, + _baseUrl, + "/processes/v3/apps/{appId}/processes/process/{processId}/metrics", + request, this.sdkConfiguration.globals); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + _req.addQueryParams(Utils.getQueryParams( + GetProcessMetricsRequest.class, + request, + this.sdkConfiguration.globals)); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "GetProcessMetrics", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401", "404", "422", "429", "4XX", "500", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "GetProcessMetrics", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "GetProcessMetrics", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "GetProcessMetrics", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetProcessMetricsResponse.Builder _resBuilder = + GetProcessMetricsResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + GetProcessMetricsResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + ProcessMetricsData _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withProcessMetricsData(Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.extractByteArrayFromBody(_httpRes)); + } + } + 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()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.extractByteArrayFromBody(_httpRes)); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(_httpRes)); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.extractByteArrayFromBody(_httpRes)); + } + + + /** * Count the number of [processes](https://hathora.dev/docs/concepts/hathora-entities#process) objects for an [application](https://hathora.dev/docs/concepts/hathora-entities#application). Filter by optionally passing in a `status` or `region`. * @return The call builder @@ -583,7 +713,7 @@ public GetProcessesCountExperimentalResponse getProcessesCountExperimental( HttpResponse _httpRes; try { _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401", "404", "429", "4XX", "5XX")) { + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401", "404", "422", "429", "4XX", "5XX")) { _httpRes = sdkConfiguration.hooks() .afterError( new AfterErrorContextImpl( @@ -639,7 +769,7 @@ public GetProcessesCountExperimentalResponse getProcessesCountExperimental( Utils.extractByteArrayFromBody(_httpRes)); } } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401", "404", "429")) { + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401", "404", "422", "429")) { 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/RoomsV2.java b/src/main/java/dev/hathora/cloud_sdk/RoomsV2.java index 65d14c9e..99368440 100644 --- a/src/main/java/dev/hathora/cloud_sdk/RoomsV2.java +++ b/src/main/java/dev/hathora/cloud_sdk/RoomsV2.java @@ -1187,7 +1187,7 @@ public UpdateRoomConfigResponse updateRoomConfig( HttpResponse _httpRes; try { _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401", "404", "429", "4XX", "500", "5XX")) { + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401", "404", "422", "429", "4XX", "500", "5XX")) { _httpRes = sdkConfiguration.hooks() .afterError( new AfterErrorContextImpl( @@ -1232,7 +1232,7 @@ public UpdateRoomConfigResponse updateRoomConfig( // no content return _res; } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401", "404", "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 2de953f5..f6ed2152 100644 --- a/src/main/java/dev/hathora/cloud_sdk/SDKConfiguration.java +++ b/src/main/java/dev/hathora/cloud_sdk/SDKConfiguration.java @@ -25,7 +25,7 @@ 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.10.9"; + public static final String SDK_VERSION = "2.10.10"; public static final String GEN_VERSION = "2.438.15"; private static final String BASE_PACKAGE = "dev.hathora.cloud_sdk"; public static final String USER_AGENT = diff --git a/src/main/java/dev/hathora/cloud_sdk/models/operations/GetFleetMetricsRequest.java b/src/main/java/dev/hathora/cloud_sdk/models/operations/GetFleetMetricsRequest.java new file mode 100644 index 00000000..46e21198 --- /dev/null +++ b/src/main/java/dev/hathora/cloud_sdk/models/operations/GetFleetMetricsRequest.java @@ -0,0 +1,383 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +package dev.hathora.cloud_sdk.models.operations; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import dev.hathora.cloud_sdk.models.shared.FleetMetricName; +import dev.hathora.cloud_sdk.models.shared.Region; +import dev.hathora.cloud_sdk.utils.LazySingletonValue; +import dev.hathora.cloud_sdk.utils.SpeakeasyMetadata; +import dev.hathora.cloud_sdk.utils.Utils; +import java.lang.Double; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.List; +import java.util.Objects; +import java.util.Optional; + + +public class GetFleetMetricsRequest { + + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=end") + private Optional end; + + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=fleetId") + private String fleetId; + + /** + * Available metrics to query over time. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=metrics") + private Optional> metrics; + + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=orgId") + private Optional orgId; + + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=region") + private Region region; + + /** + * Unix timestamp. Default is -1 hour from `end`. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=start") + private Optional start; + + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=step") + private Optional step; + + @JsonCreator + public GetFleetMetricsRequest( + Optional end, + String fleetId, + Optional> metrics, + Optional orgId, + Region region, + Optional start, + Optional step) { + Utils.checkNotNull(end, "end"); + Utils.checkNotNull(fleetId, "fleetId"); + Utils.checkNotNull(metrics, "metrics"); + Utils.checkNotNull(orgId, "orgId"); + Utils.checkNotNull(region, "region"); + Utils.checkNotNull(start, "start"); + Utils.checkNotNull(step, "step"); + this.end = end; + this.fleetId = fleetId; + this.metrics = metrics; + this.orgId = orgId; + this.region = region; + this.start = start; + this.step = step; + } + + public GetFleetMetricsRequest( + String fleetId, + Region region) { + this(Optional.empty(), fleetId, Optional.empty(), Optional.empty(), region, Optional.empty(), Optional.empty()); + } + + @JsonIgnore + public Optional end() { + return end; + } + + @JsonIgnore + public String fleetId() { + return fleetId; + } + + /** + * Available metrics to query over time. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> metrics() { + return (Optional>) metrics; + } + + @JsonIgnore + public Optional orgId() { + return orgId; + } + + @JsonIgnore + public Region region() { + return region; + } + + /** + * Unix timestamp. Default is -1 hour from `end`. + */ + @JsonIgnore + public Optional start() { + return start; + } + + @JsonIgnore + public Optional step() { + return step; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetFleetMetricsRequest withEnd(double end) { + Utils.checkNotNull(end, "end"); + this.end = Optional.ofNullable(end); + return this; + } + + public GetFleetMetricsRequest withEnd(Optional end) { + Utils.checkNotNull(end, "end"); + this.end = end; + return this; + } + + public GetFleetMetricsRequest withFleetId(String fleetId) { + Utils.checkNotNull(fleetId, "fleetId"); + this.fleetId = fleetId; + return this; + } + + /** + * Available metrics to query over time. + */ + public GetFleetMetricsRequest withMetrics(List metrics) { + Utils.checkNotNull(metrics, "metrics"); + this.metrics = Optional.ofNullable(metrics); + return this; + } + + /** + * Available metrics to query over time. + */ + public GetFleetMetricsRequest withMetrics(Optional> metrics) { + Utils.checkNotNull(metrics, "metrics"); + this.metrics = metrics; + return this; + } + + public GetFleetMetricsRequest withOrgId(String orgId) { + Utils.checkNotNull(orgId, "orgId"); + this.orgId = Optional.ofNullable(orgId); + return this; + } + + public GetFleetMetricsRequest withOrgId(Optional orgId) { + Utils.checkNotNull(orgId, "orgId"); + this.orgId = orgId; + return this; + } + + public GetFleetMetricsRequest withRegion(Region region) { + Utils.checkNotNull(region, "region"); + this.region = region; + return this; + } + + /** + * Unix timestamp. Default is -1 hour from `end`. + */ + public GetFleetMetricsRequest withStart(double start) { + Utils.checkNotNull(start, "start"); + this.start = Optional.ofNullable(start); + return this; + } + + /** + * Unix timestamp. Default is -1 hour from `end`. + */ + public GetFleetMetricsRequest withStart(Optional start) { + Utils.checkNotNull(start, "start"); + this.start = start; + return this; + } + + public GetFleetMetricsRequest withStep(int step) { + Utils.checkNotNull(step, "step"); + this.step = Optional.ofNullable(step); + return this; + } + + public GetFleetMetricsRequest withStep(Optional step) { + Utils.checkNotNull(step, "step"); + this.step = step; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetFleetMetricsRequest other = (GetFleetMetricsRequest) o; + return + Objects.deepEquals(this.end, other.end) && + Objects.deepEquals(this.fleetId, other.fleetId) && + Objects.deepEquals(this.metrics, other.metrics) && + Objects.deepEquals(this.orgId, other.orgId) && + Objects.deepEquals(this.region, other.region) && + Objects.deepEquals(this.start, other.start) && + Objects.deepEquals(this.step, other.step); + } + + @Override + public int hashCode() { + return Objects.hash( + end, + fleetId, + metrics, + orgId, + region, + start, + step); + } + + @Override + public String toString() { + return Utils.toString(GetFleetMetricsRequest.class, + "end", end, + "fleetId", fleetId, + "metrics", metrics, + "orgId", orgId, + "region", region, + "start", start, + "step", step); + } + + public final static class Builder { + + private Optional end = Optional.empty(); + + private String fleetId; + + private Optional> metrics = Optional.empty(); + + private Optional orgId = Optional.empty(); + + private Region region; + + private Optional start = Optional.empty(); + + private Optional step; + + private Builder() { + // force use of static builder() method + } + + public Builder end(double end) { + Utils.checkNotNull(end, "end"); + this.end = Optional.ofNullable(end); + return this; + } + + public Builder end(Optional end) { + Utils.checkNotNull(end, "end"); + this.end = end; + return this; + } + + public Builder fleetId(String fleetId) { + Utils.checkNotNull(fleetId, "fleetId"); + this.fleetId = fleetId; + return this; + } + + /** + * Available metrics to query over time. + */ + public Builder metrics(List metrics) { + Utils.checkNotNull(metrics, "metrics"); + this.metrics = Optional.ofNullable(metrics); + return this; + } + + /** + * Available metrics to query over time. + */ + public Builder metrics(Optional> metrics) { + Utils.checkNotNull(metrics, "metrics"); + this.metrics = metrics; + return this; + } + + public Builder orgId(String orgId) { + Utils.checkNotNull(orgId, "orgId"); + this.orgId = Optional.ofNullable(orgId); + return this; + } + + public Builder orgId(Optional orgId) { + Utils.checkNotNull(orgId, "orgId"); + this.orgId = orgId; + return this; + } + + public Builder region(Region region) { + Utils.checkNotNull(region, "region"); + this.region = region; + return this; + } + + /** + * Unix timestamp. Default is -1 hour from `end`. + */ + public Builder start(double start) { + Utils.checkNotNull(start, "start"); + this.start = Optional.ofNullable(start); + return this; + } + + /** + * Unix timestamp. Default is -1 hour from `end`. + */ + public Builder start(Optional start) { + Utils.checkNotNull(start, "start"); + this.start = start; + return this; + } + + public Builder step(int step) { + Utils.checkNotNull(step, "step"); + this.step = Optional.ofNullable(step); + return this; + } + + public Builder step(Optional step) { + Utils.checkNotNull(step, "step"); + this.step = step; + return this; + } + + public GetFleetMetricsRequest build() { + if (step == null) { + step = _SINGLETON_VALUE_Step.value(); + } return new GetFleetMetricsRequest( + end, + fleetId, + metrics, + orgId, + region, + start, + step); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_Step = + new LazySingletonValue<>( + "step", + "60", + new TypeReference>() {}); + } +} + diff --git a/src/main/java/dev/hathora/cloud_sdk/models/operations/GetFleetMetricsRequestBuilder.java b/src/main/java/dev/hathora/cloud_sdk/models/operations/GetFleetMetricsRequestBuilder.java new file mode 100644 index 00000000..3447a1f0 --- /dev/null +++ b/src/main/java/dev/hathora/cloud_sdk/models/operations/GetFleetMetricsRequestBuilder.java @@ -0,0 +1,29 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +package dev.hathora.cloud_sdk.models.operations; + +import dev.hathora.cloud_sdk.utils.Utils; + +public class GetFleetMetricsRequestBuilder { + + private GetFleetMetricsRequest request; + private final SDKMethodInterfaces.MethodCallGetFleetMetrics sdk; + + public GetFleetMetricsRequestBuilder(SDKMethodInterfaces.MethodCallGetFleetMetrics sdk) { + this.sdk = sdk; + } + + public GetFleetMetricsRequestBuilder request(GetFleetMetricsRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetFleetMetricsResponse call() throws Exception { + + return sdk.getFleetMetrics( + request); + } +} diff --git a/src/main/java/dev/hathora/cloud_sdk/models/operations/GetMetricsResponse.java b/src/main/java/dev/hathora/cloud_sdk/models/operations/GetFleetMetricsResponse.java similarity index 69% rename from src/main/java/dev/hathora/cloud_sdk/models/operations/GetMetricsResponse.java rename to src/main/java/dev/hathora/cloud_sdk/models/operations/GetFleetMetricsResponse.java index 0c56d76c..52746d0a 100644 --- a/src/main/java/dev/hathora/cloud_sdk/models/operations/GetMetricsResponse.java +++ b/src/main/java/dev/hathora/cloud_sdk/models/operations/GetFleetMetricsResponse.java @@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnore; -import dev.hathora.cloud_sdk.models.shared.MetricsData; +import dev.hathora.cloud_sdk.models.shared.FleetMetricsData; import dev.hathora.cloud_sdk.utils.Response; import dev.hathora.cloud_sdk.utils.Utils; import java.io.InputStream; @@ -20,7 +20,7 @@ import java.util.Optional; -public class GetMetricsResponse implements Response { +public class GetFleetMetricsResponse implements Response { /** * HTTP response content type for this operation @@ -30,7 +30,7 @@ public class GetMetricsResponse implements Response { /** * Ok */ - private Optional metricsData; + private Optional fleetMetricsData; /** * HTTP response status code for this operation @@ -43,22 +43,22 @@ public class GetMetricsResponse implements Response { private HttpResponse rawResponse; @JsonCreator - public GetMetricsResponse( + public GetFleetMetricsResponse( String contentType, - Optional metricsData, + Optional fleetMetricsData, int statusCode, HttpResponse rawResponse) { Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(metricsData, "metricsData"); + Utils.checkNotNull(fleetMetricsData, "fleetMetricsData"); Utils.checkNotNull(statusCode, "statusCode"); Utils.checkNotNull(rawResponse, "rawResponse"); this.contentType = contentType; - this.metricsData = metricsData; + this.fleetMetricsData = fleetMetricsData; this.statusCode = statusCode; this.rawResponse = rawResponse; } - public GetMetricsResponse( + public GetFleetMetricsResponse( String contentType, int statusCode, HttpResponse rawResponse) { @@ -78,8 +78,8 @@ public String contentType() { */ @SuppressWarnings("unchecked") @JsonIgnore - public Optional metricsData() { - return (Optional) metricsData; + public Optional fleetMetricsData() { + return (Optional) fleetMetricsData; } /** @@ -105,7 +105,7 @@ public final static Builder builder() { /** * HTTP response content type for this operation */ - public GetMetricsResponse withContentType(String contentType) { + public GetFleetMetricsResponse withContentType(String contentType) { Utils.checkNotNull(contentType, "contentType"); this.contentType = contentType; return this; @@ -114,25 +114,25 @@ public GetMetricsResponse withContentType(String contentType) { /** * Ok */ - public GetMetricsResponse withMetricsData(MetricsData metricsData) { - Utils.checkNotNull(metricsData, "metricsData"); - this.metricsData = Optional.ofNullable(metricsData); + public GetFleetMetricsResponse withFleetMetricsData(FleetMetricsData fleetMetricsData) { + Utils.checkNotNull(fleetMetricsData, "fleetMetricsData"); + this.fleetMetricsData = Optional.ofNullable(fleetMetricsData); return this; } /** * Ok */ - public GetMetricsResponse withMetricsData(Optional metricsData) { - Utils.checkNotNull(metricsData, "metricsData"); - this.metricsData = metricsData; + public GetFleetMetricsResponse withFleetMetricsData(Optional fleetMetricsData) { + Utils.checkNotNull(fleetMetricsData, "fleetMetricsData"); + this.fleetMetricsData = fleetMetricsData; return this; } /** * HTTP response status code for this operation */ - public GetMetricsResponse withStatusCode(int statusCode) { + public GetFleetMetricsResponse withStatusCode(int statusCode) { Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; @@ -141,7 +141,7 @@ public GetMetricsResponse withStatusCode(int statusCode) { /** * Raw HTTP response; suitable for custom response parsing */ - public GetMetricsResponse withRawResponse(HttpResponse rawResponse) { + public GetFleetMetricsResponse withRawResponse(HttpResponse rawResponse) { Utils.checkNotNull(rawResponse, "rawResponse"); this.rawResponse = rawResponse; return this; @@ -155,10 +155,10 @@ public boolean equals(java.lang.Object o) { if (o == null || getClass() != o.getClass()) { return false; } - GetMetricsResponse other = (GetMetricsResponse) o; + GetFleetMetricsResponse other = (GetFleetMetricsResponse) o; return Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.metricsData, other.metricsData) && + Objects.deepEquals(this.fleetMetricsData, other.fleetMetricsData) && Objects.deepEquals(this.statusCode, other.statusCode) && Objects.deepEquals(this.rawResponse, other.rawResponse); } @@ -167,16 +167,16 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash( contentType, - metricsData, + fleetMetricsData, statusCode, rawResponse); } @Override public String toString() { - return Utils.toString(GetMetricsResponse.class, + return Utils.toString(GetFleetMetricsResponse.class, "contentType", contentType, - "metricsData", metricsData, + "fleetMetricsData", fleetMetricsData, "statusCode", statusCode, "rawResponse", rawResponse); } @@ -185,7 +185,7 @@ public final static class Builder { private String contentType; - private Optional metricsData = Optional.empty(); + private Optional fleetMetricsData = Optional.empty(); private Integer statusCode; @@ -207,18 +207,18 @@ public Builder contentType(String contentType) { /** * Ok */ - public Builder metricsData(MetricsData metricsData) { - Utils.checkNotNull(metricsData, "metricsData"); - this.metricsData = Optional.ofNullable(metricsData); + public Builder fleetMetricsData(FleetMetricsData fleetMetricsData) { + Utils.checkNotNull(fleetMetricsData, "fleetMetricsData"); + this.fleetMetricsData = Optional.ofNullable(fleetMetricsData); return this; } /** * Ok */ - public Builder metricsData(Optional metricsData) { - Utils.checkNotNull(metricsData, "metricsData"); - this.metricsData = metricsData; + public Builder fleetMetricsData(Optional fleetMetricsData) { + Utils.checkNotNull(fleetMetricsData, "fleetMetricsData"); + this.fleetMetricsData = fleetMetricsData; return this; } @@ -240,10 +240,10 @@ public Builder rawResponse(HttpResponse rawResponse) { return this; } - public GetMetricsResponse build() { - return new GetMetricsResponse( + public GetFleetMetricsResponse build() { + return new GetFleetMetricsResponse( contentType, - metricsData, + fleetMetricsData, statusCode, rawResponse); } diff --git a/src/main/java/dev/hathora/cloud_sdk/models/operations/GetMetricsDeprecatedRequest.java b/src/main/java/dev/hathora/cloud_sdk/models/operations/GetMetricsDeprecatedRequest.java new file mode 100644 index 00000000..283298f7 --- /dev/null +++ b/src/main/java/dev/hathora/cloud_sdk/models/operations/GetMetricsDeprecatedRequest.java @@ -0,0 +1,370 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +package dev.hathora.cloud_sdk.models.operations; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import dev.hathora.cloud_sdk.models.shared.DeprecatedProcessMetricName; +import dev.hathora.cloud_sdk.utils.LazySingletonValue; +import dev.hathora.cloud_sdk.utils.SpeakeasyMetadata; +import dev.hathora.cloud_sdk.utils.Utils; +import java.lang.Double; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.List; +import java.util.Objects; +import java.util.Optional; + + +public class GetMetricsDeprecatedRequest { + + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=appId") + private Optional appId; + + /** + * Unix timestamp. Default is current time. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=end") + private Optional end; + + /** + * Available metrics to query over time. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=metrics") + private Optional> metrics; + + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=processId") + private String processId; + + /** + * Unix timestamp. Default is -1 hour from `end`. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=start") + private Optional start; + + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=step") + private Optional step; + + @JsonCreator + public GetMetricsDeprecatedRequest( + Optional appId, + Optional end, + Optional> metrics, + String processId, + Optional start, + Optional step) { + Utils.checkNotNull(appId, "appId"); + Utils.checkNotNull(end, "end"); + Utils.checkNotNull(metrics, "metrics"); + Utils.checkNotNull(processId, "processId"); + Utils.checkNotNull(start, "start"); + Utils.checkNotNull(step, "step"); + this.appId = appId; + this.end = end; + this.metrics = metrics; + this.processId = processId; + this.start = start; + this.step = step; + } + + public GetMetricsDeprecatedRequest( + String processId) { + this(Optional.empty(), Optional.empty(), Optional.empty(), processId, Optional.empty(), Optional.empty()); + } + + @JsonIgnore + public Optional appId() { + return appId; + } + + /** + * Unix timestamp. Default is current time. + */ + @JsonIgnore + public Optional end() { + return end; + } + + /** + * Available metrics to query over time. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> metrics() { + return (Optional>) metrics; + } + + @JsonIgnore + public String processId() { + return processId; + } + + /** + * Unix timestamp. Default is -1 hour from `end`. + */ + @JsonIgnore + public Optional start() { + return start; + } + + @JsonIgnore + public Optional step() { + return step; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetMetricsDeprecatedRequest withAppId(String appId) { + Utils.checkNotNull(appId, "appId"); + this.appId = Optional.ofNullable(appId); + return this; + } + + public GetMetricsDeprecatedRequest withAppId(Optional appId) { + Utils.checkNotNull(appId, "appId"); + this.appId = appId; + return this; + } + + /** + * Unix timestamp. Default is current time. + */ + public GetMetricsDeprecatedRequest withEnd(double end) { + Utils.checkNotNull(end, "end"); + this.end = Optional.ofNullable(end); + return this; + } + + /** + * Unix timestamp. Default is current time. + */ + public GetMetricsDeprecatedRequest withEnd(Optional end) { + Utils.checkNotNull(end, "end"); + this.end = end; + return this; + } + + /** + * Available metrics to query over time. + */ + public GetMetricsDeprecatedRequest withMetrics(List metrics) { + Utils.checkNotNull(metrics, "metrics"); + this.metrics = Optional.ofNullable(metrics); + return this; + } + + /** + * Available metrics to query over time. + */ + public GetMetricsDeprecatedRequest withMetrics(Optional> metrics) { + Utils.checkNotNull(metrics, "metrics"); + this.metrics = metrics; + return this; + } + + public GetMetricsDeprecatedRequest withProcessId(String processId) { + Utils.checkNotNull(processId, "processId"); + this.processId = processId; + return this; + } + + /** + * Unix timestamp. Default is -1 hour from `end`. + */ + public GetMetricsDeprecatedRequest withStart(double start) { + Utils.checkNotNull(start, "start"); + this.start = Optional.ofNullable(start); + return this; + } + + /** + * Unix timestamp. Default is -1 hour from `end`. + */ + public GetMetricsDeprecatedRequest withStart(Optional start) { + Utils.checkNotNull(start, "start"); + this.start = start; + return this; + } + + public GetMetricsDeprecatedRequest withStep(int step) { + Utils.checkNotNull(step, "step"); + this.step = Optional.ofNullable(step); + return this; + } + + public GetMetricsDeprecatedRequest withStep(Optional step) { + Utils.checkNotNull(step, "step"); + this.step = step; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetMetricsDeprecatedRequest other = (GetMetricsDeprecatedRequest) o; + return + Objects.deepEquals(this.appId, other.appId) && + Objects.deepEquals(this.end, other.end) && + Objects.deepEquals(this.metrics, other.metrics) && + Objects.deepEquals(this.processId, other.processId) && + Objects.deepEquals(this.start, other.start) && + Objects.deepEquals(this.step, other.step); + } + + @Override + public int hashCode() { + return Objects.hash( + appId, + end, + metrics, + processId, + start, + step); + } + + @Override + public String toString() { + return Utils.toString(GetMetricsDeprecatedRequest.class, + "appId", appId, + "end", end, + "metrics", metrics, + "processId", processId, + "start", start, + "step", step); + } + + public final static class Builder { + + private Optional appId = Optional.empty(); + + private Optional end = Optional.empty(); + + private Optional> metrics = Optional.empty(); + + private String processId; + + private Optional start = Optional.empty(); + + private Optional step; + + private Builder() { + // force use of static builder() method + } + + public Builder appId(String appId) { + Utils.checkNotNull(appId, "appId"); + this.appId = Optional.ofNullable(appId); + return this; + } + + public Builder appId(Optional appId) { + Utils.checkNotNull(appId, "appId"); + this.appId = appId; + return this; + } + + /** + * Unix timestamp. Default is current time. + */ + public Builder end(double end) { + Utils.checkNotNull(end, "end"); + this.end = Optional.ofNullable(end); + return this; + } + + /** + * Unix timestamp. Default is current time. + */ + public Builder end(Optional end) { + Utils.checkNotNull(end, "end"); + this.end = end; + return this; + } + + /** + * Available metrics to query over time. + */ + public Builder metrics(List metrics) { + Utils.checkNotNull(metrics, "metrics"); + this.metrics = Optional.ofNullable(metrics); + return this; + } + + /** + * Available metrics to query over time. + */ + public Builder metrics(Optional> metrics) { + Utils.checkNotNull(metrics, "metrics"); + this.metrics = metrics; + return this; + } + + public Builder processId(String processId) { + Utils.checkNotNull(processId, "processId"); + this.processId = processId; + return this; + } + + /** + * Unix timestamp. Default is -1 hour from `end`. + */ + public Builder start(double start) { + Utils.checkNotNull(start, "start"); + this.start = Optional.ofNullable(start); + return this; + } + + /** + * Unix timestamp. Default is -1 hour from `end`. + */ + public Builder start(Optional start) { + Utils.checkNotNull(start, "start"); + this.start = start; + return this; + } + + public Builder step(int step) { + Utils.checkNotNull(step, "step"); + this.step = Optional.ofNullable(step); + return this; + } + + public Builder step(Optional step) { + Utils.checkNotNull(step, "step"); + this.step = step; + return this; + } + + public GetMetricsDeprecatedRequest build() { + if (step == null) { + step = _SINGLETON_VALUE_Step.value(); + } return new GetMetricsDeprecatedRequest( + appId, + end, + metrics, + processId, + start, + step); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_Step = + new LazySingletonValue<>( + "step", + "60", + new TypeReference>() {}); + } +} + diff --git a/src/main/java/dev/hathora/cloud_sdk/models/operations/GetMetricsDeprecatedRequestBuilder.java b/src/main/java/dev/hathora/cloud_sdk/models/operations/GetMetricsDeprecatedRequestBuilder.java new file mode 100644 index 00000000..4b138e34 --- /dev/null +++ b/src/main/java/dev/hathora/cloud_sdk/models/operations/GetMetricsDeprecatedRequestBuilder.java @@ -0,0 +1,29 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +package dev.hathora.cloud_sdk.models.operations; + +import dev.hathora.cloud_sdk.utils.Utils; + +public class GetMetricsDeprecatedRequestBuilder { + + private GetMetricsDeprecatedRequest request; + private final SDKMethodInterfaces.MethodCallGetMetricsDeprecated sdk; + + public GetMetricsDeprecatedRequestBuilder(SDKMethodInterfaces.MethodCallGetMetricsDeprecated sdk) { + this.sdk = sdk; + } + + public GetMetricsDeprecatedRequestBuilder request(GetMetricsDeprecatedRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetMetricsDeprecatedResponse call() throws Exception { + + return sdk.getMetricsDeprecated( + request); + } +} diff --git a/src/main/java/dev/hathora/cloud_sdk/models/operations/GetMetricsDeprecatedResponse.java b/src/main/java/dev/hathora/cloud_sdk/models/operations/GetMetricsDeprecatedResponse.java new file mode 100644 index 00000000..8d1f16e1 --- /dev/null +++ b/src/main/java/dev/hathora/cloud_sdk/models/operations/GetMetricsDeprecatedResponse.java @@ -0,0 +1,252 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +package dev.hathora.cloud_sdk.models.operations; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.hathora.cloud_sdk.models.shared.DeprecatedProcessMetricsData; +import dev.hathora.cloud_sdk.utils.Response; +import dev.hathora.cloud_sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Objects; +import java.util.Optional; + + +public class GetMetricsDeprecatedResponse implements Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Ok + */ + private Optional deprecatedProcessMetricsData; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + @JsonCreator + public GetMetricsDeprecatedResponse( + String contentType, + Optional deprecatedProcessMetricsData, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(deprecatedProcessMetricsData, "deprecatedProcessMetricsData"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.deprecatedProcessMetricsData = deprecatedProcessMetricsData; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + public GetMetricsDeprecatedResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, Optional.empty(), statusCode, rawResponse); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * Ok + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional deprecatedProcessMetricsData() { + return (Optional) deprecatedProcessMetricsData; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public GetMetricsDeprecatedResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Ok + */ + public GetMetricsDeprecatedResponse withDeprecatedProcessMetricsData(DeprecatedProcessMetricsData deprecatedProcessMetricsData) { + Utils.checkNotNull(deprecatedProcessMetricsData, "deprecatedProcessMetricsData"); + this.deprecatedProcessMetricsData = Optional.ofNullable(deprecatedProcessMetricsData); + return this; + } + + /** + * Ok + */ + public GetMetricsDeprecatedResponse withDeprecatedProcessMetricsData(Optional deprecatedProcessMetricsData) { + Utils.checkNotNull(deprecatedProcessMetricsData, "deprecatedProcessMetricsData"); + this.deprecatedProcessMetricsData = deprecatedProcessMetricsData; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetMetricsDeprecatedResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetMetricsDeprecatedResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetMetricsDeprecatedResponse other = (GetMetricsDeprecatedResponse) o; + return + Objects.deepEquals(this.contentType, other.contentType) && + Objects.deepEquals(this.deprecatedProcessMetricsData, other.deprecatedProcessMetricsData) && + Objects.deepEquals(this.statusCode, other.statusCode) && + Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Objects.hash( + contentType, + deprecatedProcessMetricsData, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetMetricsDeprecatedResponse.class, + "contentType", contentType, + "deprecatedProcessMetricsData", deprecatedProcessMetricsData, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private String contentType; + + private Optional deprecatedProcessMetricsData = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Ok + */ + public Builder deprecatedProcessMetricsData(DeprecatedProcessMetricsData deprecatedProcessMetricsData) { + Utils.checkNotNull(deprecatedProcessMetricsData, "deprecatedProcessMetricsData"); + this.deprecatedProcessMetricsData = Optional.ofNullable(deprecatedProcessMetricsData); + return this; + } + + /** + * Ok + */ + public Builder deprecatedProcessMetricsData(Optional deprecatedProcessMetricsData) { + Utils.checkNotNull(deprecatedProcessMetricsData, "deprecatedProcessMetricsData"); + this.deprecatedProcessMetricsData = deprecatedProcessMetricsData; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetMetricsDeprecatedResponse build() { + return new GetMetricsDeprecatedResponse( + contentType, + deprecatedProcessMetricsData, + statusCode, + rawResponse); + } + } +} + diff --git a/src/main/java/dev/hathora/cloud_sdk/models/operations/GetMetricsRequestBuilder.java b/src/main/java/dev/hathora/cloud_sdk/models/operations/GetMetricsRequestBuilder.java deleted file mode 100644 index 1a91f123..00000000 --- a/src/main/java/dev/hathora/cloud_sdk/models/operations/GetMetricsRequestBuilder.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -package dev.hathora.cloud_sdk.models.operations; - -import dev.hathora.cloud_sdk.utils.Utils; - -public class GetMetricsRequestBuilder { - - private GetMetricsRequest request; - private final SDKMethodInterfaces.MethodCallGetMetrics sdk; - - public GetMetricsRequestBuilder(SDKMethodInterfaces.MethodCallGetMetrics sdk) { - this.sdk = sdk; - } - - public GetMetricsRequestBuilder request(GetMetricsRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - - public GetMetricsResponse call() throws Exception { - - return sdk.getMetrics( - request); - } -} diff --git a/src/main/java/dev/hathora/cloud_sdk/models/operations/GetMetricsRequest.java b/src/main/java/dev/hathora/cloud_sdk/models/operations/GetProcessMetricsRequest.java similarity index 84% rename from src/main/java/dev/hathora/cloud_sdk/models/operations/GetMetricsRequest.java rename to src/main/java/dev/hathora/cloud_sdk/models/operations/GetProcessMetricsRequest.java index 5b770cb0..368a4046 100644 --- a/src/main/java/dev/hathora/cloud_sdk/models/operations/GetMetricsRequest.java +++ b/src/main/java/dev/hathora/cloud_sdk/models/operations/GetProcessMetricsRequest.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; -import dev.hathora.cloud_sdk.models.shared.MetricName; +import dev.hathora.cloud_sdk.models.shared.ProcessMetricName; import dev.hathora.cloud_sdk.utils.LazySingletonValue; import dev.hathora.cloud_sdk.utils.SpeakeasyMetadata; import dev.hathora.cloud_sdk.utils.Utils; @@ -22,7 +22,7 @@ import java.util.Optional; -public class GetMetricsRequest { +public class GetProcessMetricsRequest { @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=appId") private Optional appId; @@ -37,7 +37,7 @@ public class GetMetricsRequest { * Available metrics to query over time. */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=metrics") - private Optional> metrics; + private Optional> metrics; @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=processId") private String processId; @@ -52,10 +52,10 @@ public class GetMetricsRequest { private Optional step; @JsonCreator - public GetMetricsRequest( + public GetProcessMetricsRequest( Optional appId, Optional end, - Optional> metrics, + Optional> metrics, String processId, Optional start, Optional step) { @@ -73,7 +73,7 @@ public GetMetricsRequest( this.step = step; } - public GetMetricsRequest( + public GetProcessMetricsRequest( String processId) { this(Optional.empty(), Optional.empty(), Optional.empty(), processId, Optional.empty(), Optional.empty()); } @@ -96,8 +96,8 @@ public Optional end() { */ @SuppressWarnings("unchecked") @JsonIgnore - public Optional> metrics() { - return (Optional>) metrics; + public Optional> metrics() { + return (Optional>) metrics; } @JsonIgnore @@ -122,13 +122,13 @@ public final static Builder builder() { return new Builder(); } - public GetMetricsRequest withAppId(String appId) { + public GetProcessMetricsRequest withAppId(String appId) { Utils.checkNotNull(appId, "appId"); this.appId = Optional.ofNullable(appId); return this; } - public GetMetricsRequest withAppId(Optional appId) { + public GetProcessMetricsRequest withAppId(Optional appId) { Utils.checkNotNull(appId, "appId"); this.appId = appId; return this; @@ -137,7 +137,7 @@ public GetMetricsRequest withAppId(Optional appId) { /** * Unix timestamp. Default is current time. */ - public GetMetricsRequest withEnd(double end) { + public GetProcessMetricsRequest withEnd(double end) { Utils.checkNotNull(end, "end"); this.end = Optional.ofNullable(end); return this; @@ -146,7 +146,7 @@ public GetMetricsRequest withEnd(double end) { /** * Unix timestamp. Default is current time. */ - public GetMetricsRequest withEnd(Optional end) { + public GetProcessMetricsRequest withEnd(Optional end) { Utils.checkNotNull(end, "end"); this.end = end; return this; @@ -155,7 +155,7 @@ public GetMetricsRequest withEnd(Optional end) { /** * Available metrics to query over time. */ - public GetMetricsRequest withMetrics(List metrics) { + public GetProcessMetricsRequest withMetrics(List metrics) { Utils.checkNotNull(metrics, "metrics"); this.metrics = Optional.ofNullable(metrics); return this; @@ -164,13 +164,13 @@ public GetMetricsRequest withMetrics(List metrics) { /** * Available metrics to query over time. */ - public GetMetricsRequest withMetrics(Optional> metrics) { + public GetProcessMetricsRequest withMetrics(Optional> metrics) { Utils.checkNotNull(metrics, "metrics"); this.metrics = metrics; return this; } - public GetMetricsRequest withProcessId(String processId) { + public GetProcessMetricsRequest withProcessId(String processId) { Utils.checkNotNull(processId, "processId"); this.processId = processId; return this; @@ -179,7 +179,7 @@ public GetMetricsRequest withProcessId(String processId) { /** * Unix timestamp. Default is -1 hour from `end`. */ - public GetMetricsRequest withStart(double start) { + public GetProcessMetricsRequest withStart(double start) { Utils.checkNotNull(start, "start"); this.start = Optional.ofNullable(start); return this; @@ -188,19 +188,19 @@ public GetMetricsRequest withStart(double start) { /** * Unix timestamp. Default is -1 hour from `end`. */ - public GetMetricsRequest withStart(Optional start) { + public GetProcessMetricsRequest withStart(Optional start) { Utils.checkNotNull(start, "start"); this.start = start; return this; } - public GetMetricsRequest withStep(int step) { + public GetProcessMetricsRequest withStep(int step) { Utils.checkNotNull(step, "step"); this.step = Optional.ofNullable(step); return this; } - public GetMetricsRequest withStep(Optional step) { + public GetProcessMetricsRequest withStep(Optional step) { Utils.checkNotNull(step, "step"); this.step = step; return this; @@ -214,7 +214,7 @@ public boolean equals(java.lang.Object o) { if (o == null || getClass() != o.getClass()) { return false; } - GetMetricsRequest other = (GetMetricsRequest) o; + GetProcessMetricsRequest other = (GetProcessMetricsRequest) o; return Objects.deepEquals(this.appId, other.appId) && Objects.deepEquals(this.end, other.end) && @@ -237,7 +237,7 @@ public int hashCode() { @Override public String toString() { - return Utils.toString(GetMetricsRequest.class, + return Utils.toString(GetProcessMetricsRequest.class, "appId", appId, "end", end, "metrics", metrics, @@ -252,7 +252,7 @@ public final static class Builder { private Optional end = Optional.empty(); - private Optional> metrics = Optional.empty(); + private Optional> metrics = Optional.empty(); private String processId; @@ -297,7 +297,7 @@ public Builder end(Optional end) { /** * Available metrics to query over time. */ - public Builder metrics(List metrics) { + public Builder metrics(List metrics) { Utils.checkNotNull(metrics, "metrics"); this.metrics = Optional.ofNullable(metrics); return this; @@ -306,7 +306,7 @@ public Builder metrics(List metrics) { /** * Available metrics to query over time. */ - public Builder metrics(Optional> metrics) { + public Builder metrics(Optional> metrics) { Utils.checkNotNull(metrics, "metrics"); this.metrics = metrics; return this; @@ -348,10 +348,10 @@ public Builder step(Optional step) { return this; } - public GetMetricsRequest build() { + public GetProcessMetricsRequest build() { if (step == null) { step = _SINGLETON_VALUE_Step.value(); - } return new GetMetricsRequest( + } return new GetProcessMetricsRequest( appId, end, metrics, diff --git a/src/main/java/dev/hathora/cloud_sdk/models/operations/GetProcessMetricsRequestBuilder.java b/src/main/java/dev/hathora/cloud_sdk/models/operations/GetProcessMetricsRequestBuilder.java new file mode 100644 index 00000000..3d3b69ee --- /dev/null +++ b/src/main/java/dev/hathora/cloud_sdk/models/operations/GetProcessMetricsRequestBuilder.java @@ -0,0 +1,29 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +package dev.hathora.cloud_sdk.models.operations; + +import dev.hathora.cloud_sdk.utils.Utils; + +public class GetProcessMetricsRequestBuilder { + + private GetProcessMetricsRequest request; + private final SDKMethodInterfaces.MethodCallGetProcessMetrics sdk; + + public GetProcessMetricsRequestBuilder(SDKMethodInterfaces.MethodCallGetProcessMetrics sdk) { + this.sdk = sdk; + } + + public GetProcessMetricsRequestBuilder request(GetProcessMetricsRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetProcessMetricsResponse call() throws Exception { + + return sdk.getProcessMetrics( + request); + } +} diff --git a/src/main/java/dev/hathora/cloud_sdk/models/operations/GetProcessMetricsResponse.java b/src/main/java/dev/hathora/cloud_sdk/models/operations/GetProcessMetricsResponse.java new file mode 100644 index 00000000..4bcc6f8e --- /dev/null +++ b/src/main/java/dev/hathora/cloud_sdk/models/operations/GetProcessMetricsResponse.java @@ -0,0 +1,252 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +package dev.hathora.cloud_sdk.models.operations; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.hathora.cloud_sdk.models.shared.ProcessMetricsData; +import dev.hathora.cloud_sdk.utils.Response; +import dev.hathora.cloud_sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Objects; +import java.util.Optional; + + +public class GetProcessMetricsResponse implements Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Ok + */ + private Optional processMetricsData; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + @JsonCreator + public GetProcessMetricsResponse( + String contentType, + Optional processMetricsData, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(processMetricsData, "processMetricsData"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.processMetricsData = processMetricsData; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + public GetProcessMetricsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, Optional.empty(), statusCode, rawResponse); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * Ok + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional processMetricsData() { + return (Optional) processMetricsData; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public GetProcessMetricsResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Ok + */ + public GetProcessMetricsResponse withProcessMetricsData(ProcessMetricsData processMetricsData) { + Utils.checkNotNull(processMetricsData, "processMetricsData"); + this.processMetricsData = Optional.ofNullable(processMetricsData); + return this; + } + + /** + * Ok + */ + public GetProcessMetricsResponse withProcessMetricsData(Optional processMetricsData) { + Utils.checkNotNull(processMetricsData, "processMetricsData"); + this.processMetricsData = processMetricsData; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetProcessMetricsResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetProcessMetricsResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetProcessMetricsResponse other = (GetProcessMetricsResponse) o; + return + Objects.deepEquals(this.contentType, other.contentType) && + Objects.deepEquals(this.processMetricsData, other.processMetricsData) && + Objects.deepEquals(this.statusCode, other.statusCode) && + Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Objects.hash( + contentType, + processMetricsData, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetProcessMetricsResponse.class, + "contentType", contentType, + "processMetricsData", processMetricsData, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private String contentType; + + private Optional processMetricsData = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Ok + */ + public Builder processMetricsData(ProcessMetricsData processMetricsData) { + Utils.checkNotNull(processMetricsData, "processMetricsData"); + this.processMetricsData = Optional.ofNullable(processMetricsData); + return this; + } + + /** + * Ok + */ + public Builder processMetricsData(Optional processMetricsData) { + Utils.checkNotNull(processMetricsData, "processMetricsData"); + this.processMetricsData = processMetricsData; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetProcessMetricsResponse build() { + return new GetProcessMetricsResponse( + contentType, + processMetricsData, + statusCode, + rawResponse); + } + } +} + diff --git a/src/main/java/dev/hathora/cloud_sdk/models/operations/SDKMethodInterfaces.java b/src/main/java/dev/hathora/cloud_sdk/models/operations/SDKMethodInterfaces.java index 899399f6..547bca75 100644 --- a/src/main/java/dev/hathora/cloud_sdk/models/operations/SDKMethodInterfaces.java +++ b/src/main/java/dev/hathora/cloud_sdk/models/operations/SDKMethodInterfaces.java @@ -353,6 +353,12 @@ public interface MethodCallGetPingServiceEndpoints { } + public interface MethodCallGetFleetMetrics { + GetFleetMetricsResponse getFleetMetrics( + GetFleetMetricsRequest request) throws Exception; + } + + public interface MethodCallGetFleetRegion { GetFleetRegionResponse getFleetRegion( String fleetId, @@ -516,9 +522,9 @@ SendVerificationEmailResponse sendVerificationEmail( } - public interface MethodCallGetMetrics { - GetMetricsResponse getMetrics( - GetMetricsRequest request) throws Exception; + public interface MethodCallGetMetricsDeprecated { + GetMetricsDeprecatedResponse getMetricsDeprecated( + GetMetricsDeprecatedRequest request) throws Exception; } @@ -650,6 +656,12 @@ GetProcessResponse getProcess( } + public interface MethodCallGetProcessMetrics { + GetProcessMetricsResponse getProcessMetrics( + GetProcessMetricsRequest request) throws Exception; + } + + public interface MethodCallGetProcessesCountExperimental { GetProcessesCountExperimentalResponse getProcessesCountExperimental( Optional appId, diff --git a/src/main/java/dev/hathora/cloud_sdk/models/shared/MetricName.java b/src/main/java/dev/hathora/cloud_sdk/models/shared/DeprecatedProcessMetricName.java similarity index 79% rename from src/main/java/dev/hathora/cloud_sdk/models/shared/MetricName.java rename to src/main/java/dev/hathora/cloud_sdk/models/shared/DeprecatedProcessMetricName.java index 9007dd3e..1f14eb78 100644 --- a/src/main/java/dev/hathora/cloud_sdk/models/shared/MetricName.java +++ b/src/main/java/dev/hathora/cloud_sdk/models/shared/DeprecatedProcessMetricName.java @@ -7,10 +7,7 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.lang.String; -/** - * MetricName - Available metrics to query over time. - */ -public enum MetricName { +public enum DeprecatedProcessMetricName { CPU("cpu"), MEMORY("memory"), RATE_EGRESS("rate_egress"), @@ -20,7 +17,7 @@ public enum MetricName { @JsonValue private final String value; - private MetricName(String value) { + private DeprecatedProcessMetricName(String value) { this.value = value; } diff --git a/src/main/java/dev/hathora/cloud_sdk/models/shared/MetricsData.java b/src/main/java/dev/hathora/cloud_sdk/models/shared/DeprecatedProcessMetricsData.java similarity index 86% rename from src/main/java/dev/hathora/cloud_sdk/models/shared/MetricsData.java rename to src/main/java/dev/hathora/cloud_sdk/models/shared/DeprecatedProcessMetricsData.java index eb676f31..deddc4ae 100644 --- a/src/main/java/dev/hathora/cloud_sdk/models/shared/MetricsData.java +++ b/src/main/java/dev/hathora/cloud_sdk/models/shared/DeprecatedProcessMetricsData.java @@ -19,7 +19,7 @@ import java.util.Optional; -public class MetricsData { +public class DeprecatedProcessMetricsData { @JsonInclude(Include.NON_ABSENT) @JsonProperty("active_connections") @@ -42,7 +42,7 @@ public class MetricsData { private Optional> totalEgress; @JsonCreator - public MetricsData( + public DeprecatedProcessMetricsData( @JsonProperty("active_connections") Optional> activeConnections, @JsonProperty("cpu") Optional> cpu, @JsonProperty("memory") Optional> memory, @@ -60,7 +60,7 @@ public MetricsData( this.totalEgress = totalEgress; } - public MetricsData() { + public DeprecatedProcessMetricsData() { this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } @@ -98,61 +98,61 @@ public final static Builder builder() { return new Builder(); } - public MetricsData withActiveConnections(List activeConnections) { + public DeprecatedProcessMetricsData withActiveConnections(List activeConnections) { Utils.checkNotNull(activeConnections, "activeConnections"); this.activeConnections = Optional.ofNullable(activeConnections); return this; } - public MetricsData withActiveConnections(Optional> activeConnections) { + public DeprecatedProcessMetricsData withActiveConnections(Optional> activeConnections) { Utils.checkNotNull(activeConnections, "activeConnections"); this.activeConnections = activeConnections; return this; } - public MetricsData withCpu(List cpu) { + public DeprecatedProcessMetricsData withCpu(List cpu) { Utils.checkNotNull(cpu, "cpu"); this.cpu = Optional.ofNullable(cpu); return this; } - public MetricsData withCpu(Optional> cpu) { + public DeprecatedProcessMetricsData withCpu(Optional> cpu) { Utils.checkNotNull(cpu, "cpu"); this.cpu = cpu; return this; } - public MetricsData withMemory(List memory) { + public DeprecatedProcessMetricsData withMemory(List memory) { Utils.checkNotNull(memory, "memory"); this.memory = Optional.ofNullable(memory); return this; } - public MetricsData withMemory(Optional> memory) { + public DeprecatedProcessMetricsData withMemory(Optional> memory) { Utils.checkNotNull(memory, "memory"); this.memory = memory; return this; } - public MetricsData withRateEgress(List rateEgress) { + public DeprecatedProcessMetricsData withRateEgress(List rateEgress) { Utils.checkNotNull(rateEgress, "rateEgress"); this.rateEgress = Optional.ofNullable(rateEgress); return this; } - public MetricsData withRateEgress(Optional> rateEgress) { + public DeprecatedProcessMetricsData withRateEgress(Optional> rateEgress) { Utils.checkNotNull(rateEgress, "rateEgress"); this.rateEgress = rateEgress; return this; } - public MetricsData withTotalEgress(List totalEgress) { + public DeprecatedProcessMetricsData withTotalEgress(List totalEgress) { Utils.checkNotNull(totalEgress, "totalEgress"); this.totalEgress = Optional.ofNullable(totalEgress); return this; } - public MetricsData withTotalEgress(Optional> totalEgress) { + public DeprecatedProcessMetricsData withTotalEgress(Optional> totalEgress) { Utils.checkNotNull(totalEgress, "totalEgress"); this.totalEgress = totalEgress; return this; @@ -166,7 +166,7 @@ public boolean equals(java.lang.Object o) { if (o == null || getClass() != o.getClass()) { return false; } - MetricsData other = (MetricsData) o; + DeprecatedProcessMetricsData other = (DeprecatedProcessMetricsData) o; return Objects.deepEquals(this.activeConnections, other.activeConnections) && Objects.deepEquals(this.cpu, other.cpu) && @@ -187,7 +187,7 @@ public int hashCode() { @Override public String toString() { - return Utils.toString(MetricsData.class, + return Utils.toString(DeprecatedProcessMetricsData.class, "activeConnections", activeConnections, "cpu", cpu, "memory", memory, @@ -271,8 +271,8 @@ public Builder totalEgress(Optional> totalEgress) { return this; } - public MetricsData build() { - return new MetricsData( + public DeprecatedProcessMetricsData build() { + return new DeprecatedProcessMetricsData( activeConnections, cpu, memory, diff --git a/src/main/java/dev/hathora/cloud_sdk/models/shared/FleetMetricName.java b/src/main/java/dev/hathora/cloud_sdk/models/shared/FleetMetricName.java new file mode 100644 index 00000000..d829f7c9 --- /dev/null +++ b/src/main/java/dev/hathora/cloud_sdk/models/shared/FleetMetricName.java @@ -0,0 +1,26 @@ +/* + * 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 FleetMetricName { + PROVISIONED_TOTAL("provisionedTotal"), + PROVISIONED_BARE_METAL("provisionedBareMetal"), + PROVISIONED_CLOUD("provisionedCloud"), + UTILIZED("utilized"); + + @JsonValue + private final String value; + + private FleetMetricName(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/dev/hathora/cloud_sdk/models/shared/FleetMetricsData.java b/src/main/java/dev/hathora/cloud_sdk/models/shared/FleetMetricsData.java new file mode 100644 index 00000000..85aaf8cf --- /dev/null +++ b/src/main/java/dev/hathora/cloud_sdk/models/shared/FleetMetricsData.java @@ -0,0 +1,241 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +package dev.hathora.cloud_sdk.models.shared; + + +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.List; +import java.util.Objects; +import java.util.Optional; + + +public class FleetMetricsData { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("provisionedBareMetal") + private Optional> provisionedBareMetal; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("provisionedCloud") + private Optional> provisionedCloud; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("provisionedTotal") + private Optional> provisionedTotal; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("utilized") + private Optional> utilized; + + @JsonCreator + public FleetMetricsData( + @JsonProperty("provisionedBareMetal") Optional> provisionedBareMetal, + @JsonProperty("provisionedCloud") Optional> provisionedCloud, + @JsonProperty("provisionedTotal") Optional> provisionedTotal, + @JsonProperty("utilized") Optional> utilized) { + Utils.checkNotNull(provisionedBareMetal, "provisionedBareMetal"); + Utils.checkNotNull(provisionedCloud, "provisionedCloud"); + Utils.checkNotNull(provisionedTotal, "provisionedTotal"); + Utils.checkNotNull(utilized, "utilized"); + this.provisionedBareMetal = provisionedBareMetal; + this.provisionedCloud = provisionedCloud; + this.provisionedTotal = provisionedTotal; + this.utilized = utilized; + } + + public FleetMetricsData() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> provisionedBareMetal() { + return (Optional>) provisionedBareMetal; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> provisionedCloud() { + return (Optional>) provisionedCloud; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> provisionedTotal() { + return (Optional>) provisionedTotal; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> utilized() { + return (Optional>) utilized; + } + + public final static Builder builder() { + return new Builder(); + } + + public FleetMetricsData withProvisionedBareMetal(List provisionedBareMetal) { + Utils.checkNotNull(provisionedBareMetal, "provisionedBareMetal"); + this.provisionedBareMetal = Optional.ofNullable(provisionedBareMetal); + return this; + } + + public FleetMetricsData withProvisionedBareMetal(Optional> provisionedBareMetal) { + Utils.checkNotNull(provisionedBareMetal, "provisionedBareMetal"); + this.provisionedBareMetal = provisionedBareMetal; + return this; + } + + public FleetMetricsData withProvisionedCloud(List provisionedCloud) { + Utils.checkNotNull(provisionedCloud, "provisionedCloud"); + this.provisionedCloud = Optional.ofNullable(provisionedCloud); + return this; + } + + public FleetMetricsData withProvisionedCloud(Optional> provisionedCloud) { + Utils.checkNotNull(provisionedCloud, "provisionedCloud"); + this.provisionedCloud = provisionedCloud; + return this; + } + + public FleetMetricsData withProvisionedTotal(List provisionedTotal) { + Utils.checkNotNull(provisionedTotal, "provisionedTotal"); + this.provisionedTotal = Optional.ofNullable(provisionedTotal); + return this; + } + + public FleetMetricsData withProvisionedTotal(Optional> provisionedTotal) { + Utils.checkNotNull(provisionedTotal, "provisionedTotal"); + this.provisionedTotal = provisionedTotal; + return this; + } + + public FleetMetricsData withUtilized(List utilized) { + Utils.checkNotNull(utilized, "utilized"); + this.utilized = Optional.ofNullable(utilized); + return this; + } + + public FleetMetricsData withUtilized(Optional> utilized) { + Utils.checkNotNull(utilized, "utilized"); + this.utilized = utilized; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FleetMetricsData other = (FleetMetricsData) o; + return + Objects.deepEquals(this.provisionedBareMetal, other.provisionedBareMetal) && + Objects.deepEquals(this.provisionedCloud, other.provisionedCloud) && + Objects.deepEquals(this.provisionedTotal, other.provisionedTotal) && + Objects.deepEquals(this.utilized, other.utilized); + } + + @Override + public int hashCode() { + return Objects.hash( + provisionedBareMetal, + provisionedCloud, + provisionedTotal, + utilized); + } + + @Override + public String toString() { + return Utils.toString(FleetMetricsData.class, + "provisionedBareMetal", provisionedBareMetal, + "provisionedCloud", provisionedCloud, + "provisionedTotal", provisionedTotal, + "utilized", utilized); + } + + public final static class Builder { + + private Optional> provisionedBareMetal = Optional.empty(); + + private Optional> provisionedCloud = Optional.empty(); + + private Optional> provisionedTotal = Optional.empty(); + + private Optional> utilized = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder provisionedBareMetal(List provisionedBareMetal) { + Utils.checkNotNull(provisionedBareMetal, "provisionedBareMetal"); + this.provisionedBareMetal = Optional.ofNullable(provisionedBareMetal); + return this; + } + + public Builder provisionedBareMetal(Optional> provisionedBareMetal) { + Utils.checkNotNull(provisionedBareMetal, "provisionedBareMetal"); + this.provisionedBareMetal = provisionedBareMetal; + return this; + } + + public Builder provisionedCloud(List provisionedCloud) { + Utils.checkNotNull(provisionedCloud, "provisionedCloud"); + this.provisionedCloud = Optional.ofNullable(provisionedCloud); + return this; + } + + public Builder provisionedCloud(Optional> provisionedCloud) { + Utils.checkNotNull(provisionedCloud, "provisionedCloud"); + this.provisionedCloud = provisionedCloud; + return this; + } + + public Builder provisionedTotal(List provisionedTotal) { + Utils.checkNotNull(provisionedTotal, "provisionedTotal"); + this.provisionedTotal = Optional.ofNullable(provisionedTotal); + return this; + } + + public Builder provisionedTotal(Optional> provisionedTotal) { + Utils.checkNotNull(provisionedTotal, "provisionedTotal"); + this.provisionedTotal = provisionedTotal; + return this; + } + + public Builder utilized(List utilized) { + Utils.checkNotNull(utilized, "utilized"); + this.utilized = Optional.ofNullable(utilized); + return this; + } + + public Builder utilized(Optional> utilized) { + Utils.checkNotNull(utilized, "utilized"); + this.utilized = utilized; + return this; + } + + public FleetMetricsData build() { + return new FleetMetricsData( + provisionedBareMetal, + provisionedCloud, + provisionedTotal, + utilized); + } + } +} + diff --git a/src/main/java/dev/hathora/cloud_sdk/models/shared/ProcessMetricName.java b/src/main/java/dev/hathora/cloud_sdk/models/shared/ProcessMetricName.java new file mode 100644 index 00000000..13b1b9db --- /dev/null +++ b/src/main/java/dev/hathora/cloud_sdk/models/shared/ProcessMetricName.java @@ -0,0 +1,30 @@ +/* + * 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; + +/** + * ProcessMetricName - Available metrics to query over time. + */ +public enum ProcessMetricName { + CPU("cpu"), + MEMORY("memory"), + RATE_EGRESS("rateEgress"), + TOTAL_EGRESS("totalEgress"), + ACTIVE_CONNECTIONS("activeConnections"); + + @JsonValue + private final String value; + + private ProcessMetricName(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/dev/hathora/cloud_sdk/models/shared/ProcessMetricsData.java b/src/main/java/dev/hathora/cloud_sdk/models/shared/ProcessMetricsData.java new file mode 100644 index 00000000..69f40313 --- /dev/null +++ b/src/main/java/dev/hathora/cloud_sdk/models/shared/ProcessMetricsData.java @@ -0,0 +1,284 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +package dev.hathora.cloud_sdk.models.shared; + + +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.List; +import java.util.Objects; +import java.util.Optional; + + +public class ProcessMetricsData { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("activeConnections") + private Optional> activeConnections; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("cpu") + private Optional> cpu; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("memory") + private Optional> memory; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("rateEgress") + private Optional> rateEgress; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("totalEgress") + private Optional> totalEgress; + + @JsonCreator + public ProcessMetricsData( + @JsonProperty("activeConnections") Optional> activeConnections, + @JsonProperty("cpu") Optional> cpu, + @JsonProperty("memory") Optional> memory, + @JsonProperty("rateEgress") Optional> rateEgress, + @JsonProperty("totalEgress") Optional> totalEgress) { + Utils.checkNotNull(activeConnections, "activeConnections"); + Utils.checkNotNull(cpu, "cpu"); + Utils.checkNotNull(memory, "memory"); + Utils.checkNotNull(rateEgress, "rateEgress"); + Utils.checkNotNull(totalEgress, "totalEgress"); + this.activeConnections = activeConnections; + this.cpu = cpu; + this.memory = memory; + this.rateEgress = rateEgress; + this.totalEgress = totalEgress; + } + + public ProcessMetricsData() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> activeConnections() { + return (Optional>) activeConnections; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> cpu() { + return (Optional>) cpu; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> memory() { + return (Optional>) memory; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rateEgress() { + return (Optional>) rateEgress; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> totalEgress() { + return (Optional>) totalEgress; + } + + public final static Builder builder() { + return new Builder(); + } + + public ProcessMetricsData withActiveConnections(List activeConnections) { + Utils.checkNotNull(activeConnections, "activeConnections"); + this.activeConnections = Optional.ofNullable(activeConnections); + return this; + } + + public ProcessMetricsData withActiveConnections(Optional> activeConnections) { + Utils.checkNotNull(activeConnections, "activeConnections"); + this.activeConnections = activeConnections; + return this; + } + + public ProcessMetricsData withCpu(List cpu) { + Utils.checkNotNull(cpu, "cpu"); + this.cpu = Optional.ofNullable(cpu); + return this; + } + + public ProcessMetricsData withCpu(Optional> cpu) { + Utils.checkNotNull(cpu, "cpu"); + this.cpu = cpu; + return this; + } + + public ProcessMetricsData withMemory(List memory) { + Utils.checkNotNull(memory, "memory"); + this.memory = Optional.ofNullable(memory); + return this; + } + + public ProcessMetricsData withMemory(Optional> memory) { + Utils.checkNotNull(memory, "memory"); + this.memory = memory; + return this; + } + + public ProcessMetricsData withRateEgress(List rateEgress) { + Utils.checkNotNull(rateEgress, "rateEgress"); + this.rateEgress = Optional.ofNullable(rateEgress); + return this; + } + + public ProcessMetricsData withRateEgress(Optional> rateEgress) { + Utils.checkNotNull(rateEgress, "rateEgress"); + this.rateEgress = rateEgress; + return this; + } + + public ProcessMetricsData withTotalEgress(List totalEgress) { + Utils.checkNotNull(totalEgress, "totalEgress"); + this.totalEgress = Optional.ofNullable(totalEgress); + return this; + } + + public ProcessMetricsData withTotalEgress(Optional> totalEgress) { + Utils.checkNotNull(totalEgress, "totalEgress"); + this.totalEgress = totalEgress; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProcessMetricsData other = (ProcessMetricsData) o; + return + Objects.deepEquals(this.activeConnections, other.activeConnections) && + Objects.deepEquals(this.cpu, other.cpu) && + Objects.deepEquals(this.memory, other.memory) && + Objects.deepEquals(this.rateEgress, other.rateEgress) && + Objects.deepEquals(this.totalEgress, other.totalEgress); + } + + @Override + public int hashCode() { + return Objects.hash( + activeConnections, + cpu, + memory, + rateEgress, + totalEgress); + } + + @Override + public String toString() { + return Utils.toString(ProcessMetricsData.class, + "activeConnections", activeConnections, + "cpu", cpu, + "memory", memory, + "rateEgress", rateEgress, + "totalEgress", totalEgress); + } + + public final static class Builder { + + private Optional> activeConnections = Optional.empty(); + + private Optional> cpu = Optional.empty(); + + private Optional> memory = Optional.empty(); + + private Optional> rateEgress = Optional.empty(); + + private Optional> totalEgress = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder activeConnections(List activeConnections) { + Utils.checkNotNull(activeConnections, "activeConnections"); + this.activeConnections = Optional.ofNullable(activeConnections); + return this; + } + + public Builder activeConnections(Optional> activeConnections) { + Utils.checkNotNull(activeConnections, "activeConnections"); + this.activeConnections = activeConnections; + return this; + } + + public Builder cpu(List cpu) { + Utils.checkNotNull(cpu, "cpu"); + this.cpu = Optional.ofNullable(cpu); + return this; + } + + public Builder cpu(Optional> cpu) { + Utils.checkNotNull(cpu, "cpu"); + this.cpu = cpu; + return this; + } + + public Builder memory(List memory) { + Utils.checkNotNull(memory, "memory"); + this.memory = Optional.ofNullable(memory); + return this; + } + + public Builder memory(Optional> memory) { + Utils.checkNotNull(memory, "memory"); + this.memory = memory; + return this; + } + + public Builder rateEgress(List rateEgress) { + Utils.checkNotNull(rateEgress, "rateEgress"); + this.rateEgress = Optional.ofNullable(rateEgress); + return this; + } + + public Builder rateEgress(Optional> rateEgress) { + Utils.checkNotNull(rateEgress, "rateEgress"); + this.rateEgress = rateEgress; + return this; + } + + public Builder totalEgress(List totalEgress) { + Utils.checkNotNull(totalEgress, "totalEgress"); + this.totalEgress = Optional.ofNullable(totalEgress); + return this; + } + + public Builder totalEgress(Optional> totalEgress) { + Utils.checkNotNull(totalEgress, "totalEgress"); + this.totalEgress = totalEgress; + return this; + } + + public ProcessMetricsData build() { + return new ProcessMetricsData( + activeConnections, + cpu, + memory, + rateEgress, + totalEgress); + } + } +} +