From 6019343eb65256ec08c7fc9bec0a553d1836792a Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Tue, 17 Mar 2026 23:34:23 +0000 Subject: [PATCH] Regenerate client from commit 9ac8497 of spec repo --- .generator/schemas/v2/openapi.yaml | 1081 +++++++++++++++++ docs/datadog_api_client.v2.api.rst | 7 + docs/datadog_api_client.v2.model.rst | 112 ++ .../CreateWebIntegrationAccount.py | 43 + .../CreateWebIntegrationAccount_516494340.py | 43 + .../DeleteWebIntegrationAccount.py | 14 + .../DeleteWebIntegrationAccount_3148550629.py | 18 + .../GetWebIntegrationAccount.py | 16 + .../GetWebIntegrationAccountSchema.py | 16 + ...tWebIntegrationAccountSchema_2275808665.py | 15 + .../GetWebIntegrationAccount_2208305330.py | 20 + .../ListWebIntegrationAccounts.py | 15 + .../ListWebIntegrationAccounts_2909671841.py | 15 + .../UpdateWebIntegrationAccount.py | 34 + .../UpdateWebIntegrationAccount_3199996405.py | 37 + .../v2/api/integration_accounts_api.py | 349 ++++++ src/datadog_api_client/v2/apis/__init__.py | 2 + .../web_integration_account_attributes.py | 60 + .../web_integration_account_create_request.py | 44 + ...ation_account_create_request_attributes.py | 83 ++ ...integration_account_create_request_data.py | 54 + .../model/web_integration_account_response.py | 54 + .../web_integration_account_response_data.py | 56 + ...web_integration_account_schema_response.py | 86 ++ ...tion_account_schema_response_properties.py | 67 + ..._account_schema_response_secrets_object.py | 77 ++ ..._account_schema_response_settings_field.py | 96 ++ ...account_schema_response_settings_object.py | 77 ++ .../v2/model/web_integration_account_type.py | 35 + .../web_integration_account_update_request.py | 44 + ...ation_account_update_request_attributes.py | 93 ++ ...integration_account_update_request_data.py | 61 + .../web_integration_accounts_response.py | 54 + src/datadog_api_client/v2/models/__init__.py | 48 + ...on_account_returns_created_response.frozen | 1 + ...tion_account_returns_created_response.yaml | 20 + ...gration_account_returns_ok_response.frozen | 1 + ...tegration_account_returns_ok_response.yaml | 36 + ..._an_integration_returns_ok_response.frozen | 1 + ...or_an_integration_returns_ok_response.yaml | 33 + ...gration_account_returns_ok_response.frozen | 1 + ...tegration_account_returns_ok_response.yaml | 36 + ...ration_accounts_returns_ok_response.frozen | 1 + ...egration_accounts_returns_ok_response.yaml | 36 + ...gration_account_returns_ok_response.frozen | 1 + ...tegration_account_returns_ok_response.yaml | 38 + tests/v2/features/given.json | 16 + .../v2/features/integration_accounts.feature | 179 +++ tests/v2/features/undo.json | 47 + tests/v2/features/web_integrations.feature | 258 ++++ 50 files changed, 3631 insertions(+) create mode 100644 examples/v2/integration-accounts/CreateWebIntegrationAccount.py create mode 100644 examples/v2/integration-accounts/CreateWebIntegrationAccount_516494340.py create mode 100644 examples/v2/integration-accounts/DeleteWebIntegrationAccount.py create mode 100644 examples/v2/integration-accounts/DeleteWebIntegrationAccount_3148550629.py create mode 100644 examples/v2/integration-accounts/GetWebIntegrationAccount.py create mode 100644 examples/v2/integration-accounts/GetWebIntegrationAccountSchema.py create mode 100644 examples/v2/integration-accounts/GetWebIntegrationAccountSchema_2275808665.py create mode 100644 examples/v2/integration-accounts/GetWebIntegrationAccount_2208305330.py create mode 100644 examples/v2/integration-accounts/ListWebIntegrationAccounts.py create mode 100644 examples/v2/integration-accounts/ListWebIntegrationAccounts_2909671841.py create mode 100644 examples/v2/integration-accounts/UpdateWebIntegrationAccount.py create mode 100644 examples/v2/integration-accounts/UpdateWebIntegrationAccount_3199996405.py create mode 100644 src/datadog_api_client/v2/api/integration_accounts_api.py create mode 100644 src/datadog_api_client/v2/model/web_integration_account_attributes.py create mode 100644 src/datadog_api_client/v2/model/web_integration_account_create_request.py create mode 100644 src/datadog_api_client/v2/model/web_integration_account_create_request_attributes.py create mode 100644 src/datadog_api_client/v2/model/web_integration_account_create_request_data.py create mode 100644 src/datadog_api_client/v2/model/web_integration_account_response.py create mode 100644 src/datadog_api_client/v2/model/web_integration_account_response_data.py create mode 100644 src/datadog_api_client/v2/model/web_integration_account_schema_response.py create mode 100644 src/datadog_api_client/v2/model/web_integration_account_schema_response_properties.py create mode 100644 src/datadog_api_client/v2/model/web_integration_account_schema_response_secrets_object.py create mode 100644 src/datadog_api_client/v2/model/web_integration_account_schema_response_settings_field.py create mode 100644 src/datadog_api_client/v2/model/web_integration_account_schema_response_settings_object.py create mode 100644 src/datadog_api_client/v2/model/web_integration_account_type.py create mode 100644 src/datadog_api_client/v2/model/web_integration_account_update_request.py create mode 100644 src/datadog_api_client/v2/model/web_integration_account_update_request_attributes.py create mode 100644 src/datadog_api_client/v2/model/web_integration_account_update_request_data.py create mode 100644 src/datadog_api_client/v2/model/web_integration_accounts_response.py create mode 100644 tests/v2/cassettes/test_scenarios/test_create_integration_account_returns_created_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_create_integration_account_returns_created_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_delete_integration_account_returns_ok_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_delete_integration_account_returns_ok_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_get_account_schema_for_an_integration_returns_ok_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_get_account_schema_for_an_integration_returns_ok_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_get_integration_account_returns_ok_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_get_integration_account_returns_ok_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_list_integration_accounts_returns_ok_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_list_integration_accounts_returns_ok_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_update_integration_account_returns_ok_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_update_integration_account_returns_ok_response.yaml create mode 100644 tests/v2/features/integration_accounts.feature create mode 100644 tests/v2/features/web_integrations.feature diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 64f30b3230..5f343ddf2f 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -1426,6 +1426,394 @@ components: $ref: '#/components/schemas/JSONAPIErrorResponse' description: The server cannot process the request because it contains invalid data. + WebIntegrationAccountSchemaBadRequestResponse: + content: + application/json: + examples: + invalid_integration_name: + summary: Invalid integration name format + value: + errors: + - detail: Invalid integration name format + status: '400' + title: Bad Request + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: 'Bad Request: The integration name format is invalid.' + WebIntegrationAccountSchemaForbiddenResponse: + content: + application/json: + examples: + integration_not_allowed: + summary: Integration not allowed + value: + errors: + - detail: The API is currently disabled for this integration + status: '403' + title: Integration Not Allowed + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: 'Forbidden: The integration is not enabled for API access.' + WebIntegrationAccountSchemaNotFoundResponse: + content: + application/json: + examples: + schema_not_found: + summary: Schema not found for integration + value: + errors: + - detail: 'Schema not found for integration: twilio' + status: '404' + title: Not Found + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: 'Not Found: The integration does not exist or has no schema available.' + WebIntegrationAccountSchemaTooManyRequestsResponse: + content: + application/json: + examples: + rate_limit_exceeded: + summary: Rate limit exceeded + value: + errors: + - detail: Rate limit exceeded. Please retry after the rate limit window + expires. + status: '429' + title: Too Many Requests + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: 'Too Many Requests: Rate limit exceeded. + + This endpoint has a rate limit of 12000 requests per organization every 60 + seconds.' + WebIntegrationCreateAccountBadRequestResponse: + content: + application/json: + examples: + invalid_request: + summary: Invalid request body + value: + errors: + - detail: 'Invalid request body: missing required field ''name''' + status: '400' + title: Bad Request + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: 'Bad Request: The request body is malformed or the integration + name format is invalid.' + WebIntegrationCreateAccountForbiddenResponse: + content: + application/json: + examples: + permission_denied: + summary: Permission denied + value: + errors: + - detail: User does not have permission to manage integrations + status: '403' + title: Forbidden + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: 'Forbidden: The integration is not enabled for API access or the + user lacks permissions to manage integrations.' + WebIntegrationCreateAccountNotFoundResponse: + content: + application/json: + examples: + integration_not_found: + summary: Integration not found + value: + errors: + - detail: 'Integration not found: unknown_integration' + status: '404' + title: Not Found + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: 'Not Found: The integration does not exist.' + WebIntegrationCreateAccountTooManyRequestsResponse: + content: + application/json: + examples: + rate_limit_exceeded: + summary: Rate limit exceeded + value: + errors: + - detail: Rate limit exceeded. Please retry after 20 seconds. + status: '429' + title: Too Many Requests + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: 'Too Many Requests: Rate limit exceeded. + + This endpoint has a rate limit of 50 requests per user every 20 seconds.' + WebIntegrationCreateAccountUnprocessableEntityResponse: + content: + application/json: + examples: + validation_failed: + summary: Validation failed + value: + errors: + - detail: settings.account_sid is required + status: '422' + title: Unprocessable Entity + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: 'Unprocessable Entity: The account configuration does not match + the integration schema.' + WebIntegrationDeleteAccountBadRequestResponse: + content: + application/json: + examples: + invalid_account_id: + summary: Invalid account ID format + value: + errors: + - detail: Invalid account ID format + status: '400' + title: Bad Request + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: 'Bad Request: The integration name or account ID format is invalid.' + WebIntegrationDeleteAccountForbiddenResponse: + content: + application/json: + examples: + permission_denied: + summary: Permission denied + value: + errors: + - detail: User does not have permission to delete this account + status: '403' + title: Forbidden + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: 'Forbidden: The integration is not enabled for API access or the + user lacks permissions to manage this account.' + WebIntegrationDeleteAccountNotFoundResponse: + content: + application/json: + examples: + account_not_found: + summary: Account not found + value: + errors: + - detail: 'Account not found: abc123def456' + status: '404' + title: Not Found + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: 'Not Found: The integration or account does not exist.' + WebIntegrationDeleteAccountTooManyRequestsResponse: + content: + application/json: + examples: + rate_limit_exceeded: + summary: Rate limit exceeded + value: + errors: + - detail: Rate limit exceeded. Please retry after 20 seconds. + status: '429' + title: Too Many Requests + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: 'Too Many Requests: Rate limit exceeded. + + This endpoint has a rate limit of 50 requests per user every 20 seconds.' + WebIntegrationGetAccountBadRequestResponse: + content: + application/json: + examples: + invalid_account_id: + summary: Invalid account ID format + value: + errors: + - detail: Invalid account ID format + status: '400' + title: Bad Request + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: 'Bad Request: The integration name or account ID format is invalid.' + WebIntegrationGetAccountForbiddenResponse: + content: + application/json: + examples: + permission_denied: + summary: Permission denied + value: + errors: + - detail: User does not have permission to access this account + status: '403' + title: Forbidden + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: 'Forbidden: The integration is not enabled for API access or the + user lacks required permissions.' + WebIntegrationGetAccountNotFoundResponse: + content: + application/json: + examples: + account_not_found: + summary: Account not found + value: + errors: + - detail: 'Account not found: abc123def456' + status: '404' + title: Not Found + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: 'Not Found: The integration or account does not exist.' + WebIntegrationGetAccountTooManyRequestsResponse: + content: + application/json: + examples: + rate_limit_exceeded: + summary: Rate limit exceeded + value: + errors: + - detail: Rate limit exceeded. Please retry after 60 seconds. + status: '429' + title: Too Many Requests + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: 'Too Many Requests: Rate limit exceeded. + + This endpoint has a rate limit of 12000 requests per organization every 60 + seconds.' + WebIntegrationListAccountsBadRequestResponse: + content: + application/json: + examples: + invalid_integration_name: + summary: Invalid integration name format + value: + errors: + - detail: Invalid integration name format + status: '400' + title: Bad Request + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: 'Bad Request: The integration name format is invalid.' + WebIntegrationListAccountsForbiddenResponse: + content: + application/json: + examples: + integration_not_allowed: + summary: Integration not allowed + value: + errors: + - detail: The API is currently disabled for this integration + status: '403' + title: Forbidden + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: 'Forbidden: The integration is not enabled for API access or the + user lacks required permissions.' + WebIntegrationListAccountsNotFoundResponse: + content: + application/json: + examples: + integration_not_found: + summary: Integration not found + value: + errors: + - detail: 'Integration not found: unknown_integration' + status: '404' + title: Not Found + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: 'Not Found: The integration does not exist.' + WebIntegrationListAccountsTooManyRequestsResponse: + content: + application/json: + examples: + rate_limit_exceeded: + summary: Rate limit exceeded + value: + errors: + - detail: Rate limit exceeded. Please retry after 20 seconds. + status: '429' + title: Too Many Requests + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: 'Too Many Requests: Rate limit exceeded. + + This endpoint has a rate limit of 50 requests per user every 20 seconds.' + WebIntegrationUpdateAccountBadRequestResponse: + content: + application/json: + examples: + invalid_request: + summary: Invalid request body + value: + errors: + - detail: Invalid request body format + status: '400' + title: Bad Request + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: 'Bad Request: The request body is malformed or the integration + name/account ID format is invalid.' + WebIntegrationUpdateAccountForbiddenResponse: + content: + application/json: + examples: + permission_denied: + summary: Permission denied + value: + errors: + - detail: User does not have permission to update this account + status: '403' + title: Forbidden + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: 'Forbidden: The integration is not enabled for API access or the + user lacks permissions to manage this account.' + WebIntegrationUpdateAccountNotFoundResponse: + content: + application/json: + examples: + account_not_found: + summary: Account not found + value: + errors: + - detail: 'Account not found: abc123def456' + status: '404' + title: Not Found + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: 'Not Found: The integration or account does not exist.' + WebIntegrationUpdateAccountTooManyRequestsResponse: + content: + application/json: + examples: + rate_limit_exceeded: + summary: Rate limit exceeded + value: + errors: + - detail: Rate limit exceeded. Please retry after 20 seconds. + status: '429' + title: Too Many Requests + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: 'Too Many Requests: Rate limit exceeded. + + This endpoint has a rate limit of 50 requests per user every 20 seconds.' + WebIntegrationUpdateAccountUnprocessableEntityResponse: + content: + application/json: + examples: + validation_failed: + summary: Validation failed + value: + errors: + - detail: settings.api_key must be at least 32 characters + status: '422' + title: Unprocessable Entity + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: 'Unprocessable Entity: The account configuration does not match + the integration schema.' schemas: APIErrorResponse: description: API error response. @@ -72575,6 +72963,407 @@ components: type: string x-enum-varnames: - RUM_REPLAY_WATCHER + WebIntegrationAccountAttributes: + description: Attributes for a web integration account. + properties: + name: + description: The name of the account. + example: My Production Account + type: string + settings: + additionalProperties: {} + description: 'Integration-specific settings for the account. The structure + and required fields vary by integration type. + + Use the schema endpoint to retrieve the specific requirements for each + integration.' + example: + account_sid: ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + alerts: false + api_key: SKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + call_summaries: true + ccm_enabled: true + censor_logs: true + events: true + messages: true + type: object + required: + - name + - settings + type: object + WebIntegrationAccountCreateRequest: + description: Payload for creating a web integration account. + properties: + data: + $ref: '#/components/schemas/WebIntegrationAccountCreateRequestData' + required: + - data + type: object + WebIntegrationAccountCreateRequestAttributes: + description: Attributes for creating a web integration account. + properties: + name: + description: The name of the account. + example: My Production Account + type: string + secrets: + additionalProperties: {} + description: 'Sensitive credentials for the account. The structure and required + fields vary by integration type. + + These values are write-only and never returned in responses.' + example: + api_key_token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + type: object + settings: + additionalProperties: {} + description: 'Integration-specific settings for the account. The structure + and required fields vary by integration type. + + Use the schema endpoint (GET /api/v2/web-integrations/{integration_name}/accounts/schema) + to retrieve + + the specific requirements for your integration before creating an account.' + example: + account_sid: ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + alerts: true + api_key: SKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + call_summaries: true + ccm_enabled: true + censor_logs: true + events: true + messages: true + type: object + required: + - name + - settings + - secrets + type: object + WebIntegrationAccountCreateRequestData: + description: Data object for creating a web integration account. + properties: + attributes: + $ref: '#/components/schemas/WebIntegrationAccountCreateRequestAttributes' + type: + $ref: '#/components/schemas/WebIntegrationAccountType' + required: + - type + - attributes + type: object + WebIntegrationAccountResponse: + description: Response containing a single web integration account. + properties: + data: + $ref: '#/components/schemas/WebIntegrationAccountResponseData' + integration_name: + description: The name of the integration. + example: twilio + type: string + type: object + WebIntegrationAccountResponseData: + description: Data object for a web integration account response. + properties: + attributes: + $ref: '#/components/schemas/WebIntegrationAccountAttributes' + id: + description: The unique identifier for the account. + example: abc123def456 + type: string + type: + $ref: '#/components/schemas/WebIntegrationAccountType' + required: + - id + - type + - attributes + type: object + WebIntegrationAccountSchemaResponse: + description: 'Response containing the JSON schema for an integration''s account + configuration. + + This schema defines the required and optional fields for both settings and + secrets, + + including field types, validation rules, and descriptions. + + + The response is a standard [JSON Schema (draft-07)](https://json-schema.org/draft-07/schema#) + document describing the account + + configuration structure. Because this is a dynamic JSON Schema, the exact + properties vary by integration.' + example: + $schema: http://json-schema.org/draft-07/schema# + properties: + secrets: + $ref: '#/components/schemas/WebIntegrationAccountSchemaResponseExampleSecrets' + settings: + $ref: '#/components/schemas/WebIntegrationAccountSchemaResponseExampleSettings' + required: + - settings + - secrets + type: object + properties: + $schema: + description: The JSON Schema version URI. + example: http://json-schema.org/draft-07/schema# + type: string + additionalProperties: + description: Whether additional properties are allowed at the root level + (typically false). + example: false + type: boolean + properties: + $ref: '#/components/schemas/WebIntegrationAccountSchemaResponseProperties' + required: + description: List of required top-level properties. + example: + - settings + - secrets + items: + type: string + type: array + type: + description: The root type of the schema (always "object"). + example: object + type: string + required: + - $schema + - type + - properties + - required + type: object + WebIntegrationAccountSchemaResponseExampleSecrets: + additionalProperties: false + properties: + api_key_token: + description: The Twilio API Key Secret corresponding to the API Key SID. + example: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + minLength: 1 + type: string + required: + - api_key_token + type: object + WebIntegrationAccountSchemaResponseExampleSettings: + additionalProperties: false + properties: + account_sid: + description: Twilio Account SID that uniquely identifies your Twilio account, + found in your account info in the Twilio console. + example: ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + minLength: 1 + type: string + alerts: + default: false + description: Enable collection of Twilio Alert logs to monitor account alerts + and notifications. + type: boolean + api_key: + description: Twilio API Key SID for authentication. Create this API key + in the Twilio console. + example: SKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + minLength: 1 + type: string + call_summaries: + default: false + description: Enable collection of Twilio Voice call summaries to track voice + call performance and metadata. + type: boolean + ccm_enabled: + default: false + description: Enable Cloud Cost Management to monitor Twilio usage costs + and identify optimization opportunities. + type: boolean + censor_logs: + default: false + description: Enable censoring of sensitive data in logs. When true, phone + numbers and SMS message bodies are censored for privacy. + type: boolean + events: + default: false + description: Enable collection of Twilio Event logs to monitor account-level + events and activities. + type: boolean + messages: + default: false + description: Enable collection of Twilio Message logs to track SMS and messaging + activity. + type: boolean + required: + - api_key + - account_sid + type: object + WebIntegrationAccountSchemaResponseProperties: + description: 'The properties object containing settings and secrets schema definitions. + + Both are always present in every integration schema, but the fields within + each + + vary depending on the specific integration.' + properties: + secrets: + $ref: '#/components/schemas/WebIntegrationAccountSchemaResponseSecretsObject' + settings: + $ref: '#/components/schemas/WebIntegrationAccountSchemaResponseSettingsObject' + required: + - settings + - secrets + type: object + WebIntegrationAccountSchemaResponseSecretsObject: + description: 'JSON Schema definition for the secrets object. + + Contains sensitive credentials required for the integration such as API keys, + + tokens, and passwords. These values are write-only and never returned in responses.' + properties: + additionalProperties: + description: Whether additional properties are allowed (typically false). + example: false + type: boolean + properties: + additionalProperties: + $ref: '#/components/schemas/WebIntegrationAccountSchemaResponseSettingsField' + description: 'The individual secret fields for this integration. + + Field names and types vary by integration.' + type: object + required: + description: List of required secret field names. + items: + type: string + type: array + type: + description: Always "object" for the secrets container. + example: object + type: string + type: object + WebIntegrationAccountSchemaResponseSettingsField: + description: 'JSON Schema definition for a single field within settings or secrets. + + The exact fields vary by integration.' + properties: + additionalProperties: + description: Whether additional properties are allowed for this field. + example: false + type: boolean + default: + description: Default value for the field if not provided. + description: + description: Human-readable description of the field's purpose. + example: API key for authentication + type: string + items: + description: Schema for array items when type is "array". + type: object + minLength: + description: Minimum length for string fields. + example: 1 + format: int64 + type: integer + type: + description: The data type of the field (string, boolean, integer, array, + object). + example: string + type: string + type: object + WebIntegrationAccountSchemaResponseSettingsObject: + description: 'JSON Schema definition for the settings object. + + Contains integration-specific configuration fields such as account identifiers, + + feature toggles, and non-sensitive configuration options.' + properties: + additionalProperties: + description: Whether additional properties are allowed (typically false). + example: false + type: boolean + properties: + additionalProperties: + $ref: '#/components/schemas/WebIntegrationAccountSchemaResponseSettingsField' + description: 'The individual setting fields for this integration. + + Field names and types vary by integration.' + type: object + required: + description: List of required setting field names. + items: + type: string + type: array + type: + description: Always "object" for the settings container. + example: object + type: string + type: object + WebIntegrationAccountType: + default: Account + description: The JSON:API type for web integration accounts. + enum: + - Account + example: Account + type: string + x-enum-varnames: + - ACCOUNT + WebIntegrationAccountUpdateRequest: + description: Payload for updating a web integration account. + properties: + data: + $ref: '#/components/schemas/WebIntegrationAccountUpdateRequestData' + required: + - data + type: object + WebIntegrationAccountUpdateRequestAttributes: + description: 'Attributes for updating a web integration account. All fields + are optional; + + only provide the fields you want to update.' + properties: + name: + description: The name of the account. + example: My Production Account (Updated) + type: string + secrets: + additionalProperties: {} + description: 'Sensitive credentials to update. Only the secrets provided + are updated. + + These values are write-only and never returned in responses.' + example: + api_key_token: new_secret_token_value + type: object + settings: + additionalProperties: {} + description: 'Integration-specific settings to update. Only the fields provided + are updated. + + The structure varies by integration type. See the integration''s schema + for available fields.' + example: + ccm_enabled: true + events: true + messages: false + type: object + type: object + WebIntegrationAccountUpdateRequestData: + description: Data object for updating a web integration account. + properties: + attributes: + $ref: '#/components/schemas/WebIntegrationAccountUpdateRequestAttributes' + type: + $ref: '#/components/schemas/WebIntegrationAccountType' + required: + - type + type: object + WebIntegrationAccountsResponse: + description: Response containing a list of web integration accounts. + properties: + data: + items: + $ref: '#/components/schemas/WebIntegrationAccountResponseData' + type: array + integration_name: + description: The name of the integration. + example: twilio + type: string + type: object Weekday: description: A day of the week. enum: @@ -110984,6 +111773,286 @@ paths: operator: OR permissions: - teams_read + /api/v2/web-integrations/{integration_name}/accounts: + get: + description: 'Retrieve all configured accounts for a specific integration within + your organization. + + + Rate limit: 50 requests per user every 20 seconds.' + operationId: ListWebIntegrationAccounts + parameters: + - description: The name of the integration. + example: twilio + in: path + name: integration_name + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/WebIntegrationAccountsResponse' + description: 'OK: List of all accounts for the specified integration.' + '400': + $ref: '#/components/responses/WebIntegrationListAccountsBadRequestResponse' + '403': + $ref: '#/components/responses/WebIntegrationListAccountsForbiddenResponse' + '404': + $ref: '#/components/responses/WebIntegrationListAccountsNotFoundResponse' + '429': + $ref: '#/components/responses/WebIntegrationListAccountsTooManyRequestsResponse' + summary: List integration accounts + tags: + - Integration Accounts + x-permission: + operator: OR + permissions: + - integrations_read + post: + description: 'Create a new account for a specific integration. The account configuration + must conform + + to the schema defined for the integration, which can be retrieved using the + schema endpoint. + + + Rate limit: 50 requests per user every 20 seconds.' + operationId: CreateWebIntegrationAccount + parameters: + - description: The name of the integration. + example: twilio + in: path + name: integration_name + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/WebIntegrationAccountCreateRequest' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/WebIntegrationAccountResponse' + description: 'Created: The account was successfully created.' + '400': + $ref: '#/components/responses/WebIntegrationCreateAccountBadRequestResponse' + '403': + $ref: '#/components/responses/WebIntegrationCreateAccountForbiddenResponse' + '404': + $ref: '#/components/responses/WebIntegrationCreateAccountNotFoundResponse' + '422': + $ref: '#/components/responses/WebIntegrationCreateAccountUnprocessableEntityResponse' + '429': + $ref: '#/components/responses/WebIntegrationCreateAccountTooManyRequestsResponse' + summary: Create integration account + tags: + - Integration Accounts + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - manage_integrations + /api/v2/web-integrations/{integration_name}/accounts/schema: + get: + description: 'Get the JSON schema that defines the structure and validation + rules for account configuration + + of a specific integration. This schema describes the required and optional + fields for both + + **settings** and **secrets** when creating or updating an account. + + + The schema structure varies between integrations, so always retrieve the schema + for your + + specific integration before creating or updating accounts. + + + Rate limit: 12000 requests per organization every 60 seconds.' + operationId: GetWebIntegrationAccountSchema + parameters: + - description: The name of the integration. + example: twilio + in: path + name: integration_name + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/WebIntegrationAccountSchemaResponse' + description: 'OK: The JSON schema for the integration''s account configuration.' + '400': + $ref: '#/components/responses/WebIntegrationAccountSchemaBadRequestResponse' + '403': + $ref: '#/components/responses/WebIntegrationAccountSchemaForbiddenResponse' + '404': + $ref: '#/components/responses/WebIntegrationAccountSchemaNotFoundResponse' + '429': + $ref: '#/components/responses/WebIntegrationAccountSchemaTooManyRequestsResponse' + summary: Get account schema for an integration + tags: + - Integration Accounts + x-permission: + operator: OR + permissions: + - integrations_read + /api/v2/web-integrations/{integration_name}/accounts/{account_id}: + delete: + description: 'Delete a specific account by its ID for a given integration. This + removes the + + account configuration and stops any data collection associated with it. + + + Rate limit: 50 requests per user every 20 seconds.' + operationId: DeleteWebIntegrationAccount + parameters: + - description: The name of the integration. + example: twilio + in: path + name: integration_name + required: true + schema: + type: string + - description: The unique identifier of the account. + example: abc123def456 + in: path + name: account_id + required: true + schema: + type: string + responses: + '200': + description: 'OK: The account was successfully deleted.' + '400': + $ref: '#/components/responses/WebIntegrationDeleteAccountBadRequestResponse' + '403': + $ref: '#/components/responses/WebIntegrationDeleteAccountForbiddenResponse' + '404': + $ref: '#/components/responses/WebIntegrationDeleteAccountNotFoundResponse' + '429': + $ref: '#/components/responses/WebIntegrationDeleteAccountTooManyRequestsResponse' + summary: Delete integration account + tags: + - Integration Accounts + x-permission: + operator: OR + permissions: + - manage_integrations + get: + description: 'Retrieve a specific account by its ID for a given integration. + The response includes + + the account name and settings, but excludes sensitive secret values. + + + Rate limit: 12000 requests per organization every 60 seconds.' + operationId: GetWebIntegrationAccount + parameters: + - description: The name of the integration. + example: twilio + in: path + name: integration_name + required: true + schema: + type: string + - description: The unique identifier of the account. + example: abc123def456 + in: path + name: account_id + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/WebIntegrationAccountResponse' + description: 'OK: The account details for the specified integration.' + '400': + $ref: '#/components/responses/WebIntegrationGetAccountBadRequestResponse' + '403': + $ref: '#/components/responses/WebIntegrationGetAccountForbiddenResponse' + '404': + $ref: '#/components/responses/WebIntegrationGetAccountNotFoundResponse' + '429': + $ref: '#/components/responses/WebIntegrationGetAccountTooManyRequestsResponse' + summary: Get integration account + tags: + - Integration Accounts + x-permission: + operator: OR + permissions: + - integrations_read + patch: + description: 'Update an existing account for a specific integration. You can + update the name, settings, + + and secrets. Only the fields provided in the request are updated. + + + Rate limit: 50 requests per user every 20 seconds.' + operationId: UpdateWebIntegrationAccount + parameters: + - description: The name of the integration. + example: twilio + in: path + name: integration_name + required: true + schema: + type: string + - description: The unique identifier of the account. + example: abc123def456 + in: path + name: account_id + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/WebIntegrationAccountUpdateRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/WebIntegrationAccountResponse' + description: 'OK: The account was successfully updated.' + '400': + $ref: '#/components/responses/WebIntegrationUpdateAccountBadRequestResponse' + '403': + $ref: '#/components/responses/WebIntegrationUpdateAccountForbiddenResponse' + '404': + $ref: '#/components/responses/WebIntegrationUpdateAccountNotFoundResponse' + '422': + $ref: '#/components/responses/WebIntegrationUpdateAccountUnprocessableEntityResponse' + '429': + $ref: '#/components/responses/WebIntegrationUpdateAccountTooManyRequestsResponse' + summary: Update integration account + tags: + - Integration Accounts + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - manage_integrations /api/v2/workflows: post: description: Create a new workflow, returning the workflow ID. This API requires @@ -111636,6 +112705,18 @@ tags: and todos. See the [Incident Management page](https://docs.datadoghq.com/service_management/incident_management/) for more information. name: Incidents +- description: "Configure and manage third-party integrations with Datadog. This API + provides a unified\ninterface for managing integration accounts across various + external services.\n\nEach integration has its own unique schema that defines + the required settings and secrets.\nBefore creating or updating an account, use + the schema endpoint to retrieve the specific\nrequirements, field types, validation + rules, and available configuration options for your\nintegration.\n\n**Note**: + This API manages integration account configurations only. It does not support\nGrace + Resources, Reference Tables, or Custom Queries CRUD operations. For those features,\nrefer + to each integration's dedicated documentation.\n\nSupported Integrations:\n - + [Twilio](https://docs.datadoghq.com/integrations/twilio/)\n - [Snowflake](https://docs.datadoghq.com/integrations/snowflake-web/)\n + \ - [Databricks](https://docs.datadoghq.com/integrations/databricks/)" + name: Integration Accounts - description: 'The Integrations API is used to list available integrations and retrieve information about their installation status.' diff --git a/docs/datadog_api_client.v2.api.rst b/docs/datadog_api_client.v2.api.rst index e4a3f68080..a27dcc4824 100644 --- a/docs/datadog_api_client.v2.api.rst +++ b/docs/datadog_api_client.v2.api.rst @@ -333,6 +333,13 @@ datadog\_api\_client.v2.api.incidents\_api module :members: :show-inheritance: +datadog\_api\_client.v2.api.integration\_accounts\_api module +------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.api.integration_accounts_api + :members: + :show-inheritance: + datadog\_api\_client.v2.api.integrations\_api module ---------------------------------------------------- diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index 7a83d1c7c6..acbe9129d0 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -32015,6 +32015,118 @@ datadog\_api\_client.v2.model.watcher\_data\_type module :members: :show-inheritance: +datadog\_api\_client.v2.model.web\_integration\_account\_attributes module +-------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.web_integration_account_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.web\_integration\_account\_create\_request module +------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.web_integration_account_create_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.web\_integration\_account\_create\_request\_attributes module +------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.web_integration_account_create_request_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.web\_integration\_account\_create\_request\_data module +------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.web_integration_account_create_request_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.web\_integration\_account\_response module +------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.web_integration_account_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.web\_integration\_account\_response\_data module +------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.web_integration_account_response_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.web\_integration\_account\_schema\_response module +-------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.web_integration_account_schema_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.web\_integration\_account\_schema\_response\_properties module +-------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.web_integration_account_schema_response_properties + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.web\_integration\_account\_schema\_response\_secrets\_object module +------------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.web_integration_account_schema_response_secrets_object + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.web\_integration\_account\_schema\_response\_settings\_field module +------------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.web_integration_account_schema_response_settings_field + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.web\_integration\_account\_schema\_response\_settings\_object module +-------------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.web_integration_account_schema_response_settings_object + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.web\_integration\_account\_type module +-------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.web_integration_account_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.web\_integration\_account\_update\_request module +------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.web_integration_account_update_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.web\_integration\_account\_update\_request\_attributes module +------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.web_integration_account_update_request_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.web\_integration\_account\_update\_request\_data module +------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.web_integration_account_update_request_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.web\_integration\_accounts\_response module +------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.web_integration_accounts_response + :members: + :show-inheritance: + datadog\_api\_client.v2.model.weekday module -------------------------------------------- diff --git a/examples/v2/integration-accounts/CreateWebIntegrationAccount.py b/examples/v2/integration-accounts/CreateWebIntegrationAccount.py new file mode 100644 index 0000000000..7d673e587f --- /dev/null +++ b/examples/v2/integration-accounts/CreateWebIntegrationAccount.py @@ -0,0 +1,43 @@ +""" +Create integration account returns "Created: The account was successfully created." response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.integration_accounts_api import IntegrationAccountsApi +from datadog_api_client.v2.model.web_integration_account_create_request import WebIntegrationAccountCreateRequest +from datadog_api_client.v2.model.web_integration_account_create_request_attributes import ( + WebIntegrationAccountCreateRequestAttributes, +) +from datadog_api_client.v2.model.web_integration_account_create_request_data import ( + WebIntegrationAccountCreateRequestData, +) +from datadog_api_client.v2.model.web_integration_account_type import WebIntegrationAccountType + +body = WebIntegrationAccountCreateRequest( + data=WebIntegrationAccountCreateRequestData( + attributes=WebIntegrationAccountCreateRequestAttributes( + name="My Production Account", + secrets=dict([("api_key_token", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")]), + settings=dict( + [ + ("account_sid", "ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"), + ("alerts", "True"), + ("api_key", "SKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"), + ("call_summaries", "True"), + ("ccm_enabled", "True"), + ("censor_logs", "True"), + ("events", "True"), + ("messages", "True"), + ] + ), + ), + type=WebIntegrationAccountType.ACCOUNT, + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = IntegrationAccountsApi(api_client) + response = api_instance.create_web_integration_account(integration_name="integration_name", body=body) + + print(response) diff --git a/examples/v2/integration-accounts/CreateWebIntegrationAccount_516494340.py b/examples/v2/integration-accounts/CreateWebIntegrationAccount_516494340.py new file mode 100644 index 0000000000..ae6fbdda13 --- /dev/null +++ b/examples/v2/integration-accounts/CreateWebIntegrationAccount_516494340.py @@ -0,0 +1,43 @@ +""" +Create integration account returns "Created" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.integration_accounts_api import IntegrationAccountsApi +from datadog_api_client.v2.model.web_integration_account_create_request import WebIntegrationAccountCreateRequest +from datadog_api_client.v2.model.web_integration_account_create_request_attributes import ( + WebIntegrationAccountCreateRequestAttributes, +) +from datadog_api_client.v2.model.web_integration_account_create_request_data import ( + WebIntegrationAccountCreateRequestData, +) +from datadog_api_client.v2.model.web_integration_account_type import WebIntegrationAccountType + +body = WebIntegrationAccountCreateRequest( + data=WebIntegrationAccountCreateRequestData( + type=WebIntegrationAccountType.ACCOUNT, + attributes=WebIntegrationAccountCreateRequestAttributes( + name="Example-Web-Integration", + settings=dict( + [ + ("api_key", "SKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"), + ("account_sid", "ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"), + ("events", "True"), + ("messages", "True"), + ("alerts", "True"), + ("call_summaries", "True"), + ("ccm_enabled", "True"), + ("censor_logs", "True"), + ] + ), + secrets=dict([("api_key_token", "test_secret_token")]), + ), + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = IntegrationAccountsApi(api_client) + response = api_instance.create_web_integration_account(integration_name="twilio", body=body) + + print(response) diff --git a/examples/v2/integration-accounts/DeleteWebIntegrationAccount.py b/examples/v2/integration-accounts/DeleteWebIntegrationAccount.py new file mode 100644 index 0000000000..d32bf7a185 --- /dev/null +++ b/examples/v2/integration-accounts/DeleteWebIntegrationAccount.py @@ -0,0 +1,14 @@ +""" +Delete integration account returns "OK: The account was successfully deleted." response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.integration_accounts_api import IntegrationAccountsApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = IntegrationAccountsApi(api_client) + api_instance.delete_web_integration_account( + integration_name="integration_name", + account_id="account_id", + ) diff --git a/examples/v2/integration-accounts/DeleteWebIntegrationAccount_3148550629.py b/examples/v2/integration-accounts/DeleteWebIntegrationAccount_3148550629.py new file mode 100644 index 0000000000..d97da39fb4 --- /dev/null +++ b/examples/v2/integration-accounts/DeleteWebIntegrationAccount_3148550629.py @@ -0,0 +1,18 @@ +""" +Delete integration account returns "OK" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.integration_accounts_api import IntegrationAccountsApi + +# there is a valid "web_integration_account" in the system +WEB_INTEGRATION_ACCOUNT_DATA_ID = environ["WEB_INTEGRATION_ACCOUNT_DATA_ID"] + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = IntegrationAccountsApi(api_client) + api_instance.delete_web_integration_account( + integration_name="twilio", + account_id=WEB_INTEGRATION_ACCOUNT_DATA_ID, + ) diff --git a/examples/v2/integration-accounts/GetWebIntegrationAccount.py b/examples/v2/integration-accounts/GetWebIntegrationAccount.py new file mode 100644 index 0000000000..f7e96550ce --- /dev/null +++ b/examples/v2/integration-accounts/GetWebIntegrationAccount.py @@ -0,0 +1,16 @@ +""" +Get integration account returns "OK: The account details for the specified integration." response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.integration_accounts_api import IntegrationAccountsApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = IntegrationAccountsApi(api_client) + response = api_instance.get_web_integration_account( + integration_name="integration_name", + account_id="account_id", + ) + + print(response) diff --git a/examples/v2/integration-accounts/GetWebIntegrationAccountSchema.py b/examples/v2/integration-accounts/GetWebIntegrationAccountSchema.py new file mode 100644 index 0000000000..332db26861 --- /dev/null +++ b/examples/v2/integration-accounts/GetWebIntegrationAccountSchema.py @@ -0,0 +1,16 @@ +""" +Get account schema for an integration returns "OK: The JSON schema for the integration's account configuration." +response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.integration_accounts_api import IntegrationAccountsApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = IntegrationAccountsApi(api_client) + response = api_instance.get_web_integration_account_schema( + integration_name="integration_name", + ) + + print(response) diff --git a/examples/v2/integration-accounts/GetWebIntegrationAccountSchema_2275808665.py b/examples/v2/integration-accounts/GetWebIntegrationAccountSchema_2275808665.py new file mode 100644 index 0000000000..254f04990d --- /dev/null +++ b/examples/v2/integration-accounts/GetWebIntegrationAccountSchema_2275808665.py @@ -0,0 +1,15 @@ +""" +Get account schema for an integration returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.integration_accounts_api import IntegrationAccountsApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = IntegrationAccountsApi(api_client) + response = api_instance.get_web_integration_account_schema( + integration_name="twilio", + ) + + print(response) diff --git a/examples/v2/integration-accounts/GetWebIntegrationAccount_2208305330.py b/examples/v2/integration-accounts/GetWebIntegrationAccount_2208305330.py new file mode 100644 index 0000000000..5facbba759 --- /dev/null +++ b/examples/v2/integration-accounts/GetWebIntegrationAccount_2208305330.py @@ -0,0 +1,20 @@ +""" +Get integration account returns "OK" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.integration_accounts_api import IntegrationAccountsApi + +# there is a valid "web_integration_account" in the system +WEB_INTEGRATION_ACCOUNT_DATA_ID = environ["WEB_INTEGRATION_ACCOUNT_DATA_ID"] + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = IntegrationAccountsApi(api_client) + response = api_instance.get_web_integration_account( + integration_name="twilio", + account_id=WEB_INTEGRATION_ACCOUNT_DATA_ID, + ) + + print(response) diff --git a/examples/v2/integration-accounts/ListWebIntegrationAccounts.py b/examples/v2/integration-accounts/ListWebIntegrationAccounts.py new file mode 100644 index 0000000000..fbef78f2e8 --- /dev/null +++ b/examples/v2/integration-accounts/ListWebIntegrationAccounts.py @@ -0,0 +1,15 @@ +""" +List integration accounts returns "OK: List of all accounts for the specified integration." response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.integration_accounts_api import IntegrationAccountsApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = IntegrationAccountsApi(api_client) + response = api_instance.list_web_integration_accounts( + integration_name="integration_name", + ) + + print(response) diff --git a/examples/v2/integration-accounts/ListWebIntegrationAccounts_2909671841.py b/examples/v2/integration-accounts/ListWebIntegrationAccounts_2909671841.py new file mode 100644 index 0000000000..3648b377a2 --- /dev/null +++ b/examples/v2/integration-accounts/ListWebIntegrationAccounts_2909671841.py @@ -0,0 +1,15 @@ +""" +List integration accounts returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.integration_accounts_api import IntegrationAccountsApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = IntegrationAccountsApi(api_client) + response = api_instance.list_web_integration_accounts( + integration_name="twilio", + ) + + print(response) diff --git a/examples/v2/integration-accounts/UpdateWebIntegrationAccount.py b/examples/v2/integration-accounts/UpdateWebIntegrationAccount.py new file mode 100644 index 0000000000..3258ef25f7 --- /dev/null +++ b/examples/v2/integration-accounts/UpdateWebIntegrationAccount.py @@ -0,0 +1,34 @@ +""" +Update integration account returns "OK: The account was successfully updated." response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.integration_accounts_api import IntegrationAccountsApi +from datadog_api_client.v2.model.web_integration_account_type import WebIntegrationAccountType +from datadog_api_client.v2.model.web_integration_account_update_request import WebIntegrationAccountUpdateRequest +from datadog_api_client.v2.model.web_integration_account_update_request_attributes import ( + WebIntegrationAccountUpdateRequestAttributes, +) +from datadog_api_client.v2.model.web_integration_account_update_request_data import ( + WebIntegrationAccountUpdateRequestData, +) + +body = WebIntegrationAccountUpdateRequest( + data=WebIntegrationAccountUpdateRequestData( + attributes=WebIntegrationAccountUpdateRequestAttributes( + name="My Production Account (Updated)", + secrets=dict([("api_key_token", "new_secret_token_value")]), + settings=dict([("ccm_enabled", "True"), ("events", "True"), ("messages", "False")]), + ), + type=WebIntegrationAccountType.ACCOUNT, + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = IntegrationAccountsApi(api_client) + response = api_instance.update_web_integration_account( + integration_name="integration_name", account_id="account_id", body=body + ) + + print(response) diff --git a/examples/v2/integration-accounts/UpdateWebIntegrationAccount_3199996405.py b/examples/v2/integration-accounts/UpdateWebIntegrationAccount_3199996405.py new file mode 100644 index 0000000000..259db6ea99 --- /dev/null +++ b/examples/v2/integration-accounts/UpdateWebIntegrationAccount_3199996405.py @@ -0,0 +1,37 @@ +""" +Update integration account returns "OK" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.integration_accounts_api import IntegrationAccountsApi +from datadog_api_client.v2.model.web_integration_account_type import WebIntegrationAccountType +from datadog_api_client.v2.model.web_integration_account_update_request import WebIntegrationAccountUpdateRequest +from datadog_api_client.v2.model.web_integration_account_update_request_attributes import ( + WebIntegrationAccountUpdateRequestAttributes, +) +from datadog_api_client.v2.model.web_integration_account_update_request_data import ( + WebIntegrationAccountUpdateRequestData, +) + +# there is a valid "web_integration_account" in the system +WEB_INTEGRATION_ACCOUNT_DATA_ID = environ["WEB_INTEGRATION_ACCOUNT_DATA_ID"] + +body = WebIntegrationAccountUpdateRequest( + data=WebIntegrationAccountUpdateRequestData( + type=WebIntegrationAccountType.ACCOUNT, + attributes=WebIntegrationAccountUpdateRequestAttributes( + name="Example-Web-Integration-updated", + settings=dict([("events", "False"), ("messages", "False"), ("ccm_enabled", "False")]), + ), + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = IntegrationAccountsApi(api_client) + response = api_instance.update_web_integration_account( + integration_name="twilio", account_id=WEB_INTEGRATION_ACCOUNT_DATA_ID, body=body + ) + + print(response) diff --git a/src/datadog_api_client/v2/api/integration_accounts_api.py b/src/datadog_api_client/v2/api/integration_accounts_api.py new file mode 100644 index 0000000000..aa094f378f --- /dev/null +++ b/src/datadog_api_client/v2/api/integration_accounts_api.py @@ -0,0 +1,349 @@ +# 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.web_integration_accounts_response import WebIntegrationAccountsResponse +from datadog_api_client.v2.model.web_integration_account_response import WebIntegrationAccountResponse +from datadog_api_client.v2.model.web_integration_account_create_request import WebIntegrationAccountCreateRequest +from datadog_api_client.v2.model.web_integration_account_schema_response import WebIntegrationAccountSchemaResponse +from datadog_api_client.v2.model.web_integration_account_update_request import WebIntegrationAccountUpdateRequest + + +class IntegrationAccountsApi: + """ + Configure and manage third-party integrations with Datadog. This API provides a unified + interface for managing integration accounts across various external services. + + Each integration has its own unique schema that defines the required settings and secrets. + Before creating or updating an account, use the schema endpoint to retrieve the specific + requirements, field types, validation rules, and available configuration options for your + integration. + + **Note** : This API manages integration account configurations only. It does not support + Grace Resources, Reference Tables, or Custom Queries CRUD operations. For those features, + refer to each integration's dedicated documentation. + + Supported Integrations: + + * `Twilio `_ + * `Snowflake `_ + * `Databricks `_ + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient(Configuration()) + self.api_client = api_client + + self._create_web_integration_account_endpoint = _Endpoint( + settings={ + "response_type": (WebIntegrationAccountResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/web-integrations/{integration_name}/accounts", + "operation_id": "create_web_integration_account", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "integration_name": { + "required": True, + "openapi_types": (str,), + "attribute": "integration_name", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (WebIntegrationAccountCreateRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._delete_web_integration_account_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/web-integrations/{integration_name}/accounts/{account_id}", + "operation_id": "delete_web_integration_account", + "http_method": "DELETE", + "version": "v2", + }, + params_map={ + "integration_name": { + "required": True, + "openapi_types": (str,), + "attribute": "integration_name", + "location": "path", + }, + "account_id": { + "required": True, + "openapi_types": (str,), + "attribute": "account_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["*/*"], + }, + api_client=api_client, + ) + + self._get_web_integration_account_endpoint = _Endpoint( + settings={ + "response_type": (WebIntegrationAccountResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/web-integrations/{integration_name}/accounts/{account_id}", + "operation_id": "get_web_integration_account", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "integration_name": { + "required": True, + "openapi_types": (str,), + "attribute": "integration_name", + "location": "path", + }, + "account_id": { + "required": True, + "openapi_types": (str,), + "attribute": "account_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._get_web_integration_account_schema_endpoint = _Endpoint( + settings={ + "response_type": (WebIntegrationAccountSchemaResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/web-integrations/{integration_name}/accounts/schema", + "operation_id": "get_web_integration_account_schema", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "integration_name": { + "required": True, + "openapi_types": (str,), + "attribute": "integration_name", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._list_web_integration_accounts_endpoint = _Endpoint( + settings={ + "response_type": (WebIntegrationAccountsResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/web-integrations/{integration_name}/accounts", + "operation_id": "list_web_integration_accounts", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "integration_name": { + "required": True, + "openapi_types": (str,), + "attribute": "integration_name", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._update_web_integration_account_endpoint = _Endpoint( + settings={ + "response_type": (WebIntegrationAccountResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/web-integrations/{integration_name}/accounts/{account_id}", + "operation_id": "update_web_integration_account", + "http_method": "PATCH", + "version": "v2", + }, + params_map={ + "integration_name": { + "required": True, + "openapi_types": (str,), + "attribute": "integration_name", + "location": "path", + }, + "account_id": { + "required": True, + "openapi_types": (str,), + "attribute": "account_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (WebIntegrationAccountUpdateRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + def create_web_integration_account( + self, + integration_name: str, + body: WebIntegrationAccountCreateRequest, + ) -> WebIntegrationAccountResponse: + """Create integration account. + + Create a new account for a specific integration. The account configuration must conform + to the schema defined for the integration, which can be retrieved using the schema endpoint. + + Rate limit: 50 requests per user every 20 seconds. + + :param integration_name: The name of the integration. + :type integration_name: str + :type body: WebIntegrationAccountCreateRequest + :rtype: WebIntegrationAccountResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["integration_name"] = integration_name + + kwargs["body"] = body + + return self._create_web_integration_account_endpoint.call_with_http_info(**kwargs) + + def delete_web_integration_account( + self, + integration_name: str, + account_id: str, + ) -> None: + """Delete integration account. + + Delete a specific account by its ID for a given integration. This removes the + account configuration and stops any data collection associated with it. + + Rate limit: 50 requests per user every 20 seconds. + + :param integration_name: The name of the integration. + :type integration_name: str + :param account_id: The unique identifier of the account. + :type account_id: str + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["integration_name"] = integration_name + + kwargs["account_id"] = account_id + + return self._delete_web_integration_account_endpoint.call_with_http_info(**kwargs) + + def get_web_integration_account( + self, + integration_name: str, + account_id: str, + ) -> WebIntegrationAccountResponse: + """Get integration account. + + Retrieve a specific account by its ID for a given integration. The response includes + the account name and settings, but excludes sensitive secret values. + + Rate limit: 12000 requests per organization every 60 seconds. + + :param integration_name: The name of the integration. + :type integration_name: str + :param account_id: The unique identifier of the account. + :type account_id: str + :rtype: WebIntegrationAccountResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["integration_name"] = integration_name + + kwargs["account_id"] = account_id + + return self._get_web_integration_account_endpoint.call_with_http_info(**kwargs) + + def get_web_integration_account_schema( + self, + integration_name: str, + ) -> WebIntegrationAccountSchemaResponse: + """Get account schema for an integration. + + Get the JSON schema that defines the structure and validation rules for account configuration + of a specific integration. This schema describes the required and optional fields for both + **settings** and **secrets** when creating or updating an account. + + The schema structure varies between integrations, so always retrieve the schema for your + specific integration before creating or updating accounts. + + Rate limit: 12000 requests per organization every 60 seconds. + + :param integration_name: The name of the integration. + :type integration_name: str + :rtype: WebIntegrationAccountSchemaResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["integration_name"] = integration_name + + return self._get_web_integration_account_schema_endpoint.call_with_http_info(**kwargs) + + def list_web_integration_accounts( + self, + integration_name: str, + ) -> WebIntegrationAccountsResponse: + """List integration accounts. + + Retrieve all configured accounts for a specific integration within your organization. + + Rate limit: 50 requests per user every 20 seconds. + + :param integration_name: The name of the integration. + :type integration_name: str + :rtype: WebIntegrationAccountsResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["integration_name"] = integration_name + + return self._list_web_integration_accounts_endpoint.call_with_http_info(**kwargs) + + def update_web_integration_account( + self, + integration_name: str, + account_id: str, + body: WebIntegrationAccountUpdateRequest, + ) -> WebIntegrationAccountResponse: + """Update integration account. + + Update an existing account for a specific integration. You can update the name, settings, + and secrets. Only the fields provided in the request are updated. + + Rate limit: 50 requests per user every 20 seconds. + + :param integration_name: The name of the integration. + :type integration_name: str + :param account_id: The unique identifier of the account. + :type account_id: str + :type body: WebIntegrationAccountUpdateRequest + :rtype: WebIntegrationAccountResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["integration_name"] = integration_name + + kwargs["account_id"] = account_id + + kwargs["body"] = body + + return self._update_web_integration_account_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 ef672a68e2..bd7624f9a7 100644 --- a/src/datadog_api_client/v2/apis/__init__.py +++ b/src/datadog_api_client/v2/apis/__init__.py @@ -46,6 +46,7 @@ from datadog_api_client.v2.api.incident_services_api import IncidentServicesApi from datadog_api_client.v2.api.incident_teams_api import IncidentTeamsApi from datadog_api_client.v2.api.incidents_api import IncidentsApi +from datadog_api_client.v2.api.integration_accounts_api import IntegrationAccountsApi from datadog_api_client.v2.api.integrations_api import IntegrationsApi from datadog_api_client.v2.api.jira_integration_api import JiraIntegrationApi from datadog_api_client.v2.api.key_management_api import KeyManagementApi @@ -152,6 +153,7 @@ "IncidentServicesApi", "IncidentTeamsApi", "IncidentsApi", + "IntegrationAccountsApi", "IntegrationsApi", "JiraIntegrationApi", "KeyManagementApi", diff --git a/src/datadog_api_client/v2/model/web_integration_account_attributes.py b/src/datadog_api_client/v2/model/web_integration_account_attributes.py new file mode 100644 index 0000000000..955620c4c1 --- /dev/null +++ b/src/datadog_api_client/v2/model/web_integration_account_attributes.py @@ -0,0 +1,60 @@ +# 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.model_utils import ( + ModelNormal, + cached_property, + date, + datetime, + none_type, + UUID, +) + + +class WebIntegrationAccountAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "name": (str,), + "settings": ( + { + str: ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + UUID, + none_type, + ) + }, + ), + } + + attribute_map = { + "name": "name", + "settings": "settings", + } + + def __init__(self_, name: str, settings: Dict[str, Any], **kwargs): + """ + Attributes for a web integration account. + + :param name: The name of the account. + :type name: str + + :param settings: Integration-specific settings for the account. The structure and required fields vary by integration type. + Use the schema endpoint to retrieve the specific requirements for each integration. + :type settings: {str: (bool, date, datetime, dict, float, int, list, str, UUID, none_type,)} + """ + super().__init__(kwargs) + + self_.name = name + self_.settings = settings diff --git a/src/datadog_api_client/v2/model/web_integration_account_create_request.py b/src/datadog_api_client/v2/model/web_integration_account_create_request.py new file mode 100644 index 0000000000..4a16e8f5d8 --- /dev/null +++ b/src/datadog_api_client/v2/model/web_integration_account_create_request.py @@ -0,0 +1,44 @@ +# 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.web_integration_account_create_request_data import ( + WebIntegrationAccountCreateRequestData, + ) + + +class WebIntegrationAccountCreateRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.web_integration_account_create_request_data import ( + WebIntegrationAccountCreateRequestData, + ) + + return { + "data": (WebIntegrationAccountCreateRequestData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: WebIntegrationAccountCreateRequestData, **kwargs): + """ + Payload for creating a web integration account. + + :param data: Data object for creating a web integration account. + :type data: WebIntegrationAccountCreateRequestData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/web_integration_account_create_request_attributes.py b/src/datadog_api_client/v2/model/web_integration_account_create_request_attributes.py new file mode 100644 index 0000000000..1c4ec58f4d --- /dev/null +++ b/src/datadog_api_client/v2/model/web_integration_account_create_request_attributes.py @@ -0,0 +1,83 @@ +# 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.model_utils import ( + ModelNormal, + cached_property, + date, + datetime, + none_type, + UUID, +) + + +class WebIntegrationAccountCreateRequestAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "name": (str,), + "secrets": ( + { + str: ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + UUID, + none_type, + ) + }, + ), + "settings": ( + { + str: ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + UUID, + none_type, + ) + }, + ), + } + + attribute_map = { + "name": "name", + "secrets": "secrets", + "settings": "settings", + } + + def __init__(self_, name: str, secrets: Dict[str, Any], settings: Dict[str, Any], **kwargs): + """ + Attributes for creating a web integration account. + + :param name: The name of the account. + :type name: str + + :param secrets: Sensitive credentials for the account. The structure and required fields vary by integration type. + These values are write-only and never returned in responses. + :type secrets: {str: (bool, date, datetime, dict, float, int, list, str, UUID, none_type,)} + + :param settings: Integration-specific settings for the account. The structure and required fields vary by integration type. + Use the schema endpoint (GET /api/v2/web-integrations/{integration_name}/accounts/schema) to retrieve + the specific requirements for your integration before creating an account. + :type settings: {str: (bool, date, datetime, dict, float, int, list, str, UUID, none_type,)} + """ + super().__init__(kwargs) + + self_.name = name + self_.secrets = secrets + self_.settings = settings diff --git a/src/datadog_api_client/v2/model/web_integration_account_create_request_data.py b/src/datadog_api_client/v2/model/web_integration_account_create_request_data.py new file mode 100644 index 0000000000..2f7be47326 --- /dev/null +++ b/src/datadog_api_client/v2/model/web_integration_account_create_request_data.py @@ -0,0 +1,54 @@ +# 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.web_integration_account_create_request_attributes import ( + WebIntegrationAccountCreateRequestAttributes, + ) + from datadog_api_client.v2.model.web_integration_account_type import WebIntegrationAccountType + + +class WebIntegrationAccountCreateRequestData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.web_integration_account_create_request_attributes import ( + WebIntegrationAccountCreateRequestAttributes, + ) + from datadog_api_client.v2.model.web_integration_account_type import WebIntegrationAccountType + + return { + "attributes": (WebIntegrationAccountCreateRequestAttributes,), + "type": (WebIntegrationAccountType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__( + self_, attributes: WebIntegrationAccountCreateRequestAttributes, type: WebIntegrationAccountType, **kwargs + ): + """ + Data object for creating a web integration account. + + :param attributes: Attributes for creating a web integration account. + :type attributes: WebIntegrationAccountCreateRequestAttributes + + :param type: The JSON:API type for web integration accounts. + :type type: WebIntegrationAccountType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/web_integration_account_response.py b/src/datadog_api_client/v2/model/web_integration_account_response.py new file mode 100644 index 0000000000..44a895c7c1 --- /dev/null +++ b/src/datadog_api_client/v2/model/web_integration_account_response.py @@ -0,0 +1,54 @@ +# 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.web_integration_account_response_data import WebIntegrationAccountResponseData + + +class WebIntegrationAccountResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.web_integration_account_response_data import WebIntegrationAccountResponseData + + return { + "data": (WebIntegrationAccountResponseData,), + "integration_name": (str,), + } + + attribute_map = { + "data": "data", + "integration_name": "integration_name", + } + + def __init__( + self_, + data: Union[WebIntegrationAccountResponseData, UnsetType] = unset, + integration_name: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Response containing a single web integration account. + + :param data: Data object for a web integration account response. + :type data: WebIntegrationAccountResponseData, optional + + :param integration_name: The name of the integration. + :type integration_name: str, optional + """ + if data is not unset: + kwargs["data"] = data + if integration_name is not unset: + kwargs["integration_name"] = integration_name + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/web_integration_account_response_data.py b/src/datadog_api_client/v2/model/web_integration_account_response_data.py new file mode 100644 index 0000000000..3ec5ac7f7c --- /dev/null +++ b/src/datadog_api_client/v2/model/web_integration_account_response_data.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.web_integration_account_attributes import WebIntegrationAccountAttributes + from datadog_api_client.v2.model.web_integration_account_type import WebIntegrationAccountType + + +class WebIntegrationAccountResponseData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.web_integration_account_attributes import WebIntegrationAccountAttributes + from datadog_api_client.v2.model.web_integration_account_type import WebIntegrationAccountType + + return { + "attributes": (WebIntegrationAccountAttributes,), + "id": (str,), + "type": (WebIntegrationAccountType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, attributes: WebIntegrationAccountAttributes, id: str, type: WebIntegrationAccountType, **kwargs + ): + """ + Data object for a web integration account response. + + :param attributes: Attributes for a web integration account. + :type attributes: WebIntegrationAccountAttributes + + :param id: The unique identifier for the account. + :type id: str + + :param type: The JSON:API type for web integration accounts. + :type type: WebIntegrationAccountType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/web_integration_account_schema_response.py b/src/datadog_api_client/v2/model/web_integration_account_schema_response.py new file mode 100644 index 0000000000..84735ada32 --- /dev/null +++ b/src/datadog_api_client/v2/model/web_integration_account_schema_response.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.web_integration_account_schema_response_properties import ( + WebIntegrationAccountSchemaResponseProperties, + ) + + +class WebIntegrationAccountSchemaResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.web_integration_account_schema_response_properties import ( + WebIntegrationAccountSchemaResponseProperties, + ) + + return { + "_schema": (str,), + "additional_properties": (bool,), + "properties": (WebIntegrationAccountSchemaResponseProperties,), + "required": ([str],), + "type": (str,), + } + + attribute_map = { + "_schema": "$schema", + "additional_properties": "additionalProperties", + "properties": "properties", + "required": "required", + "type": "type", + } + + def __init__( + self_, + _schema: str, + properties: WebIntegrationAccountSchemaResponseProperties, + required: List[str], + type: str, + additional_properties: Union[bool, UnsetType] = unset, + **kwargs, + ): + """ + Response containing the JSON schema for an integration's account configuration. + This schema defines the required and optional fields for both settings and secrets, + including field types, validation rules, and descriptions. + + The response is a standard `JSON Schema (draft-07) `_ document describing the account + configuration structure. Because this is a dynamic JSON Schema, the exact properties vary by integration. + + :param _schema: The JSON Schema version URI. + :type _schema: str + + :param additional_properties: Whether additional properties are allowed at the root level (typically false). + :type additional_properties: bool, optional + + :param properties: The properties object containing settings and secrets schema definitions. + Both are always present in every integration schema, but the fields within each + vary depending on the specific integration. + :type properties: WebIntegrationAccountSchemaResponseProperties + + :param required: List of required top-level properties. + :type required: [str] + + :param type: The root type of the schema (always "object"). + :type type: str + """ + if additional_properties is not unset: + kwargs["additional_properties"] = additional_properties + super().__init__(kwargs) + + self_._schema = _schema + self_.properties = properties + self_.required = required + self_.type = type diff --git a/src/datadog_api_client/v2/model/web_integration_account_schema_response_properties.py b/src/datadog_api_client/v2/model/web_integration_account_schema_response_properties.py new file mode 100644 index 0000000000..457ce2418a --- /dev/null +++ b/src/datadog_api_client/v2/model/web_integration_account_schema_response_properties.py @@ -0,0 +1,67 @@ +# 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.web_integration_account_schema_response_secrets_object import ( + WebIntegrationAccountSchemaResponseSecretsObject, + ) + from datadog_api_client.v2.model.web_integration_account_schema_response_settings_object import ( + WebIntegrationAccountSchemaResponseSettingsObject, + ) + + +class WebIntegrationAccountSchemaResponseProperties(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.web_integration_account_schema_response_secrets_object import ( + WebIntegrationAccountSchemaResponseSecretsObject, + ) + from datadog_api_client.v2.model.web_integration_account_schema_response_settings_object import ( + WebIntegrationAccountSchemaResponseSettingsObject, + ) + + return { + "secrets": (WebIntegrationAccountSchemaResponseSecretsObject,), + "settings": (WebIntegrationAccountSchemaResponseSettingsObject,), + } + + attribute_map = { + "secrets": "secrets", + "settings": "settings", + } + + def __init__( + self_, + secrets: WebIntegrationAccountSchemaResponseSecretsObject, + settings: WebIntegrationAccountSchemaResponseSettingsObject, + **kwargs, + ): + """ + The properties object containing settings and secrets schema definitions. + Both are always present in every integration schema, but the fields within each + vary depending on the specific integration. + + :param secrets: JSON Schema definition for the secrets object. + Contains sensitive credentials required for the integration such as API keys, + tokens, and passwords. These values are write-only and never returned in responses. + :type secrets: WebIntegrationAccountSchemaResponseSecretsObject + + :param settings: JSON Schema definition for the settings object. + Contains integration-specific configuration fields such as account identifiers, + feature toggles, and non-sensitive configuration options. + :type settings: WebIntegrationAccountSchemaResponseSettingsObject + """ + super().__init__(kwargs) + + self_.secrets = secrets + self_.settings = settings diff --git a/src/datadog_api_client/v2/model/web_integration_account_schema_response_secrets_object.py b/src/datadog_api_client/v2/model/web_integration_account_schema_response_secrets_object.py new file mode 100644 index 0000000000..ffb97a8c52 --- /dev/null +++ b/src/datadog_api_client/v2/model/web_integration_account_schema_response_secrets_object.py @@ -0,0 +1,77 @@ +# 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 Dict, 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.web_integration_account_schema_response_settings_field import ( + WebIntegrationAccountSchemaResponseSettingsField, + ) + + +class WebIntegrationAccountSchemaResponseSecretsObject(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.web_integration_account_schema_response_settings_field import ( + WebIntegrationAccountSchemaResponseSettingsField, + ) + + return { + "additional_properties": (bool,), + "properties": ({str: (WebIntegrationAccountSchemaResponseSettingsField,)},), + "required": ([str],), + "type": (str,), + } + + attribute_map = { + "additional_properties": "additionalProperties", + "properties": "properties", + "required": "required", + "type": "type", + } + + def __init__( + self_, + additional_properties: Union[bool, UnsetType] = unset, + properties: Union[Dict[str, WebIntegrationAccountSchemaResponseSettingsField], UnsetType] = unset, + required: Union[List[str], UnsetType] = unset, + type: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + JSON Schema definition for the secrets object. + Contains sensitive credentials required for the integration such as API keys, + tokens, and passwords. These values are write-only and never returned in responses. + + :param additional_properties: Whether additional properties are allowed (typically false). + :type additional_properties: bool, optional + + :param properties: The individual secret fields for this integration. + Field names and types vary by integration. + :type properties: {str: (WebIntegrationAccountSchemaResponseSettingsField,)}, optional + + :param required: List of required secret field names. + :type required: [str], optional + + :param type: Always "object" for the secrets container. + :type type: str, optional + """ + if additional_properties is not unset: + kwargs["additional_properties"] = additional_properties + if properties is not unset: + kwargs["properties"] = properties + if required is not unset: + kwargs["required"] = required + if type is not unset: + kwargs["type"] = type + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/web_integration_account_schema_response_settings_field.py b/src/datadog_api_client/v2/model/web_integration_account_schema_response_settings_field.py new file mode 100644 index 0000000000..7b75139cb6 --- /dev/null +++ b/src/datadog_api_client/v2/model/web_integration_account_schema_response_settings_field.py @@ -0,0 +1,96 @@ +# 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, Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + date, + datetime, + none_type, + unset, + UnsetType, + UUID, +) + + +class WebIntegrationAccountSchemaResponseSettingsField(ModelNormal): + @cached_property + def openapi_types(_): + return { + "additional_properties": (bool,), + "default": ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + UUID, + none_type, + ), + "description": (str,), + "items": (dict,), + "min_length": (int,), + "type": (str,), + } + + attribute_map = { + "additional_properties": "additionalProperties", + "default": "default", + "description": "description", + "items": "items", + "min_length": "minLength", + "type": "type", + } + + def __init__( + self_, + additional_properties: Union[bool, UnsetType] = unset, + default: Union[Any, UnsetType] = unset, + description: Union[str, UnsetType] = unset, + items: Union[dict, UnsetType] = unset, + min_length: Union[int, UnsetType] = unset, + type: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + JSON Schema definition for a single field within settings or secrets. + The exact fields vary by integration. + + :param additional_properties: Whether additional properties are allowed for this field. + :type additional_properties: bool, optional + + :param default: Default value for the field if not provided. + :type default: bool, date, datetime, dict, float, int, list, str, UUID, none_type, optional + + :param description: Human-readable description of the field's purpose. + :type description: str, optional + + :param items: Schema for array items when type is "array". + :type items: dict, optional + + :param min_length: Minimum length for string fields. + :type min_length: int, optional + + :param type: The data type of the field (string, boolean, integer, array, object). + :type type: str, optional + """ + if additional_properties is not unset: + kwargs["additional_properties"] = additional_properties + if default is not unset: + kwargs["default"] = default + if description is not unset: + kwargs["description"] = description + if items is not unset: + kwargs["items"] = items + if min_length is not unset: + kwargs["min_length"] = min_length + if type is not unset: + kwargs["type"] = type + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/web_integration_account_schema_response_settings_object.py b/src/datadog_api_client/v2/model/web_integration_account_schema_response_settings_object.py new file mode 100644 index 0000000000..113ac53f45 --- /dev/null +++ b/src/datadog_api_client/v2/model/web_integration_account_schema_response_settings_object.py @@ -0,0 +1,77 @@ +# 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 Dict, 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.web_integration_account_schema_response_settings_field import ( + WebIntegrationAccountSchemaResponseSettingsField, + ) + + +class WebIntegrationAccountSchemaResponseSettingsObject(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.web_integration_account_schema_response_settings_field import ( + WebIntegrationAccountSchemaResponseSettingsField, + ) + + return { + "additional_properties": (bool,), + "properties": ({str: (WebIntegrationAccountSchemaResponseSettingsField,)},), + "required": ([str],), + "type": (str,), + } + + attribute_map = { + "additional_properties": "additionalProperties", + "properties": "properties", + "required": "required", + "type": "type", + } + + def __init__( + self_, + additional_properties: Union[bool, UnsetType] = unset, + properties: Union[Dict[str, WebIntegrationAccountSchemaResponseSettingsField], UnsetType] = unset, + required: Union[List[str], UnsetType] = unset, + type: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + JSON Schema definition for the settings object. + Contains integration-specific configuration fields such as account identifiers, + feature toggles, and non-sensitive configuration options. + + :param additional_properties: Whether additional properties are allowed (typically false). + :type additional_properties: bool, optional + + :param properties: The individual setting fields for this integration. + Field names and types vary by integration. + :type properties: {str: (WebIntegrationAccountSchemaResponseSettingsField,)}, optional + + :param required: List of required setting field names. + :type required: [str], optional + + :param type: Always "object" for the settings container. + :type type: str, optional + """ + if additional_properties is not unset: + kwargs["additional_properties"] = additional_properties + if properties is not unset: + kwargs["properties"] = properties + if required is not unset: + kwargs["required"] = required + if type is not unset: + kwargs["type"] = type + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/web_integration_account_type.py b/src/datadog_api_client/v2/model/web_integration_account_type.py new file mode 100644 index 0000000000..2399af08ea --- /dev/null +++ b/src/datadog_api_client/v2/model/web_integration_account_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 WebIntegrationAccountType(ModelSimple): + """ + The JSON:API type for web integration accounts. + + :param value: If omitted defaults to "Account". Must be one of ["Account"]. + :type value: str + """ + + allowed_values = { + "Account", + } + ACCOUNT: ClassVar["WebIntegrationAccountType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +WebIntegrationAccountType.ACCOUNT = WebIntegrationAccountType("Account") diff --git a/src/datadog_api_client/v2/model/web_integration_account_update_request.py b/src/datadog_api_client/v2/model/web_integration_account_update_request.py new file mode 100644 index 0000000000..2225b959e9 --- /dev/null +++ b/src/datadog_api_client/v2/model/web_integration_account_update_request.py @@ -0,0 +1,44 @@ +# 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.web_integration_account_update_request_data import ( + WebIntegrationAccountUpdateRequestData, + ) + + +class WebIntegrationAccountUpdateRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.web_integration_account_update_request_data import ( + WebIntegrationAccountUpdateRequestData, + ) + + return { + "data": (WebIntegrationAccountUpdateRequestData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: WebIntegrationAccountUpdateRequestData, **kwargs): + """ + Payload for updating a web integration account. + + :param data: Data object for updating a web integration account. + :type data: WebIntegrationAccountUpdateRequestData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/web_integration_account_update_request_attributes.py b/src/datadog_api_client/v2/model/web_integration_account_update_request_attributes.py new file mode 100644 index 0000000000..1a87c88b09 --- /dev/null +++ b/src/datadog_api_client/v2/model/web_integration_account_update_request_attributes.py @@ -0,0 +1,93 @@ +# 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, Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + date, + datetime, + none_type, + unset, + UnsetType, + UUID, +) + + +class WebIntegrationAccountUpdateRequestAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "name": (str,), + "secrets": ( + { + str: ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + UUID, + none_type, + ) + }, + ), + "settings": ( + { + str: ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + UUID, + none_type, + ) + }, + ), + } + + attribute_map = { + "name": "name", + "secrets": "secrets", + "settings": "settings", + } + + def __init__( + self_, + name: Union[str, UnsetType] = unset, + secrets: Union[Dict[str, Any], UnsetType] = unset, + settings: Union[Dict[str, Any], UnsetType] = unset, + **kwargs, + ): + """ + Attributes for updating a web integration account. All fields are optional; + only provide the fields you want to update. + + :param name: The name of the account. + :type name: str, optional + + :param secrets: Sensitive credentials to update. Only the secrets provided are updated. + These values are write-only and never returned in responses. + :type secrets: {str: (bool, date, datetime, dict, float, int, list, str, UUID, none_type,)}, optional + + :param settings: Integration-specific settings to update. Only the fields provided are updated. + The structure varies by integration type. See the integration's schema for available fields. + :type settings: {str: (bool, date, datetime, dict, float, int, list, str, UUID, none_type,)}, optional + """ + if name is not unset: + kwargs["name"] = name + if secrets is not unset: + kwargs["secrets"] = secrets + if settings is not unset: + kwargs["settings"] = settings + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/web_integration_account_update_request_data.py b/src/datadog_api_client/v2/model/web_integration_account_update_request_data.py new file mode 100644 index 0000000000..ff1246ee47 --- /dev/null +++ b/src/datadog_api_client/v2/model/web_integration_account_update_request_data.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, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.web_integration_account_update_request_attributes import ( + WebIntegrationAccountUpdateRequestAttributes, + ) + from datadog_api_client.v2.model.web_integration_account_type import WebIntegrationAccountType + + +class WebIntegrationAccountUpdateRequestData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.web_integration_account_update_request_attributes import ( + WebIntegrationAccountUpdateRequestAttributes, + ) + from datadog_api_client.v2.model.web_integration_account_type import WebIntegrationAccountType + + return { + "attributes": (WebIntegrationAccountUpdateRequestAttributes,), + "type": (WebIntegrationAccountType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__( + self_, + type: WebIntegrationAccountType, + attributes: Union[WebIntegrationAccountUpdateRequestAttributes, UnsetType] = unset, + **kwargs, + ): + """ + Data object for updating a web integration account. + + :param attributes: Attributes for updating a web integration account. All fields are optional; + only provide the fields you want to update. + :type attributes: WebIntegrationAccountUpdateRequestAttributes, optional + + :param type: The JSON:API type for web integration accounts. + :type type: WebIntegrationAccountType + """ + if attributes is not unset: + kwargs["attributes"] = attributes + super().__init__(kwargs) + + self_.type = type diff --git a/src/datadog_api_client/v2/model/web_integration_accounts_response.py b/src/datadog_api_client/v2/model/web_integration_accounts_response.py new file mode 100644 index 0000000000..2c90cc4617 --- /dev/null +++ b/src/datadog_api_client/v2/model/web_integration_accounts_response.py @@ -0,0 +1,54 @@ +# 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.web_integration_account_response_data import WebIntegrationAccountResponseData + + +class WebIntegrationAccountsResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.web_integration_account_response_data import WebIntegrationAccountResponseData + + return { + "data": ([WebIntegrationAccountResponseData],), + "integration_name": (str,), + } + + attribute_map = { + "data": "data", + "integration_name": "integration_name", + } + + def __init__( + self_, + data: Union[List[WebIntegrationAccountResponseData], UnsetType] = unset, + integration_name: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Response containing a list of web integration accounts. + + :param data: + :type data: [WebIntegrationAccountResponseData], optional + + :param integration_name: The name of the integration. + :type integration_name: str, optional + """ + if data is not unset: + kwargs["data"] = data + if integration_name is not unset: + kwargs["integration_name"] = integration_name + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 93bc532cfa..a58f0a140f 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -6472,6 +6472,38 @@ from datadog_api_client.v2.model.watcher_data import WatcherData from datadog_api_client.v2.model.watcher_data_attributes import WatcherDataAttributes from datadog_api_client.v2.model.watcher_data_type import WatcherDataType +from datadog_api_client.v2.model.web_integration_account_attributes import WebIntegrationAccountAttributes +from datadog_api_client.v2.model.web_integration_account_create_request import WebIntegrationAccountCreateRequest +from datadog_api_client.v2.model.web_integration_account_create_request_attributes import ( + WebIntegrationAccountCreateRequestAttributes, +) +from datadog_api_client.v2.model.web_integration_account_create_request_data import ( + WebIntegrationAccountCreateRequestData, +) +from datadog_api_client.v2.model.web_integration_account_response import WebIntegrationAccountResponse +from datadog_api_client.v2.model.web_integration_account_response_data import WebIntegrationAccountResponseData +from datadog_api_client.v2.model.web_integration_account_schema_response import WebIntegrationAccountSchemaResponse +from datadog_api_client.v2.model.web_integration_account_schema_response_properties import ( + WebIntegrationAccountSchemaResponseProperties, +) +from datadog_api_client.v2.model.web_integration_account_schema_response_secrets_object import ( + WebIntegrationAccountSchemaResponseSecretsObject, +) +from datadog_api_client.v2.model.web_integration_account_schema_response_settings_field import ( + WebIntegrationAccountSchemaResponseSettingsField, +) +from datadog_api_client.v2.model.web_integration_account_schema_response_settings_object import ( + WebIntegrationAccountSchemaResponseSettingsObject, +) +from datadog_api_client.v2.model.web_integration_account_type import WebIntegrationAccountType +from datadog_api_client.v2.model.web_integration_account_update_request import WebIntegrationAccountUpdateRequest +from datadog_api_client.v2.model.web_integration_account_update_request_attributes import ( + WebIntegrationAccountUpdateRequestAttributes, +) +from datadog_api_client.v2.model.web_integration_account_update_request_data import ( + WebIntegrationAccountUpdateRequestData, +) +from datadog_api_client.v2.model.web_integration_accounts_response import WebIntegrationAccountsResponse from datadog_api_client.v2.model.weekday import Weekday from datadog_api_client.v2.model.widget_live_span import WidgetLiveSpan from datadog_api_client.v2.model.workflow_data import WorkflowData @@ -11090,6 +11122,22 @@ "WatcherData", "WatcherDataAttributes", "WatcherDataType", + "WebIntegrationAccountAttributes", + "WebIntegrationAccountCreateRequest", + "WebIntegrationAccountCreateRequestAttributes", + "WebIntegrationAccountCreateRequestData", + "WebIntegrationAccountResponse", + "WebIntegrationAccountResponseData", + "WebIntegrationAccountSchemaResponse", + "WebIntegrationAccountSchemaResponseProperties", + "WebIntegrationAccountSchemaResponseSecretsObject", + "WebIntegrationAccountSchemaResponseSettingsField", + "WebIntegrationAccountSchemaResponseSettingsObject", + "WebIntegrationAccountType", + "WebIntegrationAccountUpdateRequest", + "WebIntegrationAccountUpdateRequestAttributes", + "WebIntegrationAccountUpdateRequestData", + "WebIntegrationAccountsResponse", "Weekday", "WidgetLiveSpan", "WorkflowData", diff --git a/tests/v2/cassettes/test_scenarios/test_create_integration_account_returns_created_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_integration_account_returns_created_response.frozen new file mode 100644 index 0000000000..ee56d681a1 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_integration_account_returns_created_response.frozen @@ -0,0 +1 @@ +2026-01-16T00:21:52.989Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_integration_account_returns_created_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_integration_account_returns_created_response.yaml new file mode 100644 index 0000000000..5ab521941e --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_integration_account_returns_created_response.yaml @@ -0,0 +1,20 @@ +interactions: +- request: + body: '{"data":{"attributes":{"name":"Test-Create_integration_account_returns_Created_response-1768522912","secrets":{"api_key_token":"test_secret_token"},"settings":{"account_sid":"ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","alerts":true,"api_key":"SKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","call_summaries":true,"ccm_enabled":true,"censor_logs":true,"events":true,"messages":true}},"type":"Account"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/web-integrations/twilio/accounts + response: + body: + string: '{"data":{"id":"591eebe4-998f-49f0-b5db-a6b76e3ff392","type":"Account","attributes":{"name":"Test-Create_integration_account_returns_Created_response-1768522912","settings":{"account_sid":"ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","alerts":true,"api_key":"SKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","call_summaries":true,"ccm_enabled":true,"censor_logs":true,"events":true,"messages":true}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_delete_integration_account_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_delete_integration_account_returns_ok_response.frozen new file mode 100644 index 0000000000..5445135415 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_integration_account_returns_ok_response.frozen @@ -0,0 +1 @@ +2026-01-16T00:21:53.514Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_delete_integration_account_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_delete_integration_account_returns_ok_response.yaml new file mode 100644 index 0000000000..e9d5539b6a --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_integration_account_returns_ok_response.yaml @@ -0,0 +1,36 @@ +interactions: +- request: + body: '{"data":{"attributes":{"name":"Test-Delete_integration_account_returns_OK_response-1768522913","secrets":{"api_key_token":"test_secret_token_value"},"settings":{"account_sid":"ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","alerts":true,"api_key":"SKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","call_summaries":true,"ccm_enabled":true,"censor_logs":true,"events":true,"messages":true}},"type":"Account"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/web-integrations/twilio/accounts + response: + body: + string: '{"data":{"id":"2ef78fa1-8ebd-4dc8-8db7-1516563d9a35","type":"Account","attributes":{"name":"Test-Delete_integration_account_returns_OK_response-1768522913","settings":{"account_sid":"ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","alerts":true,"api_key":"SKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","call_summaries":true,"ccm_enabled":true,"censor_logs":true,"events":true,"messages":true}}}}' + 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/web-integrations/twilio/accounts/2ef78fa1-8ebd-4dc8-8db7-1516563d9a35 + response: + body: + string: '' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_get_account_schema_for_an_integration_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_account_schema_for_an_integration_returns_ok_response.frozen new file mode 100644 index 0000000000..5b4b6c4075 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_account_schema_for_an_integration_returns_ok_response.frozen @@ -0,0 +1 @@ +2026-01-16T00:23:39.895Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_account_schema_for_an_integration_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_account_schema_for_an_integration_returns_ok_response.yaml new file mode 100644 index 0000000000..fe16b23971 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_account_schema_for_an_integration_returns_ok_response.yaml @@ -0,0 +1,33 @@ +interactions: +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/web-integrations/twilio/accounts/schema + response: + body: + string: '{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"secrets":{"additionalProperties":false,"properties":{"api_key_token":{"additionalProperties":false,"description":"Twilio + API Key Secret (token) corresponding to the API Key SID. Keep this secure + as it provides authentication access.","minLength":1,"type":"string"}},"required":["api_key_token"],"type":"object"},"settings":{"additionalProperties":false,"properties":{"account_sid":{"additionalProperties":false,"description":"Twilio + Account SID that uniquely identifies your Twilio account. Found in Twilio + Console \u003e Account Info.","minLength":1,"type":"string"},"alerts":{"additionalProperties":false,"description":"Enable + collection of Twilio Alerts logs to monitor account alerts and notifications","type":"boolean"},"api_key":{"additionalProperties":false,"description":"Twilio + API Key SID for authentication. Create from Twilio Console \u003e Account + \u003e API Keys \u0026 Tokens.","minLength":1,"type":"string"},"call_summaries":{"additionalProperties":false,"description":"Enable + collection of Twilio Voice call summaries to track voice call performance + and metadata","type":"boolean"},"ccm_enabled":{"additionalProperties":false,"description":"Enable + Cloud Cost Management to monitor Twilio usage costs and identify optimization + opportunities","type":"boolean"},"censor_logs":{"additionalProperties":false,"description":"Enable + censoring of sensitive data in logs. When true, phone numbers in the ''to'' + field and SMS message bodies are censored for privacy.","type":"boolean"},"events":{"additionalProperties":false,"description":"Enable + collection of Twilio Events logs to monitor account-level events and activities","type":"boolean"},"messages":{"additionalProperties":false,"description":"Enable + collection of Twilio Messages logs to track SMS and messaging activity","type":"boolean"}},"required":["api_key","account_sid","events","messages","alerts","call_summaries","ccm_enabled","censor_logs"],"type":"object"}},"required":["settings","secrets"],"type":"object"}' + headers: + content-type: + - application/json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_get_integration_account_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_integration_account_returns_ok_response.frozen new file mode 100644 index 0000000000..67caccae48 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_integration_account_returns_ok_response.frozen @@ -0,0 +1 @@ +2026-01-16T00:21:54.756Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_integration_account_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_integration_account_returns_ok_response.yaml new file mode 100644 index 0000000000..a6c812a846 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_integration_account_returns_ok_response.yaml @@ -0,0 +1,36 @@ +interactions: +- request: + body: '{"data":{"attributes":{"name":"Test-Get_integration_account_returns_OK_response-1768522914","secrets":{"api_key_token":"test_secret_token_value"},"settings":{"account_sid":"ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","alerts":true,"api_key":"SKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","call_summaries":true,"ccm_enabled":true,"censor_logs":true,"events":true,"messages":true}},"type":"Account"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/web-integrations/twilio/accounts + response: + body: + string: '{"data":{"id":"945d4bbe-d24e-4530-a4db-3dc27329e5e8","type":"Account","attributes":{"name":"Test-Get_integration_account_returns_OK_response-1768522914","settings":{"account_sid":"ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","alerts":true,"api_key":"SKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","call_summaries":true,"ccm_enabled":true,"censor_logs":true,"events":true,"messages":true}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/web-integrations/twilio/accounts/945d4bbe-d24e-4530-a4db-3dc27329e5e8 + response: + body: + string: '{"data":{"id":"945d4bbe-d24e-4530-a4db-3dc27329e5e8","type":"Account","attributes":{"name":"Test-Get_integration_account_returns_OK_response-1768522914","settings":{"account_sid":"ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","alerts":true,"api_key":"SKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","call_summaries":true,"ccm_enabled":true,"censor_logs":true,"events":true,"messages":true}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_list_integration_accounts_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_list_integration_accounts_returns_ok_response.frozen new file mode 100644 index 0000000000..3e3e9e3142 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_list_integration_accounts_returns_ok_response.frozen @@ -0,0 +1 @@ +2026-01-16T00:21:55.952Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_list_integration_accounts_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_list_integration_accounts_returns_ok_response.yaml new file mode 100644 index 0000000000..f06dfe5707 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_list_integration_accounts_returns_ok_response.yaml @@ -0,0 +1,36 @@ +interactions: +- request: + body: '{"data":{"attributes":{"name":"Test-List_integration_accounts_returns_OK_response-1768522915","secrets":{"api_key_token":"test_secret_token_value"},"settings":{"account_sid":"ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","alerts":true,"api_key":"SKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","call_summaries":true,"ccm_enabled":true,"censor_logs":true,"events":true,"messages":true}},"type":"Account"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/web-integrations/twilio/accounts + response: + body: + string: '{"data":{"id":"a491e2ce-8537-4015-8552-d76b23f9c2a2","type":"Account","attributes":{"name":"Test-List_integration_accounts_returns_OK_response-1768522915","settings":{"account_sid":"ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","alerts":true,"api_key":"SKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","call_summaries":true,"ccm_enabled":true,"censor_logs":true,"events":true,"messages":true}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/web-integrations/twilio/accounts + response: + body: + string: '{"data":[{"id":"cea19da0-127c-46bd-af1f-dab6524dc139","type":"Account","attributes":{"name":"Test-Create_integration_account_returns_Created_response-1768495642","settings":{"account_sid":"ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","alerts":true,"api_key":"SKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","call_summaries":true,"ccm_enabled":true,"censor_logs":true,"events":true,"messages":true}}},{"id":"07527a04-9eab-4528-8d55-072bb4cbfdfd","type":"Account","attributes":{"name":"Test-Get_integration_account_returns_OK_response-1768495644","settings":{"account_sid":"ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","alerts":true,"api_key":"SKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","call_summaries":true,"ccm_enabled":true,"censor_logs":true,"events":true,"messages":true}}},{"id":"efa743ed-c968-49df-97ce-f078b8f6a871","type":"Account","attributes":{"name":"Test-List_integration_accounts_returns_OK_response-1768495645","settings":{"account_sid":"ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","alerts":true,"api_key":"SKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","call_summaries":true,"ccm_enabled":true,"censor_logs":true,"events":true,"messages":true}}},{"id":"4fe972b3-5a53-414f-9304-0a683f403f46","type":"Account","attributes":{"name":"Test-Update_integration_account_returns_OK_response-1768495646-updated","settings":{"account_sid":"ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","alerts":true,"api_key":"SKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","call_summaries":true,"ccm_enabled":false,"censor_logs":true,"events":false,"messages":false}}},{"id":"591eebe4-998f-49f0-b5db-a6b76e3ff392","type":"Account","attributes":{"name":"Test-Create_integration_account_returns_Created_response-1768522912","settings":{"account_sid":"ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","alerts":true,"api_key":"SKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","call_summaries":true,"ccm_enabled":true,"censor_logs":true,"events":true,"messages":true}}},{"id":"945d4bbe-d24e-4530-a4db-3dc27329e5e8","type":"Account","attributes":{"name":"Test-Get_integration_account_returns_OK_response-1768522914","settings":{"account_sid":"ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","alerts":true,"api_key":"SKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","call_summaries":true,"ccm_enabled":true,"censor_logs":true,"events":true,"messages":true}}},{"id":"a491e2ce-8537-4015-8552-d76b23f9c2a2","type":"Account","attributes":{"name":"Test-List_integration_accounts_returns_OK_response-1768522915","settings":{"account_sid":"ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","alerts":true,"api_key":"SKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","call_summaries":true,"ccm_enabled":true,"censor_logs":true,"events":true,"messages":true}}}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_update_integration_account_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_integration_account_returns_ok_response.frozen new file mode 100644 index 0000000000..954730cedd --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_integration_account_returns_ok_response.frozen @@ -0,0 +1 @@ +2026-01-16T00:21:56.916Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_update_integration_account_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_integration_account_returns_ok_response.yaml new file mode 100644 index 0000000000..e3c2407a86 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_integration_account_returns_ok_response.yaml @@ -0,0 +1,38 @@ +interactions: +- request: + body: '{"data":{"attributes":{"name":"Test-Update_integration_account_returns_OK_response-1768522916","secrets":{"api_key_token":"test_secret_token_value"},"settings":{"account_sid":"ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","alerts":true,"api_key":"SKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","call_summaries":true,"ccm_enabled":true,"censor_logs":true,"events":true,"messages":true}},"type":"Account"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/web-integrations/twilio/accounts + response: + body: + string: '{"data":{"id":"4458ffbb-09e3-4b11-8b59-7ac39a766164","type":"Account","attributes":{"name":"Test-Update_integration_account_returns_OK_response-1768522916","settings":{"account_sid":"ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","alerts":true,"api_key":"SKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","call_summaries":true,"ccm_enabled":true,"censor_logs":true,"events":true,"messages":true}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: '{"data":{"attributes":{"name":"Test-Update_integration_account_returns_OK_response-1768522916-updated","settings":{"ccm_enabled":false,"events":false,"messages":false}},"type":"Account"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/web-integrations/twilio/accounts/4458ffbb-09e3-4b11-8b59-7ac39a766164 + response: + body: + string: '{"data":{"id":"4458ffbb-09e3-4b11-8b59-7ac39a766164","type":"Account","attributes":{"name":"Test-Update_integration_account_returns_OK_response-1768522916-updated","settings":{"account_sid":"ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","alerts":true,"api_key":"SKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","call_summaries":true,"ccm_enabled":false,"censor_logs":true,"events":false,"messages":false}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v2/features/given.json b/tests/v2/features/given.json index 76980d4ce3..027b09ca18 100644 --- a/tests/v2/features/given.json +++ b/tests/v2/features/given.json @@ -1443,6 +1443,22 @@ "tag": "Users", "operationId": "CreateUser" }, + { + "parameters": [ + { + "name": "integration_name", + "value": "\"twilio\"" + }, + { + "name": "body", + "value": "{\n \"data\": {\n \"type\": \"Account\",\n \"attributes\": {\n \"name\": \"{{ unique }}\",\n \"settings\": {\n \"api_key\": \"SKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\",\n \"account_sid\": \"ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\",\n \"events\": true,\n \"messages\": true,\n \"alerts\": true,\n \"call_summaries\": true,\n \"ccm_enabled\": true,\n \"censor_logs\": true\n },\n \"secrets\": {\n \"api_key_token\": \"test_secret_token_value\"\n }\n }\n }\n}" + } + ], + "step": "there is a valid \"web_integration_account\" in the system", + "key": "web_integration_account", + "tag": "Integration Accounts", + "operationId": "CreateWebIntegrationAccount" + }, { "parameters": [ { diff --git a/tests/v2/features/integration_accounts.feature b/tests/v2/features/integration_accounts.feature new file mode 100644 index 0000000000..54b4cea828 --- /dev/null +++ b/tests/v2/features/integration_accounts.feature @@ -0,0 +1,179 @@ +@endpoint(integration-accounts) @endpoint(integration-accounts-v2) +Feature: Integration Accounts + Configure and manage third-party integrations with Datadog. This API + provides a unified interface for managing integration accounts across + various external services. Each integration has its own unique schema + that defines the required settings and secrets. Before creating or + updating an account, use the schema endpoint to retrieve the specific + requirements, field types, validation rules, and available configuration + options for your integration. **Note**: This API manages integration + account configurations only. It does not support Grace Resources, + Reference Tables, or Custom Queries CRUD operations. For those features, + refer to each integration's dedicated documentation. Supported + Integrations: - + [Twilio](https://docs.datadoghq.com/integrations/twilio/) - + [Snowflake](https://docs.datadoghq.com/integrations/snowflake-web/) - + [Databricks](https://docs.datadoghq.com/integrations/databricks/) + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "IntegrationAccounts" API + + @generated @skip @team:DataDog/web-integrations + Scenario: Create integration account returns "Bad Request: The request body is malformed or the integration name format is invalid." response + Given new "CreateWebIntegrationAccount" request + And request contains "integration_name" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"name": "My Production Account", "secrets": {"api_key_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}, "settings": {"account_sid": "ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "alerts": true, "api_key": "SKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "call_summaries": true, "ccm_enabled": true, "censor_logs": true, "events": true, "messages": true}}, "type": "Account"}} + When the request is sent + Then the response status is 400 Bad Request: The request body is malformed or the integration name format is invalid. + + @generated @skip @team:DataDog/web-integrations + Scenario: Create integration account returns "Created: The account was successfully created." response + Given new "CreateWebIntegrationAccount" request + And request contains "integration_name" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"name": "My Production Account", "secrets": {"api_key_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}, "settings": {"account_sid": "ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "alerts": true, "api_key": "SKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "call_summaries": true, "ccm_enabled": true, "censor_logs": true, "events": true, "messages": true}}, "type": "Account"}} + When the request is sent + Then the response status is 201 Created: The account was successfully created. + + @generated @skip @team:DataDog/web-integrations + Scenario: Create integration account returns "Not Found: The integration does not exist." response + Given new "CreateWebIntegrationAccount" request + And request contains "integration_name" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"name": "My Production Account", "secrets": {"api_key_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}, "settings": {"account_sid": "ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "alerts": true, "api_key": "SKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "call_summaries": true, "ccm_enabled": true, "censor_logs": true, "events": true, "messages": true}}, "type": "Account"}} + When the request is sent + Then the response status is 404 Not Found: The integration does not exist. + + @generated @skip @team:DataDog/web-integrations + Scenario: Create integration account returns "Unprocessable Entity: The account configuration does not match the integration schema." response + Given new "CreateWebIntegrationAccount" request + And request contains "integration_name" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"name": "My Production Account", "secrets": {"api_key_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}, "settings": {"account_sid": "ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "alerts": true, "api_key": "SKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "call_summaries": true, "ccm_enabled": true, "censor_logs": true, "events": true, "messages": true}}, "type": "Account"}} + When the request is sent + Then the response status is 422 Unprocessable Entity: The account configuration does not match the integration schema. + + @generated @skip @team:DataDog/web-integrations + Scenario: Delete integration account returns "Bad Request: The integration name or account ID format is invalid." response + Given new "DeleteWebIntegrationAccount" request + And request contains "integration_name" parameter from "REPLACE.ME" + And request contains "account_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request: The integration name or account ID format is invalid. + + @generated @skip @team:DataDog/web-integrations + Scenario: Delete integration account returns "Not Found: The integration or account does not exist." response + Given new "DeleteWebIntegrationAccount" request + And request contains "integration_name" parameter from "REPLACE.ME" + And request contains "account_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found: The integration or account does not exist. + + @generated @skip @team:DataDog/web-integrations + Scenario: Delete integration account returns "OK: The account was successfully deleted." response + Given new "DeleteWebIntegrationAccount" request + And request contains "integration_name" parameter from "REPLACE.ME" + And request contains "account_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK: The account was successfully deleted. + + @generated @skip @team:DataDog/web-integrations + Scenario: Get account schema for an integration returns "Bad Request: The integration name format is invalid." response + Given new "GetWebIntegrationAccountSchema" request + And request contains "integration_name" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request: The integration name format is invalid. + + @generated @skip @team:DataDog/web-integrations + Scenario: Get account schema for an integration returns "Not Found: The integration does not exist or has no schema available." response + Given new "GetWebIntegrationAccountSchema" request + And request contains "integration_name" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found: The integration does not exist or has no schema available. + + @generated @skip @team:DataDog/web-integrations + Scenario: Get account schema for an integration returns "OK: The JSON schema for the integration's account configuration." response + Given new "GetWebIntegrationAccountSchema" request + And request contains "integration_name" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK: The JSON schema for the integration's account configuration. + + @generated @skip @team:DataDog/web-integrations + Scenario: Get integration account returns "Bad Request: The integration name or account ID format is invalid." response + Given new "GetWebIntegrationAccount" request + And request contains "integration_name" parameter from "REPLACE.ME" + And request contains "account_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request: The integration name or account ID format is invalid. + + @generated @skip @team:DataDog/web-integrations + Scenario: Get integration account returns "Not Found: The integration or account does not exist." response + Given new "GetWebIntegrationAccount" request + And request contains "integration_name" parameter from "REPLACE.ME" + And request contains "account_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found: The integration or account does not exist. + + @generated @skip @team:DataDog/web-integrations + Scenario: Get integration account returns "OK: The account details for the specified integration." response + Given new "GetWebIntegrationAccount" request + And request contains "integration_name" parameter from "REPLACE.ME" + And request contains "account_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK: The account details for the specified integration. + + @generated @skip @team:DataDog/web-integrations + Scenario: List integration accounts returns "Bad Request: The integration name format is invalid." response + Given new "ListWebIntegrationAccounts" request + And request contains "integration_name" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request: The integration name format is invalid. + + @generated @skip @team:DataDog/web-integrations + Scenario: List integration accounts returns "Not Found: The integration does not exist." response + Given new "ListWebIntegrationAccounts" request + And request contains "integration_name" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found: The integration does not exist. + + @generated @skip @team:DataDog/web-integrations + Scenario: List integration accounts returns "OK: List of all accounts for the specified integration." response + Given new "ListWebIntegrationAccounts" request + And request contains "integration_name" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK: List of all accounts for the specified integration. + + @generated @skip @team:DataDog/web-integrations + Scenario: Update integration account returns "Bad Request: The request body is malformed or the integration name/account ID format is invalid." response + Given new "UpdateWebIntegrationAccount" request + And request contains "integration_name" parameter from "REPLACE.ME" + And request contains "account_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"name": "My Production Account (Updated)", "secrets": {"api_key_token": "new_secret_token_value"}, "settings": {"ccm_enabled": true, "events": true, "messages": false}}, "type": "Account"}} + When the request is sent + Then the response status is 400 Bad Request: The request body is malformed or the integration name/account ID format is invalid. + + @generated @skip @team:DataDog/web-integrations + Scenario: Update integration account returns "Not Found: The integration or account does not exist." response + Given new "UpdateWebIntegrationAccount" request + And request contains "integration_name" parameter from "REPLACE.ME" + And request contains "account_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"name": "My Production Account (Updated)", "secrets": {"api_key_token": "new_secret_token_value"}, "settings": {"ccm_enabled": true, "events": true, "messages": false}}, "type": "Account"}} + When the request is sent + Then the response status is 404 Not Found: The integration or account does not exist. + + @generated @skip @team:DataDog/web-integrations + Scenario: Update integration account returns "OK: The account was successfully updated." response + Given new "UpdateWebIntegrationAccount" request + And request contains "integration_name" parameter from "REPLACE.ME" + And request contains "account_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"name": "My Production Account (Updated)", "secrets": {"api_key_token": "new_secret_token_value"}, "settings": {"ccm_enabled": true, "events": true, "messages": false}}, "type": "Account"}} + When the request is sent + Then the response status is 200 OK: The account was successfully updated. + + @generated @skip @team:DataDog/web-integrations + Scenario: Update integration account returns "Unprocessable Entity: The account configuration does not match the integration schema." response + Given new "UpdateWebIntegrationAccount" request + And request contains "integration_name" parameter from "REPLACE.ME" + And request contains "account_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"name": "My Production Account (Updated)", "secrets": {"api_key_token": "new_secret_token_value"}, "settings": {"ccm_enabled": true, "events": true, "messages": false}}, "type": "Account"}} + When the request is sent + Then the response status is 422 Unprocessable Entity: The account configuration does not match the integration schema. diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index a04c9b283b..93438d3293 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -6209,6 +6209,53 @@ "type": "safe" } }, + "ListWebIntegrationAccounts": { + "tag": "Integration Accounts", + "undo": { + "type": "safe" + } + }, + "CreateWebIntegrationAccount": { + "tag": "Integration Accounts", + "undo": { + "operationId": "DeleteWebIntegrationAccount", + "parameters": [ + { + "name": "integration_name", + "source": "integration_name" + }, + { + "name": "account_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "GetWebIntegrationAccountSchema": { + "tag": "Integration Accounts", + "undo": { + "type": "safe" + } + }, + "DeleteWebIntegrationAccount": { + "tag": "Integration Accounts", + "undo": { + "type": "idempotent" + } + }, + "GetWebIntegrationAccount": { + "tag": "Integration Accounts", + "undo": { + "type": "safe" + } + }, + "UpdateWebIntegrationAccount": { + "tag": "Integration Accounts", + "undo": { + "type": "idempotent" + } + }, "CreateWorkflow": { "tag": "Workflow Automation", "undo": { diff --git a/tests/v2/features/web_integrations.feature b/tests/v2/features/web_integrations.feature new file mode 100644 index 0000000000..067af24109 --- /dev/null +++ b/tests/v2/features/web_integrations.feature @@ -0,0 +1,258 @@ +@endpoint(web-integrations) @endpoint(web-integrations-v2) +Feature: Web Integrations + Configure and manage third-party web integrations with Datadog. This API + provides a unified interface for managing integration accounts across + various external services. Each integration has its own unique schema + that defines the required settings and secrets. Before creating or + updating an account, use the schema endpoint to retrieve the specific + requirements, field types, validation rules, and available configuration + options for your integration. Supported Integrations: - twilio - + snowflake-web - databricks + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "IntegrationAccounts" API + + @skip @team:DataDog/web-integrations + Scenario: Create integration account returns "Bad Request" response with invalid integration name + Given new "CreateWebIntegrationAccount" request + And request contains "integration_name" parameter with value "invalid-integration-name" + And body with value {"data": {"type": "Account", "attributes": {"name": "Test Account", "settings": {"api_key": "SKtest", "account_sid": "ACtest", "events": true, "messages": true, "alerts": true, "call_summaries": true, "ccm_enabled": true, "censor_logs": true}, "secrets": {"api_key_token": "test_token"}}}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/web-integrations + Scenario: Create integration account returns "Bad Request: The request body is malformed or the integration name format is invalid." response + Given new "CreateWebIntegrationAccount" request + And request contains "integration_name" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"name": "My Production Account", "secrets": {"api_key_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}, "settings": {"account_sid": "ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "alerts": true, "api_key": "SKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "call_summaries": true, "ccm_enabled": true, "censor_logs": true, "events": true, "messages": true}}, "type": "Account"}} + When the request is sent + Then the response status is 400 Bad Request: The request body is malformed or the integration name format is invalid. + + @skip @team:DataDog/web-integrations + Scenario: Create integration account returns "Created" response + Given new "CreateWebIntegrationAccount" request + And request contains "integration_name" parameter with value "twilio" + And body with value {"data": {"type": "Account", "attributes": {"name": "{{ unique }}", "settings": {"api_key": "SKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "account_sid": "ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "events": true, "messages": true, "alerts": true, "call_summaries": true, "ccm_enabled": true, "censor_logs": true}, "secrets": {"api_key_token": "test_secret_token"}}}} + When the request is sent + Then the response status is 201 Created + And the response "data.type" is equal to "Account" + And the response "data.attributes.name" is equal to "{{ unique }}" + And the response "data.attributes.settings.api_key" is equal to "SKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + And the response "data.attributes.settings.account_sid" is equal to "ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + + @generated @skip @team:DataDog/web-integrations + Scenario: Create integration account returns "Created: The account was successfully created." response + Given new "CreateWebIntegrationAccount" request + And request contains "integration_name" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"name": "My Production Account", "secrets": {"api_key_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}, "settings": {"account_sid": "ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "alerts": true, "api_key": "SKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "call_summaries": true, "ccm_enabled": true, "censor_logs": true, "events": true, "messages": true}}, "type": "Account"}} + When the request is sent + Then the response status is 201 Created: The account was successfully created. + + @generated @skip @team:DataDog/web-integrations + Scenario: Create integration account returns "Not Found: The integration does not exist." response + Given new "CreateWebIntegrationAccount" request + And request contains "integration_name" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"name": "My Production Account", "secrets": {"api_key_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}, "settings": {"account_sid": "ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "alerts": true, "api_key": "SKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "call_summaries": true, "ccm_enabled": true, "censor_logs": true, "events": true, "messages": true}}, "type": "Account"}} + When the request is sent + Then the response status is 404 Not Found: The integration does not exist. + + @skip @team:DataDog/web-integrations + Scenario: Create integration account returns "Unprocessable Entity" response with missing required field + Given new "CreateWebIntegrationAccount" request + And request contains "integration_name" parameter with value "twilio" + And body with value {"data": {"type": "Account", "attributes": {"name": "Test Account", "settings": {"api_key": "SKtest"}, "secrets": {"api_key_token": "test_token"}}}} + When the request is sent + Then the response status is 422 Unprocessable Entity + + @generated @skip @team:DataDog/web-integrations + Scenario: Create integration account returns "Unprocessable Entity: The account configuration does not match the integration schema." response + Given new "CreateWebIntegrationAccount" request + And request contains "integration_name" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"name": "My Production Account", "secrets": {"api_key_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}, "settings": {"account_sid": "ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "alerts": true, "api_key": "SKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "call_summaries": true, "ccm_enabled": true, "censor_logs": true, "events": true, "messages": true}}, "type": "Account"}} + When the request is sent + Then the response status is 422 Unprocessable Entity: The account configuration does not match the integration schema. + + @generated @skip @team:DataDog/web-integrations + Scenario: Delete integration account returns "Bad Request: The integration name or account ID format is invalid." response + Given new "DeleteWebIntegrationAccount" request + And request contains "integration_name" parameter from "REPLACE.ME" + And request contains "account_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request: The integration name or account ID format is invalid. + + @generated @skip @team:DataDog/web-integrations + Scenario: Delete integration account returns "Not Found: The integration or account does not exist." response + Given new "DeleteWebIntegrationAccount" request + And request contains "integration_name" parameter from "REPLACE.ME" + And request contains "account_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found: The integration or account does not exist. + + @skip @team:DataDog/web-integrations + Scenario: Delete integration account returns "OK" response + Given there is a valid "web_integration_account" in the system + And new "DeleteWebIntegrationAccount" request + And request contains "integration_name" parameter with value "twilio" + And request contains "account_id" parameter from "web_integration_account.data.id" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/web-integrations + Scenario: Delete integration account returns "OK: The account was successfully deleted." response + Given new "DeleteWebIntegrationAccount" request + And request contains "integration_name" parameter from "REPLACE.ME" + And request contains "account_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK: The account was successfully deleted. + + @generated @skip @team:DataDog/web-integrations + Scenario: Get account schema for an integration returns "Bad Request: The integration name format is invalid." response + Given new "GetWebIntegrationAccountSchema" request + And request contains "integration_name" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request: The integration name format is invalid. + + @generated @skip @team:DataDog/web-integrations + Scenario: Get account schema for an integration returns "Not Found: The integration does not exist or has no schema available." response + Given new "GetWebIntegrationAccountSchema" request + And request contains "integration_name" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found: The integration does not exist or has no schema available. + + @replay-only @team:DataDog/web-integrations + Scenario: Get account schema for an integration returns "OK" response + Given new "GetWebIntegrationAccountSchema" request + And request contains "integration_name" parameter with value "twilio" + When the request is sent + Then the response status is 200 OK + And the response "type" is equal to "object" + And the response "properties.settings.properties.api_key" has field "type" + And the response "properties.secrets.properties.api_key_token" has field "type" + + @generated @skip @team:DataDog/web-integrations + Scenario: Get account schema for an integration returns "OK: The JSON schema for the integration's account configuration." response + Given new "GetWebIntegrationAccountSchema" request + And request contains "integration_name" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK: The JSON schema for the integration's account configuration. + + @generated @skip @team:DataDog/web-integrations + Scenario: Get integration account returns "Bad Request: The integration name or account ID format is invalid." response + Given new "GetWebIntegrationAccount" request + And request contains "integration_name" parameter from "REPLACE.ME" + And request contains "account_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request: The integration name or account ID format is invalid. + + @generated @skip @team:DataDog/web-integrations + Scenario: Get integration account returns "Not Found: The integration or account does not exist." response + Given new "GetWebIntegrationAccount" request + And request contains "integration_name" parameter from "REPLACE.ME" + And request contains "account_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found: The integration or account does not exist. + + @skip @team:DataDog/web-integrations + Scenario: Get integration account returns "OK" response + Given there is a valid "web_integration_account" in the system + And new "GetWebIntegrationAccount" request + And request contains "integration_name" parameter with value "twilio" + And request contains "account_id" parameter from "web_integration_account.data.id" + When the request is sent + Then the response status is 200 OK + And the response "data.type" is equal to "Account" + And the response "data.attributes.name" is equal to "{{ unique }}" + And the response "data.attributes.settings" has field "api_key" + And the response "data.attributes.settings" has field "account_sid" + + @generated @skip @team:DataDog/web-integrations + Scenario: Get integration account returns "OK: The account details for the specified integration." response + Given new "GetWebIntegrationAccount" request + And request contains "integration_name" parameter from "REPLACE.ME" + And request contains "account_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK: The account details for the specified integration. + + @generated @skip @team:DataDog/web-integrations + Scenario: List integration accounts returns "Bad Request: The integration name format is invalid." response + Given new "ListWebIntegrationAccounts" request + And request contains "integration_name" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request: The integration name format is invalid. + + @generated @skip @team:DataDog/web-integrations + Scenario: List integration accounts returns "Not Found: The integration does not exist." response + Given new "ListWebIntegrationAccounts" request + And request contains "integration_name" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found: The integration does not exist. + + @skip @team:DataDog/web-integrations + Scenario: List integration accounts returns "OK" response + Given there is a valid "web_integration_account" in the system + And new "ListWebIntegrationAccounts" request + And request contains "integration_name" parameter with value "twilio" + When the request is sent + Then the response status is 200 OK + And the response "data[0].type" is equal to "Account" + And the response "data[0].attributes" has field "name" + And the response "data[0].attributes" has field "settings" + + @generated @skip @team:DataDog/web-integrations + Scenario: List integration accounts returns "OK: List of all accounts for the specified integration." response + Given new "ListWebIntegrationAccounts" request + And request contains "integration_name" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK: List of all accounts for the specified integration. + + @generated @skip @team:DataDog/web-integrations + Scenario: Update integration account returns "Bad Request: The request body is malformed or the integration name/account ID format is invalid." response + Given new "UpdateWebIntegrationAccount" request + And request contains "integration_name" parameter from "REPLACE.ME" + And request contains "account_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"name": "My Production Account (Updated)", "secrets": {"api_key_token": "new_secret_token_value"}, "settings": {"ccm_enabled": true, "events": true, "messages": false}}, "type": "Account"}} + When the request is sent + Then the response status is 400 Bad Request: The request body is malformed or the integration name/account ID format is invalid. + + @generated @skip @team:DataDog/web-integrations + Scenario: Update integration account returns "Not Found: The integration or account does not exist." response + Given new "UpdateWebIntegrationAccount" request + And request contains "integration_name" parameter from "REPLACE.ME" + And request contains "account_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"name": "My Production Account (Updated)", "secrets": {"api_key_token": "new_secret_token_value"}, "settings": {"ccm_enabled": true, "events": true, "messages": false}}, "type": "Account"}} + When the request is sent + Then the response status is 404 Not Found: The integration or account does not exist. + + @skip @team:DataDog/web-integrations + Scenario: Update integration account returns "OK" response + Given there is a valid "web_integration_account" in the system + And new "UpdateWebIntegrationAccount" request + And request contains "integration_name" parameter with value "twilio" + And request contains "account_id" parameter from "web_integration_account.data.id" + And body with value {"data": {"type": "Account", "attributes": {"name": "{{ unique }}-updated", "settings": {"events": false, "messages": false, "ccm_enabled": false}}}} + When the request is sent + Then the response status is 200 OK + And the response "data.type" is equal to "Account" + And the response "data.attributes.name" is equal to "{{ unique }}-updated" + And the response "data.attributes.settings.events" is false + And the response "data.attributes.settings.messages" is false + + @generated @skip @team:DataDog/web-integrations + Scenario: Update integration account returns "OK: The account was successfully updated." response + Given new "UpdateWebIntegrationAccount" request + And request contains "integration_name" parameter from "REPLACE.ME" + And request contains "account_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"name": "My Production Account (Updated)", "secrets": {"api_key_token": "new_secret_token_value"}, "settings": {"ccm_enabled": true, "events": true, "messages": false}}, "type": "Account"}} + When the request is sent + Then the response status is 200 OK: The account was successfully updated. + + @generated @skip @team:DataDog/web-integrations + Scenario: Update integration account returns "Unprocessable Entity: The account configuration does not match the integration schema." response + Given new "UpdateWebIntegrationAccount" request + And request contains "integration_name" parameter from "REPLACE.ME" + And request contains "account_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"name": "My Production Account (Updated)", "secrets": {"api_key_token": "new_secret_token_value"}, "settings": {"ccm_enabled": true, "events": true, "messages": false}}, "type": "Account"}} + When the request is sent + Then the response status is 422 Unprocessable Entity: The account configuration does not match the integration schema.