From ca32e1d39ed9c7b44b0a413877da672b098a4d76 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Tue, 17 Mar 2026 23:39:16 +0000 Subject: [PATCH] Regenerate client from commit 9ac8497 of spec repo --- .generator/schemas/v2/openapi.yaml | 1081 +++++++++++++++++ .../frozen.json | 1 + .../recording.har | 67 + .../frozen.json | 1 + .../recording.har | 109 ++ .../frozen.json | 1 + .../recording.har | 57 + .../frozen.json | 1 + .../recording.har | 110 ++ .../frozen.json | 1 + .../recording.har | 110 ++ .../frozen.json | 1 + .../recording.har | 120 ++ .../CreateWebIntegrationAccount.ts | 42 + .../CreateWebIntegrationAccount_516494340.ts | 42 + .../DeleteWebIntegrationAccount.ts | 22 + .../DeleteWebIntegrationAccount_3148550629.ts | 26 + .../GetWebIntegrationAccount.ts | 22 + .../GetWebIntegrationAccountSchema.ts | 22 + ...tWebIntegrationAccountSchema_2275808665.ts | 21 + .../GetWebIntegrationAccount_2208305330.ts | 26 + .../ListWebIntegrationAccounts.ts | 21 + .../ListWebIntegrationAccounts_2909671841.ts | 21 + .../UpdateWebIntegrationAccount.ts | 38 + .../UpdateWebIntegrationAccount_3199996405.ts | 39 + features/support/scenarios_model_mapping.ts | 62 + features/v2/given.json | 16 + features/v2/integration_accounts.feature | 179 +++ features/v2/undo.json | 47 + features/v2/web_integrations.feature | 258 ++++ .../apis/IntegrationAccountsApi.ts | 932 ++++++++++++++ packages/datadog-api-client-v2/index.ts | 26 + .../models/ObjectSerializer.ts | 39 + .../models/WebIntegrationAccountAttributes.ts | 63 + .../WebIntegrationAccountCreateRequest.ts | 54 + ...tegrationAccountCreateRequestAttributes.ts | 74 ++ .../WebIntegrationAccountCreateRequestData.ts | 64 + .../models/WebIntegrationAccountResponse.ts | 61 + .../WebIntegrationAccountResponseData.ts | 73 ++ .../WebIntegrationAccountSchemaResponse.ts | 96 ++ ...egrationAccountSchemaResponseProperties.ts | 70 ++ ...ationAccountSchemaResponseSecretsObject.ts | 82 ++ ...ationAccountSchemaResponseSettingsField.ts | 94 ++ ...tionAccountSchemaResponseSettingsObject.ts | 82 ++ .../models/WebIntegrationAccountType.ts | 14 + .../WebIntegrationAccountUpdateRequest.ts | 54 + ...tegrationAccountUpdateRequestAttributes.ts | 71 ++ .../WebIntegrationAccountUpdateRequestData.ts | 64 + .../models/WebIntegrationAccountsResponse.ts | 58 + 49 files changed, 4635 insertions(+) create mode 100644 cassettes/v2/Web-Integrations_240613792/Create-integration-account-returns-Created-response_417564550/frozen.json create mode 100644 cassettes/v2/Web-Integrations_240613792/Create-integration-account-returns-Created-response_417564550/recording.har create mode 100644 cassettes/v2/Web-Integrations_240613792/Delete-integration-account-returns-OK-response_1343769113/frozen.json create mode 100644 cassettes/v2/Web-Integrations_240613792/Delete-integration-account-returns-OK-response_1343769113/recording.har create mode 100644 cassettes/v2/Web-Integrations_240613792/Get-account-schema-for-an-integration-returns-OK-response_2986478219/frozen.json create mode 100644 cassettes/v2/Web-Integrations_240613792/Get-account-schema-for-an-integration-returns-OK-response_2986478219/recording.har create mode 100644 cassettes/v2/Web-Integrations_240613792/Get-integration-account-returns-OK-response_2263948476/frozen.json create mode 100644 cassettes/v2/Web-Integrations_240613792/Get-integration-account-returns-OK-response_2263948476/recording.har create mode 100644 cassettes/v2/Web-Integrations_240613792/List-integration-accounts-returns-OK-response_1594933423/frozen.json create mode 100644 cassettes/v2/Web-Integrations_240613792/List-integration-accounts-returns-OK-response_1594933423/recording.har create mode 100644 cassettes/v2/Web-Integrations_240613792/Update-integration-account-returns-OK-response_721787531/frozen.json create mode 100644 cassettes/v2/Web-Integrations_240613792/Update-integration-account-returns-OK-response_721787531/recording.har create mode 100644 examples/v2/integration-accounts/CreateWebIntegrationAccount.ts create mode 100644 examples/v2/integration-accounts/CreateWebIntegrationAccount_516494340.ts create mode 100644 examples/v2/integration-accounts/DeleteWebIntegrationAccount.ts create mode 100644 examples/v2/integration-accounts/DeleteWebIntegrationAccount_3148550629.ts create mode 100644 examples/v2/integration-accounts/GetWebIntegrationAccount.ts create mode 100644 examples/v2/integration-accounts/GetWebIntegrationAccountSchema.ts create mode 100644 examples/v2/integration-accounts/GetWebIntegrationAccountSchema_2275808665.ts create mode 100644 examples/v2/integration-accounts/GetWebIntegrationAccount_2208305330.ts create mode 100644 examples/v2/integration-accounts/ListWebIntegrationAccounts.ts create mode 100644 examples/v2/integration-accounts/ListWebIntegrationAccounts_2909671841.ts create mode 100644 examples/v2/integration-accounts/UpdateWebIntegrationAccount.ts create mode 100644 examples/v2/integration-accounts/UpdateWebIntegrationAccount_3199996405.ts create mode 100644 features/v2/integration_accounts.feature create mode 100644 features/v2/web_integrations.feature create mode 100644 packages/datadog-api-client-v2/apis/IntegrationAccountsApi.ts create mode 100644 packages/datadog-api-client-v2/models/WebIntegrationAccountAttributes.ts create mode 100644 packages/datadog-api-client-v2/models/WebIntegrationAccountCreateRequest.ts create mode 100644 packages/datadog-api-client-v2/models/WebIntegrationAccountCreateRequestAttributes.ts create mode 100644 packages/datadog-api-client-v2/models/WebIntegrationAccountCreateRequestData.ts create mode 100644 packages/datadog-api-client-v2/models/WebIntegrationAccountResponse.ts create mode 100644 packages/datadog-api-client-v2/models/WebIntegrationAccountResponseData.ts create mode 100644 packages/datadog-api-client-v2/models/WebIntegrationAccountSchemaResponse.ts create mode 100644 packages/datadog-api-client-v2/models/WebIntegrationAccountSchemaResponseProperties.ts create mode 100644 packages/datadog-api-client-v2/models/WebIntegrationAccountSchemaResponseSecretsObject.ts create mode 100644 packages/datadog-api-client-v2/models/WebIntegrationAccountSchemaResponseSettingsField.ts create mode 100644 packages/datadog-api-client-v2/models/WebIntegrationAccountSchemaResponseSettingsObject.ts create mode 100644 packages/datadog-api-client-v2/models/WebIntegrationAccountType.ts create mode 100644 packages/datadog-api-client-v2/models/WebIntegrationAccountUpdateRequest.ts create mode 100644 packages/datadog-api-client-v2/models/WebIntegrationAccountUpdateRequestAttributes.ts create mode 100644 packages/datadog-api-client-v2/models/WebIntegrationAccountUpdateRequestData.ts create mode 100644 packages/datadog-api-client-v2/models/WebIntegrationAccountsResponse.ts diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 64f30b323064..5f343ddf2f5a 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/cassettes/v2/Web-Integrations_240613792/Create-integration-account-returns-Created-response_417564550/frozen.json b/cassettes/v2/Web-Integrations_240613792/Create-integration-account-returns-Created-response_417564550/frozen.json new file mode 100644 index 000000000000..9b596cd7aaa6 --- /dev/null +++ b/cassettes/v2/Web-Integrations_240613792/Create-integration-account-returns-Created-response_417564550/frozen.json @@ -0,0 +1 @@ +"2026-01-16T00:21:52.989Z" diff --git a/cassettes/v2/Web-Integrations_240613792/Create-integration-account-returns-Created-response_417564550/recording.har b/cassettes/v2/Web-Integrations_240613792/Create-integration-account-returns-Created-response_417564550/recording.har new file mode 100644 index 000000000000..b59a980c2042 --- /dev/null +++ b/cassettes/v2/Web-Integrations_240613792/Create-integration-account-returns-Created-response_417564550/recording.har @@ -0,0 +1,67 @@ +{ + "log": { + "_recordingName": "Web Integrations/Create integration account returns \"Created\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "657e1bc8d7c7b991aec23fcee4c48443", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 382, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 594, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"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\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/web-integrations/twilio/accounts" + }, + "response": { + "bodySize": 378, + "content": { + "mimeType": "application/vnd.api+json", + "size": 378, + "text": "{\"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}}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 665, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 201, + "statusText": "Created" + }, + "startedDateTime": "2026-01-16T00:21:52.992Z", + "time": 512 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Web-Integrations_240613792/Delete-integration-account-returns-OK-response_1343769113/frozen.json b/cassettes/v2/Web-Integrations_240613792/Delete-integration-account-returns-OK-response_1343769113/frozen.json new file mode 100644 index 000000000000..0e9a8eca71f2 --- /dev/null +++ b/cassettes/v2/Web-Integrations_240613792/Delete-integration-account-returns-OK-response_1343769113/frozen.json @@ -0,0 +1 @@ +"2026-01-16T00:21:53.514Z" diff --git a/cassettes/v2/Web-Integrations_240613792/Delete-integration-account-returns-OK-response_1343769113/recording.har b/cassettes/v2/Web-Integrations_240613792/Delete-integration-account-returns-OK-response_1343769113/recording.har new file mode 100644 index 000000000000..01a57a69a475 --- /dev/null +++ b/cassettes/v2/Web-Integrations_240613792/Delete-integration-account-returns-OK-response_1343769113/recording.har @@ -0,0 +1,109 @@ +{ + "log": { + "_recordingName": "Web Integrations/Delete integration account returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "a2197037fd4b273c0921261676cde17c", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 383, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 594, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"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\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/web-integrations/twilio/accounts" + }, + "response": { + "bodySize": 373, + "content": { + "mimeType": "application/vnd.api+json", + "size": 373, + "text": "{\"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}}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 665, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 201, + "statusText": "Created" + }, + "startedDateTime": "2026-01-16T00:21:53.516Z", + "time": 553 + }, + { + "_id": "ca5b2b008182544f6e9027ea25d21c13", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 567, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/web-integrations/twilio/accounts/2ef78fa1-8ebd-4dc8-8db7-1516563d9a35" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "application/vnd.api+json", + "size": 0 + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 666, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2026-01-16T00:21:54.077Z", + "time": 225 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Web-Integrations_240613792/Get-account-schema-for-an-integration-returns-OK-response_2986478219/frozen.json b/cassettes/v2/Web-Integrations_240613792/Get-account-schema-for-an-integration-returns-OK-response_2986478219/frozen.json new file mode 100644 index 000000000000..a0e731453bb2 --- /dev/null +++ b/cassettes/v2/Web-Integrations_240613792/Get-account-schema-for-an-integration-returns-OK-response_2986478219/frozen.json @@ -0,0 +1 @@ +"2026-01-16T00:23:39.895Z" diff --git a/cassettes/v2/Web-Integrations_240613792/Get-account-schema-for-an-integration-returns-OK-response_2986478219/recording.har b/cassettes/v2/Web-Integrations_240613792/Get-account-schema-for-an-integration-returns-OK-response_2986478219/recording.har new file mode 100644 index 000000000000..55157295a49e --- /dev/null +++ b/cassettes/v2/Web-Integrations_240613792/Get-account-schema-for-an-integration-returns-OK-response_2986478219/recording.har @@ -0,0 +1,57 @@ +{ + "log": { + "_recordingName": "Web Integrations/Get account schema for an integration returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "75560e83ca569ae862331483d36282bd", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 550, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/web-integrations/twilio/accounts/schema" + }, + "response": { + "bodySize": 2080, + "content": { + "mimeType": "application/json", + "size": 2080, + "text": "{\"$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\"}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 668, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2026-01-16T00:23:39.897Z", + "time": 445 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Web-Integrations_240613792/Get-integration-account-returns-OK-response_2263948476/frozen.json b/cassettes/v2/Web-Integrations_240613792/Get-integration-account-returns-OK-response_2263948476/frozen.json new file mode 100644 index 000000000000..76f285f07669 --- /dev/null +++ b/cassettes/v2/Web-Integrations_240613792/Get-integration-account-returns-OK-response_2263948476/frozen.json @@ -0,0 +1 @@ +"2026-01-16T00:21:54.756Z" diff --git a/cassettes/v2/Web-Integrations_240613792/Get-integration-account-returns-OK-response_2263948476/recording.har b/cassettes/v2/Web-Integrations_240613792/Get-integration-account-returns-OK-response_2263948476/recording.har new file mode 100644 index 000000000000..509585656aca --- /dev/null +++ b/cassettes/v2/Web-Integrations_240613792/Get-integration-account-returns-OK-response_2263948476/recording.har @@ -0,0 +1,110 @@ +{ + "log": { + "_recordingName": "Web Integrations/Get integration account returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "9de09fb27607508c83c94886d1b755ae", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 380, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 594, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"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\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/web-integrations/twilio/accounts" + }, + "response": { + "bodySize": 370, + "content": { + "mimeType": "application/vnd.api+json", + "size": 370, + "text": "{\"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}}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 665, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 201, + "statusText": "Created" + }, + "startedDateTime": "2026-01-16T00:21:54.757Z", + "time": 498 + }, + { + "_id": "6ec9bc6c56a356c0cad3df1e58cb062e", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 574, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/web-integrations/twilio/accounts/945d4bbe-d24e-4530-a4db-3dc27329e5e8" + }, + "response": { + "bodySize": 370, + "content": { + "mimeType": "application/vnd.api+json", + "size": 370, + "text": "{\"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}}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 671, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2026-01-16T00:21:55.260Z", + "time": 686 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Web-Integrations_240613792/List-integration-accounts-returns-OK-response_1594933423/frozen.json b/cassettes/v2/Web-Integrations_240613792/List-integration-accounts-returns-OK-response_1594933423/frozen.json new file mode 100644 index 000000000000..1c384320a1da --- /dev/null +++ b/cassettes/v2/Web-Integrations_240613792/List-integration-accounts-returns-OK-response_1594933423/frozen.json @@ -0,0 +1 @@ +"2026-01-16T00:21:55.952Z" diff --git a/cassettes/v2/Web-Integrations_240613792/List-integration-accounts-returns-OK-response_1594933423/recording.har b/cassettes/v2/Web-Integrations_240613792/List-integration-accounts-returns-OK-response_1594933423/recording.har new file mode 100644 index 000000000000..26e12718db0f --- /dev/null +++ b/cassettes/v2/Web-Integrations_240613792/List-integration-accounts-returns-OK-response_1594933423/recording.har @@ -0,0 +1,110 @@ +{ + "log": { + "_recordingName": "Web Integrations/List integration accounts returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "0bad62e11013f3279001211c97a28bf6", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 382, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 594, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"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\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/web-integrations/twilio/accounts" + }, + "response": { + "bodySize": 372, + "content": { + "mimeType": "application/vnd.api+json", + "size": 372, + "text": "{\"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}}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 665, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 201, + "statusText": "Created" + }, + "startedDateTime": "2026-01-16T00:21:55.954Z", + "time": 499 + }, + { + "_id": "903f5d3c6322d3063ec3ef11186597bc", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 539, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/web-integrations/twilio/accounts" + }, + "response": { + "bodySize": 2578, + "content": { + "mimeType": "application/vnd.api+json", + "size": 2578, + "text": "{\"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}}}]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 668, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2026-01-16T00:21:56.459Z", + "time": 452 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Web-Integrations_240613792/Update-integration-account-returns-OK-response_721787531/frozen.json b/cassettes/v2/Web-Integrations_240613792/Update-integration-account-returns-OK-response_721787531/frozen.json new file mode 100644 index 000000000000..5a36b25adedf --- /dev/null +++ b/cassettes/v2/Web-Integrations_240613792/Update-integration-account-returns-OK-response_721787531/frozen.json @@ -0,0 +1 @@ +"2026-01-16T00:21:56.916Z" diff --git a/cassettes/v2/Web-Integrations_240613792/Update-integration-account-returns-OK-response_721787531/recording.har b/cassettes/v2/Web-Integrations_240613792/Update-integration-account-returns-OK-response_721787531/recording.har new file mode 100644 index 000000000000..e37928ba86f5 --- /dev/null +++ b/cassettes/v2/Web-Integrations_240613792/Update-integration-account-returns-OK-response_721787531/recording.har @@ -0,0 +1,120 @@ +{ + "log": { + "_recordingName": "Web Integrations/Update integration account returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "a6ebe030cddb98173ba25d44f3fb2e02", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 383, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 594, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"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\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/web-integrations/twilio/accounts" + }, + "response": { + "bodySize": 373, + "content": { + "mimeType": "application/vnd.api+json", + "size": 373, + "text": "{\"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}}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 665, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 201, + "statusText": "Created" + }, + "startedDateTime": "2026-01-16T00:21:56.918Z", + "time": 469 + }, + { + "_id": "661977aedd27b5140f943ef4e63af306", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 187, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 632, + "httpVersion": "HTTP/1.1", + "method": "PATCH", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"name\":\"Test-Update_integration_account_returns_OK_response-1768522916-updated\",\"settings\":{\"ccm_enabled\":false,\"events\":false,\"messages\":false}},\"type\":\"Account\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/web-integrations/twilio/accounts/4458ffbb-09e3-4b11-8b59-7ac39a766164" + }, + "response": { + "bodySize": 384, + "content": { + "mimeType": "application/vnd.api+json", + "size": 384, + "text": "{\"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}}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 668, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2026-01-16T00:21:57.391Z", + "time": 481 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/examples/v2/integration-accounts/CreateWebIntegrationAccount.ts b/examples/v2/integration-accounts/CreateWebIntegrationAccount.ts new file mode 100644 index 000000000000..bfd4dc1ee940 --- /dev/null +++ b/examples/v2/integration-accounts/CreateWebIntegrationAccount.ts @@ -0,0 +1,42 @@ +/** + * Create integration account returns "Created: The account was successfully created." response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.IntegrationAccountsApi(configuration); + +const params: v2.IntegrationAccountsApiCreateWebIntegrationAccountRequest = { + body: { + 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", + }, + }, + integrationName: "integration_name", +}; + +apiInstance + .createWebIntegrationAccount(params) + .then((data: v2.WebIntegrationAccountResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/integration-accounts/CreateWebIntegrationAccount_516494340.ts b/examples/v2/integration-accounts/CreateWebIntegrationAccount_516494340.ts new file mode 100644 index 000000000000..816d17c4d5ac --- /dev/null +++ b/examples/v2/integration-accounts/CreateWebIntegrationAccount_516494340.ts @@ -0,0 +1,42 @@ +/** + * Create integration account returns "Created" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.IntegrationAccountsApi(configuration); + +const params: v2.IntegrationAccountsApiCreateWebIntegrationAccountRequest = { + body: { + data: { + type: "Account", + attributes: { + name: "Example-Web-Integration", + 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", + }, + }, + }, + }, + integrationName: "twilio", +}; + +apiInstance + .createWebIntegrationAccount(params) + .then((data: v2.WebIntegrationAccountResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/integration-accounts/DeleteWebIntegrationAccount.ts b/examples/v2/integration-accounts/DeleteWebIntegrationAccount.ts new file mode 100644 index 000000000000..bd8ebf947055 --- /dev/null +++ b/examples/v2/integration-accounts/DeleteWebIntegrationAccount.ts @@ -0,0 +1,22 @@ +/** + * Delete integration account returns "OK: The account was successfully deleted." response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.IntegrationAccountsApi(configuration); + +const params: v2.IntegrationAccountsApiDeleteWebIntegrationAccountRequest = { + integrationName: "integration_name", + accountId: "account_id", +}; + +apiInstance + .deleteWebIntegrationAccount(params) + .then((data: any) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/integration-accounts/DeleteWebIntegrationAccount_3148550629.ts b/examples/v2/integration-accounts/DeleteWebIntegrationAccount_3148550629.ts new file mode 100644 index 000000000000..0fe9a9558694 --- /dev/null +++ b/examples/v2/integration-accounts/DeleteWebIntegrationAccount_3148550629.ts @@ -0,0 +1,26 @@ +/** + * Delete integration account returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.IntegrationAccountsApi(configuration); + +// there is a valid "web_integration_account" in the system +const WEB_INTEGRATION_ACCOUNT_DATA_ID = process.env + .WEB_INTEGRATION_ACCOUNT_DATA_ID as string; + +const params: v2.IntegrationAccountsApiDeleteWebIntegrationAccountRequest = { + integrationName: "twilio", + accountId: WEB_INTEGRATION_ACCOUNT_DATA_ID, +}; + +apiInstance + .deleteWebIntegrationAccount(params) + .then((data: any) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/integration-accounts/GetWebIntegrationAccount.ts b/examples/v2/integration-accounts/GetWebIntegrationAccount.ts new file mode 100644 index 000000000000..895641d2c00e --- /dev/null +++ b/examples/v2/integration-accounts/GetWebIntegrationAccount.ts @@ -0,0 +1,22 @@ +/** + * Get integration account returns "OK: The account details for the specified integration." response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.IntegrationAccountsApi(configuration); + +const params: v2.IntegrationAccountsApiGetWebIntegrationAccountRequest = { + integrationName: "integration_name", + accountId: "account_id", +}; + +apiInstance + .getWebIntegrationAccount(params) + .then((data: v2.WebIntegrationAccountResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/integration-accounts/GetWebIntegrationAccountSchema.ts b/examples/v2/integration-accounts/GetWebIntegrationAccountSchema.ts new file mode 100644 index 000000000000..cb903463a14d --- /dev/null +++ b/examples/v2/integration-accounts/GetWebIntegrationAccountSchema.ts @@ -0,0 +1,22 @@ +/** + * Get account schema for an integration returns "OK: The JSON schema for the integration's account configuration." + * response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.IntegrationAccountsApi(configuration); + +const params: v2.IntegrationAccountsApiGetWebIntegrationAccountSchemaRequest = { + integrationName: "integration_name", +}; + +apiInstance + .getWebIntegrationAccountSchema(params) + .then((data: v2.WebIntegrationAccountSchemaResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/integration-accounts/GetWebIntegrationAccountSchema_2275808665.ts b/examples/v2/integration-accounts/GetWebIntegrationAccountSchema_2275808665.ts new file mode 100644 index 000000000000..c0de9b107bf7 --- /dev/null +++ b/examples/v2/integration-accounts/GetWebIntegrationAccountSchema_2275808665.ts @@ -0,0 +1,21 @@ +/** + * Get account schema for an integration returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.IntegrationAccountsApi(configuration); + +const params: v2.IntegrationAccountsApiGetWebIntegrationAccountSchemaRequest = { + integrationName: "twilio", +}; + +apiInstance + .getWebIntegrationAccountSchema(params) + .then((data: v2.WebIntegrationAccountSchemaResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/integration-accounts/GetWebIntegrationAccount_2208305330.ts b/examples/v2/integration-accounts/GetWebIntegrationAccount_2208305330.ts new file mode 100644 index 000000000000..52772a694461 --- /dev/null +++ b/examples/v2/integration-accounts/GetWebIntegrationAccount_2208305330.ts @@ -0,0 +1,26 @@ +/** + * Get integration account returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.IntegrationAccountsApi(configuration); + +// there is a valid "web_integration_account" in the system +const WEB_INTEGRATION_ACCOUNT_DATA_ID = process.env + .WEB_INTEGRATION_ACCOUNT_DATA_ID as string; + +const params: v2.IntegrationAccountsApiGetWebIntegrationAccountRequest = { + integrationName: "twilio", + accountId: WEB_INTEGRATION_ACCOUNT_DATA_ID, +}; + +apiInstance + .getWebIntegrationAccount(params) + .then((data: v2.WebIntegrationAccountResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/integration-accounts/ListWebIntegrationAccounts.ts b/examples/v2/integration-accounts/ListWebIntegrationAccounts.ts new file mode 100644 index 000000000000..5128121d74e5 --- /dev/null +++ b/examples/v2/integration-accounts/ListWebIntegrationAccounts.ts @@ -0,0 +1,21 @@ +/** + * List integration accounts returns "OK: List of all accounts for the specified integration." response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.IntegrationAccountsApi(configuration); + +const params: v2.IntegrationAccountsApiListWebIntegrationAccountsRequest = { + integrationName: "integration_name", +}; + +apiInstance + .listWebIntegrationAccounts(params) + .then((data: v2.WebIntegrationAccountsResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/integration-accounts/ListWebIntegrationAccounts_2909671841.ts b/examples/v2/integration-accounts/ListWebIntegrationAccounts_2909671841.ts new file mode 100644 index 000000000000..dd045b0e778a --- /dev/null +++ b/examples/v2/integration-accounts/ListWebIntegrationAccounts_2909671841.ts @@ -0,0 +1,21 @@ +/** + * List integration accounts returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.IntegrationAccountsApi(configuration); + +const params: v2.IntegrationAccountsApiListWebIntegrationAccountsRequest = { + integrationName: "twilio", +}; + +apiInstance + .listWebIntegrationAccounts(params) + .then((data: v2.WebIntegrationAccountsResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/integration-accounts/UpdateWebIntegrationAccount.ts b/examples/v2/integration-accounts/UpdateWebIntegrationAccount.ts new file mode 100644 index 000000000000..e86a2df737bc --- /dev/null +++ b/examples/v2/integration-accounts/UpdateWebIntegrationAccount.ts @@ -0,0 +1,38 @@ +/** + * Update integration account returns "OK: The account was successfully updated." response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.IntegrationAccountsApi(configuration); + +const params: v2.IntegrationAccountsApiUpdateWebIntegrationAccountRequest = { + body: { + 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", + }, + }, + integrationName: "integration_name", + accountId: "account_id", +}; + +apiInstance + .updateWebIntegrationAccount(params) + .then((data: v2.WebIntegrationAccountResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/integration-accounts/UpdateWebIntegrationAccount_3199996405.ts b/examples/v2/integration-accounts/UpdateWebIntegrationAccount_3199996405.ts new file mode 100644 index 000000000000..7f0b0c3aaa10 --- /dev/null +++ b/examples/v2/integration-accounts/UpdateWebIntegrationAccount_3199996405.ts @@ -0,0 +1,39 @@ +/** + * Update integration account returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.IntegrationAccountsApi(configuration); + +// there is a valid "web_integration_account" in the system +const WEB_INTEGRATION_ACCOUNT_DATA_ID = process.env + .WEB_INTEGRATION_ACCOUNT_DATA_ID as string; + +const params: v2.IntegrationAccountsApiUpdateWebIntegrationAccountRequest = { + body: { + data: { + type: "Account", + attributes: { + name: "Example-Web-Integration-updated", + settings: { + events: "False", + messages: "False", + ccm_enabled: "False", + }, + }, + }, + }, + integrationName: "twilio", + accountId: WEB_INTEGRATION_ACCOUNT_DATA_ID, +}; + +apiInstance + .updateWebIntegrationAccount(params) + .then((data: v2.WebIntegrationAccountResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/features/support/scenarios_model_mapping.ts b/features/support/scenarios_model_mapping.ts index 9c64a640e6d0..b21d163e2c81 100644 --- a/features/support/scenarios_model_mapping.ts +++ b/features/support/scenarios_model_mapping.ts @@ -11567,6 +11567,68 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = { }, "operationResponseType": "PermissionsResponse", }, + "v2.ListWebIntegrationAccounts": { + "integrationName": { + "type": "string", + "format": "", + }, + "operationResponseType": "WebIntegrationAccountsResponse", + }, + "v2.CreateWebIntegrationAccount": { + "integrationName": { + "type": "string", + "format": "", + }, + "body": { + "type": "WebIntegrationAccountCreateRequest", + "format": "", + }, + "operationResponseType": "WebIntegrationAccountResponse", + }, + "v2.GetWebIntegrationAccountSchema": { + "integrationName": { + "type": "string", + "format": "", + }, + "operationResponseType": "WebIntegrationAccountSchemaResponse", + }, + "v2.GetWebIntegrationAccount": { + "integrationName": { + "type": "string", + "format": "", + }, + "accountId": { + "type": "string", + "format": "", + }, + "operationResponseType": "WebIntegrationAccountResponse", + }, + "v2.DeleteWebIntegrationAccount": { + "integrationName": { + "type": "string", + "format": "", + }, + "accountId": { + "type": "string", + "format": "", + }, + "operationResponseType": "{}", + }, + "v2.UpdateWebIntegrationAccount": { + "integrationName": { + "type": "string", + "format": "", + }, + "accountId": { + "type": "string", + "format": "", + }, + "body": { + "type": "WebIntegrationAccountUpdateRequest", + "format": "", + }, + "operationResponseType": "WebIntegrationAccountResponse", + }, "v2.CreateWorkflow": { "body": { "type": "CreateWorkflowRequest", diff --git a/features/v2/given.json b/features/v2/given.json index 76980d4ce3dc..027b09ca181d 100644 --- a/features/v2/given.json +++ b/features/v2/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/features/v2/integration_accounts.feature b/features/v2/integration_accounts.feature new file mode 100644 index 000000000000..54b4cea828a0 --- /dev/null +++ b/features/v2/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/features/v2/undo.json b/features/v2/undo.json index a04c9b283b90..93438d32937a 100644 --- a/features/v2/undo.json +++ b/features/v2/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/features/v2/web_integrations.feature b/features/v2/web_integrations.feature new file mode 100644 index 000000000000..067af24109ad --- /dev/null +++ b/features/v2/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. diff --git a/packages/datadog-api-client-v2/apis/IntegrationAccountsApi.ts b/packages/datadog-api-client-v2/apis/IntegrationAccountsApi.ts new file mode 100644 index 000000000000..64182e330d0e --- /dev/null +++ b/packages/datadog-api-client-v2/apis/IntegrationAccountsApi.ts @@ -0,0 +1,932 @@ +import { + BaseAPIRequestFactory, + RequiredError, +} from "../../datadog-api-client-common/baseapi"; +import { + Configuration, + applySecurityAuthentication, +} from "../../datadog-api-client-common/configuration"; +import { + RequestContext, + HttpMethod, + ResponseContext, +} from "../../datadog-api-client-common/http/http"; + +import { logger } from "../../../logger"; +import { ObjectSerializer } from "../models/ObjectSerializer"; +import { ApiException } from "../../datadog-api-client-common/exception"; + +import { APIErrorResponse } from "../models/APIErrorResponse"; +import { WebIntegrationAccountCreateRequest } from "../models/WebIntegrationAccountCreateRequest"; +import { WebIntegrationAccountResponse } from "../models/WebIntegrationAccountResponse"; +import { WebIntegrationAccountSchemaResponse } from "../models/WebIntegrationAccountSchemaResponse"; +import { WebIntegrationAccountsResponse } from "../models/WebIntegrationAccountsResponse"; +import { WebIntegrationAccountUpdateRequest } from "../models/WebIntegrationAccountUpdateRequest"; + +export class IntegrationAccountsApiRequestFactory extends BaseAPIRequestFactory { + public async createWebIntegrationAccount( + integrationName: string, + body: WebIntegrationAccountCreateRequest, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + // verify required parameter 'integrationName' is not null or undefined + if (integrationName === null || integrationName === undefined) { + throw new RequiredError("integrationName", "createWebIntegrationAccount"); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "createWebIntegrationAccount"); + } + + // Path Params + const localVarPath = + "/api/v2/web-integrations/{integration_name}/accounts".replace( + "{integration_name}", + encodeURIComponent(String(integrationName)) + ); + + // Make Request Context + const requestContext = _config + .getServer("v2.IntegrationAccountsApi.createWebIntegrationAccount") + .makeRequestContext(localVarPath, HttpMethod.POST); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json", + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize( + body, + "WebIntegrationAccountCreateRequest", + "" + ), + contentType + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async deleteWebIntegrationAccount( + integrationName: string, + accountId: string, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + // verify required parameter 'integrationName' is not null or undefined + if (integrationName === null || integrationName === undefined) { + throw new RequiredError("integrationName", "deleteWebIntegrationAccount"); + } + + // verify required parameter 'accountId' is not null or undefined + if (accountId === null || accountId === undefined) { + throw new RequiredError("accountId", "deleteWebIntegrationAccount"); + } + + // Path Params + const localVarPath = + "/api/v2/web-integrations/{integration_name}/accounts/{account_id}" + .replace( + "{integration_name}", + encodeURIComponent(String(integrationName)) + ) + .replace("{account_id}", encodeURIComponent(String(accountId))); + + // Make Request Context + const requestContext = _config + .getServer("v2.IntegrationAccountsApi.deleteWebIntegrationAccount") + .makeRequestContext(localVarPath, HttpMethod.DELETE); + requestContext.setHeaderParam("Accept", "*/*"); + requestContext.setHttpConfig(_config.httpConfig); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async getWebIntegrationAccount( + integrationName: string, + accountId: string, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + // verify required parameter 'integrationName' is not null or undefined + if (integrationName === null || integrationName === undefined) { + throw new RequiredError("integrationName", "getWebIntegrationAccount"); + } + + // verify required parameter 'accountId' is not null or undefined + if (accountId === null || accountId === undefined) { + throw new RequiredError("accountId", "getWebIntegrationAccount"); + } + + // Path Params + const localVarPath = + "/api/v2/web-integrations/{integration_name}/accounts/{account_id}" + .replace( + "{integration_name}", + encodeURIComponent(String(integrationName)) + ) + .replace("{account_id}", encodeURIComponent(String(accountId))); + + // Make Request Context + const requestContext = _config + .getServer("v2.IntegrationAccountsApi.getWebIntegrationAccount") + .makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async getWebIntegrationAccountSchema( + integrationName: string, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + // verify required parameter 'integrationName' is not null or undefined + if (integrationName === null || integrationName === undefined) { + throw new RequiredError( + "integrationName", + "getWebIntegrationAccountSchema" + ); + } + + // Path Params + const localVarPath = + "/api/v2/web-integrations/{integration_name}/accounts/schema".replace( + "{integration_name}", + encodeURIComponent(String(integrationName)) + ); + + // Make Request Context + const requestContext = _config + .getServer("v2.IntegrationAccountsApi.getWebIntegrationAccountSchema") + .makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async listWebIntegrationAccounts( + integrationName: string, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + // verify required parameter 'integrationName' is not null or undefined + if (integrationName === null || integrationName === undefined) { + throw new RequiredError("integrationName", "listWebIntegrationAccounts"); + } + + // Path Params + const localVarPath = + "/api/v2/web-integrations/{integration_name}/accounts".replace( + "{integration_name}", + encodeURIComponent(String(integrationName)) + ); + + // Make Request Context + const requestContext = _config + .getServer("v2.IntegrationAccountsApi.listWebIntegrationAccounts") + .makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async updateWebIntegrationAccount( + integrationName: string, + accountId: string, + body: WebIntegrationAccountUpdateRequest, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + // verify required parameter 'integrationName' is not null or undefined + if (integrationName === null || integrationName === undefined) { + throw new RequiredError("integrationName", "updateWebIntegrationAccount"); + } + + // verify required parameter 'accountId' is not null or undefined + if (accountId === null || accountId === undefined) { + throw new RequiredError("accountId", "updateWebIntegrationAccount"); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "updateWebIntegrationAccount"); + } + + // Path Params + const localVarPath = + "/api/v2/web-integrations/{integration_name}/accounts/{account_id}" + .replace( + "{integration_name}", + encodeURIComponent(String(integrationName)) + ) + .replace("{account_id}", encodeURIComponent(String(accountId))); + + // Make Request Context + const requestContext = _config + .getServer("v2.IntegrationAccountsApi.updateWebIntegrationAccount") + .makeRequestContext(localVarPath, HttpMethod.PATCH); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json", + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize( + body, + "WebIntegrationAccountUpdateRequest", + "" + ), + contentType + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } +} + +export class IntegrationAccountsApiResponseProcessor { + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to createWebIntegrationAccount + * @throws ApiException if the response code was not in [200, 299] + */ + public async createWebIntegrationAccount( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 201) { + const body: WebIntegrationAccountResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "WebIntegrationAccountResponse" + ) as WebIntegrationAccountResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 422 || + response.httpStatusCode === 429 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: WebIntegrationAccountResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "WebIntegrationAccountResponse", + "" + ) as WebIntegrationAccountResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to deleteWebIntegrationAccount + * @throws ApiException if the response code was not in [200, 299] + */ + public async deleteWebIntegrationAccount( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + return; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 429 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + return; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to getWebIntegrationAccount + * @throws ApiException if the response code was not in [200, 299] + */ + public async getWebIntegrationAccount( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: WebIntegrationAccountResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "WebIntegrationAccountResponse" + ) as WebIntegrationAccountResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 429 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: WebIntegrationAccountResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "WebIntegrationAccountResponse", + "" + ) as WebIntegrationAccountResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to getWebIntegrationAccountSchema + * @throws ApiException if the response code was not in [200, 299] + */ + public async getWebIntegrationAccountSchema( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: WebIntegrationAccountSchemaResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "WebIntegrationAccountSchemaResponse" + ) as WebIntegrationAccountSchemaResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 429 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: WebIntegrationAccountSchemaResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "WebIntegrationAccountSchemaResponse", + "" + ) as WebIntegrationAccountSchemaResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to listWebIntegrationAccounts + * @throws ApiException if the response code was not in [200, 299] + */ + public async listWebIntegrationAccounts( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: WebIntegrationAccountsResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "WebIntegrationAccountsResponse" + ) as WebIntegrationAccountsResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 429 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: WebIntegrationAccountsResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "WebIntegrationAccountsResponse", + "" + ) as WebIntegrationAccountsResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to updateWebIntegrationAccount + * @throws ApiException if the response code was not in [200, 299] + */ + public async updateWebIntegrationAccount( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: WebIntegrationAccountResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "WebIntegrationAccountResponse" + ) as WebIntegrationAccountResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 422 || + response.httpStatusCode === 429 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: WebIntegrationAccountResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "WebIntegrationAccountResponse", + "" + ) as WebIntegrationAccountResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } +} + +export interface IntegrationAccountsApiCreateWebIntegrationAccountRequest { + /** + * The name of the integration. + * @type string + */ + integrationName: string; + /** + * @type WebIntegrationAccountCreateRequest + */ + body: WebIntegrationAccountCreateRequest; +} + +export interface IntegrationAccountsApiDeleteWebIntegrationAccountRequest { + /** + * The name of the integration. + * @type string + */ + integrationName: string; + /** + * The unique identifier of the account. + * @type string + */ + accountId: string; +} + +export interface IntegrationAccountsApiGetWebIntegrationAccountRequest { + /** + * The name of the integration. + * @type string + */ + integrationName: string; + /** + * The unique identifier of the account. + * @type string + */ + accountId: string; +} + +export interface IntegrationAccountsApiGetWebIntegrationAccountSchemaRequest { + /** + * The name of the integration. + * @type string + */ + integrationName: string; +} + +export interface IntegrationAccountsApiListWebIntegrationAccountsRequest { + /** + * The name of the integration. + * @type string + */ + integrationName: string; +} + +export interface IntegrationAccountsApiUpdateWebIntegrationAccountRequest { + /** + * The name of the integration. + * @type string + */ + integrationName: string; + /** + * The unique identifier of the account. + * @type string + */ + accountId: string; + /** + * @type WebIntegrationAccountUpdateRequest + */ + body: WebIntegrationAccountUpdateRequest; +} + +export class IntegrationAccountsApi { + private requestFactory: IntegrationAccountsApiRequestFactory; + private responseProcessor: IntegrationAccountsApiResponseProcessor; + private configuration: Configuration; + + public constructor( + configuration: Configuration, + requestFactory?: IntegrationAccountsApiRequestFactory, + responseProcessor?: IntegrationAccountsApiResponseProcessor + ) { + this.configuration = configuration; + this.requestFactory = + requestFactory || new IntegrationAccountsApiRequestFactory(configuration); + this.responseProcessor = + responseProcessor || new IntegrationAccountsApiResponseProcessor(); + } + + /** + * 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 param The request object + */ + public createWebIntegrationAccount( + param: IntegrationAccountsApiCreateWebIntegrationAccountRequest, + options?: Configuration + ): Promise { + const requestContextPromise = + this.requestFactory.createWebIntegrationAccount( + param.integrationName, + param.body, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.createWebIntegrationAccount( + responseContext + ); + }); + }); + } + + /** + * 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 param The request object + */ + public deleteWebIntegrationAccount( + param: IntegrationAccountsApiDeleteWebIntegrationAccountRequest, + options?: Configuration + ): Promise { + const requestContextPromise = + this.requestFactory.deleteWebIntegrationAccount( + param.integrationName, + param.accountId, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.deleteWebIntegrationAccount( + responseContext + ); + }); + }); + } + + /** + * 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 param The request object + */ + public getWebIntegrationAccount( + param: IntegrationAccountsApiGetWebIntegrationAccountRequest, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.getWebIntegrationAccount( + param.integrationName, + param.accountId, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.getWebIntegrationAccount( + responseContext + ); + }); + }); + } + + /** + * 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 param The request object + */ + public getWebIntegrationAccountSchema( + param: IntegrationAccountsApiGetWebIntegrationAccountSchemaRequest, + options?: Configuration + ): Promise { + const requestContextPromise = + this.requestFactory.getWebIntegrationAccountSchema( + param.integrationName, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.getWebIntegrationAccountSchema( + responseContext + ); + }); + }); + } + + /** + * Retrieve all configured accounts for a specific integration within your organization. + * + * Rate limit: 50 requests per user every 20 seconds. + * @param param The request object + */ + public listWebIntegrationAccounts( + param: IntegrationAccountsApiListWebIntegrationAccountsRequest, + options?: Configuration + ): Promise { + const requestContextPromise = + this.requestFactory.listWebIntegrationAccounts( + param.integrationName, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.listWebIntegrationAccounts( + responseContext + ); + }); + }); + } + + /** + * 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 param The request object + */ + public updateWebIntegrationAccount( + param: IntegrationAccountsApiUpdateWebIntegrationAccountRequest, + options?: Configuration + ): Promise { + const requestContextPromise = + this.requestFactory.updateWebIntegrationAccount( + param.integrationName, + param.accountId, + param.body, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.updateWebIntegrationAccount( + responseContext + ); + }); + }); + } +} diff --git a/packages/datadog-api-client-v2/index.ts b/packages/datadog-api-client-v2/index.ts index 5fb6d2da0107..a0738afe1335 100644 --- a/packages/datadog-api-client-v2/index.ts +++ b/packages/datadog-api-client-v2/index.ts @@ -514,6 +514,16 @@ export { IncidentsApi, } from "./apis/IncidentsApi"; +export { + IntegrationAccountsApiCreateWebIntegrationAccountRequest, + IntegrationAccountsApiDeleteWebIntegrationAccountRequest, + IntegrationAccountsApiGetWebIntegrationAccountRequest, + IntegrationAccountsApiGetWebIntegrationAccountSchemaRequest, + IntegrationAccountsApiListWebIntegrationAccountsRequest, + IntegrationAccountsApiUpdateWebIntegrationAccountRequest, + IntegrationAccountsApi, +} from "./apis/IntegrationAccountsApi"; + export { IntegrationsApi } from "./apis/IntegrationsApi"; export { @@ -5764,6 +5774,22 @@ export { WatcherArray } from "./models/WatcherArray"; export { WatcherData } from "./models/WatcherData"; export { WatcherDataAttributes } from "./models/WatcherDataAttributes"; export { WatcherDataType } from "./models/WatcherDataType"; +export { WebIntegrationAccountAttributes } from "./models/WebIntegrationAccountAttributes"; +export { WebIntegrationAccountCreateRequest } from "./models/WebIntegrationAccountCreateRequest"; +export { WebIntegrationAccountCreateRequestAttributes } from "./models/WebIntegrationAccountCreateRequestAttributes"; +export { WebIntegrationAccountCreateRequestData } from "./models/WebIntegrationAccountCreateRequestData"; +export { WebIntegrationAccountResponse } from "./models/WebIntegrationAccountResponse"; +export { WebIntegrationAccountResponseData } from "./models/WebIntegrationAccountResponseData"; +export { WebIntegrationAccountSchemaResponse } from "./models/WebIntegrationAccountSchemaResponse"; +export { WebIntegrationAccountSchemaResponseProperties } from "./models/WebIntegrationAccountSchemaResponseProperties"; +export { WebIntegrationAccountSchemaResponseSecretsObject } from "./models/WebIntegrationAccountSchemaResponseSecretsObject"; +export { WebIntegrationAccountSchemaResponseSettingsField } from "./models/WebIntegrationAccountSchemaResponseSettingsField"; +export { WebIntegrationAccountSchemaResponseSettingsObject } from "./models/WebIntegrationAccountSchemaResponseSettingsObject"; +export { WebIntegrationAccountsResponse } from "./models/WebIntegrationAccountsResponse"; +export { WebIntegrationAccountType } from "./models/WebIntegrationAccountType"; +export { WebIntegrationAccountUpdateRequest } from "./models/WebIntegrationAccountUpdateRequest"; +export { WebIntegrationAccountUpdateRequestAttributes } from "./models/WebIntegrationAccountUpdateRequestAttributes"; +export { WebIntegrationAccountUpdateRequestData } from "./models/WebIntegrationAccountUpdateRequestData"; export { Weekday } from "./models/Weekday"; export { WidgetLiveSpan } from "./models/WidgetLiveSpan"; export { WorkflowData } from "./models/WorkflowData"; diff --git a/packages/datadog-api-client-v2/models/ObjectSerializer.ts b/packages/datadog-api-client-v2/models/ObjectSerializer.ts index 79b06873a88a..6c4c15a209c2 100644 --- a/packages/datadog-api-client-v2/models/ObjectSerializer.ts +++ b/packages/datadog-api-client-v2/models/ObjectSerializer.ts @@ -3451,6 +3451,21 @@ import { WatchDataAttributes } from "./WatchDataAttributes"; import { WatcherArray } from "./WatcherArray"; import { WatcherData } from "./WatcherData"; import { WatcherDataAttributes } from "./WatcherDataAttributes"; +import { WebIntegrationAccountAttributes } from "./WebIntegrationAccountAttributes"; +import { WebIntegrationAccountCreateRequest } from "./WebIntegrationAccountCreateRequest"; +import { WebIntegrationAccountCreateRequestAttributes } from "./WebIntegrationAccountCreateRequestAttributes"; +import { WebIntegrationAccountCreateRequestData } from "./WebIntegrationAccountCreateRequestData"; +import { WebIntegrationAccountResponse } from "./WebIntegrationAccountResponse"; +import { WebIntegrationAccountResponseData } from "./WebIntegrationAccountResponseData"; +import { WebIntegrationAccountSchemaResponse } from "./WebIntegrationAccountSchemaResponse"; +import { WebIntegrationAccountSchemaResponseProperties } from "./WebIntegrationAccountSchemaResponseProperties"; +import { WebIntegrationAccountSchemaResponseSecretsObject } from "./WebIntegrationAccountSchemaResponseSecretsObject"; +import { WebIntegrationAccountSchemaResponseSettingsField } from "./WebIntegrationAccountSchemaResponseSettingsField"; +import { WebIntegrationAccountSchemaResponseSettingsObject } from "./WebIntegrationAccountSchemaResponseSettingsObject"; +import { WebIntegrationAccountUpdateRequest } from "./WebIntegrationAccountUpdateRequest"; +import { WebIntegrationAccountUpdateRequestAttributes } from "./WebIntegrationAccountUpdateRequestAttributes"; +import { WebIntegrationAccountUpdateRequestData } from "./WebIntegrationAccountUpdateRequestData"; +import { WebIntegrationAccountsResponse } from "./WebIntegrationAccountsResponse"; import { WorkflowData } from "./WorkflowData"; import { WorkflowDataAttributes } from "./WorkflowDataAttributes"; import { WorkflowDataRelationships } from "./WorkflowDataRelationships"; @@ -5469,6 +5484,7 @@ const enumsMap: { [key: string]: any[] } = { ], WatchDataType: ["rum_replay_watch"], WatcherDataType: ["rum_replay_watcher"], + WebIntegrationAccountType: ["Account"], Weekday: [ "monday", "tuesday", @@ -9644,6 +9660,29 @@ const typeMap: { [index: string]: any } = { WatcherArray: WatcherArray, WatcherData: WatcherData, WatcherDataAttributes: WatcherDataAttributes, + WebIntegrationAccountAttributes: WebIntegrationAccountAttributes, + WebIntegrationAccountCreateRequest: WebIntegrationAccountCreateRequest, + WebIntegrationAccountCreateRequestAttributes: + WebIntegrationAccountCreateRequestAttributes, + WebIntegrationAccountCreateRequestData: + WebIntegrationAccountCreateRequestData, + WebIntegrationAccountResponse: WebIntegrationAccountResponse, + WebIntegrationAccountResponseData: WebIntegrationAccountResponseData, + WebIntegrationAccountSchemaResponse: WebIntegrationAccountSchemaResponse, + WebIntegrationAccountSchemaResponseProperties: + WebIntegrationAccountSchemaResponseProperties, + WebIntegrationAccountSchemaResponseSecretsObject: + WebIntegrationAccountSchemaResponseSecretsObject, + WebIntegrationAccountSchemaResponseSettingsField: + WebIntegrationAccountSchemaResponseSettingsField, + WebIntegrationAccountSchemaResponseSettingsObject: + WebIntegrationAccountSchemaResponseSettingsObject, + WebIntegrationAccountUpdateRequest: WebIntegrationAccountUpdateRequest, + WebIntegrationAccountUpdateRequestAttributes: + WebIntegrationAccountUpdateRequestAttributes, + WebIntegrationAccountUpdateRequestData: + WebIntegrationAccountUpdateRequestData, + WebIntegrationAccountsResponse: WebIntegrationAccountsResponse, WorkflowData: WorkflowData, WorkflowDataAttributes: WorkflowDataAttributes, WorkflowDataRelationships: WorkflowDataRelationships, diff --git a/packages/datadog-api-client-v2/models/WebIntegrationAccountAttributes.ts b/packages/datadog-api-client-v2/models/WebIntegrationAccountAttributes.ts new file mode 100644 index 000000000000..c8d642c72495 --- /dev/null +++ b/packages/datadog-api-client-v2/models/WebIntegrationAccountAttributes.ts @@ -0,0 +1,63 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Attributes for a web integration account. + */ +export class WebIntegrationAccountAttributes { + /** + * The name of the account. + */ + "name": string; + /** + * 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. + */ + "settings": { [key: string]: any }; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + name: { + baseName: "name", + type: "string", + required: true, + }, + settings: { + baseName: "settings", + type: "{ [key: string]: any; }", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return WebIntegrationAccountAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/WebIntegrationAccountCreateRequest.ts b/packages/datadog-api-client-v2/models/WebIntegrationAccountCreateRequest.ts new file mode 100644 index 000000000000..f70fc27a46fb --- /dev/null +++ b/packages/datadog-api-client-v2/models/WebIntegrationAccountCreateRequest.ts @@ -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 2020-Present Datadog, Inc. + */ +import { WebIntegrationAccountCreateRequestData } from "./WebIntegrationAccountCreateRequestData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Payload for creating a web integration account. + */ +export class WebIntegrationAccountCreateRequest { + /** + * Data object for creating a web integration account. + */ + "data": WebIntegrationAccountCreateRequestData; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "WebIntegrationAccountCreateRequestData", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return WebIntegrationAccountCreateRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/WebIntegrationAccountCreateRequestAttributes.ts b/packages/datadog-api-client-v2/models/WebIntegrationAccountCreateRequestAttributes.ts new file mode 100644 index 000000000000..9d67edccc9da --- /dev/null +++ b/packages/datadog-api-client-v2/models/WebIntegrationAccountCreateRequestAttributes.ts @@ -0,0 +1,74 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Attributes for creating a web integration account. + */ +export class WebIntegrationAccountCreateRequestAttributes { + /** + * The name of the account. + */ + "name": string; + /** + * Sensitive credentials for the account. The structure and required fields vary by integration type. + * These values are write-only and never returned in responses. + */ + "secrets": { [key: string]: any }; + /** + * 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. + */ + "settings": { [key: string]: any }; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + name: { + baseName: "name", + type: "string", + required: true, + }, + secrets: { + baseName: "secrets", + type: "{ [key: string]: any; }", + required: true, + }, + settings: { + baseName: "settings", + type: "{ [key: string]: any; }", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return WebIntegrationAccountCreateRequestAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/WebIntegrationAccountCreateRequestData.ts b/packages/datadog-api-client-v2/models/WebIntegrationAccountCreateRequestData.ts new file mode 100644 index 000000000000..bade5811d96f --- /dev/null +++ b/packages/datadog-api-client-v2/models/WebIntegrationAccountCreateRequestData.ts @@ -0,0 +1,64 @@ +/** + * 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 2020-Present Datadog, Inc. + */ +import { WebIntegrationAccountCreateRequestAttributes } from "./WebIntegrationAccountCreateRequestAttributes"; +import { WebIntegrationAccountType } from "./WebIntegrationAccountType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Data object for creating a web integration account. + */ +export class WebIntegrationAccountCreateRequestData { + /** + * Attributes for creating a web integration account. + */ + "attributes": WebIntegrationAccountCreateRequestAttributes; + /** + * The JSON:API type for web integration accounts. + */ + "type": WebIntegrationAccountType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "WebIntegrationAccountCreateRequestAttributes", + required: true, + }, + type: { + baseName: "type", + type: "WebIntegrationAccountType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return WebIntegrationAccountCreateRequestData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/WebIntegrationAccountResponse.ts b/packages/datadog-api-client-v2/models/WebIntegrationAccountResponse.ts new file mode 100644 index 000000000000..fcbb3147eee5 --- /dev/null +++ b/packages/datadog-api-client-v2/models/WebIntegrationAccountResponse.ts @@ -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 2020-Present Datadog, Inc. + */ +import { WebIntegrationAccountResponseData } from "./WebIntegrationAccountResponseData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Response containing a single web integration account. + */ +export class WebIntegrationAccountResponse { + /** + * Data object for a web integration account response. + */ + "data"?: WebIntegrationAccountResponseData; + /** + * The name of the integration. + */ + "integrationName"?: string; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "WebIntegrationAccountResponseData", + }, + integrationName: { + baseName: "integration_name", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return WebIntegrationAccountResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/WebIntegrationAccountResponseData.ts b/packages/datadog-api-client-v2/models/WebIntegrationAccountResponseData.ts new file mode 100644 index 000000000000..2928dfeeb544 --- /dev/null +++ b/packages/datadog-api-client-v2/models/WebIntegrationAccountResponseData.ts @@ -0,0 +1,73 @@ +/** + * 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 2020-Present Datadog, Inc. + */ +import { WebIntegrationAccountAttributes } from "./WebIntegrationAccountAttributes"; +import { WebIntegrationAccountType } from "./WebIntegrationAccountType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Data object for a web integration account response. + */ +export class WebIntegrationAccountResponseData { + /** + * Attributes for a web integration account. + */ + "attributes": WebIntegrationAccountAttributes; + /** + * The unique identifier for the account. + */ + "id": string; + /** + * The JSON:API type for web integration accounts. + */ + "type": WebIntegrationAccountType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "WebIntegrationAccountAttributes", + required: true, + }, + id: { + baseName: "id", + type: "string", + required: true, + }, + type: { + baseName: "type", + type: "WebIntegrationAccountType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return WebIntegrationAccountResponseData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/WebIntegrationAccountSchemaResponse.ts b/packages/datadog-api-client-v2/models/WebIntegrationAccountSchemaResponse.ts new file mode 100644 index 000000000000..f09e2cbb9958 --- /dev/null +++ b/packages/datadog-api-client-v2/models/WebIntegrationAccountSchemaResponse.ts @@ -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 2020-Present Datadog, Inc. + */ +import { WebIntegrationAccountSchemaResponseProperties } from "./WebIntegrationAccountSchemaResponseProperties"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * 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. + */ +export class WebIntegrationAccountSchemaResponse { + /** + * The JSON Schema version URI. + */ + "schema": string; + /** + * Whether additional properties are allowed at the root level (typically false). + */ + "additionalProperties"?: boolean; + /** + * 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": WebIntegrationAccountSchemaResponseProperties; + /** + * List of required top-level properties. + */ + "required": Array; + /** + * The root type of the schema (always "object"). + */ + "type": string; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + schema: { + baseName: "$schema", + type: "string", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "boolean", + }, + properties: { + baseName: "properties", + type: "WebIntegrationAccountSchemaResponseProperties", + required: true, + }, + required: { + baseName: "required", + type: "Array", + required: true, + }, + type: { + baseName: "type", + type: "string", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return WebIntegrationAccountSchemaResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/WebIntegrationAccountSchemaResponseProperties.ts b/packages/datadog-api-client-v2/models/WebIntegrationAccountSchemaResponseProperties.ts new file mode 100644 index 000000000000..b286c56316f1 --- /dev/null +++ b/packages/datadog-api-client-v2/models/WebIntegrationAccountSchemaResponseProperties.ts @@ -0,0 +1,70 @@ +/** + * 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 2020-Present Datadog, Inc. + */ +import { WebIntegrationAccountSchemaResponseSecretsObject } from "./WebIntegrationAccountSchemaResponseSecretsObject"; +import { WebIntegrationAccountSchemaResponseSettingsObject } from "./WebIntegrationAccountSchemaResponseSettingsObject"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * 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. + */ +export class WebIntegrationAccountSchemaResponseProperties { + /** + * 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. + */ + "secrets": WebIntegrationAccountSchemaResponseSecretsObject; + /** + * JSON Schema definition for the settings object. + * Contains integration-specific configuration fields such as account identifiers, + * feature toggles, and non-sensitive configuration options. + */ + "settings": WebIntegrationAccountSchemaResponseSettingsObject; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + secrets: { + baseName: "secrets", + type: "WebIntegrationAccountSchemaResponseSecretsObject", + required: true, + }, + settings: { + baseName: "settings", + type: "WebIntegrationAccountSchemaResponseSettingsObject", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return WebIntegrationAccountSchemaResponseProperties.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/WebIntegrationAccountSchemaResponseSecretsObject.ts b/packages/datadog-api-client-v2/models/WebIntegrationAccountSchemaResponseSecretsObject.ts new file mode 100644 index 000000000000..d18a96628d87 --- /dev/null +++ b/packages/datadog-api-client-v2/models/WebIntegrationAccountSchemaResponseSecretsObject.ts @@ -0,0 +1,82 @@ +/** + * 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 2020-Present Datadog, Inc. + */ +import { WebIntegrationAccountSchemaResponseSettingsField } from "./WebIntegrationAccountSchemaResponseSettingsField"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * 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. + */ +export class WebIntegrationAccountSchemaResponseSecretsObject { + /** + * Whether additional properties are allowed (typically false). + */ + "additionalProperties"?: boolean; + /** + * The individual secret fields for this integration. + * Field names and types vary by integration. + */ + "properties"?: { + [key: string]: WebIntegrationAccountSchemaResponseSettingsField; + }; + /** + * List of required secret field names. + */ + "required"?: Array; + /** + * Always "object" for the secrets container. + */ + "type"?: string; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + additionalProperties: { + baseName: "additionalProperties", + type: "boolean", + }, + properties: { + baseName: "properties", + type: "{ [key: string]: WebIntegrationAccountSchemaResponseSettingsField; }", + }, + required: { + baseName: "required", + type: "Array", + }, + type: { + baseName: "type", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return WebIntegrationAccountSchemaResponseSecretsObject.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/WebIntegrationAccountSchemaResponseSettingsField.ts b/packages/datadog-api-client-v2/models/WebIntegrationAccountSchemaResponseSettingsField.ts new file mode 100644 index 000000000000..f6624d78f793 --- /dev/null +++ b/packages/datadog-api-client-v2/models/WebIntegrationAccountSchemaResponseSettingsField.ts @@ -0,0 +1,94 @@ +/** + * 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 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * JSON Schema definition for a single field within settings or secrets. + * The exact fields vary by integration. + */ +export class WebIntegrationAccountSchemaResponseSettingsField { + /** + * Whether additional properties are allowed for this field. + */ + "additionalProperties"?: boolean; + /** + * Default value for the field if not provided. + */ + "_default"?: any; + /** + * Human-readable description of the field's purpose. + */ + "description"?: string; + /** + * Schema for array items when type is "array". + */ + "items"?: any; + /** + * Minimum length for string fields. + */ + "minLength"?: number; + /** + * The data type of the field (string, boolean, integer, array, object). + */ + "type"?: string; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + additionalProperties: { + baseName: "additionalProperties", + type: "boolean", + }, + _default: { + baseName: "default", + type: "any", + }, + description: { + baseName: "description", + type: "string", + }, + items: { + baseName: "items", + type: "any", + }, + minLength: { + baseName: "minLength", + type: "number", + format: "int64", + }, + type: { + baseName: "type", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return WebIntegrationAccountSchemaResponseSettingsField.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/WebIntegrationAccountSchemaResponseSettingsObject.ts b/packages/datadog-api-client-v2/models/WebIntegrationAccountSchemaResponseSettingsObject.ts new file mode 100644 index 000000000000..12e8ba3d5017 --- /dev/null +++ b/packages/datadog-api-client-v2/models/WebIntegrationAccountSchemaResponseSettingsObject.ts @@ -0,0 +1,82 @@ +/** + * 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 2020-Present Datadog, Inc. + */ +import { WebIntegrationAccountSchemaResponseSettingsField } from "./WebIntegrationAccountSchemaResponseSettingsField"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * JSON Schema definition for the settings object. + * Contains integration-specific configuration fields such as account identifiers, + * feature toggles, and non-sensitive configuration options. + */ +export class WebIntegrationAccountSchemaResponseSettingsObject { + /** + * Whether additional properties are allowed (typically false). + */ + "additionalProperties"?: boolean; + /** + * The individual setting fields for this integration. + * Field names and types vary by integration. + */ + "properties"?: { + [key: string]: WebIntegrationAccountSchemaResponseSettingsField; + }; + /** + * List of required setting field names. + */ + "required"?: Array; + /** + * Always "object" for the settings container. + */ + "type"?: string; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + additionalProperties: { + baseName: "additionalProperties", + type: "boolean", + }, + properties: { + baseName: "properties", + type: "{ [key: string]: WebIntegrationAccountSchemaResponseSettingsField; }", + }, + required: { + baseName: "required", + type: "Array", + }, + type: { + baseName: "type", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return WebIntegrationAccountSchemaResponseSettingsObject.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/WebIntegrationAccountType.ts b/packages/datadog-api-client-v2/models/WebIntegrationAccountType.ts new file mode 100644 index 000000000000..e7a57553a80f --- /dev/null +++ b/packages/datadog-api-client-v2/models/WebIntegrationAccountType.ts @@ -0,0 +1,14 @@ +/** + * 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 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * The JSON:API type for web integration accounts. + */ + +export type WebIntegrationAccountType = typeof ACCOUNT | UnparsedObject; +export const ACCOUNT = "Account"; diff --git a/packages/datadog-api-client-v2/models/WebIntegrationAccountUpdateRequest.ts b/packages/datadog-api-client-v2/models/WebIntegrationAccountUpdateRequest.ts new file mode 100644 index 000000000000..23dbe0e34d01 --- /dev/null +++ b/packages/datadog-api-client-v2/models/WebIntegrationAccountUpdateRequest.ts @@ -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 2020-Present Datadog, Inc. + */ +import { WebIntegrationAccountUpdateRequestData } from "./WebIntegrationAccountUpdateRequestData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Payload for updating a web integration account. + */ +export class WebIntegrationAccountUpdateRequest { + /** + * Data object for updating a web integration account. + */ + "data": WebIntegrationAccountUpdateRequestData; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "WebIntegrationAccountUpdateRequestData", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return WebIntegrationAccountUpdateRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/WebIntegrationAccountUpdateRequestAttributes.ts b/packages/datadog-api-client-v2/models/WebIntegrationAccountUpdateRequestAttributes.ts new file mode 100644 index 000000000000..2be6f5702ccf --- /dev/null +++ b/packages/datadog-api-client-v2/models/WebIntegrationAccountUpdateRequestAttributes.ts @@ -0,0 +1,71 @@ +/** + * 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 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Attributes for updating a web integration account. All fields are optional; + * only provide the fields you want to update. + */ +export class WebIntegrationAccountUpdateRequestAttributes { + /** + * The name of the account. + */ + "name"?: string; + /** + * Sensitive credentials to update. Only the secrets provided are updated. + * These values are write-only and never returned in responses. + */ + "secrets"?: { [key: string]: any }; + /** + * 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. + */ + "settings"?: { [key: string]: any }; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + name: { + baseName: "name", + type: "string", + }, + secrets: { + baseName: "secrets", + type: "{ [key: string]: any; }", + }, + settings: { + baseName: "settings", + type: "{ [key: string]: any; }", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return WebIntegrationAccountUpdateRequestAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/WebIntegrationAccountUpdateRequestData.ts b/packages/datadog-api-client-v2/models/WebIntegrationAccountUpdateRequestData.ts new file mode 100644 index 000000000000..bf961c921e07 --- /dev/null +++ b/packages/datadog-api-client-v2/models/WebIntegrationAccountUpdateRequestData.ts @@ -0,0 +1,64 @@ +/** + * 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 2020-Present Datadog, Inc. + */ +import { WebIntegrationAccountType } from "./WebIntegrationAccountType"; +import { WebIntegrationAccountUpdateRequestAttributes } from "./WebIntegrationAccountUpdateRequestAttributes"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Data object for updating a web integration account. + */ +export class WebIntegrationAccountUpdateRequestData { + /** + * Attributes for updating a web integration account. All fields are optional; + * only provide the fields you want to update. + */ + "attributes"?: WebIntegrationAccountUpdateRequestAttributes; + /** + * The JSON:API type for web integration accounts. + */ + "type": WebIntegrationAccountType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "WebIntegrationAccountUpdateRequestAttributes", + }, + type: { + baseName: "type", + type: "WebIntegrationAccountType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return WebIntegrationAccountUpdateRequestData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/WebIntegrationAccountsResponse.ts b/packages/datadog-api-client-v2/models/WebIntegrationAccountsResponse.ts new file mode 100644 index 000000000000..6021b30a5be6 --- /dev/null +++ b/packages/datadog-api-client-v2/models/WebIntegrationAccountsResponse.ts @@ -0,0 +1,58 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { WebIntegrationAccountResponseData } from "./WebIntegrationAccountResponseData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Response containing a list of web integration accounts. + */ +export class WebIntegrationAccountsResponse { + "data"?: Array; + /** + * The name of the integration. + */ + "integrationName"?: string; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "Array", + }, + integrationName: { + baseName: "integration_name", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return WebIntegrationAccountsResponse.attributeTypeMap; + } + + public constructor() {} +}