From a9bb53de577d6e91d38f97b4b9b94d9a885eec80 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Mon, 12 Jun 2023 13:41:30 +0000 Subject: [PATCH] Regenerate client from commit 2c47742f of spec repo --- .apigentools-info | 8 +- .generator/schemas/v1/openapi.yaml | 29 +++++ .../GetSyntheticsDefaultLocations.java | 24 ++++ ...tSyntheticsDefaultLocations_746853380.java | 24 ++++ .../api/client/v1/api/SyntheticsApi.java | 109 ++++++++++++++++++ ...fault_locations_returns_OK_response.freeze | 1 + ...default_locations_returns_OK_response.json | 28 +++++ .../api/client/v1/api/synthetics.feature | 12 ++ .../com/datadog/api/client/v1/api/undo.json | 6 + 9 files changed, 237 insertions(+), 4 deletions(-) create mode 100644 examples/v1/synthetics/GetSyntheticsDefaultLocations.java create mode 100644 examples/v1/synthetics/GetSyntheticsDefaultLocations_746853380.java create mode 100644 src/test/resources/cassettes/features/v1/Get_the_list_of_default_locations_returns_OK_response.freeze create mode 100644 src/test/resources/cassettes/features/v1/Get_the_list_of_default_locations_returns_OK_response.json diff --git a/.apigentools-info b/.apigentools-info index b1b9de8f4a8..7cd71585b96 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.4", - "regenerated": "2023-06-09 14:55:30.022772", - "spec_repo_commit": "b6c7aa0b" + "regenerated": "2023-06-12 13:39:58.689827", + "spec_repo_commit": "2c47742f" }, "v2": { "apigentools_version": "1.6.4", - "regenerated": "2023-06-09 14:55:30.037081", - "spec_repo_commit": "b6c7aa0b" + "regenerated": "2023-06-12 13:39:58.704985", + "spec_repo_commit": "2c47742f" } } } \ No newline at end of file diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 5948fba8976..0079ed0f37d 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -13436,6 +13436,14 @@ components: description: URL attached to the metrics. type: string type: object + SyntheticsDefaultLocations: + description: List of Synthetics default locations settings. + example: + - aws:eu-west-3 + items: + description: Name of the location. + type: string + type: array SyntheticsDeleteTestsPayload: description: 'A JSON list of the ID or IDs of the Synthetic tests that you want @@ -27640,6 +27648,27 @@ paths: tags: - Synthetics x-codegen-request-body-name: body + /api/v1/synthetics/settings/default_locations: + get: + description: Get the default locations settings. + operationId: GetSyntheticsDefaultLocations + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/SyntheticsDefaultLocations' + description: OK + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - synthetics_default_settings_read + summary: Get the default locations + tags: + - Synthetics /api/v1/synthetics/tests: get: description: Get the list of all Synthetic tests. diff --git a/examples/v1/synthetics/GetSyntheticsDefaultLocations.java b/examples/v1/synthetics/GetSyntheticsDefaultLocations.java new file mode 100644 index 00000000000..76f1ac60ba9 --- /dev/null +++ b/examples/v1/synthetics/GetSyntheticsDefaultLocations.java @@ -0,0 +1,24 @@ +// Get the default locations returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v1.api.SyntheticsApi; +import java.util.List; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + SyntheticsApi apiInstance = new SyntheticsApi(defaultClient); + + try { + List result = apiInstance.getSyntheticsDefaultLocations(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SyntheticsApi#getSyntheticsDefaultLocations"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v1/synthetics/GetSyntheticsDefaultLocations_746853380.java b/examples/v1/synthetics/GetSyntheticsDefaultLocations_746853380.java new file mode 100644 index 00000000000..e499b11ba84 --- /dev/null +++ b/examples/v1/synthetics/GetSyntheticsDefaultLocations_746853380.java @@ -0,0 +1,24 @@ +// Get the list of default locations returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v1.api.SyntheticsApi; +import java.util.List; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + SyntheticsApi apiInstance = new SyntheticsApi(defaultClient); + + try { + List result = apiInstance.getSyntheticsDefaultLocations(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SyntheticsApi#getSyntheticsDefaultLocations"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/datadog/api/client/v1/api/SyntheticsApi.java b/src/main/java/com/datadog/api/client/v1/api/SyntheticsApi.java index 494f6b0ce72..36ebcaa07a6 100644 --- a/src/main/java/com/datadog/api/client/v1/api/SyntheticsApi.java +++ b/src/main/java/com/datadog/api/client/v1/api/SyntheticsApi.java @@ -2643,6 +2643,115 @@ public ApiResponse getSyntheticsCIBatchWithHttpInfo(Stri new GenericType() {}); } + /** + * Get the default locations. + * + *

See {@link #getSyntheticsDefaultLocationsWithHttpInfo}. + * + * @return List<String> + * @throws ApiException if fails to make API call + */ + public List getSyntheticsDefaultLocations() throws ApiException { + return getSyntheticsDefaultLocationsWithHttpInfo().getData(); + } + + /** + * Get the default locations. + * + *

See {@link #getSyntheticsDefaultLocationsWithHttpInfoAsync}. + * + * @return CompletableFuture<List<String>> + */ + public CompletableFuture> getSyntheticsDefaultLocationsAsync() { + return getSyntheticsDefaultLocationsWithHttpInfoAsync() + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get the default locations settings. + * + * @return ApiResponse<List<String>> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
429 Too many requests -
+ */ + public ApiResponse> getSyntheticsDefaultLocationsWithHttpInfo() throws ApiException { + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/v1/synthetics/settings/default_locations"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v1.SyntheticsApi.getSyntheticsDefaultLocations", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType>() {}); + } + + /** + * Get the default locations. + * + *

See {@link #getSyntheticsDefaultLocationsWithHttpInfo}. + * + * @return CompletableFuture<ApiResponse<List<String>>> + */ + public CompletableFuture>> + getSyntheticsDefaultLocationsWithHttpInfoAsync() { + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/v1/synthetics/settings/default_locations"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v1.SyntheticsApi.getSyntheticsDefaultLocations", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture>> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType>() {}); + } + /** * Get a test configuration. * diff --git a/src/test/resources/cassettes/features/v1/Get_the_list_of_default_locations_returns_OK_response.freeze b/src/test/resources/cassettes/features/v1/Get_the_list_of_default_locations_returns_OK_response.freeze new file mode 100644 index 00000000000..61195b4ced2 --- /dev/null +++ b/src/test/resources/cassettes/features/v1/Get_the_list_of_default_locations_returns_OK_response.freeze @@ -0,0 +1 @@ +2023-06-08T19:13:18.175Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v1/Get_the_list_of_default_locations_returns_OK_response.json b/src/test/resources/cassettes/features/v1/Get_the_list_of_default_locations_returns_OK_response.json new file mode 100644 index 00000000000..347bd6059d9 --- /dev/null +++ b/src/test/resources/cassettes/features/v1/Get_the_list_of_default_locations_returns_OK_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v1/synthetics/settings/default_locations", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "[\"aws:af-south-1\",\"aws:ap-east-1\",\"aws:ap-northeast-1\",\"aws:ap-northeast-2\",\"aws:ap-northeast-3\",\"aws:ap-south-1\",\"aws:ap-southeast-1\",\"aws:ap-southeast-2\",\"aws:ap-southeast-3\",\"aws:ca-central-1\",\"aws:eu-central-1\",\"aws:eu-north-1\",\"aws:eu-south-1\",\"aws:eu-west-1\",\"aws:eu-west-2\",\"aws:eu-west-3\",\"aws:me-south-1\",\"aws:sa-east-1\",\"aws:us-east-1\",\"aws:us-east-2\",\"aws:us-west-1\",\"aws:us-west-2\",\"azure:eastus\",\"pl:gcp-integrations-lab-527d63de5764c9fdad65fd1a5ac64a8e\"]\n", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "b9dc107e-6281-4944-ce79-b8f4922edb4b" + } +] \ No newline at end of file diff --git a/src/test/resources/com/datadog/api/client/v1/api/synthetics.feature b/src/test/resources/com/datadog/api/client/v1/api/synthetics.feature index 2eb8926ff49..f35f990c844 100644 --- a/src/test/resources/com/datadog/api/client/v1/api/synthetics.feature +++ b/src/test/resources/com/datadog/api/client/v1/api/synthetics.feature @@ -522,6 +522,12 @@ Feature: Synthetics When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/synthetics-app + Scenario: Get the default locations returns "OK" response + Given new "GetSyntheticsDefaultLocations" request + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/synthetics-app Scenario: Get the list of all Synthetic tests returns "OK - Returns the list of all Synthetic tests." response Given new "ListTests" request @@ -534,6 +540,12 @@ Feature: Synthetics When the request is sent Then the response status is 404 Synthetic Monitoring is not activated for the user. + @team:DataDog/synthetics-app + Scenario: Get the list of default locations returns "OK" response + Given new "GetSyntheticsDefaultLocations" request + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/synthetics-app Scenario: Pause or start a test returns "- Synthetic Monitoring is not activated for the user" response Given new "UpdateTestPauseStatus" request diff --git a/src/test/resources/com/datadog/api/client/v1/api/undo.json b/src/test/resources/com/datadog/api/client/v1/api/undo.json index b5f13498dcd..3c1f3f60c07 100644 --- a/src/test/resources/com/datadog/api/client/v1/api/undo.json +++ b/src/test/resources/com/datadog/api/client/v1/api/undo.json @@ -1078,6 +1078,12 @@ "type": "idempotent" } }, + "GetSyntheticsDefaultLocations": { + "tag": "Synthetics", + "undo": { + "type": "safe" + } + }, "ListTests": { "tag": "Synthetics", "undo": {