From 182dfe0d1783c3c435d78e652d0281832b08c45a Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Mon, 23 Jun 2025 17:11:23 +0000 Subject: [PATCH] Regenerate client from commit 75caa2e0 of spec repo --- .apigentools-info | 8 +- .generator/schemas/v2/openapi.yaml | 299 ++++++++- .../GetAppKeyRegistration.java | 25 + .../ListAppKeyRegistrations.java | 24 + .../v2/action-connection/RegisterAppKey.java | 25 + .../action-connection/UnregisterAppKey.java | 22 + .../client/v2/api/ActionConnectionApi.java | 615 +++++++++++++++++- .../api/client/v2/api/AppBuilderApi.java | 33 +- .../client/v2/api/WorkflowAutomationApi.java | 40 +- .../v2/model/AppKeyRegistrationData.java | 169 +++++ .../v2/model/AppKeyRegistrationDataType.java | 57 ++ .../model/GetAppKeyRegistrationResponse.java | 137 ++++ .../ListAppKeyRegistrationsResponse.java | 181 ++++++ .../ListAppKeyRegistrationsResponseMeta.java | 166 +++++ .../v2/model/RegisterAppKeyResponse.java | 136 ++++ ...ration_returns_Bad_request_response.freeze | 1 + ...stration_returns_Bad_request_response.json | 28 + ...stration_returns_Not_found_response.freeze | 1 + ...gistration_returns_Not_found_response.json | 28 + ...ey_Registration_returns_OK_response.freeze | 1 + ..._Key_Registration_returns_OK_response.json | 28 + ...y_Registrations_returns_OK_response.freeze | 1 + ...Key_Registrations_returns_OK_response.json | 28 + ...pp_Key_returns_Bad_request_response.freeze | 1 + ..._App_Key_returns_Bad_request_response.json | 28 + ...ew_App_Key_returns_Created_response.freeze | 1 + ..._new_App_Key_returns_Created_response.json | 28 + ...pp_Key_returns_Bad_request_response.freeze | 1 + ..._App_Key_returns_Bad_request_response.json | 28 + ..._App_Key_returns_Not_found_response.freeze | 1 + ...an_App_Key_returns_Not_found_response.json | 28 + .../client/v2/api/action_connection.feature | 68 ++ .../com/datadog/api/client/v2/api/undo.json | 24 + 33 files changed, 2206 insertions(+), 55 deletions(-) create mode 100644 examples/v2/action-connection/GetAppKeyRegistration.java create mode 100644 examples/v2/action-connection/ListAppKeyRegistrations.java create mode 100644 examples/v2/action-connection/RegisterAppKey.java create mode 100644 examples/v2/action-connection/UnregisterAppKey.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/AppKeyRegistrationData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/AppKeyRegistrationDataType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GetAppKeyRegistrationResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ListAppKeyRegistrationsResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ListAppKeyRegistrationsResponseMeta.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/RegisterAppKeyResponse.java create mode 100644 src/test/resources/cassettes/features/v2/Get_an_existing_App_Key_Registration_returns_Bad_request_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Get_an_existing_App_Key_Registration_returns_Bad_request_response.json create mode 100644 src/test/resources/cassettes/features/v2/Get_an_existing_App_Key_Registration_returns_Not_found_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Get_an_existing_App_Key_Registration_returns_Not_found_response.json create mode 100644 src/test/resources/cassettes/features/v2/Get_an_existing_App_Key_Registration_returns_OK_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Get_an_existing_App_Key_Registration_returns_OK_response.json create mode 100644 src/test/resources/cassettes/features/v2/List_App_Key_Registrations_returns_OK_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/List_App_Key_Registrations_returns_OK_response.json create mode 100644 src/test/resources/cassettes/features/v2/Register_a_new_App_Key_returns_Bad_request_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Register_a_new_App_Key_returns_Bad_request_response.json create mode 100644 src/test/resources/cassettes/features/v2/Register_a_new_App_Key_returns_Created_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Register_a_new_App_Key_returns_Created_response.json create mode 100644 src/test/resources/cassettes/features/v2/Unregister_an_App_Key_returns_Bad_request_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Unregister_an_App_Key_returns_Bad_request_response.json create mode 100644 src/test/resources/cassettes/features/v2/Unregister_an_App_Key_returns_Not_found_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Unregister_an_App_Key_returns_Not_found_response.json diff --git a/.apigentools-info b/.apigentools-info index 332d462af8d..3eb61eb3971 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2025-06-23 13:26:53.019562", - "spec_repo_commit": "2e491415" + "regenerated": "2025-06-23 17:09:19.475517", + "spec_repo_commit": "75caa2e0" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2025-06-23 13:26:53.036893", - "spec_repo_commit": "2e491415" + "regenerated": "2025-06-23 17:09:19.493264", + "spec_repo_commit": "75caa2e0" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 4c7b28f483c..fdbd7a7f5db 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -127,6 +127,13 @@ components: required: true schema: type: string + ApplicationKeyId: + description: The ID of the app key + in: path + name: app_key_id + required: true + schema: + type: string ApplicationKeyIncludeParameter: description: Resource path for related resources to include in the response. Only `owned_by` is supported. @@ -2458,6 +2465,27 @@ components: type: string x-enum-varnames: - DEPLOYMENT + AppKeyRegistrationData: + description: Data related to the app key registration. + properties: + id: + description: The app key registration identifier + format: uuid + readOnly: true + type: string + type: + $ref: '#/components/schemas/AppKeyRegistrationDataType' + required: + - type + type: object + AppKeyRegistrationDataType: + description: The definition of `AppKeyRegistrationDataType` object. + enum: + - app_key_registration + example: app_key_registration + type: string + x-enum-varnames: + - APP_KEY_REGISTRATION AppMeta: description: Metadata of an app. properties: @@ -16140,6 +16168,12 @@ components: data: $ref: '#/components/schemas/ActionConnectionData' type: object + GetAppKeyRegistrationResponse: + description: The response object after getting an app key registration. + properties: + data: + $ref: '#/components/schemas/AppKeyRegistrationData' + type: object GetAppResponse: description: The full app definition response object. properties: @@ -19918,6 +19952,32 @@ components: format: int64 type: integer type: object + ListAppKeyRegistrationsResponse: + description: A paginated list of app key registrations. + properties: + data: + description: An array of app key registrations. + items: + $ref: '#/components/schemas/AppKeyRegistrationData' + type: array + meta: + $ref: '#/components/schemas/ListAppKeyRegistrationsResponseMeta' + type: object + ListAppKeyRegistrationsResponseMeta: + description: The definition of `ListAppKeyRegistrationsResponseMeta` object. + properties: + total: + description: The total number of app key registrations. + example: 1 + format: int64 + type: integer + total_filtered: + description: The total number of app key registrations that match the specified + filters. + example: 1 + format: int64 + type: integer + type: object ListApplicationKeysResponse: description: Response for a list of application keys. properties: @@ -29555,6 +29615,12 @@ components: x-enum-varnames: - ANY - ALL + RegisterAppKeyResponse: + description: The response object after creating an app key registration. + properties: + data: + $ref: '#/components/schemas/AppKeyRegistrationData' + type: object RelationAttributes: description: Relation attributes. properties: @@ -41588,9 +41654,185 @@ info: version: '1.0' openapi: 3.0.0 paths: + /api/v2/actions/app_key_registrations: + get: + description: List App Key Registrations + operationId: ListAppKeyRegistrations + parameters: + - description: The number of App Key Registrations to return per page. + in: query + name: page[size] + required: false + schema: + format: int64 + type: integer + - description: The page number to return. + in: query + name: page[number] + required: false + schema: + format: int64 + type: integer + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ListAppKeyRegistrationsResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '429': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Too many requests + summary: List App Key Registrations + tags: + - Action Connection + x-permission: + operator: OR + permissions: + - org_app_keys_read + /api/v2/actions/app_key_registrations/{app_key_id}: + delete: + description: Unregister an App Key + operationId: UnregisterAppKey + parameters: + - $ref: '#/components/parameters/ApplicationKeyId' + responses: + '204': + description: No Content + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not found + '429': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Too many requests + summary: Unregister an App Key + tags: + - Action Connection + x-permission: + operator: OR + permissions: + - user_access_manage + - user_app_keys + - service_account_write + get: + description: Get an existing App Key Registration + operationId: GetAppKeyRegistration + parameters: + - $ref: '#/components/parameters/ApplicationKeyId' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/GetAppKeyRegistrationResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not found + '429': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Too many requests + summary: Get an existing App Key Registration + tags: + - Action Connection + x-permission: + operator: OR + permissions: + - org_app_keys_read + put: + description: Register a new App Key + operationId: RegisterAppKey + parameters: + - $ref: '#/components/parameters/ApplicationKeyId' + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/RegisterAppKeyResponse' + description: Created + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '429': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Too many requests + summary: Register a new App Key + tags: + - Action Connection + x-permission: + operator: OR + permissions: + - user_access_manage + - user_app_keys + - service_account_write /api/v2/actions/connections: post: - description: Create a new Action Connection + description: Create a new Action Connection. This API requires a [registered + application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). operationId: CreateActionConnection requestBody: content: @@ -41628,7 +41870,8 @@ paths: - Action Connection /api/v2/actions/connections/{connection_id}: delete: - description: Delete an existing Action Connection + description: Delete an existing Action Connection. This API requires a [registered + application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). operationId: DeleteActionConnection parameters: - $ref: '#/components/parameters/ConnectionId' @@ -41661,7 +41904,8 @@ paths: permissions: - connection_write get: - description: Get an existing Action Connection + description: Get an existing Action Connection. This API requires a [registered + application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). operationId: GetActionConnection parameters: - $ref: '#/components/parameters/ConnectionId' @@ -41700,7 +41944,8 @@ paths: tags: - Action Connection patch: - description: Update an existing Action Connection + description: Update an existing Action Connection. This API requires a [registered + application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). operationId: UpdateActionConnection parameters: - $ref: '#/components/parameters/ConnectionId' @@ -42730,6 +42975,7 @@ paths: /api/v2/app-builder/apps: delete: description: Delete multiple apps in a single request from a list of app IDs. + This API requires a [registered application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). operationId: DeleteApps requestBody: content: @@ -42774,7 +43020,8 @@ paths: get: description: List all apps, with optional filters and sorting. This endpoint is paginated. Only basic app information such as the app ID, name, and description - is returned by this endpoint. + is returned by this endpoint. This API requires a [registered application + key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). operationId: ListApps parameters: - description: The number of apps to return per page. @@ -42880,7 +43127,8 @@ paths: permissions: - apps_run post: - description: Create a new app, returning the app ID. + description: Create a new app, returning the app ID. This API requires a [registered + application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). operationId: CreateApp requestBody: content: @@ -42920,7 +43168,8 @@ paths: - workflows_run /api/v2/app-builder/apps/{app_id}: delete: - description: Delete a single app. + description: Delete a single app. This API requires a [registered application + key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). operationId: DeleteApp parameters: - description: The ID of the app to delete. @@ -42972,7 +43221,8 @@ paths: permissions: - apps_write get: - description: Get the full definition of an app. + description: Get the full definition of an app. This API requires a [registered + application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). operationId: GetApp parameters: - description: The ID of the app to retrieve. @@ -43035,6 +43285,7 @@ paths: - connections_read patch: description: Update an existing app. This creates a new version of the app. + This API requires a [registered application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). operationId: UpdateApp parameters: - description: The ID of the app to update. @@ -43086,7 +43337,8 @@ paths: description: Unpublish an app, removing the live version of the app. Unpublishing creates a new instance of a `deployment` object on the app, with a nil `app_version_id` (`00000000-0000-0000-0000-000000000000`). The app can still be updated and - published again in the future. + published again in the future. This API requires a [registered application + key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). operationId: UnpublishApp parameters: - description: The ID of the app to unpublish. @@ -43134,7 +43386,8 @@ paths: post: description: Publish an app for use by other users. To ensure the app is accessible to the correct users, you also need to set a [Restriction Policy](https://docs.datadoghq.com/api/latest/restriction-policies/) - on the app if a policy does not yet exist. + on the app if a policy does not yet exist. This API requires a [registered + application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). operationId: PublishApp parameters: - description: The ID of the app to publish. @@ -63060,7 +63313,7 @@ paths: /api/v2/workflows: post: description: Create a new workflow, returning the workflow ID. This API requires - an application key scoped with the `workflows_write` permission. + a [registered application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). operationId: CreateWorkflow requestBody: content: @@ -63102,8 +63355,8 @@ paths: - workflows_write /api/v2/workflows/{workflow_id}: delete: - description: Delete a workflow by ID. This API requires an application key scoped - with the `workflows_write` permission. + description: Delete a workflow by ID. This API requires a [registered application + key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). operationId: DeleteWorkflow parameters: - $ref: '#/components/parameters/WorkflowId' @@ -63136,8 +63389,8 @@ paths: permissions: - workflows_write get: - description: Get a workflow by ID. This API requires an application key scoped - with the `workflows_read` permission. + description: Get a workflow by ID. This API requires a [registered application + key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). operationId: GetWorkflow parameters: - $ref: '#/components/parameters/WorkflowId' @@ -63180,8 +63433,8 @@ paths: permissions: - workflows_read patch: - description: Update a workflow by ID. This API requires an application key scoped - with the `workflows_write` permission. + description: Update a workflow by ID. This API requires a [registered application + key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). operationId: UpdateWorkflow parameters: - $ref: '#/components/parameters/WorkflowId' @@ -63231,8 +63484,8 @@ paths: - workflows_write /api/v2/workflows/{workflow_id}/instances: get: - description: List all instances of a given workflow. This API requires an application - key scoped with the workflows_read permission. + description: List all instances of a given workflow. This API requires a [registered + application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). operationId: ListWorkflowInstances parameters: - $ref: '#/components/parameters/WorkflowId' @@ -63264,8 +63517,8 @@ paths: permissions: - workflows_read post: - description: Execute the given workflow. This API requires an application key - scoped with the workflows_run permission. + description: Execute the given workflow. This API requires a [registered application + key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). operationId: CreateWorkflowInstance parameters: - $ref: '#/components/parameters/WorkflowId' @@ -63304,7 +63557,7 @@ paths: /api/v2/workflows/{workflow_id}/instances/{instance_id}: get: description: Get a specific execution of a given workflow. This API requires - an application key scoped with the workflows_read permission. + a [registered application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). operationId: GetWorkflowInstance parameters: - $ref: '#/components/parameters/WorkflowId' @@ -63339,7 +63592,7 @@ paths: /api/v2/workflows/{workflow_id}/instances/{instance_id}/cancel: put: description: Cancels a specific execution of a given workflow. This API requires - an application key scoped with the workflows_run permission. + a [registered application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). operationId: CancelWorkflowInstance parameters: - $ref: '#/components/parameters/WorkflowId' diff --git a/examples/v2/action-connection/GetAppKeyRegistration.java b/examples/v2/action-connection/GetAppKeyRegistration.java new file mode 100644 index 00000000000..2f465438b5c --- /dev/null +++ b/examples/v2/action-connection/GetAppKeyRegistration.java @@ -0,0 +1,25 @@ +// Get an existing App Key Registration returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.ActionConnectionApi; +import com.datadog.api.client.v2.model.GetAppKeyRegistrationResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + ActionConnectionApi apiInstance = new ActionConnectionApi(defaultClient); + + try { + GetAppKeyRegistrationResponse result = + apiInstance.getAppKeyRegistration("b7feea52-994e-4714-a100-1bd9eff5aee1"); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ActionConnectionApi#getAppKeyRegistration"); + 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/v2/action-connection/ListAppKeyRegistrations.java b/examples/v2/action-connection/ListAppKeyRegistrations.java new file mode 100644 index 00000000000..be74de303f5 --- /dev/null +++ b/examples/v2/action-connection/ListAppKeyRegistrations.java @@ -0,0 +1,24 @@ +// List App Key Registrations returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.ActionConnectionApi; +import com.datadog.api.client.v2.model.ListAppKeyRegistrationsResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + ActionConnectionApi apiInstance = new ActionConnectionApi(defaultClient); + + try { + ListAppKeyRegistrationsResponse result = apiInstance.listAppKeyRegistrations(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ActionConnectionApi#listAppKeyRegistrations"); + 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/v2/action-connection/RegisterAppKey.java b/examples/v2/action-connection/RegisterAppKey.java new file mode 100644 index 00000000000..bcef9ce90a2 --- /dev/null +++ b/examples/v2/action-connection/RegisterAppKey.java @@ -0,0 +1,25 @@ +// Register a new App Key returns "Created" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.ActionConnectionApi; +import com.datadog.api.client.v2.model.RegisterAppKeyResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + ActionConnectionApi apiInstance = new ActionConnectionApi(defaultClient); + + try { + RegisterAppKeyResponse result = + apiInstance.registerAppKey("b7feea52-994e-4714-a100-1bd9eff5aee1"); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ActionConnectionApi#registerAppKey"); + 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/v2/action-connection/UnregisterAppKey.java b/examples/v2/action-connection/UnregisterAppKey.java new file mode 100644 index 00000000000..dee2787d92f --- /dev/null +++ b/examples/v2/action-connection/UnregisterAppKey.java @@ -0,0 +1,22 @@ +// Unregister an App Key returns "No Content" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.ActionConnectionApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + ActionConnectionApi apiInstance = new ActionConnectionApi(defaultClient); + + try { + apiInstance.unregisterAppKey("57cc69ae-9214-4ecc-8df8-43ecc1d92d99"); + } catch (ApiException e) { + System.err.println("Exception when calling ActionConnectionApi#unregisterAppKey"); + 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/v2/api/ActionConnectionApi.java b/src/main/java/com/datadog/api/client/v2/api/ActionConnectionApi.java index cfecde0eace..f62e28b7577 100644 --- a/src/main/java/com/datadog/api/client/v2/api/ActionConnectionApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/ActionConnectionApi.java @@ -7,12 +7,16 @@ import com.datadog.api.client.v2.model.CreateActionConnectionRequest; import com.datadog.api.client.v2.model.CreateActionConnectionResponse; import com.datadog.api.client.v2.model.GetActionConnectionResponse; +import com.datadog.api.client.v2.model.GetAppKeyRegistrationResponse; +import com.datadog.api.client.v2.model.ListAppKeyRegistrationsResponse; +import com.datadog.api.client.v2.model.RegisterAppKeyResponse; import com.datadog.api.client.v2.model.UpdateActionConnectionRequest; import com.datadog.api.client.v2.model.UpdateActionConnectionResponse; import jakarta.ws.rs.client.Invocation; import jakarta.ws.rs.core.GenericType; import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.concurrent.CompletableFuture; @@ -79,7 +83,9 @@ public CompletableFuture createActionConnectionA } /** - * Create a new Action Connection + * Create a new Action Connection. This API requires a registered + * application key. * * @param body (required) * @return ApiResponse<CreateActionConnectionResponse> @@ -211,7 +217,9 @@ public CompletableFuture deleteActionConnectionAsync(String connectionId) } /** - * Delete an existing Action Connection + * Delete an existing Action Connection. This API requires a registered + * application key. * * @param connectionId The ID of the action connection (required) * @return ApiResponse<Void> @@ -350,7 +358,9 @@ public CompletableFuture getActionConnectionAsync( } /** - * Get an existing Action Connection + * Get an existing Action Connection. This API requires a registered + * application key. * * @param connectionId The ID of the action connection (required) * @return ApiResponse<GetActionConnectionResponse> @@ -461,6 +471,601 @@ public ApiResponse getActionConnectionWithHttpInfo( new GenericType() {}); } + /** + * Get an existing App Key Registration. + * + *

See {@link #getAppKeyRegistrationWithHttpInfo}. + * + * @param appKeyId The ID of the app key (required) + * @return GetAppKeyRegistrationResponse + * @throws ApiException if fails to make API call + */ + public GetAppKeyRegistrationResponse getAppKeyRegistration(String appKeyId) throws ApiException { + return getAppKeyRegistrationWithHttpInfo(appKeyId).getData(); + } + + /** + * Get an existing App Key Registration. + * + *

See {@link #getAppKeyRegistrationWithHttpInfoAsync}. + * + * @param appKeyId The ID of the app key (required) + * @return CompletableFuture<GetAppKeyRegistrationResponse> + */ + public CompletableFuture getAppKeyRegistrationAsync( + String appKeyId) { + return getAppKeyRegistrationWithHttpInfoAsync(appKeyId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get an existing App Key Registration + * + * @param appKeyId The ID of the app key (required) + * @return ApiResponse<GetAppKeyRegistrationResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad request -
403 Forbidden -
404 Not found -
429 Too many requests -
+ */ + public ApiResponse getAppKeyRegistrationWithHttpInfo( + String appKeyId) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'appKeyId' is set + if (appKeyId == null) { + throw new ApiException( + 400, "Missing the required parameter 'appKeyId' when calling getAppKeyRegistration"); + } + // create path and map variables + String localVarPath = + "/api/v2/actions/app_key_registrations/{app_key_id}" + .replaceAll("\\{" + "app_key_id" + "\\}", apiClient.escapeString(appKeyId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.ActionConnectionApi.getAppKeyRegistration", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get an existing App Key Registration. + * + *

See {@link #getAppKeyRegistrationWithHttpInfo}. + * + * @param appKeyId The ID of the app key (required) + * @return CompletableFuture<ApiResponse<GetAppKeyRegistrationResponse>> + */ + public CompletableFuture> + getAppKeyRegistrationWithHttpInfoAsync(String appKeyId) { + Object localVarPostBody = null; + + // verify the required parameter 'appKeyId' is set + if (appKeyId == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'appKeyId' when calling getAppKeyRegistration")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/actions/app_key_registrations/{app_key_id}" + .replaceAll("\\{" + "app_key_id" + "\\}", apiClient.escapeString(appKeyId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.ActionConnectionApi.getAppKeyRegistration", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"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() {}); + } + + /** Manage optional parameters to listAppKeyRegistrations. */ + public static class ListAppKeyRegistrationsOptionalParameters { + private Long pageSize; + private Long pageNumber; + + /** + * Set pageSize. + * + * @param pageSize The number of App Key Registrations to return per page. (optional) + * @return ListAppKeyRegistrationsOptionalParameters + */ + public ListAppKeyRegistrationsOptionalParameters pageSize(Long pageSize) { + this.pageSize = pageSize; + return this; + } + + /** + * Set pageNumber. + * + * @param pageNumber The page number to return. (optional) + * @return ListAppKeyRegistrationsOptionalParameters + */ + public ListAppKeyRegistrationsOptionalParameters pageNumber(Long pageNumber) { + this.pageNumber = pageNumber; + return this; + } + } + + /** + * List App Key Registrations. + * + *

See {@link #listAppKeyRegistrationsWithHttpInfo}. + * + * @return ListAppKeyRegistrationsResponse + * @throws ApiException if fails to make API call + */ + public ListAppKeyRegistrationsResponse listAppKeyRegistrations() throws ApiException { + return listAppKeyRegistrationsWithHttpInfo(new ListAppKeyRegistrationsOptionalParameters()) + .getData(); + } + + /** + * List App Key Registrations. + * + *

See {@link #listAppKeyRegistrationsWithHttpInfoAsync}. + * + * @return CompletableFuture<ListAppKeyRegistrationsResponse> + */ + public CompletableFuture listAppKeyRegistrationsAsync() { + return listAppKeyRegistrationsWithHttpInfoAsync(new ListAppKeyRegistrationsOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List App Key Registrations. + * + *

See {@link #listAppKeyRegistrationsWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return ListAppKeyRegistrationsResponse + * @throws ApiException if fails to make API call + */ + public ListAppKeyRegistrationsResponse listAppKeyRegistrations( + ListAppKeyRegistrationsOptionalParameters parameters) throws ApiException { + return listAppKeyRegistrationsWithHttpInfo(parameters).getData(); + } + + /** + * List App Key Registrations. + * + *

See {@link #listAppKeyRegistrationsWithHttpInfoAsync}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ListAppKeyRegistrationsResponse> + */ + public CompletableFuture listAppKeyRegistrationsAsync( + ListAppKeyRegistrationsOptionalParameters parameters) { + return listAppKeyRegistrationsWithHttpInfoAsync(parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List App Key Registrations + * + * @param parameters Optional parameters for the request. + * @return ApiResponse<ListAppKeyRegistrationsResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad request -
403 Forbidden -
429 Too many requests -
+ */ + public ApiResponse listAppKeyRegistrationsWithHttpInfo( + ListAppKeyRegistrationsOptionalParameters parameters) throws ApiException { + Object localVarPostBody = null; + Long pageSize = parameters.pageSize; + Long pageNumber = parameters.pageNumber; + // create path and map variables + String localVarPath = "/api/v2/actions/app_key_registrations"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.ActionConnectionApi.listAppKeyRegistrations", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * List App Key Registrations. + * + *

See {@link #listAppKeyRegistrationsWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<ListAppKeyRegistrationsResponse>> + */ + public CompletableFuture> + listAppKeyRegistrationsWithHttpInfoAsync( + ListAppKeyRegistrationsOptionalParameters parameters) { + Object localVarPostBody = null; + Long pageSize = parameters.pageSize; + Long pageNumber = parameters.pageNumber; + // create path and map variables + String localVarPath = "/api/v2/actions/app_key_registrations"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.ActionConnectionApi.listAppKeyRegistrations", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"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() {}); + } + + /** + * Register a new App Key. + * + *

See {@link #registerAppKeyWithHttpInfo}. + * + * @param appKeyId The ID of the app key (required) + * @return RegisterAppKeyResponse + * @throws ApiException if fails to make API call + */ + public RegisterAppKeyResponse registerAppKey(String appKeyId) throws ApiException { + return registerAppKeyWithHttpInfo(appKeyId).getData(); + } + + /** + * Register a new App Key. + * + *

See {@link #registerAppKeyWithHttpInfoAsync}. + * + * @param appKeyId The ID of the app key (required) + * @return CompletableFuture<RegisterAppKeyResponse> + */ + public CompletableFuture registerAppKeyAsync(String appKeyId) { + return registerAppKeyWithHttpInfoAsync(appKeyId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Register a new App Key + * + * @param appKeyId The ID of the app key (required) + * @return ApiResponse<RegisterAppKeyResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
201 Created -
400 Bad request -
403 Forbidden -
429 Too many requests -
+ */ + public ApiResponse registerAppKeyWithHttpInfo(String appKeyId) + throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'appKeyId' is set + if (appKeyId == null) { + throw new ApiException( + 400, "Missing the required parameter 'appKeyId' when calling registerAppKey"); + } + // create path and map variables + String localVarPath = + "/api/v2/actions/app_key_registrations/{app_key_id}" + .replaceAll("\\{" + "app_key_id" + "\\}", apiClient.escapeString(appKeyId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.ActionConnectionApi.registerAppKey", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "PUT", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Register a new App Key. + * + *

See {@link #registerAppKeyWithHttpInfo}. + * + * @param appKeyId The ID of the app key (required) + * @return CompletableFuture<ApiResponse<RegisterAppKeyResponse>> + */ + public CompletableFuture> registerAppKeyWithHttpInfoAsync( + String appKeyId) { + Object localVarPostBody = null; + + // verify the required parameter 'appKeyId' is set + if (appKeyId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'appKeyId' when calling registerAppKey")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/actions/app_key_registrations/{app_key_id}" + .replaceAll("\\{" + "app_key_id" + "\\}", apiClient.escapeString(appKeyId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.ActionConnectionApi.registerAppKey", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PUT", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Unregister an App Key. + * + *

See {@link #unregisterAppKeyWithHttpInfo}. + * + * @param appKeyId The ID of the app key (required) + * @throws ApiException if fails to make API call + */ + public void unregisterAppKey(String appKeyId) throws ApiException { + unregisterAppKeyWithHttpInfo(appKeyId); + } + + /** + * Unregister an App Key. + * + *

See {@link #unregisterAppKeyWithHttpInfoAsync}. + * + * @param appKeyId The ID of the app key (required) + * @return CompletableFuture + */ + public CompletableFuture unregisterAppKeyAsync(String appKeyId) { + return unregisterAppKeyWithHttpInfoAsync(appKeyId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Unregister an App Key + * + * @param appKeyId The ID of the app key (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
204 No Content -
400 Bad request -
403 Forbidden -
404 Not found -
429 Too many requests -
+ */ + public ApiResponse unregisterAppKeyWithHttpInfo(String appKeyId) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'appKeyId' is set + if (appKeyId == null) { + throw new ApiException( + 400, "Missing the required parameter 'appKeyId' when calling unregisterAppKey"); + } + // create path and map variables + String localVarPath = + "/api/v2/actions/app_key_registrations/{app_key_id}" + .replaceAll("\\{" + "app_key_id" + "\\}", apiClient.escapeString(appKeyId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.ActionConnectionApi.unregisterAppKey", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Unregister an App Key. + * + *

See {@link #unregisterAppKeyWithHttpInfo}. + * + * @param appKeyId The ID of the app key (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> unregisterAppKeyWithHttpInfoAsync(String appKeyId) { + Object localVarPostBody = null; + + // verify the required parameter 'appKeyId' is set + if (appKeyId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'appKeyId' when calling unregisterAppKey")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/actions/app_key_registrations/{app_key_id}" + .replaceAll("\\{" + "app_key_id" + "\\}", apiClient.escapeString(appKeyId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.ActionConnectionApi.unregisterAppKey", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + /** * Update an existing Action Connection. * @@ -495,7 +1100,9 @@ public CompletableFuture updateActionConnectionA } /** - * Update an existing Action Connection + * Update an existing Action Connection. This API requires a registered + * application key. * * @param connectionId The ID of the action connection (required) * @param body Update an existing Action Connection request body (required) diff --git a/src/main/java/com/datadog/api/client/v2/api/AppBuilderApi.java b/src/main/java/com/datadog/api/client/v2/api/AppBuilderApi.java index 12c8580090c..a64b1e9bbf2 100644 --- a/src/main/java/com/datadog/api/client/v2/api/AppBuilderApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/AppBuilderApi.java @@ -86,7 +86,9 @@ public CompletableFuture createAppAsync(CreateAppRequest body } /** - * Create a new app, returning the app ID. + * Create a new app, returning the app ID. This API requires a registered + * application key. * * @param body (required) * @return ApiResponse<CreateAppResponse> @@ -215,7 +217,9 @@ public CompletableFuture deleteAppAsync(UUID appId) { } /** - * Delete a single app. + * Delete a single app. This API requires a registered + * application key. * * @param appId The ID of the app to delete. (required) * @return ApiResponse<DeleteAppResponse> @@ -348,7 +352,9 @@ public CompletableFuture deleteAppsAsync(DeleteAppsRequest b } /** - * Delete multiple apps in a single request from a list of app IDs. + * Delete multiple apps in a single request from a list of app IDs. This API requires a registered + * application key. * * @param body (required) * @return ApiResponse<DeleteAppsResponse> @@ -530,7 +536,9 @@ public CompletableFuture getAppAsync( } /** - * Get the full definition of an app. + * Get the full definition of an app. This API requires a registered + * application key. * * @param appId The ID of the app to retrieve. (required) * @param parameters Optional parameters for the request. @@ -840,7 +848,10 @@ public CompletableFuture listAppsAsync(ListAppsOptionalParamet /** * List all apps, with optional filters and sorting. This endpoint is paginated. Only basic app - * information such as the app ID, name, and description is returned by this endpoint. + * information such as the app ID, name, and description is returned by this endpoint. This API + * requires a registered + * application key. * * @param parameters Optional parameters for the request. * @return ApiResponse<ListAppsResponse> @@ -1009,7 +1020,9 @@ public CompletableFuture publishAppAsync(UUID appId) { * Publish an app for use by other users. To ensure the app is accessible to the correct users, * you also need to set a Restriction Policy on - * the app if a policy does not yet exist. + * the app if a policy does not yet exist. This API requires a registered + * application key. * * @param appId The ID of the app to publish. (required) * @return ApiResponse<PublishAppResponse> @@ -1145,7 +1158,9 @@ public CompletableFuture unpublishAppAsync(UUID appId) { * Unpublish an app, removing the live version of the app. Unpublishing creates a new instance of * a deployment object on the app, with a nil app_version_id ( * 00000000-0000-0000-0000-000000000000). The app can still be updated and published again - * in the future. + * in the future. This API requires a registered + * application key. * * @param appId The ID of the app to unpublish. (required) * @return ApiResponse<UnpublishAppResponse> @@ -1283,7 +1298,9 @@ public CompletableFuture updateAppAsync(UUID appId, UpdateApp } /** - * Update an existing app. This creates a new version of the app. + * Update an existing app. This creates a new version of the app. This API requires a registered + * application key. * * @param appId The ID of the app to update. (required) * @param body (required) diff --git a/src/main/java/com/datadog/api/client/v2/api/WorkflowAutomationApi.java b/src/main/java/com/datadog/api/client/v2/api/WorkflowAutomationApi.java index 300ffff49b5..829ae5827f1 100644 --- a/src/main/java/com/datadog/api/client/v2/api/WorkflowAutomationApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/WorkflowAutomationApi.java @@ -87,8 +87,9 @@ public CompletableFuture cancelWorkflowInstance } /** - * Cancels a specific execution of a given workflow. This API requires an application key scoped - * with the workflows_run permission. + * Cancels a specific execution of a given workflow. This API requires a registered + * application key. * * @param workflowId The ID of the workflow. (required) * @param instanceId The ID of the workflow instance. (required) @@ -252,8 +253,9 @@ public CompletableFuture createWorkflowAsync(CreateWorkf } /** - * Create a new workflow, returning the workflow ID. This API requires an application key scoped - * with the workflows_write permission. + * Create a new workflow, returning the workflow ID. This API requires a registered + * application key. * * @param body (required) * @return ApiResponse<CreateWorkflowResponse> @@ -388,8 +390,9 @@ public CompletableFuture createWorkflowInstanceA } /** - * Execute the given workflow. This API requires an application key scoped with the workflows_run - * permission. + * Execute the given workflow. This API requires a registered + * application key. * * @param workflowId The ID of the workflow. (required) * @param body (required) @@ -547,8 +550,9 @@ public CompletableFuture deleteWorkflowAsync(String workflowId) { } /** - * Delete a workflow by ID. This API requires an application key scoped with the - * workflows_write permission. + * Delete a workflow by ID. This API requires a registered + * application key. * * @param workflowId The ID of the workflow. (required) * @return ApiResponse<Void> @@ -683,8 +687,9 @@ public CompletableFuture getWorkflowAsync(String workflowId } /** - * Get a workflow by ID. This API requires an application key scoped with the workflows_read - * permission. + * Get a workflow by ID. This API requires a registered + * application key. * * @param workflowId The ID of the workflow. (required) * @return ApiResponse<GetWorkflowResponse> @@ -826,8 +831,9 @@ public CompletableFuture getWorkflowInstanceAsync( } /** - * Get a specific execution of a given workflow. This API requires an application key scoped with - * the workflows_read permission. + * Get a specific execution of a given workflow. This API requires a registered + * application key. * * @param workflowId The ID of the workflow. (required) * @param instanceId The ID of the workflow instance. (required) @@ -1056,8 +1062,9 @@ public CompletableFuture listWorkflowInstancesAsy } /** - * List all instances of a given workflow. This API requires an application key scoped with the - * workflows_read permission. + * List all instances of a given workflow. This API requires a registered + * application key. * * @param workflowId The ID of the workflow. (required) * @param parameters Optional parameters for the request. @@ -1216,8 +1223,9 @@ public CompletableFuture updateWorkflowAsync( } /** - * Update a workflow by ID. This API requires an application key scoped with the - * workflows_write permission. + * Update a workflow by ID. This API requires a registered + * application key. * * @param workflowId The ID of the workflow. (required) * @param body (required) diff --git a/src/main/java/com/datadog/api/client/v2/model/AppKeyRegistrationData.java b/src/main/java/com/datadog/api/client/v2/model/AppKeyRegistrationData.java new file mode 100644 index 00000000000..8e66400a414 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AppKeyRegistrationData.java @@ -0,0 +1,169 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.UUID; + +/** Data related to the app key registration. */ +@JsonPropertyOrder({ + AppKeyRegistrationData.JSON_PROPERTY_ID, + AppKeyRegistrationData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AppKeyRegistrationData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private UUID id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private AppKeyRegistrationDataType type; + + public AppKeyRegistrationData() {} + + @JsonCreator + public AppKeyRegistrationData( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) AppKeyRegistrationDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + } + + /** + * The app key registration identifier + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getId() { + return id; + } + + public AppKeyRegistrationData type(AppKeyRegistrationDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The definition of AppKeyRegistrationDataType object. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AppKeyRegistrationDataType getType() { + return type; + } + + public void setType(AppKeyRegistrationDataType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return AppKeyRegistrationData + */ + @JsonAnySetter + public AppKeyRegistrationData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this AppKeyRegistrationData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AppKeyRegistrationData appKeyRegistrationData = (AppKeyRegistrationData) o; + return Objects.equals(this.id, appKeyRegistrationData.id) + && Objects.equals(this.type, appKeyRegistrationData.type) + && Objects.equals(this.additionalProperties, appKeyRegistrationData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AppKeyRegistrationData {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AppKeyRegistrationDataType.java b/src/main/java/com/datadog/api/client/v2/model/AppKeyRegistrationDataType.java new file mode 100644 index 00000000000..5365635121b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AppKeyRegistrationDataType.java @@ -0,0 +1,57 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The definition of AppKeyRegistrationDataType object. */ +@JsonSerialize(using = AppKeyRegistrationDataType.AppKeyRegistrationDataTypeSerializer.class) +public class AppKeyRegistrationDataType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("app_key_registration")); + + public static final AppKeyRegistrationDataType APP_KEY_REGISTRATION = + new AppKeyRegistrationDataType("app_key_registration"); + + AppKeyRegistrationDataType(String value) { + super(value, allowedValues); + } + + public static class AppKeyRegistrationDataTypeSerializer + extends StdSerializer { + public AppKeyRegistrationDataTypeSerializer(Class t) { + super(t); + } + + public AppKeyRegistrationDataTypeSerializer() { + this(null); + } + + @Override + public void serialize( + AppKeyRegistrationDataType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static AppKeyRegistrationDataType fromValue(String value) { + return new AppKeyRegistrationDataType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GetAppKeyRegistrationResponse.java b/src/main/java/com/datadog/api/client/v2/model/GetAppKeyRegistrationResponse.java new file mode 100644 index 00000000000..3ef024a9e8d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GetAppKeyRegistrationResponse.java @@ -0,0 +1,137 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The response object after getting an app key registration. */ +@JsonPropertyOrder({GetAppKeyRegistrationResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GetAppKeyRegistrationResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private AppKeyRegistrationData data; + + public GetAppKeyRegistrationResponse data(AppKeyRegistrationData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data related to the app key registration. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AppKeyRegistrationData getData() { + return data; + } + + public void setData(AppKeyRegistrationData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return GetAppKeyRegistrationResponse + */ + @JsonAnySetter + public GetAppKeyRegistrationResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this GetAppKeyRegistrationResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAppKeyRegistrationResponse getAppKeyRegistrationResponse = (GetAppKeyRegistrationResponse) o; + return Objects.equals(this.data, getAppKeyRegistrationResponse.data) + && Objects.equals( + this.additionalProperties, getAppKeyRegistrationResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetAppKeyRegistrationResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ListAppKeyRegistrationsResponse.java b/src/main/java/com/datadog/api/client/v2/model/ListAppKeyRegistrationsResponse.java new file mode 100644 index 00000000000..9bf9b57a570 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ListAppKeyRegistrationsResponse.java @@ -0,0 +1,181 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** A paginated list of app key registrations. */ +@JsonPropertyOrder({ + ListAppKeyRegistrationsResponse.JSON_PROPERTY_DATA, + ListAppKeyRegistrationsResponse.JSON_PROPERTY_META +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ListAppKeyRegistrationsResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = null; + + public static final String JSON_PROPERTY_META = "meta"; + private ListAppKeyRegistrationsResponseMeta meta; + + public ListAppKeyRegistrationsResponse data(List data) { + this.data = data; + for (AppKeyRegistrationData item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public ListAppKeyRegistrationsResponse addDataItem(AppKeyRegistrationData dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * An array of app key registrations. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public ListAppKeyRegistrationsResponse meta(ListAppKeyRegistrationsResponseMeta meta) { + this.meta = meta; + this.unparsed |= meta.unparsed; + return this; + } + + /** + * The definition of ListAppKeyRegistrationsResponseMeta object. + * + * @return meta + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_META) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ListAppKeyRegistrationsResponseMeta getMeta() { + return meta; + } + + public void setMeta(ListAppKeyRegistrationsResponseMeta meta) { + this.meta = meta; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ListAppKeyRegistrationsResponse + */ + @JsonAnySetter + public ListAppKeyRegistrationsResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ListAppKeyRegistrationsResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListAppKeyRegistrationsResponse listAppKeyRegistrationsResponse = + (ListAppKeyRegistrationsResponse) o; + return Objects.equals(this.data, listAppKeyRegistrationsResponse.data) + && Objects.equals(this.meta, listAppKeyRegistrationsResponse.meta) + && Objects.equals( + this.additionalProperties, listAppKeyRegistrationsResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, meta, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListAppKeyRegistrationsResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" meta: ").append(toIndentedString(meta)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ListAppKeyRegistrationsResponseMeta.java b/src/main/java/com/datadog/api/client/v2/model/ListAppKeyRegistrationsResponseMeta.java new file mode 100644 index 00000000000..1a5354b8e2b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ListAppKeyRegistrationsResponseMeta.java @@ -0,0 +1,166 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The definition of ListAppKeyRegistrationsResponseMeta object. */ +@JsonPropertyOrder({ + ListAppKeyRegistrationsResponseMeta.JSON_PROPERTY_TOTAL, + ListAppKeyRegistrationsResponseMeta.JSON_PROPERTY_TOTAL_FILTERED +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ListAppKeyRegistrationsResponseMeta { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_TOTAL = "total"; + private Long total; + + public static final String JSON_PROPERTY_TOTAL_FILTERED = "total_filtered"; + private Long totalFiltered; + + public ListAppKeyRegistrationsResponseMeta total(Long total) { + this.total = total; + return this; + } + + /** + * The total number of app key registrations. + * + * @return total + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TOTAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getTotal() { + return total; + } + + public void setTotal(Long total) { + this.total = total; + } + + public ListAppKeyRegistrationsResponseMeta totalFiltered(Long totalFiltered) { + this.totalFiltered = totalFiltered; + return this; + } + + /** + * The total number of app key registrations that match the specified filters. + * + * @return totalFiltered + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TOTAL_FILTERED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getTotalFiltered() { + return totalFiltered; + } + + public void setTotalFiltered(Long totalFiltered) { + this.totalFiltered = totalFiltered; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ListAppKeyRegistrationsResponseMeta + */ + @JsonAnySetter + public ListAppKeyRegistrationsResponseMeta putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ListAppKeyRegistrationsResponseMeta object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListAppKeyRegistrationsResponseMeta listAppKeyRegistrationsResponseMeta = + (ListAppKeyRegistrationsResponseMeta) o; + return Objects.equals(this.total, listAppKeyRegistrationsResponseMeta.total) + && Objects.equals(this.totalFiltered, listAppKeyRegistrationsResponseMeta.totalFiltered) + && Objects.equals( + this.additionalProperties, listAppKeyRegistrationsResponseMeta.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(total, totalFiltered, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListAppKeyRegistrationsResponseMeta {\n"); + sb.append(" total: ").append(toIndentedString(total)).append("\n"); + sb.append(" totalFiltered: ").append(toIndentedString(totalFiltered)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RegisterAppKeyResponse.java b/src/main/java/com/datadog/api/client/v2/model/RegisterAppKeyResponse.java new file mode 100644 index 00000000000..dd7536450c6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RegisterAppKeyResponse.java @@ -0,0 +1,136 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The response object after creating an app key registration. */ +@JsonPropertyOrder({RegisterAppKeyResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RegisterAppKeyResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private AppKeyRegistrationData data; + + public RegisterAppKeyResponse data(AppKeyRegistrationData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data related to the app key registration. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AppKeyRegistrationData getData() { + return data; + } + + public void setData(AppKeyRegistrationData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return RegisterAppKeyResponse + */ + @JsonAnySetter + public RegisterAppKeyResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this RegisterAppKeyResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RegisterAppKeyResponse registerAppKeyResponse = (RegisterAppKeyResponse) o; + return Objects.equals(this.data, registerAppKeyResponse.data) + && Objects.equals(this.additionalProperties, registerAppKeyResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RegisterAppKeyResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/test/resources/cassettes/features/v2/Get_an_existing_App_Key_Registration_returns_Bad_request_response.freeze b/src/test/resources/cassettes/features/v2/Get_an_existing_App_Key_Registration_returns_Bad_request_response.freeze new file mode 100644 index 00000000000..bf4ba6bc770 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_an_existing_App_Key_Registration_returns_Bad_request_response.freeze @@ -0,0 +1 @@ +2025-06-13T17:54:59.658Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_an_existing_App_Key_Registration_returns_Bad_request_response.json b/src/test/resources/cassettes/features/v2/Get_an_existing_App_Key_Registration_returns_Bad_request_response.json new file mode 100644 index 00000000000..aed8657f551 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_an_existing_App_Key_Registration_returns_Bad_request_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/actions/app_key_registrations/not_valid_app_key_id", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"400\",\"title\":\"Invalid Parameter\",\"detail\":\"invalid parameter \\\"appKeyId\\\" in \\\"path\\\"; expected type \\\"uuid\\\"\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "7de66af1-7185-56e4-df93-dc1dc8b7f2c3" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_an_existing_App_Key_Registration_returns_Not_found_response.freeze b/src/test/resources/cassettes/features/v2/Get_an_existing_App_Key_Registration_returns_Not_found_response.freeze new file mode 100644 index 00000000000..f50611d250b --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_an_existing_App_Key_Registration_returns_Not_found_response.freeze @@ -0,0 +1 @@ +2025-06-13T18:04:07.176Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_an_existing_App_Key_Registration_returns_Not_found_response.json b/src/test/resources/cassettes/features/v2/Get_an_existing_App_Key_Registration_returns_Not_found_response.json new file mode 100644 index 00000000000..bbc0d95bd98 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_an_existing_App_Key_Registration_returns_Not_found_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/actions/app_key_registrations/aaa11111-aa11-aa11-aaaa-aaaaaa111111", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"detail\":\"app key not found\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "82c3b312-6ffe-c3b6-627d-1db15a2457e0" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_an_existing_App_Key_Registration_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Get_an_existing_App_Key_Registration_returns_OK_response.freeze new file mode 100644 index 00000000000..6a5bad178a6 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_an_existing_App_Key_Registration_returns_OK_response.freeze @@ -0,0 +1 @@ +2025-06-13T18:04:07.258Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_an_existing_App_Key_Registration_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Get_an_existing_App_Key_Registration_returns_OK_response.json new file mode 100644 index 00000000000..c408467a23f --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_an_existing_App_Key_Registration_returns_OK_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/actions/app_key_registrations/b7feea52-994e-4714-a100-1bd9eff5aee1", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"b7feea52-994e-4714-a100-1bd9eff5aee1\",\"type\":\"app_key_registration\"}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "e2cf01a0-1c97-97d3-e85d-d60a7b3e04ce" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/List_App_Key_Registrations_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/List_App_Key_Registrations_returns_OK_response.freeze new file mode 100644 index 00000000000..1ecc5c9b090 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/List_App_Key_Registrations_returns_OK_response.freeze @@ -0,0 +1 @@ +2025-06-13T18:04:07.439Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/List_App_Key_Registrations_returns_OK_response.json b/src/test/resources/cassettes/features/v2/List_App_Key_Registrations_returns_OK_response.json new file mode 100644 index 00000000000..6efdbc30f62 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/List_App_Key_Registrations_returns_OK_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/actions/app_key_registrations", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":[{\"id\":\"b7feea52-994e-4714-a100-1bd9eff5aee1\",\"type\":\"app_key_registration\"}],\"meta\":{\"total\":1,\"total_filtered\":1}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "9ac27827-afdc-3ed9-ea25-d56bd5e4fb3a" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Register_a_new_App_Key_returns_Bad_request_response.freeze b/src/test/resources/cassettes/features/v2/Register_a_new_App_Key_returns_Bad_request_response.freeze new file mode 100644 index 00000000000..aaa15730d79 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Register_a_new_App_Key_returns_Bad_request_response.freeze @@ -0,0 +1 @@ +2025-06-13T17:55:00.012Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Register_a_new_App_Key_returns_Bad_request_response.json b/src/test/resources/cassettes/features/v2/Register_a_new_App_Key_returns_Bad_request_response.json new file mode 100644 index 00000000000..b0ba9c824cb --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Register_a_new_App_Key_returns_Bad_request_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "PUT", + "path": "/api/v2/actions/app_key_registrations/not_valid_app_key_id", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"400\",\"title\":\"Invalid Parameter\",\"detail\":\"invalid parameter \\\"appKeyId\\\" in \\\"path\\\"; expected type \\\"uuid\\\"\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "7557b489-d254-1493-3645-c63e333f6998" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Register_a_new_App_Key_returns_Created_response.freeze b/src/test/resources/cassettes/features/v2/Register_a_new_App_Key_returns_Created_response.freeze new file mode 100644 index 00000000000..4b01ba1fe06 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Register_a_new_App_Key_returns_Created_response.freeze @@ -0,0 +1 @@ +2025-06-13T18:04:07.513Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Register_a_new_App_Key_returns_Created_response.json b/src/test/resources/cassettes/features/v2/Register_a_new_App_Key_returns_Created_response.json new file mode 100644 index 00000000000..4a11c0a7038 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Register_a_new_App_Key_returns_Created_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "PUT", + "path": "/api/v2/actions/app_key_registrations/b7feea52-994e-4714-a100-1bd9eff5aee1", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"b7feea52-994e-4714-a100-1bd9eff5aee1\",\"type\":\"app_key_registration\"}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "9dbd56dc-3356-1e9f-b5bc-5000bd0300ea" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Unregister_an_App_Key_returns_Bad_request_response.freeze b/src/test/resources/cassettes/features/v2/Unregister_an_App_Key_returns_Bad_request_response.freeze new file mode 100644 index 00000000000..4a543730c9d --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Unregister_an_App_Key_returns_Bad_request_response.freeze @@ -0,0 +1 @@ +2025-06-13T17:55:00.202Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Unregister_an_App_Key_returns_Bad_request_response.json b/src/test/resources/cassettes/features/v2/Unregister_an_App_Key_returns_Bad_request_response.json new file mode 100644 index 00000000000..dd1ad7fd7ae --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Unregister_an_App_Key_returns_Bad_request_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/actions/app_key_registrations/not_valid_app_key_id", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"400\",\"title\":\"Invalid Parameter\",\"detail\":\"invalid parameter \\\"appKeyId\\\" in \\\"path\\\"; expected type \\\"uuid\\\"\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "fa8b002a-48d8-a19d-81af-bdef3f1d9081" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Unregister_an_App_Key_returns_Not_found_response.freeze b/src/test/resources/cassettes/features/v2/Unregister_an_App_Key_returns_Not_found_response.freeze new file mode 100644 index 00000000000..d53b2da2cc0 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Unregister_an_App_Key_returns_Not_found_response.freeze @@ -0,0 +1 @@ +2025-06-13T18:04:07.614Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Unregister_an_App_Key_returns_Not_found_response.json b/src/test/resources/cassettes/features/v2/Unregister_an_App_Key_returns_Not_found_response.json new file mode 100644 index 00000000000..604488d195c --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Unregister_an_App_Key_returns_Not_found_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/actions/app_key_registrations/57cc69ae-9214-4ecc-8df8-43ecc1d92d99", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"detail\":\"app key not found\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "7b163b7f-bb44-7e2c-7b72-08135e7bcfad" + } +] \ No newline at end of file diff --git a/src/test/resources/com/datadog/api/client/v2/api/action_connection.feature b/src/test/resources/com/datadog/api/client/v2/api/action_connection.feature index 3189007fbcd..759615a8fd6 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/action_connection.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/action_connection.feature @@ -64,6 +64,74 @@ Feature: Action Connection When the request is sent Then the response status is 200 Successfully get Action Connection + @team:DataDog/workflow-automation-dev + Scenario: Get an existing App Key Registration returns "Bad request" response + Given new "GetAppKeyRegistration" request + And request contains "app_key_id" parameter with value "not_valid_app_key_id" + When the request is sent + Then the response status is 400 Bad request + + @team:DataDog/workflow-automation-dev + Scenario: Get an existing App Key Registration returns "Not found" response + Given new "GetAppKeyRegistration" request + And request contains "app_key_id" parameter with value "aaa11111-aa11-aa11-aaaa-aaaaaa111111" + When the request is sent + Then the response status is 404 Not found + + @team:DataDog/workflow-automation-dev + Scenario: Get an existing App Key Registration returns "OK" response + Given new "GetAppKeyRegistration" request + And request contains "app_key_id" parameter with value "b7feea52-994e-4714-a100-1bd9eff5aee1" + When the request is sent + Then the response status is 200 OK + + @skip @team:DataDog/workflow-automation-dev + Scenario: List App Key Registrations returns "Bad request" response + Given new "ListAppKeyRegistrations" request + When the request is sent + Then the response status is 400 Bad request + + @team:DataDog/workflow-automation-dev + Scenario: List App Key Registrations returns "OK" response + Given new "ListAppKeyRegistrations" request + When the request is sent + Then the response status is 200 OK + + @team:DataDog/workflow-automation-dev + Scenario: Register a new App Key returns "Bad request" response + Given new "RegisterAppKey" request + And request contains "app_key_id" parameter with value "not_valid_app_key_id" + When the request is sent + Then the response status is 400 Bad request + + @team:DataDog/workflow-automation-dev + Scenario: Register a new App Key returns "Created" response + Given new "RegisterAppKey" request + And request contains "app_key_id" parameter with value "b7feea52-994e-4714-a100-1bd9eff5aee1" + When the request is sent + Then the response status is 201 Created + + @team:DataDog/workflow-automation-dev + Scenario: Unregister an App Key returns "Bad request" response + Given new "UnregisterAppKey" request + And request contains "app_key_id" parameter with value "not_valid_app_key_id" + When the request is sent + Then the response status is 400 Bad request + + @skip @team:DataDog/workflow-automation-dev + Scenario: Unregister an App Key returns "No Content" response + Given new "UnregisterAppKey" request + And request contains "app_key_id" parameter with value "57cc69ae-9214-4ecc-8df8-43ecc1d92d99" + When the request is sent + Then the response status is 204 No Content + + @team:DataDog/workflow-automation-dev + Scenario: Unregister an App Key returns "Not found" response + Given new "UnregisterAppKey" request + And request contains "app_key_id" parameter with value "57cc69ae-9214-4ecc-8df8-43ecc1d92d99" + When the request is sent + Then the response status is 404 Not found + @team:DataDog/workflow-automation-dev Scenario: Update an existing Action Connection returns "Bad Request" response Given new "UpdateActionConnection" request diff --git a/src/test/resources/com/datadog/api/client/v2/api/undo.json b/src/test/resources/com/datadog/api/client/v2/api/undo.json index 3cc857a7365..5c77eb80f04 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/undo.json +++ b/src/test/resources/com/datadog/api/client/v2/api/undo.json @@ -1,4 +1,28 @@ { + "ListAppKeyRegistrations": { + "tag": "Action Connection", + "undo": { + "type": "safe" + } + }, + "UnregisterAppKey": { + "tag": "Action Connection", + "undo": { + "type": "idempotent" + } + }, + "GetAppKeyRegistration": { + "tag": "Action Connection", + "undo": { + "type": "safe" + } + }, + "RegisterAppKey": { + "tag": "Action Connection", + "undo": { + "type": "idempotent" + } + }, "CreateActionConnection": { "tag": "Action Connection", "undo": {