From 0f2a04e0ddfcc53e3eab3cfae5770bbdb92d8378 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Fri, 3 Jan 2025 19:51:27 +0000 Subject: [PATCH] Regenerate client from commit a9ad82b7 of spec repo --- .apigentools-info | 8 +- .generator/schemas/v2/openapi.yaml | 551 ++++++++++++++++++ docs/datadog_api_client.v2.api.rst | 7 + docs/datadog_api_client.v2.model.rst | 252 ++++++++ .../CreateActionConnection.py | 38 ++ .../DeleteActionConnection.py | 13 + .../DeleteActionConnection_2142905164.py | 17 + .../action-connection/GetActionConnection.py | 15 + .../UpdateActionConnection.py | 38 ++ .../v2/api/action_connection_api.py | 196 +++++++ src/datadog_api_client/v2/apis/__init__.py | 2 + .../v2/model/action_connection_attributes.py | 50 ++ .../action_connection_attributes_update.py | 58 ++ .../v2/model/action_connection_data.py | 66 +++ .../v2/model/action_connection_data_type.py | 35 ++ .../v2/model/action_connection_data_update.py | 48 ++ .../v2/model/action_connection_integration.py | 46 ++ .../action_connection_integration_update.py | 46 ++ .../v2/model/aws_assume_role.py | 84 +++ .../v2/model/aws_assume_role_type.py | 35 ++ .../v2/model/aws_assume_role_update.py | 74 +++ .../v2/model/aws_credentials.py | 50 ++ .../v2/model/aws_credentials_update.py | 47 ++ .../v2/model/aws_integration.py | 49 ++ .../v2/model/aws_integration_type.py | 35 ++ .../v2/model/aws_integration_update.py | 57 ++ .../model/create_action_connection_request.py | 40 ++ .../create_action_connection_response.py | 42 ++ .../model/get_action_connection_response.py | 42 ++ src/datadog_api_client/v2/model/http_body.py | 43 ++ .../v2/model/http_credentials.py | 50 ++ .../v2/model/http_credentials_update.py | 50 ++ .../v2/model/http_header.py | 43 ++ .../v2/model/http_header_update.py | 56 ++ .../v2/model/http_integration.py | 61 ++ .../v2/model/http_integration_type.py | 35 ++ .../v2/model/http_integration_update.py | 69 +++ src/datadog_api_client/v2/model/http_token.py | 56 ++ .../v2/model/http_token_auth.py | 86 +++ .../v2/model/http_token_auth_type.py | 35 ++ .../v2/model/http_token_auth_update.py | 86 +++ .../v2/model/http_token_update.py | 65 +++ src/datadog_api_client/v2/model/token_type.py | 35 ++ .../model/update_action_connection_request.py | 40 ++ .../update_action_connection_response.py | 42 ++ src/datadog_api_client/v2/model/url_param.py | 43 ++ .../v2/model/url_param_update.py | 56 ++ src/datadog_api_client/v2/models/__init__.py | 72 +++ ...ection_returns_bad_request_response.frozen | 1 + ...nnection_returns_bad_request_response.yaml | 27 + ..._created_action_connection_response.frozen | 1 + ...ly_created_action_connection_response.yaml | 36 ++ ...nnection_returns_not_found_response.frozen | 1 + ...connection_returns_not_found_response.yaml | 19 + ...ection_returns_bad_request_response.frozen | 1 + ...nnection_returns_bad_request_response.yaml | 19 + ...nnection_returns_not_found_response.frozen | 1 + ...connection_returns_not_found_response.yaml | 19 + ...ully_get_action_connection_response.frozen | 1 + ...sfully_get_action_connection_response.yaml | 19 + ...ection_returns_bad_request_response.frozen | 1 + ...nnection_returns_bad_request_response.yaml | 27 + ...nnection_returns_not_found_response.frozen | 1 + ...connection_returns_not_found_response.yaml | 22 + ..._updated_action_connection_response.frozen | 1 + ...ly_updated_action_connection_response.yaml | 22 + tests/v2/features/action_connection.feature | 96 +++ tests/v2/features/given.json | 12 + tests/v2/features/undo.json | 31 + 69 files changed, 3418 insertions(+), 4 deletions(-) create mode 100644 examples/v2/action-connection/CreateActionConnection.py create mode 100644 examples/v2/action-connection/DeleteActionConnection.py create mode 100644 examples/v2/action-connection/DeleteActionConnection_2142905164.py create mode 100644 examples/v2/action-connection/GetActionConnection.py create mode 100644 examples/v2/action-connection/UpdateActionConnection.py create mode 100644 src/datadog_api_client/v2/api/action_connection_api.py create mode 100644 src/datadog_api_client/v2/model/action_connection_attributes.py create mode 100644 src/datadog_api_client/v2/model/action_connection_attributes_update.py create mode 100644 src/datadog_api_client/v2/model/action_connection_data.py create mode 100644 src/datadog_api_client/v2/model/action_connection_data_type.py create mode 100644 src/datadog_api_client/v2/model/action_connection_data_update.py create mode 100644 src/datadog_api_client/v2/model/action_connection_integration.py create mode 100644 src/datadog_api_client/v2/model/action_connection_integration_update.py create mode 100644 src/datadog_api_client/v2/model/aws_assume_role.py create mode 100644 src/datadog_api_client/v2/model/aws_assume_role_type.py create mode 100644 src/datadog_api_client/v2/model/aws_assume_role_update.py create mode 100644 src/datadog_api_client/v2/model/aws_credentials.py create mode 100644 src/datadog_api_client/v2/model/aws_credentials_update.py create mode 100644 src/datadog_api_client/v2/model/aws_integration.py create mode 100644 src/datadog_api_client/v2/model/aws_integration_type.py create mode 100644 src/datadog_api_client/v2/model/aws_integration_update.py create mode 100644 src/datadog_api_client/v2/model/create_action_connection_request.py create mode 100644 src/datadog_api_client/v2/model/create_action_connection_response.py create mode 100644 src/datadog_api_client/v2/model/get_action_connection_response.py create mode 100644 src/datadog_api_client/v2/model/http_body.py create mode 100644 src/datadog_api_client/v2/model/http_credentials.py create mode 100644 src/datadog_api_client/v2/model/http_credentials_update.py create mode 100644 src/datadog_api_client/v2/model/http_header.py create mode 100644 src/datadog_api_client/v2/model/http_header_update.py create mode 100644 src/datadog_api_client/v2/model/http_integration.py create mode 100644 src/datadog_api_client/v2/model/http_integration_type.py create mode 100644 src/datadog_api_client/v2/model/http_integration_update.py create mode 100644 src/datadog_api_client/v2/model/http_token.py create mode 100644 src/datadog_api_client/v2/model/http_token_auth.py create mode 100644 src/datadog_api_client/v2/model/http_token_auth_type.py create mode 100644 src/datadog_api_client/v2/model/http_token_auth_update.py create mode 100644 src/datadog_api_client/v2/model/http_token_update.py create mode 100644 src/datadog_api_client/v2/model/token_type.py create mode 100644 src/datadog_api_client/v2/model/update_action_connection_request.py create mode 100644 src/datadog_api_client/v2/model/update_action_connection_response.py create mode 100644 src/datadog_api_client/v2/model/url_param.py create mode 100644 src/datadog_api_client/v2/model/url_param_update.py create mode 100644 tests/v2/cassettes/test_scenarios/test_create_a_new_action_connection_returns_bad_request_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_create_a_new_action_connection_returns_bad_request_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_create_a_new_action_connection_returns_successfully_created_action_connection_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_create_a_new_action_connection_returns_successfully_created_action_connection_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_delete_an_existing_action_connection_returns_not_found_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_delete_an_existing_action_connection_returns_not_found_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_get_an_existing_action_connection_returns_bad_request_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_get_an_existing_action_connection_returns_bad_request_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_get_an_existing_action_connection_returns_not_found_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_get_an_existing_action_connection_returns_not_found_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_get_an_existing_action_connection_returns_successfully_get_action_connection_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_get_an_existing_action_connection_returns_successfully_get_action_connection_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_update_an_existing_action_connection_returns_bad_request_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_update_an_existing_action_connection_returns_bad_request_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_update_an_existing_action_connection_returns_not_found_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_update_an_existing_action_connection_returns_not_found_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_update_an_existing_action_connection_returns_successfully_updated_action_connection_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_update_an_existing_action_connection_returns_successfully_updated_action_connection_response.yaml create mode 100644 tests/v2/features/action_connection.feature diff --git a/.apigentools-info b/.apigentools-info index 6d74f37372..c891b12739 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2025-01-03 18:07:32.277333", - "spec_repo_commit": "08abd462" + "regenerated": "2025-01-03 19:50:53.464240", + "spec_repo_commit": "a9ad82b7" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2025-01-03 18:07:32.291292", - "spec_repo_commit": "08abd462" + "regenerated": "2025-01-03 19:50:53.478529", + "spec_repo_commit": "a9ad82b7" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 5ffff4300a..94ef9bc36a 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -206,6 +206,13 @@ components: required: true schema: type: string + ConnectionId: + description: The ID of the action connection + in: path + name: connection_id + required: true + schema: + type: string CustomDestinationId: description: The ID of the custom destination. in: path @@ -1209,6 +1216,64 @@ components: required: - data type: object + AWSAssumeRole: + description: The definition of `AWSAssumeRole` object. + properties: + account_id: + description: AWS account the connection is created for + example: '111222333444' + pattern: ^\d{12}$ + type: string + external_id: + description: External ID used to scope which connection can be used to assume + the role + example: 33a1011635c44b38a064cf14e82e1d8f + readOnly: true + type: string + principal_id: + description: AWS account that will assume the role + example: '123456789012' + readOnly: true + type: string + role: + description: Role to assume + example: my-role + type: string + type: + $ref: '#/components/schemas/AWSAssumeRoleType' + required: + - type + - account_id + - role + type: object + AWSAssumeRoleType: + description: The definition of `AWSAssumeRoleType` object. + enum: + - AWSAssumeRole + example: AWSAssumeRole + type: string + x-enum-varnames: + - AWSASSUMEROLE + AWSAssumeRoleUpdate: + description: The definition of `AWSAssumeRoleUpdate` object. + properties: + account_id: + description: AWS account the connection is created for + example: '111222333444' + pattern: ^\d{12}$ + type: string + generate_new_external_id: + description: The `AWSAssumeRoleUpdate` `generate_new_external_id`. + type: boolean + role: + description: Role to assume + example: my-role + type: string + type: + $ref: '#/components/schemas/AWSAssumeRoleType' + required: + - type + type: object AWSAuthConfig: description: AWS Authentication config. oneOf: @@ -1247,6 +1312,43 @@ components: required: - role_name type: object + AWSCredentials: + description: The definition of `AWSCredentials` object. + oneOf: + - $ref: '#/components/schemas/AWSAssumeRole' + AWSCredentialsUpdate: + description: The definition of `AWSCredentialsUpdate` object. + oneOf: + - $ref: '#/components/schemas/AWSAssumeRoleUpdate' + AWSIntegration: + description: The definition of `AWSIntegration` object. + properties: + credentials: + $ref: '#/components/schemas/AWSCredentials' + type: + $ref: '#/components/schemas/AWSIntegrationType' + required: + - type + - credentials + type: object + AWSIntegrationType: + description: The definition of `AWSIntegrationType` object. + enum: + - AWS + example: AWS + type: string + x-enum-varnames: + - AWS + AWSIntegrationUpdate: + description: The definition of `AWSIntegrationUpdate` object. + properties: + credentials: + $ref: '#/components/schemas/AWSCredentialsUpdate' + type: + $ref: '#/components/schemas/AWSIntegrationType' + required: + - type + type: object AWSLambdaForwarderConfig: description: 'Log Autosubscription configuration for Datadog Forwarder Lambda functions. Automatically set up triggers for existing @@ -1560,6 +1662,73 @@ components: xray_services: $ref: '#/components/schemas/XRayServicesList' type: object + ActionConnectionAttributes: + description: The definition of `ActionConnectionAttributes` object. + properties: + integration: + $ref: '#/components/schemas/ActionConnectionIntegration' + name: + description: Name of the connection + example: My AWS Connection + type: string + required: + - name + - integration + type: object + ActionConnectionAttributesUpdate: + description: The definition of `ActionConnectionAttributesUpdate` object. + properties: + integration: + $ref: '#/components/schemas/ActionConnectionIntegrationUpdate' + name: + description: Name of the connection + example: My AWS Connection + type: string + type: object + ActionConnectionData: + description: Data related to the connection. + properties: + attributes: + $ref: '#/components/schemas/ActionConnectionAttributes' + id: + description: The connection identifier + readOnly: true + type: string + type: + $ref: '#/components/schemas/ActionConnectionDataType' + required: + - type + - attributes + type: object + ActionConnectionDataType: + description: The definition of `ActionConnectionDataType` object. + enum: + - action_connection + example: action_connection + type: string + x-enum-varnames: + - ACTION_CONNECTION + ActionConnectionDataUpdate: + description: Data related to the connection update. + properties: + attributes: + $ref: '#/components/schemas/ActionConnectionAttributesUpdate' + type: + $ref: '#/components/schemas/ActionConnectionDataType' + required: + - type + - attributes + type: object + ActionConnectionIntegration: + description: The definition of `ActionConnectionIntegration` object. + oneOf: + - $ref: '#/components/schemas/AWSIntegration' + - $ref: '#/components/schemas/HTTPIntegration' + ActionConnectionIntegrationUpdate: + description: The definition of `ActionConnectionIntegrationUpdate` object. + oneOf: + - $ref: '#/components/schemas/AWSIntegrationUpdate' + - $ref: '#/components/schemas/HTTPIntegrationUpdate' ActiveBillingDimensionsAttributes: description: List of active billing dimensions. properties: @@ -6995,6 +7164,20 @@ components: type: string x-enum-varnames: - COST_BY_ORG + CreateActionConnectionRequest: + description: Request used to create an action connection. + properties: + data: + $ref: '#/components/schemas/ActionConnectionData' + required: + - data + type: object + CreateActionConnectionResponse: + description: The response for a created connection + properties: + data: + $ref: '#/components/schemas/ActionConnectionData' + type: object CreateAppRequest: description: The definition of `CreateAppRequest` object. example: @@ -12202,6 +12385,12 @@ components: type: string x-enum-varnames: - GCP_SERVICE_ACCOUNT + GetActionConnectionResponse: + description: The response for found connection + properties: + data: + $ref: '#/components/schemas/ActionConnectionData' + type: object GetAppResponse: description: The definition of `GetAppResponse` object. properties: @@ -12496,6 +12685,18 @@ components: example: env:production type: string type: array + HTTPBody: + description: The definition of `HTTPBody` object. + properties: + content: + description: Serialized body content + example: '{"some-json": "with-value"}' + type: string + content_type: + description: Content type of the body + example: application/json + type: string + type: object HTTPCIAppError: description: List of errors. properties: @@ -12521,6 +12722,88 @@ components: $ref: '#/components/schemas/HTTPCIAppError' type: array type: object + HTTPCredentials: + description: The definition of `HTTPCredentials` object. + oneOf: + - $ref: '#/components/schemas/HTTPTokenAuth' + HTTPCredentialsUpdate: + description: The definition of `HTTPCredentialsUpdate` object. + oneOf: + - $ref: '#/components/schemas/HTTPTokenAuthUpdate' + HTTPHeader: + description: The definition of `HTTPHeader` object. + properties: + name: + description: The `HTTPHeader` `name`. + example: MyHttpHeader + pattern: ^[A-Za-z][A-Za-z\\d\\-\\_]*$ + type: string + value: + description: The `HTTPHeader` `value`. + example: Some header value + type: string + required: + - name + - value + type: object + HTTPHeaderUpdate: + description: The definition of `HTTPHeaderUpdate` object. + properties: + deleted: + description: Should the header be deleted. + type: boolean + name: + description: The `HTTPHeaderUpdate` `name`. + example: MyHttpHeader + pattern: ^[A-Za-z][A-Za-z\\d\\-\\_]*$ + type: string + value: + description: The `HTTPHeaderUpdate` `value`. + example: Updated Header Value + type: string + required: + - name + type: object + HTTPIntegration: + description: The definition of `HTTPIntegration` object. + properties: + base_url: + description: Base HTTP url for the integration + example: http://datadoghq.com + pattern: url + type: string + credentials: + $ref: '#/components/schemas/HTTPCredentials' + type: + $ref: '#/components/schemas/HTTPIntegrationType' + required: + - type + - base_url + - credentials + type: object + HTTPIntegrationType: + description: The definition of `HTTPIntegrationType` object. + enum: + - HTTP + example: HTTP + type: string + x-enum-varnames: + - HTTP + HTTPIntegrationUpdate: + description: The definition of `HTTPIntegrationUpdate` object. + properties: + base_url: + description: Base HTTP url for the integration + example: http://datadoghq.com + pattern: url + type: string + credentials: + $ref: '#/components/schemas/HTTPCredentialsUpdate' + type: + $ref: '#/components/schemas/HTTPIntegrationType' + required: + - type + type: object HTTPLog: description: Structured log message. items: @@ -12597,6 +12880,105 @@ components: required: - message type: object + HTTPToken: + description: The definition of `HTTPToken` object. + properties: + name: + description: The `HTTPToken` `name`. + example: MyToken + pattern: ^[A-Za-z][A-Za-z\\d]*$ + type: string + type: + $ref: '#/components/schemas/TokenType' + value: + description: The `HTTPToken` `value`. + example: Some Token Value + type: string + required: + - name + - value + - type + type: object + HTTPTokenAuth: + description: The definition of `HTTPTokenAuth` object. + properties: + body: + $ref: '#/components/schemas/HTTPBody' + headers: + description: The `HTTPTokenAuth` `headers`. + items: + $ref: '#/components/schemas/HTTPHeader' + type: array + tokens: + description: The `HTTPTokenAuth` `tokens`. + items: + $ref: '#/components/schemas/HTTPToken' + type: array + type: + $ref: '#/components/schemas/HTTPTokenAuthType' + url_parameters: + description: The `HTTPTokenAuth` `url_parameters`. + items: + $ref: '#/components/schemas/UrlParam' + type: array + required: + - type + type: object + HTTPTokenAuthType: + description: The definition of `HTTPTokenAuthType` object. + enum: + - HTTPTokenAuth + example: HTTPTokenAuth + type: string + x-enum-varnames: + - HTTPTOKENAUTH + HTTPTokenAuthUpdate: + description: The definition of `HTTPTokenAuthUpdate` object. + properties: + body: + $ref: '#/components/schemas/HTTPBody' + headers: + description: The `HTTPTokenAuthUpdate` `headers`. + items: + $ref: '#/components/schemas/HTTPHeaderUpdate' + type: array + tokens: + description: The `HTTPTokenAuthUpdate` `tokens`. + items: + $ref: '#/components/schemas/HTTPTokenUpdate' + type: array + type: + $ref: '#/components/schemas/HTTPTokenAuthType' + url_parameters: + description: The `HTTPTokenAuthUpdate` `url_parameters`. + items: + $ref: '#/components/schemas/UrlParamUpdate' + type: array + required: + - type + type: object + HTTPTokenUpdate: + description: The definition of `HTTPTokenUpdate` object. + properties: + deleted: + description: Should the header be deleted. + type: boolean + name: + description: The `HTTPToken` `name`. + example: MyToken + pattern: ^[A-Za-z][A-Za-z\\d]*$ + type: string + type: + $ref: '#/components/schemas/TokenType' + value: + description: The `HTTPToken` `value`. + example: Some Token Value + type: string + required: + - name + - type + - value + type: object HistoricalJobDataType: description: Type of payload. enum: @@ -28683,6 +29065,19 @@ components: items: $ref: '#/components/schemas/TimeseriesResponseValues' type: array + TokenName: + description: Name for tokens. + example: MyTokenName + pattern: ^[A-Za-z][A-Za-z\\d]*$ + type: string + TokenType: + description: The definition of `TokenType` object. + enum: + - SECRET + example: SECRET + type: string + x-enum-varnames: + - SECRET Unit: description: Object containing the metric unit family, scale factor, name, and short name. @@ -28711,6 +29106,20 @@ components: example: min type: string type: object + UpdateActionConnectionRequest: + description: Request used to update an action connection. + properties: + data: + $ref: '#/components/schemas/ActionConnectionDataUpdate' + required: + - data + type: object + UpdateActionConnectionResponse: + description: The response for an updated connection. + properties: + data: + $ref: '#/components/schemas/ActionConnectionData' + type: object UpdateAppRequest: description: The definition of `UpdateAppRequest` object. example: @@ -28981,6 +29390,36 @@ components: description: Upsert entity response included item. oneOf: - $ref: '#/components/schemas/EntityResponseIncludedSchema' + UrlParam: + description: The definition of `UrlParam` object. + properties: + name: + $ref: '#/components/schemas/TokenName' + example: MyUrlParameter + value: + description: The `UrlParam` `value`. + example: Some Url Parameter value + type: string + required: + - name + - value + type: object + UrlParamUpdate: + description: The definition of `UrlParamUpdate` object. + properties: + deleted: + description: Should the header be deleted. + type: boolean + name: + $ref: '#/components/schemas/TokenName' + example: MyUrlParameter + value: + description: The `UrlParamUpdate` `value`. + example: Some Url Parameter value + type: string + required: + - name + type: object UsageApplicationSecurityMonitoringResponse: description: Application Security Monitoring usage response. properties: @@ -30222,6 +30661,107 @@ info: version: '1.0' openapi: 3.0.0 paths: + /api/v2/actions/connections: + post: + description: Create a new Action Connection + operationId: CreateActionConnection + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateActionConnectionRequest' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/CreateActionConnectionResponse' + description: Successfully created Action Connection + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Create a new Action Connection + tags: + - Action Connection + /api/v2/actions/connections/{connection_id}: + delete: + description: Delete an existing Action Connection + operationId: DeleteActionConnection + parameters: + - $ref: '#/components/parameters/ConnectionId' + responses: + '204': + description: The resource was deleted successfully. + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Delete an existing Action Connection + tags: + - Action Connection + x-permission: + operator: OR + permissions: + - connection_write + get: + description: Get an existing Action Connection + operationId: GetActionConnection + parameters: + - $ref: '#/components/parameters/ConnectionId' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/GetActionConnectionResponse' + description: Successfully get Action Connection + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Get an existing Action Connection + tags: + - Action Connection + patch: + description: Update an existing Action Connection + operationId: UpdateActionConnection + parameters: + - $ref: '#/components/parameters/ConnectionId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateActionConnectionRequest' + description: Update an existing Action Connection request body + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateActionConnectionResponse' + description: Successfully updated Action Connection + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Update an existing Action Connection + tags: + - Action Connection /api/v2/api_keys: get: description: List all API keys available for your account. @@ -48120,6 +48660,17 @@ tags: externalDocs: url: https://docs.datadoghq.com/integrations/amazon_web_services/#log-collection name: AWS Logs Integration +- description: "Action connections extend your installed integrations and allow you + to take action in your third-party systems\n(e.g. AWS, Gitlab, and Statuspage) + with Datadog\u2019s Workflow Automation and App Builder products.\n\nDatadog\u2019s + Integrations automatically provide authentication for Slack, Microsoft Teams, + PagerDuty, Opsgenie,\nJIRA, GitHub, and Statuspage. You do not need additional + connections in order to access these tools within\nWorkflow Automation and App + Builder.\n\nWe offer granular access control for editing and resolving connections." + externalDocs: + description: Find out more at + url: https://docs.datadoghq.com/service_management/workflows/connections/ + name: Action Connection - description: Deploy and disable apps in App Builder. name: App Deployment - description: Create, read, update, and delete apps in App Builder. diff --git a/docs/datadog_api_client.v2.api.rst b/docs/datadog_api_client.v2.api.rst index 254ec256ef..2de9727198 100644 --- a/docs/datadog_api_client.v2.api.rst +++ b/docs/datadog_api_client.v2.api.rst @@ -4,6 +4,13 @@ datadog\_api\_client.v2.api package Submodules ---------- +datadog\_api\_client.v2.api.action\_connection\_api module +---------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.api.action_connection_api + :members: + :show-inheritance: + datadog\_api\_client.v2.api.api\_management\_api module ------------------------------------------------------- diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index de26188832..d9ce0f3b83 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -4,6 +4,55 @@ datadog\_api\_client.v2.model package Submodules ---------- +datadog\_api\_client.v2.model.action\_connection\_attributes module +------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.action_connection_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.action\_connection\_attributes\_update module +--------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.action_connection_attributes_update + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.action\_connection\_data module +------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.action_connection_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.action\_connection\_data\_type module +------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.action_connection_data_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.action\_connection\_data\_update module +--------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.action_connection_data_update + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.action\_connection\_integration module +-------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.action_connection_integration + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.action\_connection\_integration\_update module +---------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.action_connection_integration_update + :members: + :show-inheritance: + datadog\_api\_client.v2.model.active\_billing\_dimensions\_attributes module ---------------------------------------------------------------------------- @@ -669,6 +718,27 @@ datadog\_api\_client.v2.model.aws\_accounts\_response module :members: :show-inheritance: +datadog\_api\_client.v2.model.aws\_assume\_role module +------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.aws_assume_role + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.aws\_assume\_role\_type module +------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.aws_assume_role_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.aws\_assume\_role\_update module +-------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.aws_assume_role_update + :members: + :show-inheritance: + datadog\_api\_client.v2.model.aws\_auth\_config module ------------------------------------------------------ @@ -690,6 +760,20 @@ datadog\_api\_client.v2.model.aws\_auth\_config\_role module :members: :show-inheritance: +datadog\_api\_client.v2.model.aws\_credentials module +----------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.aws_credentials + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.aws\_credentials\_update module +------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.aws_credentials_update + :members: + :show-inheritance: + datadog\_api\_client.v2.model.aws\_cur\_config module ----------------------------------------------------- @@ -781,6 +865,27 @@ datadog\_api\_client.v2.model.aws\_cur\_configs\_response module :members: :show-inheritance: +datadog\_api\_client.v2.model.aws\_integration module +----------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.aws_integration + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.aws\_integration\_type module +----------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.aws_integration_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.aws\_integration\_update module +------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.aws_integration_update + :members: + :show-inheritance: + datadog\_api\_client.v2.model.aws\_lambda\_forwarder\_config module ------------------------------------------------------------------- @@ -2671,6 +2776,20 @@ datadog\_api\_client.v2.model.cost\_by\_org\_type module :members: :show-inheritance: +datadog\_api\_client.v2.model.create\_action\_connection\_request module +------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.create_action_connection_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.create\_action\_connection\_response module +------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.create_action_connection_response + :members: + :show-inheritance: + datadog\_api\_client.v2.model.create\_app\_request module --------------------------------------------------------- @@ -5009,6 +5128,13 @@ datadog\_api\_client.v2.model.gcpsts\_service\_accounts\_response module :members: :show-inheritance: +datadog\_api\_client.v2.model.get\_action\_connection\_response module +---------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.get_action_connection_response + :members: + :show-inheritance: + datadog\_api\_client.v2.model.get\_app\_response module ------------------------------------------------------- @@ -5212,6 +5338,62 @@ datadog\_api\_client.v2.model.hourly\_usage\_type module :members: :show-inheritance: +datadog\_api\_client.v2.model.http\_body module +----------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.http_body + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.http\_credentials module +------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.http_credentials + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.http\_credentials\_update module +-------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.http_credentials_update + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.http\_header module +------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.http_header + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.http\_header\_update module +--------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.http_header_update + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.http\_integration module +------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.http_integration + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.http\_integration\_type module +------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.http_integration_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.http\_integration\_update module +-------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.http_integration_update + :members: + :show-inheritance: + datadog\_api\_client.v2.model.http\_log module ---------------------------------------------- @@ -5240,6 +5422,41 @@ datadog\_api\_client.v2.model.http\_log\_item module :members: :show-inheritance: +datadog\_api\_client.v2.model.http\_token module +------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.http_token + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.http\_token\_auth module +------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.http_token_auth + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.http\_token\_auth\_type module +------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.http_token_auth_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.http\_token\_auth\_update module +-------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.http_token_auth_update + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.http\_token\_update module +-------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.http_token_update + :members: + :show-inheritance: + datadog\_api\_client.v2.model.httpci\_app\_error module ------------------------------------------------------- @@ -12660,6 +12877,13 @@ datadog\_api\_client.v2.model.timeseries\_response\_values\_list module :members: :show-inheritance: +datadog\_api\_client.v2.model.token\_type module +------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.token_type + :members: + :show-inheritance: + datadog\_api\_client.v2.model.unit module ----------------------------------------- @@ -12667,6 +12891,20 @@ datadog\_api\_client.v2.model.unit module :members: :show-inheritance: +datadog\_api\_client.v2.model.update\_action\_connection\_request module +------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.update_action_connection_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.update\_action\_connection\_response module +------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.update_action_connection_response + :members: + :show-inheritance: + datadog\_api\_client.v2.model.update\_app\_request module --------------------------------------------------------- @@ -12800,6 +13038,20 @@ datadog\_api\_client.v2.model.upsert\_catalog\_entity\_response\_included\_item :members: :show-inheritance: +datadog\_api\_client.v2.model.url\_param module +----------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.url_param + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.url\_param\_update module +------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.url_param_update + :members: + :show-inheritance: + datadog\_api\_client.v2.model.usage\_application\_security\_monitoring\_response module --------------------------------------------------------------------------------------- diff --git a/examples/v2/action-connection/CreateActionConnection.py b/examples/v2/action-connection/CreateActionConnection.py new file mode 100644 index 0000000000..d167f5b70b --- /dev/null +++ b/examples/v2/action-connection/CreateActionConnection.py @@ -0,0 +1,38 @@ +""" +Create a new Action Connection returns "Successfully created Action Connection" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.action_connection_api import ActionConnectionApi +from datadog_api_client.v2.model.action_connection_attributes import ActionConnectionAttributes +from datadog_api_client.v2.model.action_connection_data import ActionConnectionData +from datadog_api_client.v2.model.action_connection_data_type import ActionConnectionDataType +from datadog_api_client.v2.model.aws_assume_role import AWSAssumeRole +from datadog_api_client.v2.model.aws_assume_role_type import AWSAssumeRoleType +from datadog_api_client.v2.model.aws_integration import AWSIntegration +from datadog_api_client.v2.model.aws_integration_type import AWSIntegrationType +from datadog_api_client.v2.model.create_action_connection_request import CreateActionConnectionRequest + +body = CreateActionConnectionRequest( + data=ActionConnectionData( + type=ActionConnectionDataType.ACTION_CONNECTION, + attributes=ActionConnectionAttributes( + name="Cassette Connection DELETE_ME", + integration=AWSIntegration( + type=AWSIntegrationType.AWS, + credentials=AWSAssumeRole( + type=AWSAssumeRoleType.AWSASSUMEROLE, + role="MyRoleUpdated", + account_id="123456789123", + ), + ), + ), + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = ActionConnectionApi(api_client) + response = api_instance.create_action_connection(body=body) + + print(response) diff --git a/examples/v2/action-connection/DeleteActionConnection.py b/examples/v2/action-connection/DeleteActionConnection.py new file mode 100644 index 0000000000..8941a3eaf6 --- /dev/null +++ b/examples/v2/action-connection/DeleteActionConnection.py @@ -0,0 +1,13 @@ +""" +Delete an existing Action Connection returns "The resource was deleted successfully." response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.action_connection_api import ActionConnectionApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = ActionConnectionApi(api_client) + api_instance.delete_action_connection( + connection_id="connection_id", + ) diff --git a/examples/v2/action-connection/DeleteActionConnection_2142905164.py b/examples/v2/action-connection/DeleteActionConnection_2142905164.py new file mode 100644 index 0000000000..f58054658e --- /dev/null +++ b/examples/v2/action-connection/DeleteActionConnection_2142905164.py @@ -0,0 +1,17 @@ +""" +Delete an existing Action Connection returns "Successfully deleted Action Connection" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.action_connection_api import ActionConnectionApi + +# there is a valid "action_connection" in the system +ACTION_CONNECTION_DATA_ID = environ["ACTION_CONNECTION_DATA_ID"] + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = ActionConnectionApi(api_client) + api_instance.delete_action_connection( + connection_id=ACTION_CONNECTION_DATA_ID, + ) diff --git a/examples/v2/action-connection/GetActionConnection.py b/examples/v2/action-connection/GetActionConnection.py new file mode 100644 index 0000000000..1d21aa7b15 --- /dev/null +++ b/examples/v2/action-connection/GetActionConnection.py @@ -0,0 +1,15 @@ +""" +Get an existing Action Connection returns "Successfully get Action Connection" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.action_connection_api import ActionConnectionApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = ActionConnectionApi(api_client) + response = api_instance.get_action_connection( + connection_id="cb460d51-3c88-4e87-adac-d47131d0423d", + ) + + print(response) diff --git a/examples/v2/action-connection/UpdateActionConnection.py b/examples/v2/action-connection/UpdateActionConnection.py new file mode 100644 index 0000000000..c17f4ca40d --- /dev/null +++ b/examples/v2/action-connection/UpdateActionConnection.py @@ -0,0 +1,38 @@ +""" +Update an existing Action Connection returns "Successfully updated Action Connection" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.action_connection_api import ActionConnectionApi +from datadog_api_client.v2.model.action_connection_attributes_update import ActionConnectionAttributesUpdate +from datadog_api_client.v2.model.action_connection_data_type import ActionConnectionDataType +from datadog_api_client.v2.model.action_connection_data_update import ActionConnectionDataUpdate +from datadog_api_client.v2.model.aws_assume_role_type import AWSAssumeRoleType +from datadog_api_client.v2.model.aws_assume_role_update import AWSAssumeRoleUpdate +from datadog_api_client.v2.model.aws_integration_type import AWSIntegrationType +from datadog_api_client.v2.model.aws_integration_update import AWSIntegrationUpdate +from datadog_api_client.v2.model.update_action_connection_request import UpdateActionConnectionRequest + +body = UpdateActionConnectionRequest( + data=ActionConnectionDataUpdate( + type=ActionConnectionDataType.ACTION_CONNECTION, + attributes=ActionConnectionAttributesUpdate( + name="Cassette Connection", + integration=AWSIntegrationUpdate( + type=AWSIntegrationType.AWS, + credentials=AWSAssumeRoleUpdate( + type=AWSAssumeRoleType.AWSASSUMEROLE, + role="MyRoleUpdated", + account_id="123456789123", + ), + ), + ), + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = ActionConnectionApi(api_client) + response = api_instance.update_action_connection(connection_id="cb460d51-3c88-4e87-adac-d47131d0423d", body=body) + + print(response) diff --git a/src/datadog_api_client/v2/api/action_connection_api.py b/src/datadog_api_client/v2/api/action_connection_api.py new file mode 100644 index 0000000000..ca28b28b3c --- /dev/null +++ b/src/datadog_api_client/v2/api/action_connection_api.py @@ -0,0 +1,196 @@ +# 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. +from __future__ import annotations + +from typing import Any, Dict + +from datadog_api_client.api_client import ApiClient, Endpoint as _Endpoint +from datadog_api_client.configuration import Configuration +from datadog_api_client.v2.model.create_action_connection_response import CreateActionConnectionResponse +from datadog_api_client.v2.model.create_action_connection_request import CreateActionConnectionRequest +from datadog_api_client.v2.model.get_action_connection_response import GetActionConnectionResponse +from datadog_api_client.v2.model.update_action_connection_response import UpdateActionConnectionResponse +from datadog_api_client.v2.model.update_action_connection_request import UpdateActionConnectionRequest + + +class ActionConnectionApi: + """ + Action connections extend your installed integrations and allow you to take action in your third-party systems + (e.g. AWS, Gitlab, and Statuspage) with Datadog’s Workflow Automation and App Builder products. + + Datadog’s Integrations automatically provide authentication for Slack, Microsoft Teams, PagerDuty, Opsgenie, + JIRA, GitHub, and Statuspage. You do not need additional connections in order to access these tools within + Workflow Automation and App Builder. + + We offer granular access control for editing and resolving connections. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient(Configuration()) + self.api_client = api_client + + self._create_action_connection_endpoint = _Endpoint( + settings={ + "response_type": (CreateActionConnectionResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/actions/connections", + "operation_id": "create_action_connection", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (CreateActionConnectionRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._delete_action_connection_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/actions/connections/{connection_id}", + "operation_id": "delete_action_connection", + "http_method": "DELETE", + "version": "v2", + }, + params_map={ + "connection_id": { + "required": True, + "openapi_types": (str,), + "attribute": "connection_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["*/*"], + }, + api_client=api_client, + ) + + self._get_action_connection_endpoint = _Endpoint( + settings={ + "response_type": (GetActionConnectionResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/actions/connections/{connection_id}", + "operation_id": "get_action_connection", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "connection_id": { + "required": True, + "openapi_types": (str,), + "attribute": "connection_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._update_action_connection_endpoint = _Endpoint( + settings={ + "response_type": (UpdateActionConnectionResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/actions/connections/{connection_id}", + "operation_id": "update_action_connection", + "http_method": "PATCH", + "version": "v2", + }, + params_map={ + "connection_id": { + "required": True, + "openapi_types": (str,), + "attribute": "connection_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (UpdateActionConnectionRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + def create_action_connection( + self, + body: CreateActionConnectionRequest, + ) -> CreateActionConnectionResponse: + """Create a new Action Connection. + + Create a new Action Connection + + :type body: CreateActionConnectionRequest + :rtype: CreateActionConnectionResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._create_action_connection_endpoint.call_with_http_info(**kwargs) + + def delete_action_connection( + self, + connection_id: str, + ) -> None: + """Delete an existing Action Connection. + + Delete an existing Action Connection + + :param connection_id: The ID of the action connection + :type connection_id: str + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["connection_id"] = connection_id + + return self._delete_action_connection_endpoint.call_with_http_info(**kwargs) + + def get_action_connection( + self, + connection_id: str, + ) -> GetActionConnectionResponse: + """Get an existing Action Connection. + + Get an existing Action Connection + + :param connection_id: The ID of the action connection + :type connection_id: str + :rtype: GetActionConnectionResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["connection_id"] = connection_id + + return self._get_action_connection_endpoint.call_with_http_info(**kwargs) + + def update_action_connection( + self, + connection_id: str, + body: UpdateActionConnectionRequest, + ) -> UpdateActionConnectionResponse: + """Update an existing Action Connection. + + Update an existing Action Connection + + :param connection_id: The ID of the action connection + :type connection_id: str + :param body: Update an existing Action Connection request body + :type body: UpdateActionConnectionRequest + :rtype: UpdateActionConnectionResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["connection_id"] = connection_id + + kwargs["body"] = body + + return self._update_action_connection_endpoint.call_with_http_info(**kwargs) diff --git a/src/datadog_api_client/v2/apis/__init__.py b/src/datadog_api_client/v2/apis/__init__.py index c65d4efef3..6b663f7242 100644 --- a/src/datadog_api_client/v2/apis/__init__.py +++ b/src/datadog_api_client/v2/apis/__init__.py @@ -2,6 +2,7 @@ from datadog_api_client.v2.api.apm_retention_filters_api import APMRetentionFiltersApi from datadog_api_client.v2.api.aws_integration_api import AWSIntegrationApi from datadog_api_client.v2.api.aws_logs_integration_api import AWSLogsIntegrationApi +from datadog_api_client.v2.api.action_connection_api import ActionConnectionApi from datadog_api_client.v2.api.app_deployment_api import AppDeploymentApi from datadog_api_client.v2.api.apps_api import AppsApi from datadog_api_client.v2.api.audit_api import AuditApi @@ -68,6 +69,7 @@ "APMRetentionFiltersApi", "AWSIntegrationApi", "AWSLogsIntegrationApi", + "ActionConnectionApi", "AppDeploymentApi", "AppsApi", "AuditApi", diff --git a/src/datadog_api_client/v2/model/action_connection_attributes.py b/src/datadog_api_client/v2/model/action_connection_attributes.py new file mode 100644 index 0000000000..5d7ec6e05b --- /dev/null +++ b/src/datadog_api_client/v2/model/action_connection_attributes.py @@ -0,0 +1,50 @@ +# 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. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.action_connection_integration import ActionConnectionIntegration + from datadog_api_client.v2.model.aws_integration import AWSIntegration + from datadog_api_client.v2.model.http_integration import HTTPIntegration + + +class ActionConnectionAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.action_connection_integration import ActionConnectionIntegration + + return { + "integration": (ActionConnectionIntegration,), + "name": (str,), + } + + attribute_map = { + "integration": "integration", + "name": "name", + } + + def __init__( + self_, integration: Union[ActionConnectionIntegration, AWSIntegration, HTTPIntegration], name: str, **kwargs + ): + """ + The definition of ``ActionConnectionAttributes`` object. + + :param integration: The definition of ``ActionConnectionIntegration`` object. + :type integration: ActionConnectionIntegration + + :param name: Name of the connection + :type name: str + """ + super().__init__(kwargs) + + self_.integration = integration + self_.name = name diff --git a/src/datadog_api_client/v2/model/action_connection_attributes_update.py b/src/datadog_api_client/v2/model/action_connection_attributes_update.py new file mode 100644 index 0000000000..e30d087e72 --- /dev/null +++ b/src/datadog_api_client/v2/model/action_connection_attributes_update.py @@ -0,0 +1,58 @@ +# 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. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.action_connection_integration_update import ActionConnectionIntegrationUpdate + from datadog_api_client.v2.model.aws_integration_update import AWSIntegrationUpdate + from datadog_api_client.v2.model.http_integration_update import HTTPIntegrationUpdate + + +class ActionConnectionAttributesUpdate(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.action_connection_integration_update import ActionConnectionIntegrationUpdate + + return { + "integration": (ActionConnectionIntegrationUpdate,), + "name": (str,), + } + + attribute_map = { + "integration": "integration", + "name": "name", + } + + def __init__( + self_, + integration: Union[ + ActionConnectionIntegrationUpdate, AWSIntegrationUpdate, HTTPIntegrationUpdate, UnsetType + ] = unset, + name: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + The definition of ``ActionConnectionAttributesUpdate`` object. + + :param integration: The definition of ``ActionConnectionIntegrationUpdate`` object. + :type integration: ActionConnectionIntegrationUpdate, optional + + :param name: Name of the connection + :type name: str, optional + """ + if integration is not unset: + kwargs["integration"] = integration + if name is not unset: + kwargs["name"] = name + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/action_connection_data.py b/src/datadog_api_client/v2/model/action_connection_data.py new file mode 100644 index 0000000000..dfe4812701 --- /dev/null +++ b/src/datadog_api_client/v2/model/action_connection_data.py @@ -0,0 +1,66 @@ +# 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. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.action_connection_attributes import ActionConnectionAttributes + from datadog_api_client.v2.model.action_connection_data_type import ActionConnectionDataType + + +class ActionConnectionData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.action_connection_attributes import ActionConnectionAttributes + from datadog_api_client.v2.model.action_connection_data_type import ActionConnectionDataType + + return { + "attributes": (ActionConnectionAttributes,), + "id": (str,), + "type": (ActionConnectionDataType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + read_only_vars = { + "id", + } + + def __init__( + self_, + attributes: ActionConnectionAttributes, + type: ActionConnectionDataType, + id: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Data related to the connection. + + :param attributes: The definition of ``ActionConnectionAttributes`` object. + :type attributes: ActionConnectionAttributes + + :param id: The connection identifier + :type id: str, optional + + :param type: The definition of ``ActionConnectionDataType`` object. + :type type: ActionConnectionDataType + """ + if id is not unset: + kwargs["id"] = id + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/action_connection_data_type.py b/src/datadog_api_client/v2/model/action_connection_data_type.py new file mode 100644 index 0000000000..d8690f2807 --- /dev/null +++ b/src/datadog_api_client/v2/model/action_connection_data_type.py @@ -0,0 +1,35 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class ActionConnectionDataType(ModelSimple): + """ + The definition of `ActionConnectionDataType` object. + + :param value: If omitted defaults to "action_connection". Must be one of ["action_connection"]. + :type value: str + """ + + allowed_values = { + "action_connection", + } + ACTION_CONNECTION: ClassVar["ActionConnectionDataType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +ActionConnectionDataType.ACTION_CONNECTION = ActionConnectionDataType("action_connection") diff --git a/src/datadog_api_client/v2/model/action_connection_data_update.py b/src/datadog_api_client/v2/model/action_connection_data_update.py new file mode 100644 index 0000000000..5a9828eb9e --- /dev/null +++ b/src/datadog_api_client/v2/model/action_connection_data_update.py @@ -0,0 +1,48 @@ +# 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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.action_connection_attributes_update import ActionConnectionAttributesUpdate + from datadog_api_client.v2.model.action_connection_data_type import ActionConnectionDataType + + +class ActionConnectionDataUpdate(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.action_connection_attributes_update import ActionConnectionAttributesUpdate + from datadog_api_client.v2.model.action_connection_data_type import ActionConnectionDataType + + return { + "attributes": (ActionConnectionAttributesUpdate,), + "type": (ActionConnectionDataType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__(self_, attributes: ActionConnectionAttributesUpdate, type: ActionConnectionDataType, **kwargs): + """ + Data related to the connection update. + + :param attributes: The definition of ``ActionConnectionAttributesUpdate`` object. + :type attributes: ActionConnectionAttributesUpdate + + :param type: The definition of ``ActionConnectionDataType`` object. + :type type: ActionConnectionDataType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/action_connection_integration.py b/src/datadog_api_client/v2/model/action_connection_integration.py new file mode 100644 index 0000000000..23301ee351 --- /dev/null +++ b/src/datadog_api_client/v2/model/action_connection_integration.py @@ -0,0 +1,46 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelComposed, + cached_property, +) + + +class ActionConnectionIntegration(ModelComposed): + def __init__(self, **kwargs): + """ + The definition of ``ActionConnectionIntegration`` object. + + :param credentials: The definition of `AWSCredentials` object. + :type credentials: AWSCredentials + + :param type: The definition of `AWSIntegrationType` object. + :type type: AWSIntegrationType + + :param base_url: Base HTTP url for the integration + :type base_url: str + """ + super().__init__(kwargs) + + @cached_property + def _composed_schemas(_): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + from datadog_api_client.v2.model.aws_integration import AWSIntegration + from datadog_api_client.v2.model.http_integration import HTTPIntegration + + return { + "oneOf": [ + AWSIntegration, + HTTPIntegration, + ], + } diff --git a/src/datadog_api_client/v2/model/action_connection_integration_update.py b/src/datadog_api_client/v2/model/action_connection_integration_update.py new file mode 100644 index 0000000000..20760fbd0c --- /dev/null +++ b/src/datadog_api_client/v2/model/action_connection_integration_update.py @@ -0,0 +1,46 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelComposed, + cached_property, +) + + +class ActionConnectionIntegrationUpdate(ModelComposed): + def __init__(self, **kwargs): + """ + The definition of ``ActionConnectionIntegrationUpdate`` object. + + :param credentials: The definition of `AWSCredentialsUpdate` object. + :type credentials: AWSCredentialsUpdate, optional + + :param type: The definition of `AWSIntegrationType` object. + :type type: AWSIntegrationType + + :param base_url: Base HTTP url for the integration + :type base_url: str, optional + """ + super().__init__(kwargs) + + @cached_property + def _composed_schemas(_): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + from datadog_api_client.v2.model.aws_integration_update import AWSIntegrationUpdate + from datadog_api_client.v2.model.http_integration_update import HTTPIntegrationUpdate + + return { + "oneOf": [ + AWSIntegrationUpdate, + HTTPIntegrationUpdate, + ], + } diff --git a/src/datadog_api_client/v2/model/aws_assume_role.py b/src/datadog_api_client/v2/model/aws_assume_role.py new file mode 100644 index 0000000000..7b5aa9e80f --- /dev/null +++ b/src/datadog_api_client/v2/model/aws_assume_role.py @@ -0,0 +1,84 @@ +# 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. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.aws_assume_role_type import AWSAssumeRoleType + + +class AWSAssumeRole(ModelNormal): + validations = { + "account_id": {}, + } + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.aws_assume_role_type import AWSAssumeRoleType + + return { + "account_id": (str,), + "external_id": (str,), + "principal_id": (str,), + "role": (str,), + "type": (AWSAssumeRoleType,), + } + + attribute_map = { + "account_id": "account_id", + "external_id": "external_id", + "principal_id": "principal_id", + "role": "role", + "type": "type", + } + read_only_vars = { + "external_id", + "principal_id", + } + + def __init__( + self_, + account_id: str, + role: str, + type: AWSAssumeRoleType, + external_id: Union[str, UnsetType] = unset, + principal_id: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + The definition of ``AWSAssumeRole`` object. + + :param account_id: AWS account the connection is created for + :type account_id: str + + :param external_id: External ID used to scope which connection can be used to assume the role + :type external_id: str, optional + + :param principal_id: AWS account that will assume the role + :type principal_id: str, optional + + :param role: Role to assume + :type role: str + + :param type: The definition of ``AWSAssumeRoleType`` object. + :type type: AWSAssumeRoleType + """ + if external_id is not unset: + kwargs["external_id"] = external_id + if principal_id is not unset: + kwargs["principal_id"] = principal_id + super().__init__(kwargs) + + self_.account_id = account_id + self_.role = role + self_.type = type diff --git a/src/datadog_api_client/v2/model/aws_assume_role_type.py b/src/datadog_api_client/v2/model/aws_assume_role_type.py new file mode 100644 index 0000000000..251026c553 --- /dev/null +++ b/src/datadog_api_client/v2/model/aws_assume_role_type.py @@ -0,0 +1,35 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class AWSAssumeRoleType(ModelSimple): + """ + The definition of `AWSAssumeRoleType` object. + + :param value: If omitted defaults to "AWSAssumeRole". Must be one of ["AWSAssumeRole"]. + :type value: str + """ + + allowed_values = { + "AWSAssumeRole", + } + AWSASSUMEROLE: ClassVar["AWSAssumeRoleType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +AWSAssumeRoleType.AWSASSUMEROLE = AWSAssumeRoleType("AWSAssumeRole") diff --git a/src/datadog_api_client/v2/model/aws_assume_role_update.py b/src/datadog_api_client/v2/model/aws_assume_role_update.py new file mode 100644 index 0000000000..fa9fd395a5 --- /dev/null +++ b/src/datadog_api_client/v2/model/aws_assume_role_update.py @@ -0,0 +1,74 @@ +# 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. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.aws_assume_role_type import AWSAssumeRoleType + + +class AWSAssumeRoleUpdate(ModelNormal): + validations = { + "account_id": {}, + } + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.aws_assume_role_type import AWSAssumeRoleType + + return { + "account_id": (str,), + "generate_new_external_id": (bool,), + "role": (str,), + "type": (AWSAssumeRoleType,), + } + + attribute_map = { + "account_id": "account_id", + "generate_new_external_id": "generate_new_external_id", + "role": "role", + "type": "type", + } + + def __init__( + self_, + type: AWSAssumeRoleType, + account_id: Union[str, UnsetType] = unset, + generate_new_external_id: Union[bool, UnsetType] = unset, + role: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + The definition of ``AWSAssumeRoleUpdate`` object. + + :param account_id: AWS account the connection is created for + :type account_id: str, optional + + :param generate_new_external_id: The ``AWSAssumeRoleUpdate`` ``generate_new_external_id``. + :type generate_new_external_id: bool, optional + + :param role: Role to assume + :type role: str, optional + + :param type: The definition of ``AWSAssumeRoleType`` object. + :type type: AWSAssumeRoleType + """ + if account_id is not unset: + kwargs["account_id"] = account_id + if generate_new_external_id is not unset: + kwargs["generate_new_external_id"] = generate_new_external_id + if role is not unset: + kwargs["role"] = role + super().__init__(kwargs) + + self_.type = type diff --git a/src/datadog_api_client/v2/model/aws_credentials.py b/src/datadog_api_client/v2/model/aws_credentials.py new file mode 100644 index 0000000000..533c46f0b1 --- /dev/null +++ b/src/datadog_api_client/v2/model/aws_credentials.py @@ -0,0 +1,50 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelComposed, + cached_property, +) + + +class AWSCredentials(ModelComposed): + def __init__(self, **kwargs): + """ + The definition of ``AWSCredentials`` object. + + :param account_id: AWS account the connection is created for + :type account_id: str + + :param external_id: External ID used to scope which connection can be used to assume the role + :type external_id: str, optional + + :param principal_id: AWS account that will assume the role + :type principal_id: str, optional + + :param role: Role to assume + :type role: str + + :param type: The definition of `AWSAssumeRoleType` object. + :type type: AWSAssumeRoleType + """ + super().__init__(kwargs) + + @cached_property + def _composed_schemas(_): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + from datadog_api_client.v2.model.aws_assume_role import AWSAssumeRole + + return { + "oneOf": [ + AWSAssumeRole, + ], + } diff --git a/src/datadog_api_client/v2/model/aws_credentials_update.py b/src/datadog_api_client/v2/model/aws_credentials_update.py new file mode 100644 index 0000000000..1339823687 --- /dev/null +++ b/src/datadog_api_client/v2/model/aws_credentials_update.py @@ -0,0 +1,47 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelComposed, + cached_property, +) + + +class AWSCredentialsUpdate(ModelComposed): + def __init__(self, **kwargs): + """ + The definition of ``AWSCredentialsUpdate`` object. + + :param account_id: AWS account the connection is created for + :type account_id: str, optional + + :param generate_new_external_id: The `AWSAssumeRoleUpdate` `generate_new_external_id`. + :type generate_new_external_id: bool, optional + + :param role: Role to assume + :type role: str, optional + + :param type: The definition of `AWSAssumeRoleType` object. + :type type: AWSAssumeRoleType + """ + super().__init__(kwargs) + + @cached_property + def _composed_schemas(_): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + from datadog_api_client.v2.model.aws_assume_role_update import AWSAssumeRoleUpdate + + return { + "oneOf": [ + AWSAssumeRoleUpdate, + ], + } diff --git a/src/datadog_api_client/v2/model/aws_integration.py b/src/datadog_api_client/v2/model/aws_integration.py new file mode 100644 index 0000000000..0ebac5e091 --- /dev/null +++ b/src/datadog_api_client/v2/model/aws_integration.py @@ -0,0 +1,49 @@ +# 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. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.aws_credentials import AWSCredentials + from datadog_api_client.v2.model.aws_integration_type import AWSIntegrationType + from datadog_api_client.v2.model.aws_assume_role import AWSAssumeRole + + +class AWSIntegration(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.aws_credentials import AWSCredentials + from datadog_api_client.v2.model.aws_integration_type import AWSIntegrationType + + return { + "credentials": (AWSCredentials,), + "type": (AWSIntegrationType,), + } + + attribute_map = { + "credentials": "credentials", + "type": "type", + } + + def __init__(self_, credentials: Union[AWSCredentials, AWSAssumeRole], type: AWSIntegrationType, **kwargs): + """ + The definition of ``AWSIntegration`` object. + + :param credentials: The definition of ``AWSCredentials`` object. + :type credentials: AWSCredentials + + :param type: The definition of ``AWSIntegrationType`` object. + :type type: AWSIntegrationType + """ + super().__init__(kwargs) + + self_.credentials = credentials + self_.type = type diff --git a/src/datadog_api_client/v2/model/aws_integration_type.py b/src/datadog_api_client/v2/model/aws_integration_type.py new file mode 100644 index 0000000000..35f8078a85 --- /dev/null +++ b/src/datadog_api_client/v2/model/aws_integration_type.py @@ -0,0 +1,35 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class AWSIntegrationType(ModelSimple): + """ + The definition of `AWSIntegrationType` object. + + :param value: If omitted defaults to "AWS". Must be one of ["AWS"]. + :type value: str + """ + + allowed_values = { + "AWS", + } + AWS: ClassVar["AWSIntegrationType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +AWSIntegrationType.AWS = AWSIntegrationType("AWS") diff --git a/src/datadog_api_client/v2/model/aws_integration_update.py b/src/datadog_api_client/v2/model/aws_integration_update.py new file mode 100644 index 0000000000..ccb2ab20fb --- /dev/null +++ b/src/datadog_api_client/v2/model/aws_integration_update.py @@ -0,0 +1,57 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.aws_credentials_update import AWSCredentialsUpdate + from datadog_api_client.v2.model.aws_integration_type import AWSIntegrationType + from datadog_api_client.v2.model.aws_assume_role_update import AWSAssumeRoleUpdate + + +class AWSIntegrationUpdate(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.aws_credentials_update import AWSCredentialsUpdate + from datadog_api_client.v2.model.aws_integration_type import AWSIntegrationType + + return { + "credentials": (AWSCredentialsUpdate,), + "type": (AWSIntegrationType,), + } + + attribute_map = { + "credentials": "credentials", + "type": "type", + } + + def __init__( + self_, + type: AWSIntegrationType, + credentials: Union[AWSCredentialsUpdate, AWSAssumeRoleUpdate, UnsetType] = unset, + **kwargs, + ): + """ + The definition of ``AWSIntegrationUpdate`` object. + + :param credentials: The definition of ``AWSCredentialsUpdate`` object. + :type credentials: AWSCredentialsUpdate, optional + + :param type: The definition of ``AWSIntegrationType`` object. + :type type: AWSIntegrationType + """ + if credentials is not unset: + kwargs["credentials"] = credentials + super().__init__(kwargs) + + self_.type = type diff --git a/src/datadog_api_client/v2/model/create_action_connection_request.py b/src/datadog_api_client/v2/model/create_action_connection_request.py new file mode 100644 index 0000000000..084cb61758 --- /dev/null +++ b/src/datadog_api_client/v2/model/create_action_connection_request.py @@ -0,0 +1,40 @@ +# 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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.action_connection_data import ActionConnectionData + + +class CreateActionConnectionRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.action_connection_data import ActionConnectionData + + return { + "data": (ActionConnectionData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: ActionConnectionData, **kwargs): + """ + Request used to create an action connection. + + :param data: Data related to the connection. + :type data: ActionConnectionData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/create_action_connection_response.py b/src/datadog_api_client/v2/model/create_action_connection_response.py new file mode 100644 index 0000000000..1f062437da --- /dev/null +++ b/src/datadog_api_client/v2/model/create_action_connection_response.py @@ -0,0 +1,42 @@ +# 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. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.action_connection_data import ActionConnectionData + + +class CreateActionConnectionResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.action_connection_data import ActionConnectionData + + return { + "data": (ActionConnectionData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[ActionConnectionData, UnsetType] = unset, **kwargs): + """ + The response for a created connection + + :param data: Data related to the connection. + :type data: ActionConnectionData, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/get_action_connection_response.py b/src/datadog_api_client/v2/model/get_action_connection_response.py new file mode 100644 index 0000000000..84f906ee83 --- /dev/null +++ b/src/datadog_api_client/v2/model/get_action_connection_response.py @@ -0,0 +1,42 @@ +# 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. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.action_connection_data import ActionConnectionData + + +class GetActionConnectionResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.action_connection_data import ActionConnectionData + + return { + "data": (ActionConnectionData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[ActionConnectionData, UnsetType] = unset, **kwargs): + """ + The response for found connection + + :param data: Data related to the connection. + :type data: ActionConnectionData, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/http_body.py b/src/datadog_api_client/v2/model/http_body.py new file mode 100644 index 0000000000..1dcf17e1e5 --- /dev/null +++ b/src/datadog_api_client/v2/model/http_body.py @@ -0,0 +1,43 @@ +# 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. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class HTTPBody(ModelNormal): + @cached_property + def openapi_types(_): + return { + "content": (str,), + "content_type": (str,), + } + + attribute_map = { + "content": "content", + "content_type": "content_type", + } + + def __init__(self_, content: Union[str, UnsetType] = unset, content_type: Union[str, UnsetType] = unset, **kwargs): + """ + The definition of ``HTTPBody`` object. + + :param content: Serialized body content + :type content: str, optional + + :param content_type: Content type of the body + :type content_type: str, optional + """ + if content is not unset: + kwargs["content"] = content + if content_type is not unset: + kwargs["content_type"] = content_type + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/http_credentials.py b/src/datadog_api_client/v2/model/http_credentials.py new file mode 100644 index 0000000000..9fc4ef6fb0 --- /dev/null +++ b/src/datadog_api_client/v2/model/http_credentials.py @@ -0,0 +1,50 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelComposed, + cached_property, +) + + +class HTTPCredentials(ModelComposed): + def __init__(self, **kwargs): + """ + The definition of ``HTTPCredentials`` object. + + :param body: The definition of `HTTPBody` object. + :type body: HTTPBody, optional + + :param headers: The `HTTPTokenAuth` `headers`. + :type headers: [HTTPHeader], optional + + :param tokens: The `HTTPTokenAuth` `tokens`. + :type tokens: [HTTPToken], optional + + :param type: The definition of `HTTPTokenAuthType` object. + :type type: HTTPTokenAuthType + + :param url_parameters: The `HTTPTokenAuth` `url_parameters`. + :type url_parameters: [UrlParam], optional + """ + super().__init__(kwargs) + + @cached_property + def _composed_schemas(_): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + from datadog_api_client.v2.model.http_token_auth import HTTPTokenAuth + + return { + "oneOf": [ + HTTPTokenAuth, + ], + } diff --git a/src/datadog_api_client/v2/model/http_credentials_update.py b/src/datadog_api_client/v2/model/http_credentials_update.py new file mode 100644 index 0000000000..66a37071ee --- /dev/null +++ b/src/datadog_api_client/v2/model/http_credentials_update.py @@ -0,0 +1,50 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelComposed, + cached_property, +) + + +class HTTPCredentialsUpdate(ModelComposed): + def __init__(self, **kwargs): + """ + The definition of ``HTTPCredentialsUpdate`` object. + + :param body: The definition of `HTTPBody` object. + :type body: HTTPBody, optional + + :param headers: The `HTTPTokenAuthUpdate` `headers`. + :type headers: [HTTPHeaderUpdate], optional + + :param tokens: The `HTTPTokenAuthUpdate` `tokens`. + :type tokens: [HTTPTokenUpdate], optional + + :param type: The definition of `HTTPTokenAuthType` object. + :type type: HTTPTokenAuthType + + :param url_parameters: The `HTTPTokenAuthUpdate` `url_parameters`. + :type url_parameters: [UrlParamUpdate], optional + """ + super().__init__(kwargs) + + @cached_property + def _composed_schemas(_): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + from datadog_api_client.v2.model.http_token_auth_update import HTTPTokenAuthUpdate + + return { + "oneOf": [ + HTTPTokenAuthUpdate, + ], + } diff --git a/src/datadog_api_client/v2/model/http_header.py b/src/datadog_api_client/v2/model/http_header.py new file mode 100644 index 0000000000..e4a6c27e12 --- /dev/null +++ b/src/datadog_api_client/v2/model/http_header.py @@ -0,0 +1,43 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class HTTPHeader(ModelNormal): + validations = { + "name": {}, + } + + @cached_property + def openapi_types(_): + return { + "name": (str,), + "value": (str,), + } + + attribute_map = { + "name": "name", + "value": "value", + } + + def __init__(self_, name: str, value: str, **kwargs): + """ + The definition of ``HTTPHeader`` object. + + :param name: The ``HTTPHeader`` ``name``. + :type name: str + + :param value: The ``HTTPHeader`` ``value``. + :type value: str + """ + super().__init__(kwargs) + + self_.name = name + self_.value = value diff --git a/src/datadog_api_client/v2/model/http_header_update.py b/src/datadog_api_client/v2/model/http_header_update.py new file mode 100644 index 0000000000..5cb7de904b --- /dev/null +++ b/src/datadog_api_client/v2/model/http_header_update.py @@ -0,0 +1,56 @@ +# 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. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class HTTPHeaderUpdate(ModelNormal): + validations = { + "name": {}, + } + + @cached_property + def openapi_types(_): + return { + "deleted": (bool,), + "name": (str,), + "value": (str,), + } + + attribute_map = { + "deleted": "deleted", + "name": "name", + "value": "value", + } + + def __init__( + self_, name: str, deleted: Union[bool, UnsetType] = unset, value: Union[str, UnsetType] = unset, **kwargs + ): + """ + The definition of ``HTTPHeaderUpdate`` object. + + :param deleted: Should the header be deleted. + :type deleted: bool, optional + + :param name: The ``HTTPHeaderUpdate`` ``name``. + :type name: str + + :param value: The ``HTTPHeaderUpdate`` ``value``. + :type value: str, optional + """ + if deleted is not unset: + kwargs["deleted"] = deleted + if value is not unset: + kwargs["value"] = value + super().__init__(kwargs) + + self_.name = name diff --git a/src/datadog_api_client/v2/model/http_integration.py b/src/datadog_api_client/v2/model/http_integration.py new file mode 100644 index 0000000000..c74c849571 --- /dev/null +++ b/src/datadog_api_client/v2/model/http_integration.py @@ -0,0 +1,61 @@ +# 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. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.http_credentials import HTTPCredentials + from datadog_api_client.v2.model.http_integration_type import HTTPIntegrationType + from datadog_api_client.v2.model.http_token_auth import HTTPTokenAuth + + +class HTTPIntegration(ModelNormal): + validations = { + "base_url": {}, + } + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.http_credentials import HTTPCredentials + from datadog_api_client.v2.model.http_integration_type import HTTPIntegrationType + + return { + "base_url": (str,), + "credentials": (HTTPCredentials,), + "type": (HTTPIntegrationType,), + } + + attribute_map = { + "base_url": "base_url", + "credentials": "credentials", + "type": "type", + } + + def __init__( + self_, base_url: str, credentials: Union[HTTPCredentials, HTTPTokenAuth], type: HTTPIntegrationType, **kwargs + ): + """ + The definition of ``HTTPIntegration`` object. + + :param base_url: Base HTTP url for the integration + :type base_url: str + + :param credentials: The definition of ``HTTPCredentials`` object. + :type credentials: HTTPCredentials + + :param type: The definition of ``HTTPIntegrationType`` object. + :type type: HTTPIntegrationType + """ + super().__init__(kwargs) + + self_.base_url = base_url + self_.credentials = credentials + self_.type = type diff --git a/src/datadog_api_client/v2/model/http_integration_type.py b/src/datadog_api_client/v2/model/http_integration_type.py new file mode 100644 index 0000000000..3c1bdd088a --- /dev/null +++ b/src/datadog_api_client/v2/model/http_integration_type.py @@ -0,0 +1,35 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class HTTPIntegrationType(ModelSimple): + """ + The definition of `HTTPIntegrationType` object. + + :param value: If omitted defaults to "HTTP". Must be one of ["HTTP"]. + :type value: str + """ + + allowed_values = { + "HTTP", + } + HTTP: ClassVar["HTTPIntegrationType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +HTTPIntegrationType.HTTP = HTTPIntegrationType("HTTP") diff --git a/src/datadog_api_client/v2/model/http_integration_update.py b/src/datadog_api_client/v2/model/http_integration_update.py new file mode 100644 index 0000000000..0cb70dd7e4 --- /dev/null +++ b/src/datadog_api_client/v2/model/http_integration_update.py @@ -0,0 +1,69 @@ +# 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. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.http_credentials_update import HTTPCredentialsUpdate + from datadog_api_client.v2.model.http_integration_type import HTTPIntegrationType + from datadog_api_client.v2.model.http_token_auth_update import HTTPTokenAuthUpdate + + +class HTTPIntegrationUpdate(ModelNormal): + validations = { + "base_url": {}, + } + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.http_credentials_update import HTTPCredentialsUpdate + from datadog_api_client.v2.model.http_integration_type import HTTPIntegrationType + + return { + "base_url": (str,), + "credentials": (HTTPCredentialsUpdate,), + "type": (HTTPIntegrationType,), + } + + attribute_map = { + "base_url": "base_url", + "credentials": "credentials", + "type": "type", + } + + def __init__( + self_, + type: HTTPIntegrationType, + base_url: Union[str, UnsetType] = unset, + credentials: Union[HTTPCredentialsUpdate, HTTPTokenAuthUpdate, UnsetType] = unset, + **kwargs, + ): + """ + The definition of ``HTTPIntegrationUpdate`` object. + + :param base_url: Base HTTP url for the integration + :type base_url: str, optional + + :param credentials: The definition of ``HTTPCredentialsUpdate`` object. + :type credentials: HTTPCredentialsUpdate, optional + + :param type: The definition of ``HTTPIntegrationType`` object. + :type type: HTTPIntegrationType + """ + if base_url is not unset: + kwargs["base_url"] = base_url + if credentials is not unset: + kwargs["credentials"] = credentials + super().__init__(kwargs) + + self_.type = type diff --git a/src/datadog_api_client/v2/model/http_token.py b/src/datadog_api_client/v2/model/http_token.py new file mode 100644 index 0000000000..8983f5e2a8 --- /dev/null +++ b/src/datadog_api_client/v2/model/http_token.py @@ -0,0 +1,56 @@ +# 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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.token_type import TokenType + + +class HTTPToken(ModelNormal): + validations = { + "name": {}, + } + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.token_type import TokenType + + return { + "name": (str,), + "type": (TokenType,), + "value": (str,), + } + + attribute_map = { + "name": "name", + "type": "type", + "value": "value", + } + + def __init__(self_, name: str, type: TokenType, value: str, **kwargs): + """ + The definition of ``HTTPToken`` object. + + :param name: The ``HTTPToken`` ``name``. + :type name: str + + :param type: The definition of ``TokenType`` object. + :type type: TokenType + + :param value: The ``HTTPToken`` ``value``. + :type value: str + """ + super().__init__(kwargs) + + self_.name = name + self_.type = type + self_.value = value diff --git a/src/datadog_api_client/v2/model/http_token_auth.py b/src/datadog_api_client/v2/model/http_token_auth.py new file mode 100644 index 0000000000..6b5a583965 --- /dev/null +++ b/src/datadog_api_client/v2/model/http_token_auth.py @@ -0,0 +1,86 @@ +# 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. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.http_body import HTTPBody + from datadog_api_client.v2.model.http_header import HTTPHeader + from datadog_api_client.v2.model.http_token import HTTPToken + from datadog_api_client.v2.model.http_token_auth_type import HTTPTokenAuthType + from datadog_api_client.v2.model.url_param import UrlParam + + +class HTTPTokenAuth(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.http_body import HTTPBody + from datadog_api_client.v2.model.http_header import HTTPHeader + from datadog_api_client.v2.model.http_token import HTTPToken + from datadog_api_client.v2.model.http_token_auth_type import HTTPTokenAuthType + from datadog_api_client.v2.model.url_param import UrlParam + + return { + "body": (HTTPBody,), + "headers": ([HTTPHeader],), + "tokens": ([HTTPToken],), + "type": (HTTPTokenAuthType,), + "url_parameters": ([UrlParam],), + } + + attribute_map = { + "body": "body", + "headers": "headers", + "tokens": "tokens", + "type": "type", + "url_parameters": "url_parameters", + } + + def __init__( + self_, + type: HTTPTokenAuthType, + body: Union[HTTPBody, UnsetType] = unset, + headers: Union[List[HTTPHeader], UnsetType] = unset, + tokens: Union[List[HTTPToken], UnsetType] = unset, + url_parameters: Union[List[UrlParam], UnsetType] = unset, + **kwargs, + ): + """ + The definition of ``HTTPTokenAuth`` object. + + :param body: The definition of ``HTTPBody`` object. + :type body: HTTPBody, optional + + :param headers: The ``HTTPTokenAuth`` ``headers``. + :type headers: [HTTPHeader], optional + + :param tokens: The ``HTTPTokenAuth`` ``tokens``. + :type tokens: [HTTPToken], optional + + :param type: The definition of ``HTTPTokenAuthType`` object. + :type type: HTTPTokenAuthType + + :param url_parameters: The ``HTTPTokenAuth`` ``url_parameters``. + :type url_parameters: [UrlParam], optional + """ + if body is not unset: + kwargs["body"] = body + if headers is not unset: + kwargs["headers"] = headers + if tokens is not unset: + kwargs["tokens"] = tokens + if url_parameters is not unset: + kwargs["url_parameters"] = url_parameters + super().__init__(kwargs) + + self_.type = type diff --git a/src/datadog_api_client/v2/model/http_token_auth_type.py b/src/datadog_api_client/v2/model/http_token_auth_type.py new file mode 100644 index 0000000000..aa9292f73e --- /dev/null +++ b/src/datadog_api_client/v2/model/http_token_auth_type.py @@ -0,0 +1,35 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class HTTPTokenAuthType(ModelSimple): + """ + The definition of `HTTPTokenAuthType` object. + + :param value: If omitted defaults to "HTTPTokenAuth". Must be one of ["HTTPTokenAuth"]. + :type value: str + """ + + allowed_values = { + "HTTPTokenAuth", + } + HTTPTOKENAUTH: ClassVar["HTTPTokenAuthType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +HTTPTokenAuthType.HTTPTOKENAUTH = HTTPTokenAuthType("HTTPTokenAuth") diff --git a/src/datadog_api_client/v2/model/http_token_auth_update.py b/src/datadog_api_client/v2/model/http_token_auth_update.py new file mode 100644 index 0000000000..6b562cac84 --- /dev/null +++ b/src/datadog_api_client/v2/model/http_token_auth_update.py @@ -0,0 +1,86 @@ +# 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. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.http_body import HTTPBody + from datadog_api_client.v2.model.http_header_update import HTTPHeaderUpdate + from datadog_api_client.v2.model.http_token_update import HTTPTokenUpdate + from datadog_api_client.v2.model.http_token_auth_type import HTTPTokenAuthType + from datadog_api_client.v2.model.url_param_update import UrlParamUpdate + + +class HTTPTokenAuthUpdate(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.http_body import HTTPBody + from datadog_api_client.v2.model.http_header_update import HTTPHeaderUpdate + from datadog_api_client.v2.model.http_token_update import HTTPTokenUpdate + from datadog_api_client.v2.model.http_token_auth_type import HTTPTokenAuthType + from datadog_api_client.v2.model.url_param_update import UrlParamUpdate + + return { + "body": (HTTPBody,), + "headers": ([HTTPHeaderUpdate],), + "tokens": ([HTTPTokenUpdate],), + "type": (HTTPTokenAuthType,), + "url_parameters": ([UrlParamUpdate],), + } + + attribute_map = { + "body": "body", + "headers": "headers", + "tokens": "tokens", + "type": "type", + "url_parameters": "url_parameters", + } + + def __init__( + self_, + type: HTTPTokenAuthType, + body: Union[HTTPBody, UnsetType] = unset, + headers: Union[List[HTTPHeaderUpdate], UnsetType] = unset, + tokens: Union[List[HTTPTokenUpdate], UnsetType] = unset, + url_parameters: Union[List[UrlParamUpdate], UnsetType] = unset, + **kwargs, + ): + """ + The definition of ``HTTPTokenAuthUpdate`` object. + + :param body: The definition of ``HTTPBody`` object. + :type body: HTTPBody, optional + + :param headers: The ``HTTPTokenAuthUpdate`` ``headers``. + :type headers: [HTTPHeaderUpdate], optional + + :param tokens: The ``HTTPTokenAuthUpdate`` ``tokens``. + :type tokens: [HTTPTokenUpdate], optional + + :param type: The definition of ``HTTPTokenAuthType`` object. + :type type: HTTPTokenAuthType + + :param url_parameters: The ``HTTPTokenAuthUpdate`` ``url_parameters``. + :type url_parameters: [UrlParamUpdate], optional + """ + if body is not unset: + kwargs["body"] = body + if headers is not unset: + kwargs["headers"] = headers + if tokens is not unset: + kwargs["tokens"] = tokens + if url_parameters is not unset: + kwargs["url_parameters"] = url_parameters + super().__init__(kwargs) + + self_.type = type diff --git a/src/datadog_api_client/v2/model/http_token_update.py b/src/datadog_api_client/v2/model/http_token_update.py new file mode 100644 index 0000000000..6f71ef7478 --- /dev/null +++ b/src/datadog_api_client/v2/model/http_token_update.py @@ -0,0 +1,65 @@ +# 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. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.token_type import TokenType + + +class HTTPTokenUpdate(ModelNormal): + validations = { + "name": {}, + } + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.token_type import TokenType + + return { + "deleted": (bool,), + "name": (str,), + "type": (TokenType,), + "value": (str,), + } + + attribute_map = { + "deleted": "deleted", + "name": "name", + "type": "type", + "value": "value", + } + + def __init__(self_, name: str, type: TokenType, value: str, deleted: Union[bool, UnsetType] = unset, **kwargs): + """ + The definition of ``HTTPTokenUpdate`` object. + + :param deleted: Should the header be deleted. + :type deleted: bool, optional + + :param name: The ``HTTPToken`` ``name``. + :type name: str + + :param type: The definition of ``TokenType`` object. + :type type: TokenType + + :param value: The ``HTTPToken`` ``value``. + :type value: str + """ + if deleted is not unset: + kwargs["deleted"] = deleted + super().__init__(kwargs) + + self_.name = name + self_.type = type + self_.value = value diff --git a/src/datadog_api_client/v2/model/token_type.py b/src/datadog_api_client/v2/model/token_type.py new file mode 100644 index 0000000000..8f9683171e --- /dev/null +++ b/src/datadog_api_client/v2/model/token_type.py @@ -0,0 +1,35 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class TokenType(ModelSimple): + """ + The definition of `TokenType` object. + + :param value: If omitted defaults to "SECRET". Must be one of ["SECRET"]. + :type value: str + """ + + allowed_values = { + "SECRET", + } + SECRET: ClassVar["TokenType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +TokenType.SECRET = TokenType("SECRET") diff --git a/src/datadog_api_client/v2/model/update_action_connection_request.py b/src/datadog_api_client/v2/model/update_action_connection_request.py new file mode 100644 index 0000000000..e9d931ed6d --- /dev/null +++ b/src/datadog_api_client/v2/model/update_action_connection_request.py @@ -0,0 +1,40 @@ +# 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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.action_connection_data_update import ActionConnectionDataUpdate + + +class UpdateActionConnectionRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.action_connection_data_update import ActionConnectionDataUpdate + + return { + "data": (ActionConnectionDataUpdate,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: ActionConnectionDataUpdate, **kwargs): + """ + Request used to update an action connection. + + :param data: Data related to the connection update. + :type data: ActionConnectionDataUpdate + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/update_action_connection_response.py b/src/datadog_api_client/v2/model/update_action_connection_response.py new file mode 100644 index 0000000000..6d90dd5b65 --- /dev/null +++ b/src/datadog_api_client/v2/model/update_action_connection_response.py @@ -0,0 +1,42 @@ +# 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. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.action_connection_data import ActionConnectionData + + +class UpdateActionConnectionResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.action_connection_data import ActionConnectionData + + return { + "data": (ActionConnectionData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[ActionConnectionData, UnsetType] = unset, **kwargs): + """ + The response for an updated connection. + + :param data: Data related to the connection. + :type data: ActionConnectionData, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/url_param.py b/src/datadog_api_client/v2/model/url_param.py new file mode 100644 index 0000000000..ba51c35a97 --- /dev/null +++ b/src/datadog_api_client/v2/model/url_param.py @@ -0,0 +1,43 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class UrlParam(ModelNormal): + validations = { + "name": {}, + } + + @cached_property + def openapi_types(_): + return { + "name": (str,), + "value": (str,), + } + + attribute_map = { + "name": "name", + "value": "value", + } + + def __init__(self_, name: str, value: str, **kwargs): + """ + The definition of ``UrlParam`` object. + + :param name: Name for tokens. + :type name: str + + :param value: The ``UrlParam`` ``value``. + :type value: str + """ + super().__init__(kwargs) + + self_.name = name + self_.value = value diff --git a/src/datadog_api_client/v2/model/url_param_update.py b/src/datadog_api_client/v2/model/url_param_update.py new file mode 100644 index 0000000000..8c7fe10629 --- /dev/null +++ b/src/datadog_api_client/v2/model/url_param_update.py @@ -0,0 +1,56 @@ +# 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. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class UrlParamUpdate(ModelNormal): + validations = { + "name": {}, + } + + @cached_property + def openapi_types(_): + return { + "deleted": (bool,), + "name": (str,), + "value": (str,), + } + + attribute_map = { + "deleted": "deleted", + "name": "name", + "value": "value", + } + + def __init__( + self_, name: str, deleted: Union[bool, UnsetType] = unset, value: Union[str, UnsetType] = unset, **kwargs + ): + """ + The definition of ``UrlParamUpdate`` object. + + :param deleted: Should the header be deleted. + :type deleted: bool, optional + + :param name: Name for tokens. + :type name: str + + :param value: The ``UrlParamUpdate`` ``value``. + :type value: str, optional + """ + if deleted is not unset: + kwargs["deleted"] = deleted + if value is not unset: + kwargs["value"] = value + super().__init__(kwargs) + + self_.name = name diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 2b47ff17bd..20f352d937 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -25,9 +25,17 @@ from datadog_api_client.v2.model.aws_account_update_request_attributes import AWSAccountUpdateRequestAttributes from datadog_api_client.v2.model.aws_account_update_request_data import AWSAccountUpdateRequestData from datadog_api_client.v2.model.aws_accounts_response import AWSAccountsResponse +from datadog_api_client.v2.model.aws_assume_role import AWSAssumeRole +from datadog_api_client.v2.model.aws_assume_role_type import AWSAssumeRoleType +from datadog_api_client.v2.model.aws_assume_role_update import AWSAssumeRoleUpdate from datadog_api_client.v2.model.aws_auth_config import AWSAuthConfig from datadog_api_client.v2.model.aws_auth_config_keys import AWSAuthConfigKeys from datadog_api_client.v2.model.aws_auth_config_role import AWSAuthConfigRole +from datadog_api_client.v2.model.aws_credentials import AWSCredentials +from datadog_api_client.v2.model.aws_credentials_update import AWSCredentialsUpdate +from datadog_api_client.v2.model.aws_integration import AWSIntegration +from datadog_api_client.v2.model.aws_integration_type import AWSIntegrationType +from datadog_api_client.v2.model.aws_integration_update import AWSIntegrationUpdate from datadog_api_client.v2.model.aws_lambda_forwarder_config import AWSLambdaForwarderConfig from datadog_api_client.v2.model.aws_logs_config import AWSLogsConfig from datadog_api_client.v2.model.aws_logs_services_response import AWSLogsServicesResponse @@ -52,6 +60,13 @@ from datadog_api_client.v2.model.aws_regions_include_only import AWSRegionsIncludeOnly from datadog_api_client.v2.model.aws_resources_config import AWSResourcesConfig from datadog_api_client.v2.model.aws_traces_config import AWSTracesConfig +from datadog_api_client.v2.model.action_connection_attributes import ActionConnectionAttributes +from datadog_api_client.v2.model.action_connection_attributes_update import ActionConnectionAttributesUpdate +from datadog_api_client.v2.model.action_connection_data import ActionConnectionData +from datadog_api_client.v2.model.action_connection_data_type import ActionConnectionDataType +from datadog_api_client.v2.model.action_connection_data_update import ActionConnectionDataUpdate +from datadog_api_client.v2.model.action_connection_integration import ActionConnectionIntegration +from datadog_api_client.v2.model.action_connection_integration_update import ActionConnectionIntegrationUpdate from datadog_api_client.v2.model.active_billing_dimensions_attributes import ActiveBillingDimensionsAttributes from datadog_api_client.v2.model.active_billing_dimensions_body import ActiveBillingDimensionsBody from datadog_api_client.v2.model.active_billing_dimensions_response import ActiveBillingDimensionsResponse @@ -447,6 +462,8 @@ from datadog_api_client.v2.model.cost_by_org_attributes import CostByOrgAttributes from datadog_api_client.v2.model.cost_by_org_response import CostByOrgResponse from datadog_api_client.v2.model.cost_by_org_type import CostByOrgType +from datadog_api_client.v2.model.create_action_connection_request import CreateActionConnectionRequest +from datadog_api_client.v2.model.create_action_connection_response import CreateActionConnectionResponse from datadog_api_client.v2.model.create_app_request import CreateAppRequest from datadog_api_client.v2.model.create_app_request_data import CreateAppRequestData from datadog_api_client.v2.model.create_app_request_data_attributes import CreateAppRequestDataAttributes @@ -883,6 +900,7 @@ from datadog_api_client.v2.model.gcpsts_service_accounts_response import GCPSTSServiceAccountsResponse from datadog_api_client.v2.model.gcp_service_account_meta import GCPServiceAccountMeta from datadog_api_client.v2.model.gcp_service_account_type import GCPServiceAccountType +from datadog_api_client.v2.model.get_action_connection_response import GetActionConnectionResponse from datadog_api_client.v2.model.get_app_response import GetAppResponse from datadog_api_client.v2.model.get_app_response_data import GetAppResponseData from datadog_api_client.v2.model.get_app_response_data_attributes import GetAppResponseDataAttributes @@ -898,12 +916,25 @@ from datadog_api_client.v2.model.get_team_memberships_sort import GetTeamMembershipsSort from datadog_api_client.v2.model.group_scalar_column import GroupScalarColumn from datadog_api_client.v2.model.group_tags import GroupTags +from datadog_api_client.v2.model.http_body import HTTPBody from datadog_api_client.v2.model.httpci_app_error import HTTPCIAppError from datadog_api_client.v2.model.httpci_app_errors import HTTPCIAppErrors +from datadog_api_client.v2.model.http_credentials import HTTPCredentials +from datadog_api_client.v2.model.http_credentials_update import HTTPCredentialsUpdate +from datadog_api_client.v2.model.http_header import HTTPHeader +from datadog_api_client.v2.model.http_header_update import HTTPHeaderUpdate +from datadog_api_client.v2.model.http_integration import HTTPIntegration +from datadog_api_client.v2.model.http_integration_type import HTTPIntegrationType +from datadog_api_client.v2.model.http_integration_update import HTTPIntegrationUpdate from datadog_api_client.v2.model.http_log import HTTPLog from datadog_api_client.v2.model.http_log_error import HTTPLogError from datadog_api_client.v2.model.http_log_errors import HTTPLogErrors from datadog_api_client.v2.model.http_log_item import HTTPLogItem +from datadog_api_client.v2.model.http_token import HTTPToken +from datadog_api_client.v2.model.http_token_auth import HTTPTokenAuth +from datadog_api_client.v2.model.http_token_auth_type import HTTPTokenAuthType +from datadog_api_client.v2.model.http_token_auth_update import HTTPTokenAuthUpdate +from datadog_api_client.v2.model.http_token_update import HTTPTokenUpdate from datadog_api_client.v2.model.historical_job_data_type import HistoricalJobDataType from datadog_api_client.v2.model.historical_job_list_meta import HistoricalJobListMeta from datadog_api_client.v2.model.historical_job_options import HistoricalJobOptions @@ -2216,7 +2247,10 @@ from datadog_api_client.v2.model.timeseries_response_times import TimeseriesResponseTimes from datadog_api_client.v2.model.timeseries_response_values import TimeseriesResponseValues from datadog_api_client.v2.model.timeseries_response_values_list import TimeseriesResponseValuesList +from datadog_api_client.v2.model.token_type import TokenType from datadog_api_client.v2.model.unit import Unit +from datadog_api_client.v2.model.update_action_connection_request import UpdateActionConnectionRequest +from datadog_api_client.v2.model.update_action_connection_response import UpdateActionConnectionResponse from datadog_api_client.v2.model.update_app_request import UpdateAppRequest from datadog_api_client.v2.model.update_app_request_data import UpdateAppRequestData from datadog_api_client.v2.model.update_app_request_data_attributes import UpdateAppRequestDataAttributes @@ -2238,6 +2272,8 @@ from datadog_api_client.v2.model.upsert_catalog_entity_response_included_item import ( UpsertCatalogEntityResponseIncludedItem, ) +from datadog_api_client.v2.model.url_param import UrlParam +from datadog_api_client.v2.model.url_param_update import UrlParamUpdate from datadog_api_client.v2.model.usage_application_security_monitoring_response import ( UsageApplicationSecurityMonitoringResponse, ) @@ -2353,9 +2389,17 @@ "AWSAccountUpdateRequestAttributes", "AWSAccountUpdateRequestData", "AWSAccountsResponse", + "AWSAssumeRole", + "AWSAssumeRoleType", + "AWSAssumeRoleUpdate", "AWSAuthConfig", "AWSAuthConfigKeys", "AWSAuthConfigRole", + "AWSCredentials", + "AWSCredentialsUpdate", + "AWSIntegration", + "AWSIntegrationType", + "AWSIntegrationUpdate", "AWSLambdaForwarderConfig", "AWSLogsConfig", "AWSLogsServicesResponse", @@ -2380,6 +2424,13 @@ "AWSRegionsIncludeOnly", "AWSResourcesConfig", "AWSTracesConfig", + "ActionConnectionAttributes", + "ActionConnectionAttributesUpdate", + "ActionConnectionData", + "ActionConnectionDataType", + "ActionConnectionDataUpdate", + "ActionConnectionIntegration", + "ActionConnectionIntegrationUpdate", "ActiveBillingDimensionsAttributes", "ActiveBillingDimensionsBody", "ActiveBillingDimensionsResponse", @@ -2711,6 +2762,8 @@ "CostByOrgAttributes", "CostByOrgResponse", "CostByOrgType", + "CreateActionConnectionRequest", + "CreateActionConnectionResponse", "CreateAppRequest", "CreateAppRequestData", "CreateAppRequestDataAttributes", @@ -3043,6 +3096,7 @@ "GCPSTSServiceAccountsResponse", "GCPServiceAccountMeta", "GCPServiceAccountType", + "GetActionConnectionResponse", "GetAppResponse", "GetAppResponseData", "GetAppResponseDataAttributes", @@ -3058,12 +3112,25 @@ "GetTeamMembershipsSort", "GroupScalarColumn", "GroupTags", + "HTTPBody", "HTTPCIAppError", "HTTPCIAppErrors", + "HTTPCredentials", + "HTTPCredentialsUpdate", + "HTTPHeader", + "HTTPHeaderUpdate", + "HTTPIntegration", + "HTTPIntegrationType", + "HTTPIntegrationUpdate", "HTTPLog", "HTTPLogError", "HTTPLogErrors", "HTTPLogItem", + "HTTPToken", + "HTTPTokenAuth", + "HTTPTokenAuthType", + "HTTPTokenAuthUpdate", + "HTTPTokenUpdate", "HistoricalJobDataType", "HistoricalJobListMeta", "HistoricalJobOptions", @@ -4140,7 +4207,10 @@ "TimeseriesResponseTimes", "TimeseriesResponseValues", "TimeseriesResponseValuesList", + "TokenType", "Unit", + "UpdateActionConnectionRequest", + "UpdateActionConnectionResponse", "UpdateAppRequest", "UpdateAppRequestData", "UpdateAppRequestDataAttributes", @@ -4160,6 +4230,8 @@ "UpsertCatalogEntityRequest", "UpsertCatalogEntityResponse", "UpsertCatalogEntityResponseIncludedItem", + "UrlParam", + "UrlParamUpdate", "UsageApplicationSecurityMonitoringResponse", "UsageAttributesObject", "UsageDataObject", diff --git a/tests/v2/cassettes/test_scenarios/test_create_a_new_action_connection_returns_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_a_new_action_connection_returns_bad_request_response.frozen new file mode 100644 index 0000000000..c04237b75e --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_a_new_action_connection_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2025-01-03T17:54:28.593Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_a_new_action_connection_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_a_new_action_connection_returns_bad_request_response.yaml new file mode 100644 index 0000000000..82dcbbee2b --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_a_new_action_connection_returns_bad_request_response.yaml @@ -0,0 +1,27 @@ +interactions: +- request: + body: '{"data":{"attributes":{"integration":{"credentials":{"account_id":"1","role":"MyRoleUpdated","type":"AWSAssumeRole"},"type":"AWS"},"name":"Cassette + Connection"},"type":"action_connection"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/actions/connections + response: + body: + string: '{"errors":[{"title":"Generic Error","detail":"error creating connection: + rpc error: code = InvalidArgument desc = multiple errors: 1 error occurred:\n\t* + [error_code=8]: invalid CreateCustomConnectionRequest.Data: embedded message + failed validation | caused by: invalid CustomConnectionData.Aws: embedded + message failed validation | caused by: invalid CustomConnectionData_AwsAuthData.AssumeRole: + embedded message failed validation | caused by: invalid CustomConnectionData_AwsAuthData_AssumeRole.AccountId: + value does not match regex pattern \"^\\\\d{12}$\"\n\n"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_create_a_new_action_connection_returns_successfully_created_action_connection_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_a_new_action_connection_returns_successfully_created_action_connection_response.frozen new file mode 100644 index 0000000000..17bd6109de --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_a_new_action_connection_returns_successfully_created_action_connection_response.frozen @@ -0,0 +1 @@ +2025-01-03T17:54:28.861Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_a_new_action_connection_returns_successfully_created_action_connection_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_a_new_action_connection_returns_successfully_created_action_connection_response.yaml new file mode 100644 index 0000000000..72578e92b7 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_a_new_action_connection_returns_successfully_created_action_connection_response.yaml @@ -0,0 +1,36 @@ +interactions: +- request: + body: '{"data":{"attributes":{"integration":{"credentials":{"account_id":"123456789123","role":"MyRoleUpdated","type":"AWSAssumeRole"},"type":"AWS"},"name":"Cassette + Connection DELETE_ME"},"type":"action_connection"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/actions/connections + response: + body: + string: '{"data":{"id":"f3476932-f278-42a4-b47d-64a310f39d00","type":"action_connection","attributes":{"integration":{"credentials":{"account_id":"123456789123","role":"MyRoleUpdated","external_id":"636e6e83f06f4cd4b90b18b39c3f0714","principal_id":"464622532012","type":"AWSAssumeRole"},"type":"AWS"},"name":"Cassette + Connection DELETE_ME"}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/actions/connections/f3476932-f278-42a4-b47d-64a310f39d00 + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_delete_an_existing_action_connection_returns_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_delete_an_existing_action_connection_returns_not_found_response.frozen new file mode 100644 index 0000000000..51f4fadf41 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_an_existing_action_connection_returns_not_found_response.frozen @@ -0,0 +1 @@ +2025-01-03T17:54:29.701Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_delete_an_existing_action_connection_returns_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_delete_an_existing_action_connection_returns_not_found_response.yaml new file mode 100644 index 0000000000..9ffffebd6e --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_an_existing_action_connection_returns_not_found_response.yaml @@ -0,0 +1,19 @@ +interactions: +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/actions/connections/aaa11111-aa11-aa11-aaaa-aaaaaa111111 + response: + body: + string: '{"errors":[{"title":"Generic Error","detail":"error deleting connection: + rpc error: code = NotFound desc = connection not found"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_get_an_existing_action_connection_returns_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_an_existing_action_connection_returns_bad_request_response.frozen new file mode 100644 index 0000000000..27ac1ad0fa --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_an_existing_action_connection_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2025-01-03T17:54:29.931Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_an_existing_action_connection_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_an_existing_action_connection_returns_bad_request_response.yaml new file mode 100644 index 0000000000..97a5ca58a0 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_an_existing_action_connection_returns_bad_request_response.yaml @@ -0,0 +1,19 @@ +interactions: +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/actions/connections/bad%20format + response: + body: + string: '{"errors":[{"title":"Generic Error","detail":"error connectionId not + a valid UUID"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_get_an_existing_action_connection_returns_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_an_existing_action_connection_returns_not_found_response.frozen new file mode 100644 index 0000000000..92aba415e5 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_an_existing_action_connection_returns_not_found_response.frozen @@ -0,0 +1 @@ +2025-01-03T17:54:30.093Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_an_existing_action_connection_returns_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_an_existing_action_connection_returns_not_found_response.yaml new file mode 100644 index 0000000000..d7258dcfdc --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_an_existing_action_connection_returns_not_found_response.yaml @@ -0,0 +1,19 @@ +interactions: +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/actions/connections/aaa11111-aa11-aa11-aaaa-aaaaaa111111 + response: + body: + string: '{"errors":[{"title":"Generic Error","detail":"error getting connection: + rpc error: code = NotFound desc = connection not found"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_get_an_existing_action_connection_returns_successfully_get_action_connection_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_an_existing_action_connection_returns_successfully_get_action_connection_response.frozen new file mode 100644 index 0000000000..e15f28fc55 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_an_existing_action_connection_returns_successfully_get_action_connection_response.frozen @@ -0,0 +1 @@ +2025-01-03T17:54:30.187Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_an_existing_action_connection_returns_successfully_get_action_connection_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_an_existing_action_connection_returns_successfully_get_action_connection_response.yaml new file mode 100644 index 0000000000..f10eed5741 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_an_existing_action_connection_returns_successfully_get_action_connection_response.yaml @@ -0,0 +1,19 @@ +interactions: +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/actions/connections/cb460d51-3c88-4e87-adac-d47131d0423d + response: + body: + string: '{"data":{"id":"cb460d51-3c88-4e87-adac-d47131d0423d","type":"action_connection","attributes":{"integration":{"credentials":{"account_id":"123456789123","role":"MyRoleUpdated","external_id":"909b33b1242748cfbef42f20011e2fa0","principal_id":"464622532012","type":"AWSAssumeRole"},"type":"AWS"},"name":"Cassette + Connection"}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_update_an_existing_action_connection_returns_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_an_existing_action_connection_returns_bad_request_response.frozen new file mode 100644 index 0000000000..267e68c92e --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_an_existing_action_connection_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2025-01-03T17:54:30.291Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_update_an_existing_action_connection_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_an_existing_action_connection_returns_bad_request_response.yaml new file mode 100644 index 0000000000..34009439e3 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_an_existing_action_connection_returns_bad_request_response.yaml @@ -0,0 +1,27 @@ +interactions: +- request: + body: '{"data":{"attributes":{"integration":{"credentials":{"account_id":"1","role":"MyRoleUpdated","type":"AWSAssumeRole"},"type":"AWS"},"name":"Cassette + Connection"},"type":"action_connection"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/actions/connections/cb460d51-3c88-4e87-adac-d47131d0423d + response: + body: + string: '{"errors":[{"title":"Generic Error","detail":"error creating connection: + rpc error: code = InvalidArgument desc = multiple errors: 1 error occurred:\n\t* + [error_code=8]: invalid UpdateCustomConnectionRequest.DataUpdate: embedded + message failed validation | caused by: invalid CustomConnectionDataUpdate.Aws: + embedded message failed validation | caused by: invalid CustomConnectionDataUpdate_AwsAuth.AssumeRole: + embedded message failed validation | caused by: invalid CustomConnectionDataUpdate_AwsAuth_AssumeRole.AccountId: + value does not match regex pattern \"^\\\\d{12}$\"\n\n"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_update_an_existing_action_connection_returns_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_an_existing_action_connection_returns_not_found_response.frozen new file mode 100644 index 0000000000..c3bbe09493 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_an_existing_action_connection_returns_not_found_response.frozen @@ -0,0 +1 @@ +2025-01-03T17:54:30.379Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_update_an_existing_action_connection_returns_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_an_existing_action_connection_returns_not_found_response.yaml new file mode 100644 index 0000000000..0d409fe18c --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_an_existing_action_connection_returns_not_found_response.yaml @@ -0,0 +1,22 @@ +interactions: +- request: + body: '{"data":{"attributes":{"integration":{"credentials":{"account_id":"123456789123","role":"MyRoleUpdated","type":"AWSAssumeRole"},"type":"AWS"},"name":"Cassette + Connection"},"type":"action_connection"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/actions/connections/aaa11111-aa11-aa11-aaaa-aaaaaa111111 + response: + body: + string: '{"errors":[{"title":"Generic Error","detail":"error creating connection: + rpc error: code = NotFound desc = connection not found"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_update_an_existing_action_connection_returns_successfully_updated_action_connection_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_an_existing_action_connection_returns_successfully_updated_action_connection_response.frozen new file mode 100644 index 0000000000..d2af60d3bc --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_an_existing_action_connection_returns_successfully_updated_action_connection_response.frozen @@ -0,0 +1 @@ +2025-01-03T17:54:30.599Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_update_an_existing_action_connection_returns_successfully_updated_action_connection_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_an_existing_action_connection_returns_successfully_updated_action_connection_response.yaml new file mode 100644 index 0000000000..07204f0e12 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_an_existing_action_connection_returns_successfully_updated_action_connection_response.yaml @@ -0,0 +1,22 @@ +interactions: +- request: + body: '{"data":{"attributes":{"integration":{"credentials":{"account_id":"123456789123","role":"MyRoleUpdated","type":"AWSAssumeRole"},"type":"AWS"},"name":"Cassette + Connection"},"type":"action_connection"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/actions/connections/cb460d51-3c88-4e87-adac-d47131d0423d + response: + body: + string: '{"data":{"id":"cb460d51-3c88-4e87-adac-d47131d0423d","type":"action_connection","attributes":{"integration":{"credentials":{"account_id":"123456789123","role":"MyRoleUpdated","external_id":"909b33b1242748cfbef42f20011e2fa0","principal_id":"464622532012","type":"AWSAssumeRole"},"type":"AWS"},"name":"Cassette + Connection"}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v2/features/action_connection.feature b/tests/v2/features/action_connection.feature new file mode 100644 index 0000000000..7f63502f63 --- /dev/null +++ b/tests/v2/features/action_connection.feature @@ -0,0 +1,96 @@ +@endpoint(action-connection) @endpoint(action-connection-v2) +Feature: Action Connection + Action connections extend your installed integrations and allow you to + take action in your third-party systems (e.g. AWS, Gitlab, and Statuspage) + with Datadog’s Workflow Automation and App Builder products. Datadog’s + Integrations automatically provide authentication for Slack, Microsoft + Teams, PagerDuty, Opsgenie, JIRA, GitHub, and Statuspage. You do not need + additional connections in order to access these tools within Workflow + Automation and App Builder. We offer granular access control for editing + and resolving connections. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "ActionConnection" API + + @team:DataDog/workflow-automation-dev + Scenario: Create a new Action Connection returns "Bad Request" response + Given new "CreateActionConnection" request + And body with value {"data":{"type":"action_connection","attributes":{"name":"Cassette Connection","integration":{"type":"AWS","credentials":{"type":"AWSAssumeRole","role":"MyRoleUpdated","account_id":"1"}}}}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/workflow-automation-dev + Scenario: Create a new Action Connection returns "Successfully created Action Connection" response + Given new "CreateActionConnection" request + And body with value {"data":{"type":"action_connection","attributes":{"name":"Cassette Connection DELETE_ME","integration":{"type":"AWS","credentials":{"type":"AWSAssumeRole","role":"MyRoleUpdated","account_id":"123456789123"}}}}} + When the request is sent + Then the response status is 201 Successfully created Action Connection + + @team:DataDog/workflow-automation-dev + Scenario: Delete an existing Action Connection returns "Not Found" response + Given new "DeleteActionConnection" request + And request contains "connection_id" parameter with value "aaa11111-aa11-aa11-aaaa-aaaaaa111111" + When the request is sent + Then the response status is 404 Not Found + + @skip @team:DataDog/workflow-automation-dev + Scenario: Delete an existing Action Connection returns "Successfully deleted Action Connection" response + Given there is a valid "action_connection" in the system + And new "DeleteActionConnection" request + And request contains "connection_id" parameter from "action_connection.data.id" + When the request is sent + Then the response status is 204 The resource was deleted successfully. + + @generated @skip @team:DataDog/workflow-automation-dev + Scenario: Delete an existing Action Connection returns "The resource was deleted successfully." response + Given new "DeleteActionConnection" request + And request contains "connection_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 The resource was deleted successfully. + + @team:DataDog/workflow-automation-dev + Scenario: Get an existing Action Connection returns "Bad Request" response + Given new "GetActionConnection" request + And request contains "connection_id" parameter with value "bad format" + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/workflow-automation-dev + Scenario: Get an existing Action Connection returns "Not Found" response + Given new "GetActionConnection" request + And request contains "connection_id" parameter with value "aaa11111-aa11-aa11-aaaa-aaaaaa111111" + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/workflow-automation-dev + Scenario: Get an existing Action Connection returns "Successfully get Action Connection" response + Given new "GetActionConnection" request + And request contains "connection_id" parameter with value "cb460d51-3c88-4e87-adac-d47131d0423d" + When the request is sent + Then the response status is 200 Successfully get Action Connection + + @team:DataDog/workflow-automation-dev + Scenario: Update an existing Action Connection returns "Bad Request" response + Given new "UpdateActionConnection" request + And request contains "connection_id" parameter with value "cb460d51-3c88-4e87-adac-d47131d0423d" + And body with value {"data":{"type":"action_connection","attributes":{"name":"Cassette Connection","integration":{"type":"AWS","credentials":{"type":"AWSAssumeRole","role":"MyRoleUpdated","account_id":"1"}}}}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/workflow-automation-dev + Scenario: Update an existing Action Connection returns "Not Found" response + Given new "UpdateActionConnection" request + And request contains "connection_id" parameter with value "aaa11111-aa11-aa11-aaaa-aaaaaa111111" + And body with value {"data":{"type":"action_connection","attributes":{"name":"Cassette Connection","integration":{"type":"AWS","credentials":{"type":"AWSAssumeRole","role":"MyRoleUpdated","account_id":"123456789123"}}}}} + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/workflow-automation-dev + Scenario: Update an existing Action Connection returns "Successfully updated Action Connection" response + Given new "UpdateActionConnection" request + And request contains "connection_id" parameter with value "cb460d51-3c88-4e87-adac-d47131d0423d" + And body with value {"data":{"type":"action_connection","attributes":{"name":"Cassette Connection","integration":{"type":"AWS","credentials":{"type":"AWSAssumeRole","role":"MyRoleUpdated","account_id":"123456789123"}}}}} + When the request is sent + Then the response status is 200 Successfully updated Action Connection diff --git a/tests/v2/features/given.json b/tests/v2/features/given.json index 29503a6ae7..4bd8a2cfc6 100644 --- a/tests/v2/features/given.json +++ b/tests/v2/features/given.json @@ -1,4 +1,16 @@ [ + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"type\": \"action_connection\",\n \"attributes\": {\n \"name\": \"Cassette Connection DELETE\",\n \"integration\": {\n \"type\": \"AWS\",\n \"credentials\": {\n \"type\": \"AWSAssumeRole\",\n \"role\": \"MyRole\",\n \"account_id\": \"123456789123\"\n }\n }\n }\n }\n}" + } + ], + "step": "there is a valid \"action_connection\" in the system", + "key": "action_connection", + "tag": "Action Connection", + "operationId": "CreateActionConnection" + }, { "parameters": [ { diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index daae080a0c..7b195aad9e 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -1,4 +1,35 @@ { + "CreateActionConnection": { + "tag": "Action Connection", + "undo": { + "operationId": "DeleteActionConnection", + "parameters": [ + { + "name": "connection_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "DeleteActionConnection": { + "tag": "Action Connection", + "undo": { + "type": "idempotent" + } + }, + "GetActionConnection": { + "tag": "Action Connection", + "undo": { + "type": "safe" + } + }, + "UpdateActionConnection": { + "tag": "Action Connection", + "undo": { + "type": "idempotent" + } + }, "ListAPIKeys": { "tag": "Key Management", "undo": {