diff --git a/.apigentools-info b/.apigentools-info index 8d14e063f8e..390afcc3b4c 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2025-01-28 14:57:27.800529", - "spec_repo_commit": "f832f43e" + "regenerated": "2025-01-28 20:05:58.369749", + "spec_repo_commit": "b1d18df4" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2025-01-28 14:57:27.815886", - "spec_repo_commit": "f832f43e" + "regenerated": "2025-01-28 20:05:58.386163", + "spec_repo_commit": "b1d18df4" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index ec0661fe202..1dba6a783f6 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -532,6 +532,20 @@ components: required: true schema: type: string + MicrosoftTeamsWorkflowsWebhookHandleIDPathParameter: + description: Your workflows webhook handle id. + in: path + name: handle_id + required: true + schema: + type: string + MicrosoftTeamsWorkflowsWebhookHandleNameQueryParameter: + description: Your workflows webhook handle name. + in: query + name: name + required: false + schema: + type: string OpsgenieServiceIDPathParameter: description: The UUID of the service. in: path @@ -18685,6 +18699,14 @@ components: required: - data type: object + MicrosoftTeamsCreateWorkflowsWebhookHandleRequest: + description: Create workflows webhook handle request. + properties: + data: + $ref: '#/components/schemas/MicrosoftTeamsWorkflowsWebhookHandleRequestData' + required: + - data + type: object MicrosoftTeamsGetChannelByNameResponse: description: Response with channel, team, and tenant ID information. properties: @@ -18899,6 +18921,127 @@ components: - type - attributes type: object + MicrosoftTeamsUpdateWorkflowsWebhookHandleRequest: + description: Update workflows webhook handle request. + properties: + data: + $ref: '#/components/schemas/MicrosoftTeamsUpdateWorkflowsWebhookHandleRequestData' + required: + - data + type: object + MicrosoftTeamsUpdateWorkflowsWebhookHandleRequestData: + description: Workflows Webhook handle data from a response. + properties: + attributes: + $ref: '#/components/schemas/MicrosoftTeamsWorkflowsWebhookHandleAttributes' + type: + $ref: '#/components/schemas/MicrosoftTeamsWorkflowsWebhookHandleType' + required: + - type + - attributes + type: object + MicrosoftTeamsWorkflowsWebhookHandleAttributes: + description: Workflows Webhook handle attributes. + properties: + name: + description: Workflows Webhook handle name. + example: fake-handle-name + maxLength: 255 + type: string + url: + description: Workflows Webhook URL. + example: https://fake.url.com + maxLength: 255 + type: string + type: object + MicrosoftTeamsWorkflowsWebhookHandleRequestAttributes: + description: Workflows Webhook handle attributes. + properties: + name: + description: Workflows Webhook handle name. + example: fake-handle-name + maxLength: 255 + type: string + url: + description: Workflows Webhook URL. + example: https://fake.url.com + maxLength: 255 + type: string + required: + - name + - url + type: object + MicrosoftTeamsWorkflowsWebhookHandleRequestData: + description: Workflows Webhook handle data from a response. + properties: + attributes: + $ref: '#/components/schemas/MicrosoftTeamsWorkflowsWebhookHandleRequestAttributes' + type: + $ref: '#/components/schemas/MicrosoftTeamsWorkflowsWebhookHandleType' + required: + - type + - attributes + type: object + MicrosoftTeamsWorkflowsWebhookHandleResponse: + description: Response of a workflows webhook handle. + properties: + data: + $ref: '#/components/schemas/MicrosoftTeamsWorkflowsWebhookHandleResponseData' + required: + - data + type: object + MicrosoftTeamsWorkflowsWebhookHandleResponseData: + description: Workflows Webhook handle data from a response. + properties: + attributes: + $ref: '#/components/schemas/MicrosoftTeamsWorkflowsWebhookResponseAttributes' + id: + description: The ID of the workflows webhook handle. + example: 596da4af-0563-4097-90ff-07230c3f9db3 + maxLength: 100 + minLength: 1 + type: string + type: + $ref: '#/components/schemas/MicrosoftTeamsWorkflowsWebhookHandleType' + type: object + MicrosoftTeamsWorkflowsWebhookHandleType: + default: workflows-webhook-handle + description: Specifies the workflows webhook handle resource type. + enum: + - workflows-webhook-handle + example: workflows-webhook-handle + type: string + x-enum-varnames: + - WORKFLOWS_WEBHOOK_HANDLE + MicrosoftTeamsWorkflowsWebhookHandlesResponse: + description: Response with a list of workflows webhook handles. + properties: + data: + description: An array of workflows webhook handles. + example: + - attributes: + name: general-handle + id: 596da4af-0563-4097-90ff-07230c3f9db3 + type: workflows-webhook-handle + - attributes: + name: general-handle-2 + id: 596da4af-0563-4097-90ff-07230c3f9db4 + type: workflows-webhook-handle + items: + $ref: '#/components/schemas/MicrosoftTeamsWorkflowsWebhookHandleResponseData' + type: array + required: + - data + type: object + MicrosoftTeamsWorkflowsWebhookResponseAttributes: + description: Workflows Webhook handle attributes. + properties: + name: + description: Workflows Webhook handle name. + example: fake-handle-name + maxLength: 255 + type: string + type: object MonitorConfigPolicyAttributeCreateRequest: description: Policy and policy type for a monitor configuration policy. properties: @@ -37543,6 +37686,150 @@ paths: tags: - Microsoft Teams Integration x-codegen-request-body-name: body + /api/v2/integration/ms-teams/configuration/workflows-webhook-handles: + get: + description: Get a list of all workflows webhook handles from the Datadog Microsoft + Teams integration. + operationId: ListWorkflowsWebhookHandles + parameters: + - $ref: '#/components/parameters/MicrosoftTeamsWorkflowsWebhookHandleNameQueryParameter' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/MicrosoftTeamsWorkflowsWebhookHandlesResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '412': + $ref: '#/components/responses/PreconditionFailedResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Get all workflows webhook handles + tags: + - Microsoft Teams Integration + post: + description: Create a workflows webhook handle in the Datadog Microsoft Teams + integration. + operationId: CreateWorkflowsWebhookHandle + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MicrosoftTeamsCreateWorkflowsWebhookHandleRequest' + description: Workflows Webhook handle payload. + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/MicrosoftTeamsWorkflowsWebhookHandleResponse' + description: CREATED + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '409': + $ref: '#/components/responses/ConflictResponse' + '412': + $ref: '#/components/responses/PreconditionFailedResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Create workflows webhook handle + tags: + - Microsoft Teams Integration + x-codegen-request-body-name: body + /api/v2/integration/ms-teams/configuration/workflows-webhook-handles/{handle_id}: + delete: + description: Delete a workflows webhook handle from the Datadog Microsoft Teams + integration. + operationId: DeleteWorkflowsWebhookHandle + parameters: + - $ref: '#/components/parameters/MicrosoftTeamsWorkflowsWebhookHandleIDPathParameter' + responses: + '204': + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '412': + $ref: '#/components/responses/PreconditionFailedResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Delete workflows webhook handle + tags: + - Microsoft Teams Integration + get: + description: Get the name of a workflows webhook handle from the Datadog Microsoft + Teams integration. + operationId: GetWorkflowsWebhookHandle + parameters: + - $ref: '#/components/parameters/MicrosoftTeamsWorkflowsWebhookHandleIDPathParameter' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/MicrosoftTeamsWorkflowsWebhookHandleResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '412': + $ref: '#/components/responses/PreconditionFailedResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Get workflows webhook handle information + tags: + - Microsoft Teams Integration + patch: + description: Update a workflows webhook handle from the Datadog Microsoft Teams + integration. + operationId: UpdateWorkflowsWebhookHandle + parameters: + - $ref: '#/components/parameters/MicrosoftTeamsWorkflowsWebhookHandleIDPathParameter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MicrosoftTeamsUpdateWorkflowsWebhookHandleRequest' + description: Workflows Webhook handle payload. + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/MicrosoftTeamsWorkflowsWebhookHandleResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '409': + $ref: '#/components/responses/ConflictResponse' + '412': + $ref: '#/components/responses/PreconditionFailedResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Update workflows webhook handle + tags: + - Microsoft Teams Integration + x-codegen-request-body-name: body /api/v2/integration/opsgenie/services: get: description: Get a list of all services from the Datadog Opsgenie integration. diff --git a/examples/v2/microsoft-teams-integration/CreateWorkflowsWebhookHandle.java b/examples/v2/microsoft-teams-integration/CreateWorkflowsWebhookHandle.java new file mode 100644 index 00000000000..36d4b3815d5 --- /dev/null +++ b/examples/v2/microsoft-teams-integration/CreateWorkflowsWebhookHandle.java @@ -0,0 +1,40 @@ +// Create workflows webhook handle returns "CREATED" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.MicrosoftTeamsIntegrationApi; +import com.datadog.api.client.v2.model.MicrosoftTeamsCreateWorkflowsWebhookHandleRequest; +import com.datadog.api.client.v2.model.MicrosoftTeamsWorkflowsWebhookHandleRequestAttributes; +import com.datadog.api.client.v2.model.MicrosoftTeamsWorkflowsWebhookHandleRequestData; +import com.datadog.api.client.v2.model.MicrosoftTeamsWorkflowsWebhookHandleResponse; +import com.datadog.api.client.v2.model.MicrosoftTeamsWorkflowsWebhookHandleType; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + MicrosoftTeamsIntegrationApi apiInstance = new MicrosoftTeamsIntegrationApi(defaultClient); + + MicrosoftTeamsCreateWorkflowsWebhookHandleRequest body = + new MicrosoftTeamsCreateWorkflowsWebhookHandleRequest() + .data( + new MicrosoftTeamsWorkflowsWebhookHandleRequestData() + .attributes( + new MicrosoftTeamsWorkflowsWebhookHandleRequestAttributes() + .name("fake-handle-name") + .url("https://fake.url.com")) + .type(MicrosoftTeamsWorkflowsWebhookHandleType.WORKFLOWS_WEBHOOK_HANDLE)); + + try { + MicrosoftTeamsWorkflowsWebhookHandleResponse result = + apiInstance.createWorkflowsWebhookHandle(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling MicrosoftTeamsIntegrationApi#createWorkflowsWebhookHandle"); + 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/microsoft-teams-integration/CreateWorkflowsWebhookHandle_1716851881.java b/examples/v2/microsoft-teams-integration/CreateWorkflowsWebhookHandle_1716851881.java new file mode 100644 index 00000000000..7b15b51ece3 --- /dev/null +++ b/examples/v2/microsoft-teams-integration/CreateWorkflowsWebhookHandle_1716851881.java @@ -0,0 +1,40 @@ +// Create workflow webhook handle returns "CREATED" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.MicrosoftTeamsIntegrationApi; +import com.datadog.api.client.v2.model.MicrosoftTeamsCreateWorkflowsWebhookHandleRequest; +import com.datadog.api.client.v2.model.MicrosoftTeamsWorkflowsWebhookHandleRequestAttributes; +import com.datadog.api.client.v2.model.MicrosoftTeamsWorkflowsWebhookHandleRequestData; +import com.datadog.api.client.v2.model.MicrosoftTeamsWorkflowsWebhookHandleResponse; +import com.datadog.api.client.v2.model.MicrosoftTeamsWorkflowsWebhookHandleType; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + MicrosoftTeamsIntegrationApi apiInstance = new MicrosoftTeamsIntegrationApi(defaultClient); + + MicrosoftTeamsCreateWorkflowsWebhookHandleRequest body = + new MicrosoftTeamsCreateWorkflowsWebhookHandleRequest() + .data( + new MicrosoftTeamsWorkflowsWebhookHandleRequestData() + .attributes( + new MicrosoftTeamsWorkflowsWebhookHandleRequestAttributes() + .name("Example-Microsoft-Teams-Integration") + .url("https://fake.url.com")) + .type(MicrosoftTeamsWorkflowsWebhookHandleType.WORKFLOWS_WEBHOOK_HANDLE)); + + try { + MicrosoftTeamsWorkflowsWebhookHandleResponse result = + apiInstance.createWorkflowsWebhookHandle(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling MicrosoftTeamsIntegrationApi#createWorkflowsWebhookHandle"); + 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/microsoft-teams-integration/DeleteWorkflowsWebhookHandle.java b/examples/v2/microsoft-teams-integration/DeleteWorkflowsWebhookHandle.java new file mode 100644 index 00000000000..e2ba7cf2c2b --- /dev/null +++ b/examples/v2/microsoft-teams-integration/DeleteWorkflowsWebhookHandle.java @@ -0,0 +1,23 @@ +// Delete workflows webhook handle returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.MicrosoftTeamsIntegrationApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + MicrosoftTeamsIntegrationApi apiInstance = new MicrosoftTeamsIntegrationApi(defaultClient); + + try { + apiInstance.deleteWorkflowsWebhookHandle("handle_id"); + } catch (ApiException e) { + System.err.println( + "Exception when calling MicrosoftTeamsIntegrationApi#deleteWorkflowsWebhookHandle"); + 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/microsoft-teams-integration/DeleteWorkflowsWebhookHandle_107549514.java b/examples/v2/microsoft-teams-integration/DeleteWorkflowsWebhookHandle_107549514.java new file mode 100644 index 00000000000..c7cb90b9c1f --- /dev/null +++ b/examples/v2/microsoft-teams-integration/DeleteWorkflowsWebhookHandle_107549514.java @@ -0,0 +1,26 @@ +// Delete workflow webhook handle returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.MicrosoftTeamsIntegrationApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + MicrosoftTeamsIntegrationApi apiInstance = new MicrosoftTeamsIntegrationApi(defaultClient); + + // there is a valid "workflows_webhook_handle" in the system + String WORKFLOWS_WEBHOOK_HANDLE_DATA_ID = System.getenv("WORKFLOWS_WEBHOOK_HANDLE_DATA_ID"); + + try { + apiInstance.deleteWorkflowsWebhookHandle(WORKFLOWS_WEBHOOK_HANDLE_DATA_ID); + } catch (ApiException e) { + System.err.println( + "Exception when calling MicrosoftTeamsIntegrationApi#deleteWorkflowsWebhookHandle"); + 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/microsoft-teams-integration/GetWorkflowsWebhookHandle.java b/examples/v2/microsoft-teams-integration/GetWorkflowsWebhookHandle.java new file mode 100644 index 00000000000..71ef5d497f8 --- /dev/null +++ b/examples/v2/microsoft-teams-integration/GetWorkflowsWebhookHandle.java @@ -0,0 +1,26 @@ +// Get workflows webhook handle information returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.MicrosoftTeamsIntegrationApi; +import com.datadog.api.client.v2.model.MicrosoftTeamsWorkflowsWebhookHandleResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + MicrosoftTeamsIntegrationApi apiInstance = new MicrosoftTeamsIntegrationApi(defaultClient); + + try { + MicrosoftTeamsWorkflowsWebhookHandleResponse result = + apiInstance.getWorkflowsWebhookHandle("handle_id"); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling MicrosoftTeamsIntegrationApi#getWorkflowsWebhookHandle"); + 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/microsoft-teams-integration/GetWorkflowsWebhookHandle_3421443805.java b/examples/v2/microsoft-teams-integration/GetWorkflowsWebhookHandle_3421443805.java new file mode 100644 index 00000000000..8c53974d433 --- /dev/null +++ b/examples/v2/microsoft-teams-integration/GetWorkflowsWebhookHandle_3421443805.java @@ -0,0 +1,29 @@ +// Get workflow webhook handle information returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.MicrosoftTeamsIntegrationApi; +import com.datadog.api.client.v2.model.MicrosoftTeamsWorkflowsWebhookHandleResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + MicrosoftTeamsIntegrationApi apiInstance = new MicrosoftTeamsIntegrationApi(defaultClient); + + // there is a valid "workflows_webhook_handle" in the system + String WORKFLOWS_WEBHOOK_HANDLE_DATA_ID = System.getenv("WORKFLOWS_WEBHOOK_HANDLE_DATA_ID"); + + try { + MicrosoftTeamsWorkflowsWebhookHandleResponse result = + apiInstance.getWorkflowsWebhookHandle(WORKFLOWS_WEBHOOK_HANDLE_DATA_ID); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling MicrosoftTeamsIntegrationApi#getWorkflowsWebhookHandle"); + 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/microsoft-teams-integration/ListWorkflowsWebhookHandles.java b/examples/v2/microsoft-teams-integration/ListWorkflowsWebhookHandles.java new file mode 100644 index 00000000000..94161d48db9 --- /dev/null +++ b/examples/v2/microsoft-teams-integration/ListWorkflowsWebhookHandles.java @@ -0,0 +1,26 @@ +// Get all workflows webhook handles returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.MicrosoftTeamsIntegrationApi; +import com.datadog.api.client.v2.model.MicrosoftTeamsWorkflowsWebhookHandlesResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + MicrosoftTeamsIntegrationApi apiInstance = new MicrosoftTeamsIntegrationApi(defaultClient); + + try { + MicrosoftTeamsWorkflowsWebhookHandlesResponse result = + apiInstance.listWorkflowsWebhookHandles(); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling MicrosoftTeamsIntegrationApi#listWorkflowsWebhookHandles"); + 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/microsoft-teams-integration/ListWorkflowsWebhookHandles_620762083.java b/examples/v2/microsoft-teams-integration/ListWorkflowsWebhookHandles_620762083.java new file mode 100644 index 00000000000..29925f50a9e --- /dev/null +++ b/examples/v2/microsoft-teams-integration/ListWorkflowsWebhookHandles_620762083.java @@ -0,0 +1,26 @@ +// Get all workflow webhook handles returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.MicrosoftTeamsIntegrationApi; +import com.datadog.api.client.v2.model.MicrosoftTeamsWorkflowsWebhookHandlesResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + MicrosoftTeamsIntegrationApi apiInstance = new MicrosoftTeamsIntegrationApi(defaultClient); + + try { + MicrosoftTeamsWorkflowsWebhookHandlesResponse result = + apiInstance.listWorkflowsWebhookHandles(); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling MicrosoftTeamsIntegrationApi#listWorkflowsWebhookHandles"); + 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/microsoft-teams-integration/UpdateWorkflowsWebhookHandle.java b/examples/v2/microsoft-teams-integration/UpdateWorkflowsWebhookHandle.java new file mode 100644 index 00000000000..67eb07b7ab6 --- /dev/null +++ b/examples/v2/microsoft-teams-integration/UpdateWorkflowsWebhookHandle.java @@ -0,0 +1,40 @@ +// Update workflows webhook handle returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.MicrosoftTeamsIntegrationApi; +import com.datadog.api.client.v2.model.MicrosoftTeamsUpdateWorkflowsWebhookHandleRequest; +import com.datadog.api.client.v2.model.MicrosoftTeamsUpdateWorkflowsWebhookHandleRequestData; +import com.datadog.api.client.v2.model.MicrosoftTeamsWorkflowsWebhookHandleAttributes; +import com.datadog.api.client.v2.model.MicrosoftTeamsWorkflowsWebhookHandleResponse; +import com.datadog.api.client.v2.model.MicrosoftTeamsWorkflowsWebhookHandleType; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + MicrosoftTeamsIntegrationApi apiInstance = new MicrosoftTeamsIntegrationApi(defaultClient); + + MicrosoftTeamsUpdateWorkflowsWebhookHandleRequest body = + new MicrosoftTeamsUpdateWorkflowsWebhookHandleRequest() + .data( + new MicrosoftTeamsUpdateWorkflowsWebhookHandleRequestData() + .attributes( + new MicrosoftTeamsWorkflowsWebhookHandleAttributes() + .name("fake-handle-name") + .url("https://fake.url.com")) + .type(MicrosoftTeamsWorkflowsWebhookHandleType.WORKFLOWS_WEBHOOK_HANDLE)); + + try { + MicrosoftTeamsWorkflowsWebhookHandleResponse result = + apiInstance.updateWorkflowsWebhookHandle("handle_id", body); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling MicrosoftTeamsIntegrationApi#updateWorkflowsWebhookHandle"); + 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/microsoft-teams-integration/UpdateWorkflowsWebhookHandle_163189594.java b/examples/v2/microsoft-teams-integration/UpdateWorkflowsWebhookHandle_163189594.java new file mode 100644 index 00000000000..42345613141 --- /dev/null +++ b/examples/v2/microsoft-teams-integration/UpdateWorkflowsWebhookHandle_163189594.java @@ -0,0 +1,44 @@ +// Update workflow webhook handle returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.MicrosoftTeamsIntegrationApi; +import com.datadog.api.client.v2.model.MicrosoftTeamsUpdateWorkflowsWebhookHandleRequest; +import com.datadog.api.client.v2.model.MicrosoftTeamsUpdateWorkflowsWebhookHandleRequestData; +import com.datadog.api.client.v2.model.MicrosoftTeamsWorkflowsWebhookHandleAttributes; +import com.datadog.api.client.v2.model.MicrosoftTeamsWorkflowsWebhookHandleResponse; +import com.datadog.api.client.v2.model.MicrosoftTeamsWorkflowsWebhookHandleType; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + MicrosoftTeamsIntegrationApi apiInstance = new MicrosoftTeamsIntegrationApi(defaultClient); + + // there is a valid "workflows_webhook_handle" in the system + String WORKFLOWS_WEBHOOK_HANDLE_DATA_ATTRIBUTES_NAME = + System.getenv("WORKFLOWS_WEBHOOK_HANDLE_DATA_ATTRIBUTES_NAME"); + String WORKFLOWS_WEBHOOK_HANDLE_DATA_ID = System.getenv("WORKFLOWS_WEBHOOK_HANDLE_DATA_ID"); + + MicrosoftTeamsUpdateWorkflowsWebhookHandleRequest body = + new MicrosoftTeamsUpdateWorkflowsWebhookHandleRequest() + .data( + new MicrosoftTeamsUpdateWorkflowsWebhookHandleRequestData() + .attributes( + new MicrosoftTeamsWorkflowsWebhookHandleAttributes() + .name("fake-handle-name--updated")) + .type(MicrosoftTeamsWorkflowsWebhookHandleType.WORKFLOWS_WEBHOOK_HANDLE)); + + try { + MicrosoftTeamsWorkflowsWebhookHandleResponse result = + apiInstance.updateWorkflowsWebhookHandle(WORKFLOWS_WEBHOOK_HANDLE_DATA_ID, body); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling MicrosoftTeamsIntegrationApi#updateWorkflowsWebhookHandle"); + 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/MicrosoftTeamsIntegrationApi.java b/src/main/java/com/datadog/api/client/v2/api/MicrosoftTeamsIntegrationApi.java index 825ac8fe990..6aca81ff1d6 100644 --- a/src/main/java/com/datadog/api/client/v2/api/MicrosoftTeamsIntegrationApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/MicrosoftTeamsIntegrationApi.java @@ -5,10 +5,14 @@ import com.datadog.api.client.ApiResponse; import com.datadog.api.client.Pair; import com.datadog.api.client.v2.model.MicrosoftTeamsCreateTenantBasedHandleRequest; +import com.datadog.api.client.v2.model.MicrosoftTeamsCreateWorkflowsWebhookHandleRequest; import com.datadog.api.client.v2.model.MicrosoftTeamsGetChannelByNameResponse; import com.datadog.api.client.v2.model.MicrosoftTeamsTenantBasedHandleResponse; import com.datadog.api.client.v2.model.MicrosoftTeamsTenantBasedHandlesResponse; import com.datadog.api.client.v2.model.MicrosoftTeamsUpdateTenantBasedHandleRequest; +import com.datadog.api.client.v2.model.MicrosoftTeamsUpdateWorkflowsWebhookHandleRequest; +import com.datadog.api.client.v2.model.MicrosoftTeamsWorkflowsWebhookHandleResponse; +import com.datadog.api.client.v2.model.MicrosoftTeamsWorkflowsWebhookHandlesResponse; import jakarta.ws.rs.client.Invocation; import jakarta.ws.rs.core.GenericType; import java.util.ArrayList; @@ -186,6 +190,148 @@ public ApiResponse createTenantBasedHan new GenericType() {}); } + /** + * Create workflows webhook handle. + * + *

See {@link #createWorkflowsWebhookHandleWithHttpInfo}. + * + * @param body Workflows Webhook handle payload. (required) + * @return MicrosoftTeamsWorkflowsWebhookHandleResponse + * @throws ApiException if fails to make API call + */ + public MicrosoftTeamsWorkflowsWebhookHandleResponse createWorkflowsWebhookHandle( + MicrosoftTeamsCreateWorkflowsWebhookHandleRequest body) throws ApiException { + return createWorkflowsWebhookHandleWithHttpInfo(body).getData(); + } + + /** + * Create workflows webhook handle. + * + *

See {@link #createWorkflowsWebhookHandleWithHttpInfoAsync}. + * + * @param body Workflows Webhook handle payload. (required) + * @return CompletableFuture<MicrosoftTeamsWorkflowsWebhookHandleResponse> + */ + public CompletableFuture + createWorkflowsWebhookHandleAsync(MicrosoftTeamsCreateWorkflowsWebhookHandleRequest body) { + return createWorkflowsWebhookHandleWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Create a workflows webhook handle in the Datadog Microsoft Teams integration. + * + * @param body Workflows Webhook handle payload. (required) + * @return ApiResponse<MicrosoftTeamsWorkflowsWebhookHandleResponse> + * @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 -
404 Not Found -
409 Conflict -
412 Failed Precondition -
429 Too many requests -
+ */ + public ApiResponse + createWorkflowsWebhookHandleWithHttpInfo( + MicrosoftTeamsCreateWorkflowsWebhookHandleRequest body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling createWorkflowsWebhookHandle"); + } + // create path and map variables + String localVarPath = "/api/v2/integration/ms-teams/configuration/workflows-webhook-handles"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.MicrosoftTeamsIntegrationApi.createWorkflowsWebhookHandle", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Create workflows webhook handle. + * + *

See {@link #createWorkflowsWebhookHandleWithHttpInfo}. + * + * @param body Workflows Webhook handle payload. (required) + * @return + * CompletableFuture<ApiResponse<MicrosoftTeamsWorkflowsWebhookHandleResponse>> + */ + public CompletableFuture> + createWorkflowsWebhookHandleWithHttpInfoAsync( + MicrosoftTeamsCreateWorkflowsWebhookHandleRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'body' when calling createWorkflowsWebhookHandle")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/integration/ms-teams/configuration/workflows-webhook-handles"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.MicrosoftTeamsIntegrationApi.createWorkflowsWebhookHandle", + 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( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + /** * Delete tenant-based handle. * @@ -322,6 +468,144 @@ public CompletableFuture> deleteTenantBasedHandleWithHttpInfoA null); } + /** + * Delete workflows webhook handle. + * + *

See {@link #deleteWorkflowsWebhookHandleWithHttpInfo}. + * + * @param handleId Your workflows webhook handle id. (required) + * @throws ApiException if fails to make API call + */ + public void deleteWorkflowsWebhookHandle(String handleId) throws ApiException { + deleteWorkflowsWebhookHandleWithHttpInfo(handleId); + } + + /** + * Delete workflows webhook handle. + * + *

See {@link #deleteWorkflowsWebhookHandleWithHttpInfoAsync}. + * + * @param handleId Your workflows webhook handle id. (required) + * @return CompletableFuture + */ + public CompletableFuture deleteWorkflowsWebhookHandleAsync(String handleId) { + return deleteWorkflowsWebhookHandleWithHttpInfoAsync(handleId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Delete a workflows webhook handle from the Datadog Microsoft Teams integration. + * + * @param handleId Your workflows webhook handle id. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
204 OK -
400 Bad Request -
403 Forbidden -
412 Failed Precondition -
429 Too many requests -
+ */ + public ApiResponse deleteWorkflowsWebhookHandleWithHttpInfo(String handleId) + throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'handleId' is set + if (handleId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'handleId' when calling deleteWorkflowsWebhookHandle"); + } + // create path and map variables + String localVarPath = + "/api/v2/integration/ms-teams/configuration/workflows-webhook-handles/{handle_id}" + .replaceAll("\\{" + "handle_id" + "\\}", apiClient.escapeString(handleId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.MicrosoftTeamsIntegrationApi.deleteWorkflowsWebhookHandle", + 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); + } + + /** + * Delete workflows webhook handle. + * + *

See {@link #deleteWorkflowsWebhookHandleWithHttpInfo}. + * + * @param handleId Your workflows webhook handle id. (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> deleteWorkflowsWebhookHandleWithHttpInfoAsync( + String handleId) { + Object localVarPostBody = null; + + // verify the required parameter 'handleId' is set + if (handleId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'handleId' when calling" + + " deleteWorkflowsWebhookHandle")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/integration/ms-teams/configuration/workflows-webhook-handles/{handle_id}" + .replaceAll("\\{" + "handle_id" + "\\}", apiClient.escapeString(handleId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.MicrosoftTeamsIntegrationApi.deleteWorkflowsWebhookHandle", + 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); + } + /** * Get channel information by name. * @@ -652,55 +936,198 @@ public ApiResponse getTenantBasedHandle new GenericType() {}); } - /** Manage optional parameters to listTenantBasedHandles. */ - public static class ListTenantBasedHandlesOptionalParameters { - private String tenantId; - private String name; - - /** - * Set tenantId. - * - * @param tenantId Your tenant id. (optional) - * @return ListTenantBasedHandlesOptionalParameters - */ - public ListTenantBasedHandlesOptionalParameters tenantId(String tenantId) { - this.tenantId = tenantId; - return this; - } - - /** - * Set name. - * - * @param name Your tenant-based handle name. (optional) - * @return ListTenantBasedHandlesOptionalParameters - */ - public ListTenantBasedHandlesOptionalParameters name(String name) { - this.name = name; - return this; - } - } - /** - * Get all tenant-based handles. + * Get workflows webhook handle information. * - *

See {@link #listTenantBasedHandlesWithHttpInfo}. + *

See {@link #getWorkflowsWebhookHandleWithHttpInfo}. * - * @return MicrosoftTeamsTenantBasedHandlesResponse + * @param handleId Your workflows webhook handle id. (required) + * @return MicrosoftTeamsWorkflowsWebhookHandleResponse * @throws ApiException if fails to make API call */ - public MicrosoftTeamsTenantBasedHandlesResponse listTenantBasedHandles() throws ApiException { - return listTenantBasedHandlesWithHttpInfo(new ListTenantBasedHandlesOptionalParameters()) - .getData(); + public MicrosoftTeamsWorkflowsWebhookHandleResponse getWorkflowsWebhookHandle(String handleId) + throws ApiException { + return getWorkflowsWebhookHandleWithHttpInfo(handleId).getData(); } /** - * Get all tenant-based handles. + * Get workflows webhook handle information. * - *

See {@link #listTenantBasedHandlesWithHttpInfoAsync}. + *

See {@link #getWorkflowsWebhookHandleWithHttpInfoAsync}. * - * @return CompletableFuture<MicrosoftTeamsTenantBasedHandlesResponse> + * @param handleId Your workflows webhook handle id. (required) + * @return CompletableFuture<MicrosoftTeamsWorkflowsWebhookHandleResponse> */ - public CompletableFuture listTenantBasedHandlesAsync() { + public CompletableFuture + getWorkflowsWebhookHandleAsync(String handleId) { + return getWorkflowsWebhookHandleWithHttpInfoAsync(handleId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get the name of a workflows webhook handle from the Datadog Microsoft Teams integration. + * + * @param handleId Your workflows webhook handle id. (required) + * @return ApiResponse<MicrosoftTeamsWorkflowsWebhookHandleResponse> + * @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 -
412 Failed Precondition -
429 Too many requests -
+ */ + public ApiResponse + getWorkflowsWebhookHandleWithHttpInfo(String handleId) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'handleId' is set + if (handleId == null) { + throw new ApiException( + 400, "Missing the required parameter 'handleId' when calling getWorkflowsWebhookHandle"); + } + // create path and map variables + String localVarPath = + "/api/v2/integration/ms-teams/configuration/workflows-webhook-handles/{handle_id}" + .replaceAll("\\{" + "handle_id" + "\\}", apiClient.escapeString(handleId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.MicrosoftTeamsIntegrationApi.getWorkflowsWebhookHandle", + 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 workflows webhook handle information. + * + *

See {@link #getWorkflowsWebhookHandleWithHttpInfo}. + * + * @param handleId Your workflows webhook handle id. (required) + * @return + * CompletableFuture<ApiResponse<MicrosoftTeamsWorkflowsWebhookHandleResponse>> + */ + public CompletableFuture> + getWorkflowsWebhookHandleWithHttpInfoAsync(String handleId) { + Object localVarPostBody = null; + + // verify the required parameter 'handleId' is set + if (handleId == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'handleId' when calling getWorkflowsWebhookHandle")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/integration/ms-teams/configuration/workflows-webhook-handles/{handle_id}" + .replaceAll("\\{" + "handle_id" + "\\}", apiClient.escapeString(handleId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.MicrosoftTeamsIntegrationApi.getWorkflowsWebhookHandle", + 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 listTenantBasedHandles. */ + public static class ListTenantBasedHandlesOptionalParameters { + private String tenantId; + private String name; + + /** + * Set tenantId. + * + * @param tenantId Your tenant id. (optional) + * @return ListTenantBasedHandlesOptionalParameters + */ + public ListTenantBasedHandlesOptionalParameters tenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Set name. + * + * @param name Your tenant-based handle name. (optional) + * @return ListTenantBasedHandlesOptionalParameters + */ + public ListTenantBasedHandlesOptionalParameters name(String name) { + this.name = name; + return this; + } + } + + /** + * Get all tenant-based handles. + * + *

See {@link #listTenantBasedHandlesWithHttpInfo}. + * + * @return MicrosoftTeamsTenantBasedHandlesResponse + * @throws ApiException if fails to make API call + */ + public MicrosoftTeamsTenantBasedHandlesResponse listTenantBasedHandles() throws ApiException { + return listTenantBasedHandlesWithHttpInfo(new ListTenantBasedHandlesOptionalParameters()) + .getData(); + } + + /** + * Get all tenant-based handles. + * + *

See {@link #listTenantBasedHandlesWithHttpInfoAsync}. + * + * @return CompletableFuture<MicrosoftTeamsTenantBasedHandlesResponse> + */ + public CompletableFuture listTenantBasedHandlesAsync() { return listTenantBasedHandlesWithHttpInfoAsync(new ListTenantBasedHandlesOptionalParameters()) .thenApply( response -> { @@ -841,6 +1268,186 @@ public ApiResponse listTenantBasedHand new GenericType() {}); } + /** Manage optional parameters to listWorkflowsWebhookHandles. */ + public static class ListWorkflowsWebhookHandlesOptionalParameters { + private String name; + + /** + * Set name. + * + * @param name Your workflows webhook handle name. (optional) + * @return ListWorkflowsWebhookHandlesOptionalParameters + */ + public ListWorkflowsWebhookHandlesOptionalParameters name(String name) { + this.name = name; + return this; + } + } + + /** + * Get all workflows webhook handles. + * + *

See {@link #listWorkflowsWebhookHandlesWithHttpInfo}. + * + * @return MicrosoftTeamsWorkflowsWebhookHandlesResponse + * @throws ApiException if fails to make API call + */ + public MicrosoftTeamsWorkflowsWebhookHandlesResponse listWorkflowsWebhookHandles() + throws ApiException { + return listWorkflowsWebhookHandlesWithHttpInfo( + new ListWorkflowsWebhookHandlesOptionalParameters()) + .getData(); + } + + /** + * Get all workflows webhook handles. + * + *

See {@link #listWorkflowsWebhookHandlesWithHttpInfoAsync}. + * + * @return CompletableFuture<MicrosoftTeamsWorkflowsWebhookHandlesResponse> + */ + public CompletableFuture + listWorkflowsWebhookHandlesAsync() { + return listWorkflowsWebhookHandlesWithHttpInfoAsync( + new ListWorkflowsWebhookHandlesOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get all workflows webhook handles. + * + *

See {@link #listWorkflowsWebhookHandlesWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return MicrosoftTeamsWorkflowsWebhookHandlesResponse + * @throws ApiException if fails to make API call + */ + public MicrosoftTeamsWorkflowsWebhookHandlesResponse listWorkflowsWebhookHandles( + ListWorkflowsWebhookHandlesOptionalParameters parameters) throws ApiException { + return listWorkflowsWebhookHandlesWithHttpInfo(parameters).getData(); + } + + /** + * Get all workflows webhook handles. + * + *

See {@link #listWorkflowsWebhookHandlesWithHttpInfoAsync}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<MicrosoftTeamsWorkflowsWebhookHandlesResponse> + */ + public CompletableFuture + listWorkflowsWebhookHandlesAsync(ListWorkflowsWebhookHandlesOptionalParameters parameters) { + return listWorkflowsWebhookHandlesWithHttpInfoAsync(parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get a list of all workflows webhook handles from the Datadog Microsoft Teams integration. + * + * @param parameters Optional parameters for the request. + * @return ApiResponse<MicrosoftTeamsWorkflowsWebhookHandlesResponse> + * @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 -
412 Failed Precondition -
429 Too many requests -
+ */ + public ApiResponse + listWorkflowsWebhookHandlesWithHttpInfo( + ListWorkflowsWebhookHandlesOptionalParameters parameters) throws ApiException { + Object localVarPostBody = null; + String name = parameters.name; + // create path and map variables + String localVarPath = "/api/v2/integration/ms-teams/configuration/workflows-webhook-handles"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "name", name)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.MicrosoftTeamsIntegrationApi.listWorkflowsWebhookHandles", + 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() {}); + } + + /** + * Get all workflows webhook handles. + * + *

See {@link #listWorkflowsWebhookHandlesWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return + * CompletableFuture<ApiResponse<MicrosoftTeamsWorkflowsWebhookHandlesResponse>> + */ + public CompletableFuture> + listWorkflowsWebhookHandlesWithHttpInfoAsync( + ListWorkflowsWebhookHandlesOptionalParameters parameters) { + Object localVarPostBody = null; + String name = parameters.name; + // create path and map variables + String localVarPath = "/api/v2/integration/ms-teams/configuration/workflows-webhook-handles"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "name", name)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.MicrosoftTeamsIntegrationApi.listWorkflowsWebhookHandles", + 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() {}); + } + /** * Update tenant-based handle. * @@ -1004,4 +1611,175 @@ public ApiResponse updateTenantBasedHan false, new GenericType() {}); } + + /** + * Update workflows webhook handle. + * + *

See {@link #updateWorkflowsWebhookHandleWithHttpInfo}. + * + * @param handleId Your workflows webhook handle id. (required) + * @param body Workflows Webhook handle payload. (required) + * @return MicrosoftTeamsWorkflowsWebhookHandleResponse + * @throws ApiException if fails to make API call + */ + public MicrosoftTeamsWorkflowsWebhookHandleResponse updateWorkflowsWebhookHandle( + String handleId, MicrosoftTeamsUpdateWorkflowsWebhookHandleRequest body) throws ApiException { + return updateWorkflowsWebhookHandleWithHttpInfo(handleId, body).getData(); + } + + /** + * Update workflows webhook handle. + * + *

See {@link #updateWorkflowsWebhookHandleWithHttpInfoAsync}. + * + * @param handleId Your workflows webhook handle id. (required) + * @param body Workflows Webhook handle payload. (required) + * @return CompletableFuture<MicrosoftTeamsWorkflowsWebhookHandleResponse> + */ + public CompletableFuture + updateWorkflowsWebhookHandleAsync( + String handleId, MicrosoftTeamsUpdateWorkflowsWebhookHandleRequest body) { + return updateWorkflowsWebhookHandleWithHttpInfoAsync(handleId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Update a workflows webhook handle from the Datadog Microsoft Teams integration. + * + * @param handleId Your workflows webhook handle id. (required) + * @param body Workflows Webhook handle payload. (required) + * @return ApiResponse<MicrosoftTeamsWorkflowsWebhookHandleResponse> + * @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 -
409 Conflict -
412 Failed Precondition -
429 Too many requests -
+ */ + public ApiResponse + updateWorkflowsWebhookHandleWithHttpInfo( + String handleId, MicrosoftTeamsUpdateWorkflowsWebhookHandleRequest body) + throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'handleId' is set + if (handleId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'handleId' when calling updateWorkflowsWebhookHandle"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling updateWorkflowsWebhookHandle"); + } + // create path and map variables + String localVarPath = + "/api/v2/integration/ms-teams/configuration/workflows-webhook-handles/{handle_id}" + .replaceAll("\\{" + "handle_id" + "\\}", apiClient.escapeString(handleId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.MicrosoftTeamsIntegrationApi.updateWorkflowsWebhookHandle", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update workflows webhook handle. + * + *

See {@link #updateWorkflowsWebhookHandleWithHttpInfo}. + * + * @param handleId Your workflows webhook handle id. (required) + * @param body Workflows Webhook handle payload. (required) + * @return + * CompletableFuture<ApiResponse<MicrosoftTeamsWorkflowsWebhookHandleResponse>> + */ + public CompletableFuture> + updateWorkflowsWebhookHandleWithHttpInfoAsync( + String handleId, MicrosoftTeamsUpdateWorkflowsWebhookHandleRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'handleId' is set + if (handleId == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'handleId' when calling" + + " updateWorkflowsWebhookHandle")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'body' when calling updateWorkflowsWebhookHandle")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/integration/ms-teams/configuration/workflows-webhook-handles/{handle_id}" + .replaceAll("\\{" + "handle_id" + "\\}", apiClient.escapeString(handleId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.MicrosoftTeamsIntegrationApi.updateWorkflowsWebhookHandle", + 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( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } } diff --git a/src/main/java/com/datadog/api/client/v2/model/MicrosoftTeamsCreateWorkflowsWebhookHandleRequest.java b/src/main/java/com/datadog/api/client/v2/model/MicrosoftTeamsCreateWorkflowsWebhookHandleRequest.java new file mode 100644 index 00000000000..994abe25874 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/MicrosoftTeamsCreateWorkflowsWebhookHandleRequest.java @@ -0,0 +1,152 @@ +/* + * 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; + +/** Create workflows webhook handle request. */ +@JsonPropertyOrder({MicrosoftTeamsCreateWorkflowsWebhookHandleRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class MicrosoftTeamsCreateWorkflowsWebhookHandleRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private MicrosoftTeamsWorkflowsWebhookHandleRequestData data; + + public MicrosoftTeamsCreateWorkflowsWebhookHandleRequest() {} + + @JsonCreator + public MicrosoftTeamsCreateWorkflowsWebhookHandleRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + MicrosoftTeamsWorkflowsWebhookHandleRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public MicrosoftTeamsCreateWorkflowsWebhookHandleRequest data( + MicrosoftTeamsWorkflowsWebhookHandleRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Workflows Webhook handle data from a response. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public MicrosoftTeamsWorkflowsWebhookHandleRequestData getData() { + return data; + } + + public void setData(MicrosoftTeamsWorkflowsWebhookHandleRequestData 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 MicrosoftTeamsCreateWorkflowsWebhookHandleRequest + */ + @JsonAnySetter + public MicrosoftTeamsCreateWorkflowsWebhookHandleRequest 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 MicrosoftTeamsCreateWorkflowsWebhookHandleRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MicrosoftTeamsCreateWorkflowsWebhookHandleRequest + microsoftTeamsCreateWorkflowsWebhookHandleRequest = + (MicrosoftTeamsCreateWorkflowsWebhookHandleRequest) o; + return Objects.equals(this.data, microsoftTeamsCreateWorkflowsWebhookHandleRequest.data) + && Objects.equals( + this.additionalProperties, + microsoftTeamsCreateWorkflowsWebhookHandleRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MicrosoftTeamsCreateWorkflowsWebhookHandleRequest {\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/MicrosoftTeamsUpdateWorkflowsWebhookHandleRequest.java b/src/main/java/com/datadog/api/client/v2/model/MicrosoftTeamsUpdateWorkflowsWebhookHandleRequest.java new file mode 100644 index 00000000000..f1e5028864e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/MicrosoftTeamsUpdateWorkflowsWebhookHandleRequest.java @@ -0,0 +1,152 @@ +/* + * 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; + +/** Update workflows webhook handle request. */ +@JsonPropertyOrder({MicrosoftTeamsUpdateWorkflowsWebhookHandleRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class MicrosoftTeamsUpdateWorkflowsWebhookHandleRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private MicrosoftTeamsUpdateWorkflowsWebhookHandleRequestData data; + + public MicrosoftTeamsUpdateWorkflowsWebhookHandleRequest() {} + + @JsonCreator + public MicrosoftTeamsUpdateWorkflowsWebhookHandleRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + MicrosoftTeamsUpdateWorkflowsWebhookHandleRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public MicrosoftTeamsUpdateWorkflowsWebhookHandleRequest data( + MicrosoftTeamsUpdateWorkflowsWebhookHandleRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Workflows Webhook handle data from a response. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public MicrosoftTeamsUpdateWorkflowsWebhookHandleRequestData getData() { + return data; + } + + public void setData(MicrosoftTeamsUpdateWorkflowsWebhookHandleRequestData 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 MicrosoftTeamsUpdateWorkflowsWebhookHandleRequest + */ + @JsonAnySetter + public MicrosoftTeamsUpdateWorkflowsWebhookHandleRequest 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 MicrosoftTeamsUpdateWorkflowsWebhookHandleRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MicrosoftTeamsUpdateWorkflowsWebhookHandleRequest + microsoftTeamsUpdateWorkflowsWebhookHandleRequest = + (MicrosoftTeamsUpdateWorkflowsWebhookHandleRequest) o; + return Objects.equals(this.data, microsoftTeamsUpdateWorkflowsWebhookHandleRequest.data) + && Objects.equals( + this.additionalProperties, + microsoftTeamsUpdateWorkflowsWebhookHandleRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MicrosoftTeamsUpdateWorkflowsWebhookHandleRequest {\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/MicrosoftTeamsUpdateWorkflowsWebhookHandleRequestData.java b/src/main/java/com/datadog/api/client/v2/model/MicrosoftTeamsUpdateWorkflowsWebhookHandleRequestData.java new file mode 100644 index 00000000000..949928f0431 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/MicrosoftTeamsUpdateWorkflowsWebhookHandleRequestData.java @@ -0,0 +1,193 @@ +/* + * 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; + +/** Workflows Webhook handle data from a response. */ +@JsonPropertyOrder({ + MicrosoftTeamsUpdateWorkflowsWebhookHandleRequestData.JSON_PROPERTY_ATTRIBUTES, + MicrosoftTeamsUpdateWorkflowsWebhookHandleRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class MicrosoftTeamsUpdateWorkflowsWebhookHandleRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private MicrosoftTeamsWorkflowsWebhookHandleAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private MicrosoftTeamsWorkflowsWebhookHandleType type = + MicrosoftTeamsWorkflowsWebhookHandleType.WORKFLOWS_WEBHOOK_HANDLE; + + public MicrosoftTeamsUpdateWorkflowsWebhookHandleRequestData() {} + + @JsonCreator + public MicrosoftTeamsUpdateWorkflowsWebhookHandleRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + MicrosoftTeamsWorkflowsWebhookHandleAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + MicrosoftTeamsWorkflowsWebhookHandleType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public MicrosoftTeamsUpdateWorkflowsWebhookHandleRequestData attributes( + MicrosoftTeamsWorkflowsWebhookHandleAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Workflows Webhook handle attributes. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public MicrosoftTeamsWorkflowsWebhookHandleAttributes getAttributes() { + return attributes; + } + + public void setAttributes(MicrosoftTeamsWorkflowsWebhookHandleAttributes attributes) { + this.attributes = attributes; + } + + public MicrosoftTeamsUpdateWorkflowsWebhookHandleRequestData type( + MicrosoftTeamsWorkflowsWebhookHandleType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Specifies the workflows webhook handle resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public MicrosoftTeamsWorkflowsWebhookHandleType getType() { + return type; + } + + public void setType(MicrosoftTeamsWorkflowsWebhookHandleType 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 MicrosoftTeamsUpdateWorkflowsWebhookHandleRequestData + */ + @JsonAnySetter + public MicrosoftTeamsUpdateWorkflowsWebhookHandleRequestData 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 MicrosoftTeamsUpdateWorkflowsWebhookHandleRequestData object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MicrosoftTeamsUpdateWorkflowsWebhookHandleRequestData + microsoftTeamsUpdateWorkflowsWebhookHandleRequestData = + (MicrosoftTeamsUpdateWorkflowsWebhookHandleRequestData) o; + return Objects.equals( + this.attributes, microsoftTeamsUpdateWorkflowsWebhookHandleRequestData.attributes) + && Objects.equals(this.type, microsoftTeamsUpdateWorkflowsWebhookHandleRequestData.type) + && Objects.equals( + this.additionalProperties, + microsoftTeamsUpdateWorkflowsWebhookHandleRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MicrosoftTeamsUpdateWorkflowsWebhookHandleRequestData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).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/MicrosoftTeamsWorkflowsWebhookHandleAttributes.java b/src/main/java/com/datadog/api/client/v2/model/MicrosoftTeamsWorkflowsWebhookHandleAttributes.java new file mode 100644 index 00000000000..bd9ee9973d5 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/MicrosoftTeamsWorkflowsWebhookHandleAttributes.java @@ -0,0 +1,168 @@ +/* + * 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; + +/** Workflows Webhook handle attributes. */ +@JsonPropertyOrder({ + MicrosoftTeamsWorkflowsWebhookHandleAttributes.JSON_PROPERTY_NAME, + MicrosoftTeamsWorkflowsWebhookHandleAttributes.JSON_PROPERTY_URL +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class MicrosoftTeamsWorkflowsWebhookHandleAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_URL = "url"; + private String url; + + public MicrosoftTeamsWorkflowsWebhookHandleAttributes name(String name) { + this.name = name; + return this; + } + + /** + * Workflows Webhook handle name. + * + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public MicrosoftTeamsWorkflowsWebhookHandleAttributes url(String url) { + this.url = url; + return this; + } + + /** + * Workflows Webhook URL. + * + * @return url + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + /** + * 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 MicrosoftTeamsWorkflowsWebhookHandleAttributes + */ + @JsonAnySetter + public MicrosoftTeamsWorkflowsWebhookHandleAttributes 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 MicrosoftTeamsWorkflowsWebhookHandleAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MicrosoftTeamsWorkflowsWebhookHandleAttributes microsoftTeamsWorkflowsWebhookHandleAttributes = + (MicrosoftTeamsWorkflowsWebhookHandleAttributes) o; + return Objects.equals(this.name, microsoftTeamsWorkflowsWebhookHandleAttributes.name) + && Objects.equals(this.url, microsoftTeamsWorkflowsWebhookHandleAttributes.url) + && Objects.equals( + this.additionalProperties, + microsoftTeamsWorkflowsWebhookHandleAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, url, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MicrosoftTeamsWorkflowsWebhookHandleAttributes {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).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/MicrosoftTeamsWorkflowsWebhookHandleRequestAttributes.java b/src/main/java/com/datadog/api/client/v2/model/MicrosoftTeamsWorkflowsWebhookHandleRequestAttributes.java new file mode 100644 index 00000000000..bde33dfe001 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/MicrosoftTeamsWorkflowsWebhookHandleRequestAttributes.java @@ -0,0 +1,180 @@ +/* + * 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; + +/** Workflows Webhook handle attributes. */ +@JsonPropertyOrder({ + MicrosoftTeamsWorkflowsWebhookHandleRequestAttributes.JSON_PROPERTY_NAME, + MicrosoftTeamsWorkflowsWebhookHandleRequestAttributes.JSON_PROPERTY_URL +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class MicrosoftTeamsWorkflowsWebhookHandleRequestAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_URL = "url"; + private String url; + + public MicrosoftTeamsWorkflowsWebhookHandleRequestAttributes() {} + + @JsonCreator + public MicrosoftTeamsWorkflowsWebhookHandleRequestAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_URL) String url) { + this.name = name; + this.url = url; + } + + public MicrosoftTeamsWorkflowsWebhookHandleRequestAttributes name(String name) { + this.name = name; + return this; + } + + /** + * Workflows Webhook handle name. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public MicrosoftTeamsWorkflowsWebhookHandleRequestAttributes url(String url) { + this.url = url; + return this; + } + + /** + * Workflows Webhook URL. + * + * @return url + */ + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + /** + * 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 MicrosoftTeamsWorkflowsWebhookHandleRequestAttributes + */ + @JsonAnySetter + public MicrosoftTeamsWorkflowsWebhookHandleRequestAttributes 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 MicrosoftTeamsWorkflowsWebhookHandleRequestAttributes object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MicrosoftTeamsWorkflowsWebhookHandleRequestAttributes + microsoftTeamsWorkflowsWebhookHandleRequestAttributes = + (MicrosoftTeamsWorkflowsWebhookHandleRequestAttributes) o; + return Objects.equals(this.name, microsoftTeamsWorkflowsWebhookHandleRequestAttributes.name) + && Objects.equals(this.url, microsoftTeamsWorkflowsWebhookHandleRequestAttributes.url) + && Objects.equals( + this.additionalProperties, + microsoftTeamsWorkflowsWebhookHandleRequestAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, url, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MicrosoftTeamsWorkflowsWebhookHandleRequestAttributes {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).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/MicrosoftTeamsWorkflowsWebhookHandleRequestData.java b/src/main/java/com/datadog/api/client/v2/model/MicrosoftTeamsWorkflowsWebhookHandleRequestData.java new file mode 100644 index 00000000000..9b98fee1c67 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/MicrosoftTeamsWorkflowsWebhookHandleRequestData.java @@ -0,0 +1,191 @@ +/* + * 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; + +/** Workflows Webhook handle data from a response. */ +@JsonPropertyOrder({ + MicrosoftTeamsWorkflowsWebhookHandleRequestData.JSON_PROPERTY_ATTRIBUTES, + MicrosoftTeamsWorkflowsWebhookHandleRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class MicrosoftTeamsWorkflowsWebhookHandleRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private MicrosoftTeamsWorkflowsWebhookHandleRequestAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private MicrosoftTeamsWorkflowsWebhookHandleType type = + MicrosoftTeamsWorkflowsWebhookHandleType.WORKFLOWS_WEBHOOK_HANDLE; + + public MicrosoftTeamsWorkflowsWebhookHandleRequestData() {} + + @JsonCreator + public MicrosoftTeamsWorkflowsWebhookHandleRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + MicrosoftTeamsWorkflowsWebhookHandleRequestAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + MicrosoftTeamsWorkflowsWebhookHandleType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public MicrosoftTeamsWorkflowsWebhookHandleRequestData attributes( + MicrosoftTeamsWorkflowsWebhookHandleRequestAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Workflows Webhook handle attributes. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public MicrosoftTeamsWorkflowsWebhookHandleRequestAttributes getAttributes() { + return attributes; + } + + public void setAttributes(MicrosoftTeamsWorkflowsWebhookHandleRequestAttributes attributes) { + this.attributes = attributes; + } + + public MicrosoftTeamsWorkflowsWebhookHandleRequestData type( + MicrosoftTeamsWorkflowsWebhookHandleType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Specifies the workflows webhook handle resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public MicrosoftTeamsWorkflowsWebhookHandleType getType() { + return type; + } + + public void setType(MicrosoftTeamsWorkflowsWebhookHandleType 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 MicrosoftTeamsWorkflowsWebhookHandleRequestData + */ + @JsonAnySetter + public MicrosoftTeamsWorkflowsWebhookHandleRequestData 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 MicrosoftTeamsWorkflowsWebhookHandleRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MicrosoftTeamsWorkflowsWebhookHandleRequestData + microsoftTeamsWorkflowsWebhookHandleRequestData = + (MicrosoftTeamsWorkflowsWebhookHandleRequestData) o; + return Objects.equals( + this.attributes, microsoftTeamsWorkflowsWebhookHandleRequestData.attributes) + && Objects.equals(this.type, microsoftTeamsWorkflowsWebhookHandleRequestData.type) + && Objects.equals( + this.additionalProperties, + microsoftTeamsWorkflowsWebhookHandleRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MicrosoftTeamsWorkflowsWebhookHandleRequestData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).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/MicrosoftTeamsWorkflowsWebhookHandleResponse.java b/src/main/java/com/datadog/api/client/v2/model/MicrosoftTeamsWorkflowsWebhookHandleResponse.java new file mode 100644 index 00000000000..f6b186de177 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/MicrosoftTeamsWorkflowsWebhookHandleResponse.java @@ -0,0 +1,151 @@ +/* + * 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; + +/** Response of a workflows webhook handle. */ +@JsonPropertyOrder({MicrosoftTeamsWorkflowsWebhookHandleResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class MicrosoftTeamsWorkflowsWebhookHandleResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private MicrosoftTeamsWorkflowsWebhookHandleResponseData data; + + public MicrosoftTeamsWorkflowsWebhookHandleResponse() {} + + @JsonCreator + public MicrosoftTeamsWorkflowsWebhookHandleResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + MicrosoftTeamsWorkflowsWebhookHandleResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public MicrosoftTeamsWorkflowsWebhookHandleResponse data( + MicrosoftTeamsWorkflowsWebhookHandleResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Workflows Webhook handle data from a response. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public MicrosoftTeamsWorkflowsWebhookHandleResponseData getData() { + return data; + } + + public void setData(MicrosoftTeamsWorkflowsWebhookHandleResponseData 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 MicrosoftTeamsWorkflowsWebhookHandleResponse + */ + @JsonAnySetter + public MicrosoftTeamsWorkflowsWebhookHandleResponse 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 MicrosoftTeamsWorkflowsWebhookHandleResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MicrosoftTeamsWorkflowsWebhookHandleResponse microsoftTeamsWorkflowsWebhookHandleResponse = + (MicrosoftTeamsWorkflowsWebhookHandleResponse) o; + return Objects.equals(this.data, microsoftTeamsWorkflowsWebhookHandleResponse.data) + && Objects.equals( + this.additionalProperties, + microsoftTeamsWorkflowsWebhookHandleResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MicrosoftTeamsWorkflowsWebhookHandleResponse {\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/MicrosoftTeamsWorkflowsWebhookHandleResponseData.java b/src/main/java/com/datadog/api/client/v2/model/MicrosoftTeamsWorkflowsWebhookHandleResponseData.java new file mode 100644 index 00000000000..70fbcc0a64f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/MicrosoftTeamsWorkflowsWebhookHandleResponseData.java @@ -0,0 +1,205 @@ +/* + * 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; + +/** Workflows Webhook handle data from a response. */ +@JsonPropertyOrder({ + MicrosoftTeamsWorkflowsWebhookHandleResponseData.JSON_PROPERTY_ATTRIBUTES, + MicrosoftTeamsWorkflowsWebhookHandleResponseData.JSON_PROPERTY_ID, + MicrosoftTeamsWorkflowsWebhookHandleResponseData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class MicrosoftTeamsWorkflowsWebhookHandleResponseData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private MicrosoftTeamsWorkflowsWebhookResponseAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private MicrosoftTeamsWorkflowsWebhookHandleType type = + MicrosoftTeamsWorkflowsWebhookHandleType.WORKFLOWS_WEBHOOK_HANDLE; + + public MicrosoftTeamsWorkflowsWebhookHandleResponseData attributes( + MicrosoftTeamsWorkflowsWebhookResponseAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Workflows Webhook handle attributes. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public MicrosoftTeamsWorkflowsWebhookResponseAttributes getAttributes() { + return attributes; + } + + public void setAttributes(MicrosoftTeamsWorkflowsWebhookResponseAttributes attributes) { + this.attributes = attributes; + } + + public MicrosoftTeamsWorkflowsWebhookHandleResponseData id(String id) { + this.id = id; + return this; + } + + /** + * The ID of the workflows webhook handle. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public MicrosoftTeamsWorkflowsWebhookHandleResponseData type( + MicrosoftTeamsWorkflowsWebhookHandleType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Specifies the workflows webhook handle resource type. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public MicrosoftTeamsWorkflowsWebhookHandleType getType() { + return type; + } + + public void setType(MicrosoftTeamsWorkflowsWebhookHandleType 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 MicrosoftTeamsWorkflowsWebhookHandleResponseData + */ + @JsonAnySetter + public MicrosoftTeamsWorkflowsWebhookHandleResponseData 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 MicrosoftTeamsWorkflowsWebhookHandleResponseData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MicrosoftTeamsWorkflowsWebhookHandleResponseData + microsoftTeamsWorkflowsWebhookHandleResponseData = + (MicrosoftTeamsWorkflowsWebhookHandleResponseData) o; + return Objects.equals( + this.attributes, microsoftTeamsWorkflowsWebhookHandleResponseData.attributes) + && Objects.equals(this.id, microsoftTeamsWorkflowsWebhookHandleResponseData.id) + && Objects.equals(this.type, microsoftTeamsWorkflowsWebhookHandleResponseData.type) + && Objects.equals( + this.additionalProperties, + microsoftTeamsWorkflowsWebhookHandleResponseData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MicrosoftTeamsWorkflowsWebhookHandleResponseData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\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/MicrosoftTeamsWorkflowsWebhookHandleType.java b/src/main/java/com/datadog/api/client/v2/model/MicrosoftTeamsWorkflowsWebhookHandleType.java new file mode 100644 index 00000000000..1a8e53fe08f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/MicrosoftTeamsWorkflowsWebhookHandleType.java @@ -0,0 +1,63 @@ +/* + * 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; + +/** Specifies the workflows webhook handle resource type. */ +@JsonSerialize( + using = + MicrosoftTeamsWorkflowsWebhookHandleType.MicrosoftTeamsWorkflowsWebhookHandleTypeSerializer + .class) +public class MicrosoftTeamsWorkflowsWebhookHandleType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("workflows-webhook-handle")); + + public static final MicrosoftTeamsWorkflowsWebhookHandleType WORKFLOWS_WEBHOOK_HANDLE = + new MicrosoftTeamsWorkflowsWebhookHandleType("workflows-webhook-handle"); + + MicrosoftTeamsWorkflowsWebhookHandleType(String value) { + super(value, allowedValues); + } + + public static class MicrosoftTeamsWorkflowsWebhookHandleTypeSerializer + extends StdSerializer { + public MicrosoftTeamsWorkflowsWebhookHandleTypeSerializer( + Class t) { + super(t); + } + + public MicrosoftTeamsWorkflowsWebhookHandleTypeSerializer() { + this(null); + } + + @Override + public void serialize( + MicrosoftTeamsWorkflowsWebhookHandleType value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static MicrosoftTeamsWorkflowsWebhookHandleType fromValue(String value) { + return new MicrosoftTeamsWorkflowsWebhookHandleType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/MicrosoftTeamsWorkflowsWebhookHandlesResponse.java b/src/main/java/com/datadog/api/client/v2/model/MicrosoftTeamsWorkflowsWebhookHandlesResponse.java new file mode 100644 index 00000000000..ae2ae488cc1 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/MicrosoftTeamsWorkflowsWebhookHandlesResponse.java @@ -0,0 +1,161 @@ +/* + * 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.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Response with a list of workflows webhook handles. */ +@JsonPropertyOrder({MicrosoftTeamsWorkflowsWebhookHandlesResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class MicrosoftTeamsWorkflowsWebhookHandlesResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public MicrosoftTeamsWorkflowsWebhookHandlesResponse() {} + + @JsonCreator + public MicrosoftTeamsWorkflowsWebhookHandlesResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + List data) { + this.data = data; + } + + public MicrosoftTeamsWorkflowsWebhookHandlesResponse data( + List data) { + this.data = data; + for (MicrosoftTeamsWorkflowsWebhookHandleResponseData item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public MicrosoftTeamsWorkflowsWebhookHandlesResponse addDataItem( + MicrosoftTeamsWorkflowsWebhookHandleResponseData dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * An array of workflows webhook handles. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List 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 MicrosoftTeamsWorkflowsWebhookHandlesResponse + */ + @JsonAnySetter + public MicrosoftTeamsWorkflowsWebhookHandlesResponse 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 MicrosoftTeamsWorkflowsWebhookHandlesResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MicrosoftTeamsWorkflowsWebhookHandlesResponse microsoftTeamsWorkflowsWebhookHandlesResponse = + (MicrosoftTeamsWorkflowsWebhookHandlesResponse) o; + return Objects.equals(this.data, microsoftTeamsWorkflowsWebhookHandlesResponse.data) + && Objects.equals( + this.additionalProperties, + microsoftTeamsWorkflowsWebhookHandlesResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MicrosoftTeamsWorkflowsWebhookHandlesResponse {\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/MicrosoftTeamsWorkflowsWebhookResponseAttributes.java b/src/main/java/com/datadog/api/client/v2/model/MicrosoftTeamsWorkflowsWebhookResponseAttributes.java new file mode 100644 index 00000000000..6bfd1cf5faf --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/MicrosoftTeamsWorkflowsWebhookResponseAttributes.java @@ -0,0 +1,140 @@ +/* + * 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; + +/** Workflows Webhook handle attributes. */ +@JsonPropertyOrder({MicrosoftTeamsWorkflowsWebhookResponseAttributes.JSON_PROPERTY_NAME}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class MicrosoftTeamsWorkflowsWebhookResponseAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public MicrosoftTeamsWorkflowsWebhookResponseAttributes name(String name) { + this.name = name; + return this; + } + + /** + * Workflows Webhook handle name. + * + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + /** + * 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 MicrosoftTeamsWorkflowsWebhookResponseAttributes + */ + @JsonAnySetter + public MicrosoftTeamsWorkflowsWebhookResponseAttributes 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 MicrosoftTeamsWorkflowsWebhookResponseAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MicrosoftTeamsWorkflowsWebhookResponseAttributes + microsoftTeamsWorkflowsWebhookResponseAttributes = + (MicrosoftTeamsWorkflowsWebhookResponseAttributes) o; + return Objects.equals(this.name, microsoftTeamsWorkflowsWebhookResponseAttributes.name) + && Objects.equals( + this.additionalProperties, + microsoftTeamsWorkflowsWebhookResponseAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MicrosoftTeamsWorkflowsWebhookResponseAttributes {\n"); + sb.append(" name: ").append(toIndentedString(name)).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/Create_workflow_webhook_handle_returns_CREATED_response.freeze b/src/test/resources/cassettes/features/v2/Create_workflow_webhook_handle_returns_CREATED_response.freeze new file mode 100644 index 00000000000..5134584260f --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_workflow_webhook_handle_returns_CREATED_response.freeze @@ -0,0 +1 @@ +2025-01-28T19:36:52.782Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_workflow_webhook_handle_returns_CREATED_response.json b/src/test/resources/cassettes/features/v2/Create_workflow_webhook_handle_returns_CREATED_response.json new file mode 100644 index 00000000000..112d6b5a07d --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_workflow_webhook_handle_returns_CREATED_response.json @@ -0,0 +1,53 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"name\":\"Test-Create_workflow_webhook_handle_returns_CREATED_response-1738093012\",\"url\":\"https://fake.url.com\"},\"type\":\"workflows-webhook-handle\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/integration/ms-teams/configuration/workflows-webhook-handles", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"264ae337-af6e-4c54-8e90-2612426f270e\",\"type\":\"workflows-webhook-handle\",\"attributes\":{\"name\":\"Test-Create_workflow_webhook_handle_returns_CREATED_response-1738093012\"}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "2cd4a6d4-0ecb-e5f5-c0a8-6a4f800af0b6" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/integration/ms-teams/configuration/workflows-webhook-handles/264ae337-af6e-4c54-8e90-2612426f270e", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "c1bbdff8-4281-f2e9-b7e1-21c4b15d1dcb" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_workflow_webhook_handle_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Delete_workflow_webhook_handle_returns_OK_response.freeze new file mode 100644 index 00000000000..788b6197b2d --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Delete_workflow_webhook_handle_returns_OK_response.freeze @@ -0,0 +1 @@ +2025-01-28T19:36:53.060Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_workflow_webhook_handle_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Delete_workflow_webhook_handle_returns_OK_response.json new file mode 100644 index 00000000000..2bec7668cdf --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Delete_workflow_webhook_handle_returns_OK_response.json @@ -0,0 +1,74 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"name\":\"Test-Delete_workflow_webhook_handle_returns_OK_response-1738093013\",\"url\":\"https://prod-100.westus.logic.azure.com:443/workflows/abcd1234\"},\"type\":\"workflows-webhook-handle\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/integration/ms-teams/configuration/workflows-webhook-handles", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"859e58f9-f63e-4ead-bde4-31265b79c6a7\",\"type\":\"workflows-webhook-handle\",\"attributes\":{\"name\":\"Test-Delete_workflow_webhook_handle_returns_OK_response-1738093013\"}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "e34f8f00-072a-5a55-1341-b203e4216b14" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/integration/ms-teams/configuration/workflows-webhook-handles/859e58f9-f63e-4ead-bde4-31265b79c6a7", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "69e34f33-e902-3723-7253-ab21ad55ee59" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/integration/ms-teams/configuration/workflows-webhook-handles/859e58f9-f63e-4ead-bde4-31265b79c6a7", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "69e34f33-e902-3723-7253-ab21ad55ee5a" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_all_workflow_webhook_handles_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Get_all_workflow_webhook_handles_returns_OK_response.freeze new file mode 100644 index 00000000000..4cc10403a8a --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_all_workflow_webhook_handles_returns_OK_response.freeze @@ -0,0 +1 @@ +2025-01-28T19:36:53.337Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_all_workflow_webhook_handles_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Get_all_workflow_webhook_handles_returns_OK_response.json new file mode 100644 index 00000000000..b6f989d7691 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_all_workflow_webhook_handles_returns_OK_response.json @@ -0,0 +1,79 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"name\":\"Test-Get_all_workflow_webhook_handles_returns_OK_response-1738093013\",\"url\":\"https://prod-100.westus.logic.azure.com:443/workflows/abcd1234\"},\"type\":\"workflows-webhook-handle\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/integration/ms-teams/configuration/workflows-webhook-handles", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"49cc81df-ccaf-48e3-b532-abf24d3b5287\",\"type\":\"workflows-webhook-handle\",\"attributes\":{\"name\":\"Test-Get_all_workflow_webhook_handles_returns_OK_response-1738093013\"}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "95d7bcc7-5e76-9897-0917-99a183f8f722" + }, + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/integration/ms-teams/configuration/workflows-webhook-handles", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":[{\"id\":\"49cc81df-ccaf-48e3-b532-abf24d3b5287\",\"type\":\"workflows-webhook-handle\",\"attributes\":{\"name\":\"Test-Get_all_workflow_webhook_handles_returns_OK_response-1738093013\"}}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "200f8c5b-fccf-ac37-0053-ea06ccaa8097" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/integration/ms-teams/configuration/workflows-webhook-handles/49cc81df-ccaf-48e3-b532-abf24d3b5287", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "f51b0784-46ce-bb74-1d3b-328a283b7362" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_workflow_webhook_handle_information_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Get_workflow_webhook_handle_information_returns_OK_response.freeze new file mode 100644 index 00000000000..e5e33b39f45 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_workflow_webhook_handle_information_returns_OK_response.freeze @@ -0,0 +1 @@ +2025-01-28T19:36:53.606Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_workflow_webhook_handle_information_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Get_workflow_webhook_handle_information_returns_OK_response.json new file mode 100644 index 00000000000..056406cca4a --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_workflow_webhook_handle_information_returns_OK_response.json @@ -0,0 +1,79 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"name\":\"Test-Get_workflow_webhook_handle_information_returns_OK_response-1738093013\",\"url\":\"https://prod-100.westus.logic.azure.com:443/workflows/abcd1234\"},\"type\":\"workflows-webhook-handle\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/integration/ms-teams/configuration/workflows-webhook-handles", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"cf3d9006-205e-47b2-9e6a-bea534a2d38b\",\"type\":\"workflows-webhook-handle\",\"attributes\":{\"name\":\"Test-Get_workflow_webhook_handle_information_returns_OK_response-1738093013\"}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "f051e89c-9491-f2a9-3ce5-12103332339d" + }, + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/integration/ms-teams/configuration/workflows-webhook-handles/cf3d9006-205e-47b2-9e6a-bea534a2d38b", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"cf3d9006-205e-47b2-9e6a-bea534a2d38b\",\"type\":\"workflows-webhook-handle\",\"attributes\":{\"name\":\"Test-Get_workflow_webhook_handle_information_returns_OK_response-1738093013\"}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "95a0c8d7-a5c5-a947-9729-b7029ad9e5bd" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/integration/ms-teams/configuration/workflows-webhook-handles/cf3d9006-205e-47b2-9e6a-bea534a2d38b", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "e2dc0777-5e13-be64-16f2-afd5c37cab92" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_workflow_webhook_handle_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Update_workflow_webhook_handle_returns_OK_response.freeze new file mode 100644 index 00000000000..aa1d78447e0 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_workflow_webhook_handle_returns_OK_response.freeze @@ -0,0 +1 @@ +2025-01-28T19:36:53.897Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_workflow_webhook_handle_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Update_workflow_webhook_handle_returns_OK_response.json new file mode 100644 index 00000000000..bc5027b3e36 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_workflow_webhook_handle_returns_OK_response.json @@ -0,0 +1,83 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"name\":\"Test-Update_workflow_webhook_handle_returns_OK_response-1738093013\",\"url\":\"https://prod-100.westus.logic.azure.com:443/workflows/abcd1234\"},\"type\":\"workflows-webhook-handle\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/integration/ms-teams/configuration/workflows-webhook-handles", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"756d04a2-e0b5-439a-9be0-8772b62ba02c\",\"type\":\"workflows-webhook-handle\",\"attributes\":{\"name\":\"Test-Update_workflow_webhook_handle_returns_OK_response-1738093013\"}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "838f46de-bf54-5ed0-b209-f2f21c763a8e" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"name\":\"Test-Update_workflow_webhook_handle_returns_OK_response-1738093013--updated\"},\"type\":\"workflows-webhook-handle\"}}" + }, + "headers": {}, + "method": "PATCH", + "path": "/api/v2/integration/ms-teams/configuration/workflows-webhook-handles/756d04a2-e0b5-439a-9be0-8772b62ba02c", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"756d04a2-e0b5-439a-9be0-8772b62ba02c\",\"type\":\"workflows-webhook-handle\",\"attributes\":{\"name\":\"Test-Update_workflow_webhook_handle_returns_OK_response-1738093013--updated\"}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "2f3def58-42ca-7770-b8d0-a06a6bbf31c4" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/integration/ms-teams/configuration/workflows-webhook-handles/756d04a2-e0b5-439a-9be0-8772b62ba02c", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "3e903108-b451-4621-9c91-cf179a305669" + } +] \ No newline at end of file diff --git a/src/test/resources/com/datadog/api/client/v2/api/given.json b/src/test/resources/com/datadog/api/client/v2/api/given.json index 9f928a1afcb..79b780cf5c8 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/given.json +++ b/src/test/resources/com/datadog/api/client/v2/api/given.json @@ -288,6 +288,18 @@ "tag": "Microsoft Teams Integration", "operationId": "CreateTenantBasedHandle" }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"attributes\": {\n \"name\": \"{{ unique }}\",\n \"url\": \"https://prod-100.westus.logic.azure.com:443/workflows/abcd1234\"\n },\n \"type\": \"workflows-webhook-handle\"\n }\n}" + } + ], + "step": "there is a valid \"workflows_webhook_handle\" in the system", + "key": "workflows_webhook_handle", + "tag": "Microsoft Teams Integration", + "operationId": "CreateWorkflowsWebhookHandle" + }, { "parameters": [ { diff --git a/src/test/resources/com/datadog/api/client/v2/api/microsoft_teams_integration.feature b/src/test/resources/com/datadog/api/client/v2/api/microsoft_teams_integration.feature index 59f31993a73..c69ef209537 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/microsoft_teams_integration.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/microsoft_teams_integration.feature @@ -53,6 +53,49 @@ Feature: Microsoft Teams Integration When the request is sent Then the response status is 404 Not Found + @team:DataDog/chat-integrations + Scenario: Create workflow webhook handle returns "CREATED" response + Given new "CreateWorkflowsWebhookHandle" request + And body with value {"data": {"attributes": {"name": "{{unique}}", "url": "https://fake.url.com"}, "type": "workflows-webhook-handle"}} + When the request is sent + Then the response status is 201 CREATED + And the response "data.attributes.name" is equal to "{{unique}}" + + @generated @skip @team:DataDog/chat-integrations + Scenario: Create workflows webhook handle returns "Bad Request" response + Given new "CreateWorkflowsWebhookHandle" request + And body with value {"data": {"attributes": {"name": "fake-handle-name", "url": "https://fake.url.com"}, "type": "workflows-webhook-handle"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/chat-integrations + Scenario: Create workflows webhook handle returns "CREATED" response + Given new "CreateWorkflowsWebhookHandle" request + And body with value {"data": {"attributes": {"name": "fake-handle-name", "url": "https://fake.url.com"}, "type": "workflows-webhook-handle"}} + When the request is sent + Then the response status is 201 CREATED + + @generated @skip @team:DataDog/chat-integrations + Scenario: Create workflows webhook handle returns "Conflict" response + Given new "CreateWorkflowsWebhookHandle" request + And body with value {"data": {"attributes": {"name": "fake-handle-name", "url": "https://fake.url.com"}, "type": "workflows-webhook-handle"}} + When the request is sent + Then the response status is 409 Conflict + + @generated @skip @team:DataDog/chat-integrations + Scenario: Create workflows webhook handle returns "Failed Precondition" response + Given new "CreateWorkflowsWebhookHandle" request + And body with value {"data": {"attributes": {"name": "fake-handle-name", "url": "https://fake.url.com"}, "type": "workflows-webhook-handle"}} + When the request is sent + Then the response status is 412 Failed Precondition + + @generated @skip @team:DataDog/chat-integrations + Scenario: Create workflows webhook handle returns "Not Found" response + Given new "CreateWorkflowsWebhookHandle" request + And body with value {"data": {"attributes": {"name": "fake-handle-name", "url": "https://fake.url.com"}, "type": "workflows-webhook-handle"}} + When the request is sent + Then the response status is 404 Not Found + @integration-only @team:DataDog/chat-integrations Scenario: Delete api handle returns "OK" response Given there is a valid "tenant_based_handle" in the system @@ -82,6 +125,35 @@ Feature: Microsoft Teams Integration When the request is sent Then the response status is 204 OK + @team:DataDog/chat-integrations + Scenario: Delete workflow webhook handle returns "OK" response + Given there is a valid "workflows_webhook_handle" in the system + And new "DeleteWorkflowsWebhookHandle" request + And request contains "handle_id" parameter from "workflows_webhook_handle.data.id" + When the request is sent + Then the response status is 204 OK + + @generated @skip @team:DataDog/chat-integrations + Scenario: Delete workflows webhook handle returns "Bad Request" response + Given new "DeleteWorkflowsWebhookHandle" request + And request contains "handle_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/chat-integrations + Scenario: Delete workflows webhook handle returns "Failed Precondition" response + Given new "DeleteWorkflowsWebhookHandle" request + And request contains "handle_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 412 Failed Precondition + + @generated @skip @team:DataDog/chat-integrations + Scenario: Delete workflows webhook handle returns "OK" response + Given new "DeleteWorkflowsWebhookHandle" request + And request contains "handle_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 OK + @integration-only @team:DataDog/chat-integrations Scenario: Get all api handles returns "OK" response Given there is a valid "tenant_based_handle" in the system @@ -114,6 +186,38 @@ Feature: Microsoft Teams Integration When the request is sent Then the response status is 200 OK + @team:DataDog/chat-integrations + Scenario: Get all workflow webhook handles returns "OK" response + Given there is a valid "workflows_webhook_handle" in the system + And new "ListWorkflowsWebhookHandles" request + When the request is sent + Then the response status is 200 OK + And the response "data[0].type" is equal to "workflows-webhook-handle" + + @generated @skip @team:DataDog/chat-integrations + Scenario: Get all workflows webhook handles returns "Bad Request" response + Given new "ListWorkflowsWebhookHandles" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/chat-integrations + Scenario: Get all workflows webhook handles returns "Failed Precondition" response + Given new "ListWorkflowsWebhookHandles" request + When the request is sent + Then the response status is 412 Failed Precondition + + @generated @skip @team:DataDog/chat-integrations + Scenario: Get all workflows webhook handles returns "Not Found" response + Given new "ListWorkflowsWebhookHandles" request + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/chat-integrations + Scenario: Get all workflows webhook handles returns "OK" response + Given new "ListWorkflowsWebhookHandles" request + When the request is sent + Then the response status is 200 OK + @integration-only @team:DataDog/chat-integrations Scenario: Get api handle information returns "OK" response Given there is a valid "tenant_based_handle" in the system @@ -181,6 +285,42 @@ Feature: Microsoft Teams Integration When the request is sent Then the response status is 200 OK + @team:DataDog/chat-integrations + Scenario: Get workflow webhook handle information returns "OK" response + Given there is a valid "workflows_webhook_handle" in the system + And new "GetWorkflowsWebhookHandle" request + And request contains "handle_id" parameter from "workflows_webhook_handle.data.id" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/chat-integrations + Scenario: Get workflows webhook handle information returns "Bad Request" response + Given new "GetWorkflowsWebhookHandle" request + And request contains "handle_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/chat-integrations + Scenario: Get workflows webhook handle information returns "Failed Precondition" response + Given new "GetWorkflowsWebhookHandle" request + And request contains "handle_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 412 Failed Precondition + + @generated @skip @team:DataDog/chat-integrations + Scenario: Get workflows webhook handle information returns "Not Found" response + Given new "GetWorkflowsWebhookHandle" request + And request contains "handle_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/chat-integrations + Scenario: Get workflows webhook handle information returns "OK" response + Given new "GetWorkflowsWebhookHandle" request + And request contains "handle_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @integration-only @team:DataDog/chat-integrations Scenario: Update api handle returns "OK" response Given there is a valid "tenant_based_handle" in the system @@ -230,3 +370,53 @@ Feature: Microsoft Teams Integration And body with value {"data": {"attributes": {"channel_id": "fake-channel-id", "name": "fake-handle-name", "team_id": "00000000-0000-0000-0000-000000000000", "tenant_id": "00000000-0000-0000-0000-000000000001"}, "type": "tenant-based-handle"}} When the request is sent Then the response status is 200 OK + + @team:DataDog/chat-integrations + Scenario: Update workflow webhook handle returns "OK" response + Given there is a valid "workflows_webhook_handle" in the system + And new "UpdateWorkflowsWebhookHandle" request + And request contains "handle_id" parameter from "workflows_webhook_handle.data.id" + And body with value {"data": {"attributes": {"name": "{{workflows_webhook_handle.data.attributes.name}}--updated"}, "type": "workflows-webhook-handle"}} + When the request is sent + Then the response status is 200 OK + And the response "data.attributes.name" is equal to "{{workflows_webhook_handle.data.attributes.name}}--updated" + + @generated @skip @team:DataDog/chat-integrations + Scenario: Update workflows webhook handle returns "Bad Request" response + Given new "UpdateWorkflowsWebhookHandle" request + And request contains "handle_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"name": "fake-handle-name", "url": "https://fake.url.com"}, "type": "workflows-webhook-handle"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/chat-integrations + Scenario: Update workflows webhook handle returns "Conflict" response + Given new "UpdateWorkflowsWebhookHandle" request + And request contains "handle_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"name": "fake-handle-name", "url": "https://fake.url.com"}, "type": "workflows-webhook-handle"}} + When the request is sent + Then the response status is 409 Conflict + + @generated @skip @team:DataDog/chat-integrations + Scenario: Update workflows webhook handle returns "Failed Precondition" response + Given new "UpdateWorkflowsWebhookHandle" request + And request contains "handle_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"name": "fake-handle-name", "url": "https://fake.url.com"}, "type": "workflows-webhook-handle"}} + When the request is sent + Then the response status is 412 Failed Precondition + + @generated @skip @team:DataDog/chat-integrations + Scenario: Update workflows webhook handle returns "Not Found" response + Given new "UpdateWorkflowsWebhookHandle" request + And request contains "handle_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"name": "fake-handle-name", "url": "https://fake.url.com"}, "type": "workflows-webhook-handle"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/chat-integrations + Scenario: Update workflows webhook handle returns "OK" response + Given new "UpdateWorkflowsWebhookHandle" request + And request contains "handle_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"name": "fake-handle-name", "url": "https://fake.url.com"}, "type": "workflows-webhook-handle"}} + When the request is sent + Then the response status is 200 OK 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 bb873597555..03717048ec6 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 @@ -1076,6 +1076,43 @@ "type": "idempotent" } }, + "ListWorkflowsWebhookHandles": { + "tag": "Microsoft Teams Integration", + "undo": { + "type": "safe" + } + }, + "CreateWorkflowsWebhookHandle": { + "tag": "Microsoft Teams Integration", + "undo": { + "operationId": "DeleteWorkflowsWebhookHandle", + "parameters": [ + { + "name": "handle_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "DeleteWorkflowsWebhookHandle": { + "tag": "Microsoft Teams Integration", + "undo": { + "type": "idempotent" + } + }, + "GetWorkflowsWebhookHandle": { + "tag": "Microsoft Teams Integration", + "undo": { + "type": "safe" + } + }, + "UpdateWorkflowsWebhookHandle": { + "tag": "Microsoft Teams Integration", + "undo": { + "type": "idempotent" + } + }, "ListOpsgenieServices": { "tag": "Opsgenie Integration", "undo": {