diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 65d674fb23d1..6424cf718842 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -1968,6 +1968,64 @@ components: type: string requestBodies: {} responses: + AmsIntegrationAccountSchemaBadRequestResponse: + 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." + AmsIntegrationAccountSchemaForbiddenResponse: + 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." + AmsIntegrationAccountSchemaNotFoundResponse: + 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." + AmsIntegrationAccountSchemaTooManyRequestsResponse: + 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. BadRequestResponse: content: "application/json": @@ -2100,6 +2158,324 @@ components: schema: $ref: "#/components/schemas/JSONAPIErrorResponse" description: The server cannot process the request because it contains invalid data. + 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. @@ -6394,6 +6770,370 @@ components: x-enum-varnames: - FEATURE_GATE - CANARY + AmsIntegrationAccountAttributes: + 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 + AmsIntegrationAccountCreateRequest: + description: Payload for creating a web integration account. + properties: + data: + $ref: "#/components/schemas/AmsIntegrationAccountCreateRequestData" + required: + - data + type: object + AmsIntegrationAccountCreateRequestAttributes: + 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/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 + AmsIntegrationAccountCreateRequestData: + description: Data object for creating a web integration account. + properties: + attributes: + $ref: "#/components/schemas/AmsIntegrationAccountCreateRequestAttributes" + type: + $ref: "#/components/schemas/AmsIntegrationAccountType" + required: + - type + - attributes + type: object + AmsIntegrationAccountResponse: + description: Response containing a single web integration account. + properties: + data: + $ref: "#/components/schemas/AmsIntegrationAccountResponseData" + integration_name: + description: The name of the integration. + example: "twilio" + type: string + type: object + AmsIntegrationAccountResponseData: + description: Data object for a web integration account response. + properties: + attributes: + $ref: "#/components/schemas/AmsIntegrationAccountAttributes" + id: + description: The unique identifier for the account. + example: "abc123def456" + type: string + type: + $ref: "#/components/schemas/AmsIntegrationAccountType" + required: + - id + - type + - attributes + type: object + AmsIntegrationAccountSchemaResponse: + 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: + properties: + secrets: + $ref: "#/components/schemas/AmsIntegrationAccountSchemaResponseExampleSecrets" + settings: + $ref: "#/components/schemas/AmsIntegrationAccountSchemaResponseExampleSettings" + required: + - settings + - secrets + type: "object" + properties: + additionalProperties: + description: Whether additional properties are allowed at the root level (typically false). + example: false + type: boolean + properties: + $ref: "#/components/schemas/AmsIntegrationAccountSchemaResponseProperties" + 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: + - type + - properties + - required + type: object + AmsIntegrationAccountSchemaResponseExampleSecrets: + additionalProperties: false + description: Example secrets object for a Twilio integration account schema response. + 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" + AmsIntegrationAccountSchemaResponseExampleSettings: + additionalProperties: false + description: Example settings object for a Twilio integration account schema response. + 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" + AmsIntegrationAccountSchemaResponseProperties: + 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/AmsIntegrationAccountSchemaResponseSecretsObject" + settings: + $ref: "#/components/schemas/AmsIntegrationAccountSchemaResponseSettingsObject" + required: + - settings + - secrets + type: object + AmsIntegrationAccountSchemaResponseSecretsObject: + 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/AmsIntegrationAccountSchemaResponseSettingsField" + 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 + AmsIntegrationAccountSchemaResponseSettingsField: + 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 + AmsIntegrationAccountSchemaResponseSettingsObject: + 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/AmsIntegrationAccountSchemaResponseSettingsField" + 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 + AmsIntegrationAccountType: + default: Account + description: The JSON:API type for web integration accounts. + enum: + - Account + example: Account + type: string + x-enum-varnames: + - ACCOUNT + AmsIntegrationAccountUpdateRequest: + description: Payload for updating a web integration account. + properties: + data: + $ref: "#/components/schemas/AmsIntegrationAccountUpdateRequestData" + required: + - data + type: object + AmsIntegrationAccountUpdateRequestAttributes: + 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 + AmsIntegrationAccountUpdateRequestData: + description: Data object for updating a web integration account. + properties: + attributes: + $ref: "#/components/schemas/AmsIntegrationAccountUpdateRequestAttributes" + type: + $ref: "#/components/schemas/AmsIntegrationAccountType" + required: + - type + type: object + AmsIntegrationAccountsResponse: + description: Response containing a list of web integration accounts. + properties: + data: + items: + $ref: "#/components/schemas/AmsIntegrationAccountResponseData" + type: array + integration_name: + description: The name of the integration. + example: "twilio" + type: string + type: object AnalysisEdit: description: A single edit operation within a fix suggestion for a rule violation. properties: @@ -77612,6 +78352,48 @@ components: page: $ref: "#/components/schemas/Pagination" type: object + ResponseSchema: + additionalProperties: false + description: Example JSON Schema document for an integration account configuration. + properties: + secrets: + $ref: "#/components/schemas/ResponseSchema139714313396896" + settings: + $ref: "#/components/schemas/ResponseSchema139714313396096" + required: + - settings + - secrets + type: "object" + ResponseSchema139714313396096: + additionalProperties: false + description: Example settings schema for an integration account configuration. + properties: + account_sid: + description: Twilio Account SID that uniquely identifies the Twilio account. + example: L + minLength: 1 + type: "string" + api_key: + description: Twilio API Key SID for authentication. + example: L + minLength: 1 + type: "string" + required: + - api_key + - account_sid + type: "object" + ResponseSchema139714313396896: + additionalProperties: false + description: Example secrets schema for an integration account configuration. + properties: + api_key_token: + description: The Twilio API Key Secret corresponding to the API Key SID. + example: L + minLength: 1 + type: "string" + required: + - api_key_token + type: "object" RestrictionPolicy: description: Restriction policy object. properties: @@ -143102,6 +143884,388 @@ paths: operator: OR permissions: - manage_integrations + /api/v2/integrations/{integration_name}/interfaces/{interface_id}/accounts: + get: + description: |- + Retrieve all configured accounts for a specific integration within your organization. + + Rate limit: 50 requests per user every 20 seconds. + operationId: ListAmsIntegrationAccounts + 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 interface. + example: "twilio.messaging" + in: path + name: interface_id + required: true + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + name: "My Production Account" + settings: + account_sid: "ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + api_key: "SKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + id: "abc123def456" + type: "Account" + schema: + $ref: "#/components/schemas/AmsIntegrationAccountsResponse" + 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: CreateAmsIntegrationAccount + 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 interface. + example: "twilio.messaging" + in: path + name: interface_id + required: true + schema: + type: string + requestBody: + content: + application/json: + examples: + default: + 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" + schema: + $ref: "#/components/schemas/AmsIntegrationAccountCreateRequest" + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + name: "My Production Account" + settings: + account_sid: "ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + api_key: "SKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + id: "abc123def456" + type: "Account" + schema: + $ref: "#/components/schemas/AmsIntegrationAccountResponse" + 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/integrations/{integration_name}/interfaces/{interface_id}/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: GetAmsIntegrationAccountSchema + 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 interface. + example: "twilio.messaging" + in: path + name: interface_id + required: true + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + $ref: "#/components/schemas/ResponseSchema" + schema: + $ref: "#/components/schemas/AmsIntegrationAccountSchemaResponse" + description: "OK: The JSON schema for the integration's account configuration." + "400": + $ref: "#/components/responses/AmsIntegrationAccountSchemaBadRequestResponse" + "403": + $ref: "#/components/responses/AmsIntegrationAccountSchemaForbiddenResponse" + "404": + $ref: "#/components/responses/AmsIntegrationAccountSchemaNotFoundResponse" + "429": + $ref: "#/components/responses/AmsIntegrationAccountSchemaTooManyRequestsResponse" + summary: Get account schema for an integration + tags: + - Integration Accounts + x-permission: + operator: OR + permissions: + - integrations_read + /api/v2/integrations/{integration_name}/interfaces/{interface_id}/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: DeleteAmsIntegrationAccount + 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 interface. + example: "twilio.messaging" + in: path + name: interface_id + 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: GetAmsIntegrationAccount + 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 interface. + example: "twilio.messaging" + in: path + name: interface_id + 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: + examples: + default: + value: + data: + attributes: + name: "My Production Account" + settings: + account_sid: "ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + api_key: "SKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + id: "abc123def456" + type: "Account" + schema: + $ref: "#/components/schemas/AmsIntegrationAccountResponse" + 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: UpdateAmsIntegrationAccount + 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 interface. + example: "twilio.messaging" + in: path + name: interface_id + 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: + examples: + default: + value: + data: + attributes: + name: "My Production Account (Updated)" + settings: + ccm_enabled: true + events: true + messages: false + type: "Account" + schema: + $ref: "#/components/schemas/AmsIntegrationAccountUpdateRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + name: "My Production Account (Updated)" + settings: + account_sid: "ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + api_key: "SKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + id: "abc123def456" + type: "Account" + schema: + $ref: "#/components/schemas/AmsIntegrationAccountResponse" + 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/ip_allowlist: get: description: Returns the IP allowlist and its enabled or disabled state. @@ -193632,6 +194796,24 @@ tags: name: IP Allowlist - description: Manage incident response, as well as associated attachments, metadata, 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 + 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/) + name: Integration Accounts - description: |- The Integrations API is used to list available integrations and retrieve information about their installation status. diff --git a/examples/v2/integration-accounts/CreateAmsIntegrationAccount.rb b/examples/v2/integration-accounts/CreateAmsIntegrationAccount.rb new file mode 100644 index 000000000000..3ef341b83c0e --- /dev/null +++ b/examples/v2/integration-accounts/CreateAmsIntegrationAccount.rb @@ -0,0 +1,20 @@ +# Create integration account returns "Created: The account was successfully created." response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::IntegrationAccountsAPI.new + +body = DatadogAPIClient::V2::AmsIntegrationAccountCreateRequest.new({ + data: DatadogAPIClient::V2::AmsIntegrationAccountCreateRequestData.new({ + attributes: DatadogAPIClient::V2::AmsIntegrationAccountCreateRequestAttributes.new({ + 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: DatadogAPIClient::V2::AmsIntegrationAccountType::ACCOUNT, + }), +}) +p api_instance.create_ams_integration_account("integration_name", "interface_id", body) diff --git a/examples/v2/integration-accounts/DeleteAmsIntegrationAccount.rb b/examples/v2/integration-accounts/DeleteAmsIntegrationAccount.rb new file mode 100644 index 000000000000..978dc4d79d5d --- /dev/null +++ b/examples/v2/integration-accounts/DeleteAmsIntegrationAccount.rb @@ -0,0 +1,5 @@ +# Delete integration account returns "OK: The account was successfully deleted." response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::IntegrationAccountsAPI.new +p api_instance.delete_ams_integration_account("integration_name", "interface_id", "account_id") diff --git a/examples/v2/integration-accounts/GetAmsIntegrationAccount.rb b/examples/v2/integration-accounts/GetAmsIntegrationAccount.rb new file mode 100644 index 000000000000..dc1c8c669c3d --- /dev/null +++ b/examples/v2/integration-accounts/GetAmsIntegrationAccount.rb @@ -0,0 +1,5 @@ +# Get integration account returns "OK: The account details for the specified integration." response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::IntegrationAccountsAPI.new +p api_instance.get_ams_integration_account("integration_name", "interface_id", "account_id") diff --git a/examples/v2/integration-accounts/GetAmsIntegrationAccountSchema.rb b/examples/v2/integration-accounts/GetAmsIntegrationAccountSchema.rb new file mode 100644 index 000000000000..f8b4c93e4bf3 --- /dev/null +++ b/examples/v2/integration-accounts/GetAmsIntegrationAccountSchema.rb @@ -0,0 +1,6 @@ +# Get account schema for an integration returns "OK: The JSON schema for the integration's account configuration." +# response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::IntegrationAccountsAPI.new +p api_instance.get_ams_integration_account_schema("integration_name", "interface_id") diff --git a/examples/v2/integration-accounts/ListAmsIntegrationAccounts.rb b/examples/v2/integration-accounts/ListAmsIntegrationAccounts.rb new file mode 100644 index 000000000000..46a8c74da45d --- /dev/null +++ b/examples/v2/integration-accounts/ListAmsIntegrationAccounts.rb @@ -0,0 +1,5 @@ +# List integration accounts returns "OK: List of all accounts for the specified integration." response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::IntegrationAccountsAPI.new +p api_instance.list_ams_integration_accounts("integration_name", "interface_id") diff --git a/examples/v2/integration-accounts/UpdateAmsIntegrationAccount.rb b/examples/v2/integration-accounts/UpdateAmsIntegrationAccount.rb new file mode 100644 index 000000000000..7f1b16eef966 --- /dev/null +++ b/examples/v2/integration-accounts/UpdateAmsIntegrationAccount.rb @@ -0,0 +1,20 @@ +# Update integration account returns "OK: The account was successfully updated." response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::IntegrationAccountsAPI.new + +body = DatadogAPIClient::V2::AmsIntegrationAccountUpdateRequest.new({ + data: DatadogAPIClient::V2::AmsIntegrationAccountUpdateRequestData.new({ + attributes: DatadogAPIClient::V2::AmsIntegrationAccountUpdateRequestAttributes.new({ + name: "My Production Account (Updated)", + secrets: { + "api_key_token": "new_secret_token_value", + }, + settings: { + "ccm_enabled": "True", "events": "True", "messages": "False", + }, + }), + type: DatadogAPIClient::V2::AmsIntegrationAccountType::ACCOUNT, + }), +}) +p api_instance.update_ams_integration_account("integration_name", "interface_id", "account_id", body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 8d27a626e6cf..feef70795365 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -3950,6 +3950,35 @@ "account_id" => "String", "body" => "OktaAccountUpdateRequest", }, + "v2.ListAmsIntegrationAccounts" => { + "integration_name" => "String", + "interface_id" => "String", + }, + "v2.CreateAmsIntegrationAccount" => { + "integration_name" => "String", + "interface_id" => "String", + "body" => "AmsIntegrationAccountCreateRequest", + }, + "v2.GetAmsIntegrationAccountSchema" => { + "integration_name" => "String", + "interface_id" => "String", + }, + "v2.DeleteAmsIntegrationAccount" => { + "integration_name" => "String", + "interface_id" => "String", + "account_id" => "String", + }, + "v2.GetAmsIntegrationAccount" => { + "integration_name" => "String", + "interface_id" => "String", + "account_id" => "String", + }, + "v2.UpdateAmsIntegrationAccount" => { + "integration_name" => "String", + "interface_id" => "String", + "account_id" => "String", + "body" => "AmsIntegrationAccountUpdateRequest", + }, "v2.UpdateIPAllowlist" => { "body" => "IPAllowlistUpdateRequest", }, diff --git a/features/v2/given.json b/features/v2/given.json index 0f9de6d48a2f..dab2215ce318 100644 --- a/features/v2/given.json +++ b/features/v2/given.json @@ -834,6 +834,26 @@ "tag": "Okta Integration", "operationId": "CreateOktaAccount" }, + { + "parameters": [ + { + "name": "integration_name", + "value": "\"twilio\"" + }, + { + "name": "interface_id", + "value": "\"twilio.messaging\"" + }, + { + "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": "CreateAmsIntegrationAccount" + }, { "parameters": [ { diff --git a/features/v2/integration_accounts.feature b/features/v2/integration_accounts.feature new file mode 100644 index 000000000000..c0d96602bda0 --- /dev/null +++ b/features/v2/integration_accounts.feature @@ -0,0 +1,199 @@ +@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/saas-integrations + Scenario: Create integration account returns "Bad Request: The request body is malformed or the integration name format is invalid." response + Given new "CreateAmsIntegrationAccount" request + And request contains "integration_name" parameter from "REPLACE.ME" + And request contains "interface_id" 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/saas-integrations + Scenario: Create integration account returns "Created: The account was successfully created." response + Given new "CreateAmsIntegrationAccount" request + And request contains "integration_name" parameter from "REPLACE.ME" + And request contains "interface_id" 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/saas-integrations + Scenario: Create integration account returns "Not Found: The integration does not exist." response + Given new "CreateAmsIntegrationAccount" request + And request contains "integration_name" parameter from "REPLACE.ME" + And request contains "interface_id" 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/saas-integrations + Scenario: Create integration account returns "Unprocessable Entity: The account configuration does not match the integration schema." response + Given new "CreateAmsIntegrationAccount" request + And request contains "integration_name" parameter from "REPLACE.ME" + And request contains "interface_id" 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/saas-integrations + Scenario: Delete integration account returns "Bad Request: The integration name or account ID format is invalid." response + Given new "DeleteAmsIntegrationAccount" request + And request contains "integration_name" parameter from "REPLACE.ME" + And request contains "interface_id" 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/saas-integrations + Scenario: Delete integration account returns "Not Found: The integration or account does not exist." response + Given new "DeleteAmsIntegrationAccount" request + And request contains "integration_name" parameter from "REPLACE.ME" + And request contains "interface_id" 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/saas-integrations + Scenario: Delete integration account returns "OK: The account was successfully deleted." response + Given new "DeleteAmsIntegrationAccount" request + And request contains "integration_name" parameter from "REPLACE.ME" + And request contains "interface_id" 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/saas-integrations + Scenario: Get account schema for an integration returns "Bad Request: The integration name format is invalid." response + Given new "GetAmsIntegrationAccountSchema" request + And request contains "integration_name" parameter from "REPLACE.ME" + And request contains "interface_id" 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/saas-integrations + Scenario: Get account schema for an integration returns "Not Found: The integration does not exist or has no schema available." response + Given new "GetAmsIntegrationAccountSchema" request + And request contains "integration_name" parameter from "REPLACE.ME" + And request contains "interface_id" 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/saas-integrations + Scenario: Get account schema for an integration returns "OK: The JSON schema for the integration's account configuration." response + Given new "GetAmsIntegrationAccountSchema" request + And request contains "integration_name" parameter from "REPLACE.ME" + And request contains "interface_id" 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/saas-integrations + Scenario: Get integration account returns "Bad Request: The integration name or account ID format is invalid." response + Given new "GetAmsIntegrationAccount" request + And request contains "integration_name" parameter from "REPLACE.ME" + And request contains "interface_id" 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/saas-integrations + Scenario: Get integration account returns "Not Found: The integration or account does not exist." response + Given new "GetAmsIntegrationAccount" request + And request contains "integration_name" parameter from "REPLACE.ME" + And request contains "interface_id" 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/saas-integrations + Scenario: Get integration account returns "OK: The account details for the specified integration." response + Given new "GetAmsIntegrationAccount" request + And request contains "integration_name" parameter from "REPLACE.ME" + And request contains "interface_id" 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/saas-integrations + Scenario: List integration accounts returns "Bad Request: The integration name format is invalid." response + Given new "ListAmsIntegrationAccounts" request + And request contains "integration_name" parameter from "REPLACE.ME" + And request contains "interface_id" 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/saas-integrations + Scenario: List integration accounts returns "Not Found: The integration does not exist." response + Given new "ListAmsIntegrationAccounts" request + And request contains "integration_name" parameter from "REPLACE.ME" + And request contains "interface_id" 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/saas-integrations + Scenario: List integration accounts returns "OK: List of all accounts for the specified integration." response + Given new "ListAmsIntegrationAccounts" request + And request contains "integration_name" parameter from "REPLACE.ME" + And request contains "interface_id" 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/saas-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 "UpdateAmsIntegrationAccount" request + And request contains "integration_name" parameter from "REPLACE.ME" + And request contains "interface_id" 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/saas-integrations + Scenario: Update integration account returns "Not Found: The integration or account does not exist." response + Given new "UpdateAmsIntegrationAccount" request + And request contains "integration_name" parameter from "REPLACE.ME" + And request contains "interface_id" 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/saas-integrations + Scenario: Update integration account returns "OK: The account was successfully updated." response + Given new "UpdateAmsIntegrationAccount" request + And request contains "integration_name" parameter from "REPLACE.ME" + And request contains "interface_id" 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/saas-integrations + Scenario: Update integration account returns "Unprocessable Entity: The account configuration does not match the integration schema." response + Given new "UpdateAmsIntegrationAccount" request + And request contains "integration_name" parameter from "REPLACE.ME" + And request contains "interface_id" 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 a5c43f6c0f2c..33e331e2b1a3 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -4191,6 +4191,57 @@ "type": "idempotent" } }, + "ListAmsIntegrationAccounts": { + "tag": "Integration Accounts", + "undo": { + "type": "safe" + } + }, + "CreateAmsIntegrationAccount": { + "tag": "Integration Accounts", + "undo": { + "operationId": "DeleteAmsIntegrationAccount", + "parameters": [ + { + "name": "integration_name", + "source": "integration_name" + }, + { + "name": "interface_id", + "source": "interface_id" + }, + { + "name": "account_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "GetAmsIntegrationAccountSchema": { + "tag": "Integration Accounts", + "undo": { + "type": "safe" + } + }, + "DeleteAmsIntegrationAccount": { + "tag": "Integration Accounts", + "undo": { + "type": "idempotent" + } + }, + "GetAmsIntegrationAccount": { + "tag": "Integration Accounts", + "undo": { + "type": "safe" + } + }, + "UpdateAmsIntegrationAccount": { + "tag": "Integration Accounts", + "undo": { + "type": "idempotent" + } + }, "GetIPAllowlist": { "tag": "IP Allowlist", "undo": { diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 1912c3a1f419..6c432af3b93c 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -1266,6 +1266,22 @@ def overrides "v2.allocation_exposure_schedule_response" => "AllocationExposureScheduleResponse", "v2.allocation_response" => "AllocationResponse", "v2.allocation_type" => "AllocationType", + "v2.ams_integration_account_attributes" => "AmsIntegrationAccountAttributes", + "v2.ams_integration_account_create_request" => "AmsIntegrationAccountCreateRequest", + "v2.ams_integration_account_create_request_attributes" => "AmsIntegrationAccountCreateRequestAttributes", + "v2.ams_integration_account_create_request_data" => "AmsIntegrationAccountCreateRequestData", + "v2.ams_integration_account_response" => "AmsIntegrationAccountResponse", + "v2.ams_integration_account_response_data" => "AmsIntegrationAccountResponseData", + "v2.ams_integration_account_schema_response" => "AmsIntegrationAccountSchemaResponse", + "v2.ams_integration_account_schema_response_properties" => "AmsIntegrationAccountSchemaResponseProperties", + "v2.ams_integration_account_schema_response_secrets_object" => "AmsIntegrationAccountSchemaResponseSecretsObject", + "v2.ams_integration_account_schema_response_settings_field" => "AmsIntegrationAccountSchemaResponseSettingsField", + "v2.ams_integration_account_schema_response_settings_object" => "AmsIntegrationAccountSchemaResponseSettingsObject", + "v2.ams_integration_accounts_response" => "AmsIntegrationAccountsResponse", + "v2.ams_integration_account_type" => "AmsIntegrationAccountType", + "v2.ams_integration_account_update_request" => "AmsIntegrationAccountUpdateRequest", + "v2.ams_integration_account_update_request_attributes" => "AmsIntegrationAccountUpdateRequestAttributes", + "v2.ams_integration_account_update_request_data" => "AmsIntegrationAccountUpdateRequestData", "v2.analysis_edit" => "AnalysisEdit", "v2.analysis_edit_type" => "AnalysisEditType", "v2.analysis_fix" => "AnalysisFix", @@ -7871,6 +7887,7 @@ def overrides "v2.governance_insights_api" => "GovernanceInsightsAPI", "v2.high_availability_multi_region_api" => "HighAvailabilityMultiRegionAPI", "v2.incidents_api" => "IncidentsAPI", + "v2.integration_accounts_api" => "IntegrationAccountsAPI", "v2.integrations_api" => "IntegrationsAPI", "v2.ip_allowlist_api" => "IPAllowlistAPI", "v2.jira_integration_api" => "JiraIntegrationAPI", diff --git a/lib/datadog_api_client/v2/api/integration_accounts_api.rb b/lib/datadog_api_client/v2/api/integration_accounts_api.rb new file mode 100644 index 000000000000..945a625f5c6b --- /dev/null +++ b/lib/datadog_api_client/v2/api/integration_accounts_api.rb @@ -0,0 +1,496 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'cgi' + +module DatadogAPIClient::V2 + class IntegrationAccountsAPI + attr_accessor :api_client + + def initialize(api_client = DatadogAPIClient::APIClient.default) + @api_client = api_client + end + + # Create integration account. + # + # @see #create_ams_integration_account_with_http_info + def create_ams_integration_account(integration_name, interface_id, body, opts = {}) + data, _status_code, _headers = create_ams_integration_account_with_http_info(integration_name, interface_id, body, opts) + data + end + + # Create integration account. + # + # Create a new account for a specific integration. The account configuration must conform + # to the schema defined for the integration, which can be retrieved using the schema endpoint. + # + # Rate limit: 50 requests per user every 20 seconds. + # + # @param integration_name [String] The name of the integration. + # @param interface_id [String] The unique identifier of the interface. + # @param body [AmsIntegrationAccountCreateRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(AmsIntegrationAccountResponse, Integer, Hash)>] AmsIntegrationAccountResponse data, response status code and response headers + def create_ams_integration_account_with_http_info(integration_name, interface_id, body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IntegrationAccountsAPI.create_ams_integration_account ...' + end + # verify the required parameter 'integration_name' is set + if @api_client.config.client_side_validation && integration_name.nil? + fail ArgumentError, "Missing the required parameter 'integration_name' when calling IntegrationAccountsAPI.create_ams_integration_account" + end + # verify the required parameter 'interface_id' is set + if @api_client.config.client_side_validation && interface_id.nil? + fail ArgumentError, "Missing the required parameter 'interface_id' when calling IntegrationAccountsAPI.create_ams_integration_account" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling IntegrationAccountsAPI.create_ams_integration_account" + end + # resource path + local_var_path = '/api/v2/integrations/{integration_name}/interfaces/{interface_id}/accounts'.sub('{integration_name}', CGI.escape(integration_name.to_s).gsub('%2F', '/')).sub('{interface_id}', CGI.escape(interface_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'AmsIntegrationAccountResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :create_ams_integration_account, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: IntegrationAccountsAPI#create_ams_integration_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Delete integration account. + # + # @see #delete_ams_integration_account_with_http_info + def delete_ams_integration_account(integration_name, interface_id, account_id, opts = {}) + delete_ams_integration_account_with_http_info(integration_name, interface_id, account_id, opts) + nil + end + + # Delete integration account. + # + # Delete a specific account by its ID for a given integration. This removes the + # account configuration and stops any data collection associated with it. + # + # Rate limit: 50 requests per user every 20 seconds. + # + # @param integration_name [String] The name of the integration. + # @param interface_id [String] The unique identifier of the interface. + # @param account_id [String] The unique identifier of the account. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_ams_integration_account_with_http_info(integration_name, interface_id, account_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IntegrationAccountsAPI.delete_ams_integration_account ...' + end + # verify the required parameter 'integration_name' is set + if @api_client.config.client_side_validation && integration_name.nil? + fail ArgumentError, "Missing the required parameter 'integration_name' when calling IntegrationAccountsAPI.delete_ams_integration_account" + end + # verify the required parameter 'interface_id' is set + if @api_client.config.client_side_validation && interface_id.nil? + fail ArgumentError, "Missing the required parameter 'interface_id' when calling IntegrationAccountsAPI.delete_ams_integration_account" + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling IntegrationAccountsAPI.delete_ams_integration_account" + end + # resource path + local_var_path = '/api/v2/integrations/{integration_name}/interfaces/{interface_id}/accounts/{account_id}'.sub('{integration_name}', CGI.escape(integration_name.to_s).gsub('%2F', '/')).sub('{interface_id}', CGI.escape(interface_id.to_s).gsub('%2F', '/')).sub('{account_id}', CGI.escape(account_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :delete_ams_integration_account, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: IntegrationAccountsAPI#delete_ams_integration_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get integration account. + # + # @see #get_ams_integration_account_with_http_info + def get_ams_integration_account(integration_name, interface_id, account_id, opts = {}) + data, _status_code, _headers = get_ams_integration_account_with_http_info(integration_name, interface_id, account_id, opts) + data + end + + # Get integration account. + # + # Retrieve a specific account by its ID for a given integration. The response includes + # the account name and settings, but excludes sensitive secret values. + # + # Rate limit: 12000 requests per organization every 60 seconds. + # + # @param integration_name [String] The name of the integration. + # @param interface_id [String] The unique identifier of the interface. + # @param account_id [String] The unique identifier of the account. + # @param opts [Hash] the optional parameters + # @return [Array<(AmsIntegrationAccountResponse, Integer, Hash)>] AmsIntegrationAccountResponse data, response status code and response headers + def get_ams_integration_account_with_http_info(integration_name, interface_id, account_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IntegrationAccountsAPI.get_ams_integration_account ...' + end + # verify the required parameter 'integration_name' is set + if @api_client.config.client_side_validation && integration_name.nil? + fail ArgumentError, "Missing the required parameter 'integration_name' when calling IntegrationAccountsAPI.get_ams_integration_account" + end + # verify the required parameter 'interface_id' is set + if @api_client.config.client_side_validation && interface_id.nil? + fail ArgumentError, "Missing the required parameter 'interface_id' when calling IntegrationAccountsAPI.get_ams_integration_account" + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling IntegrationAccountsAPI.get_ams_integration_account" + end + # resource path + local_var_path = '/api/v2/integrations/{integration_name}/interfaces/{interface_id}/accounts/{account_id}'.sub('{integration_name}', CGI.escape(integration_name.to_s).gsub('%2F', '/')).sub('{interface_id}', CGI.escape(interface_id.to_s).gsub('%2F', '/')).sub('{account_id}', CGI.escape(account_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'AmsIntegrationAccountResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_ams_integration_account, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: IntegrationAccountsAPI#get_ams_integration_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get account schema for an integration. + # + # @see #get_ams_integration_account_schema_with_http_info + def get_ams_integration_account_schema(integration_name, interface_id, opts = {}) + data, _status_code, _headers = get_ams_integration_account_schema_with_http_info(integration_name, interface_id, opts) + data + end + + # Get account schema for an integration. + # + # Get the JSON schema that defines the structure and validation rules for account configuration + # of a specific integration. This schema describes the required and optional fields for both + # **settings** and **secrets** when creating or updating an account. + # + # The schema structure varies between integrations, so always retrieve the schema for your + # specific integration before creating or updating accounts. + # + # Rate limit: 12000 requests per organization every 60 seconds. + # + # @param integration_name [String] The name of the integration. + # @param interface_id [String] The unique identifier of the interface. + # @param opts [Hash] the optional parameters + # @return [Array<(AmsIntegrationAccountSchemaResponse, Integer, Hash)>] AmsIntegrationAccountSchemaResponse data, response status code and response headers + def get_ams_integration_account_schema_with_http_info(integration_name, interface_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IntegrationAccountsAPI.get_ams_integration_account_schema ...' + end + # verify the required parameter 'integration_name' is set + if @api_client.config.client_side_validation && integration_name.nil? + fail ArgumentError, "Missing the required parameter 'integration_name' when calling IntegrationAccountsAPI.get_ams_integration_account_schema" + end + # verify the required parameter 'interface_id' is set + if @api_client.config.client_side_validation && interface_id.nil? + fail ArgumentError, "Missing the required parameter 'interface_id' when calling IntegrationAccountsAPI.get_ams_integration_account_schema" + end + # resource path + local_var_path = '/api/v2/integrations/{integration_name}/interfaces/{interface_id}/accounts/schema'.sub('{integration_name}', CGI.escape(integration_name.to_s).gsub('%2F', '/')).sub('{interface_id}', CGI.escape(interface_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'AmsIntegrationAccountSchemaResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_ams_integration_account_schema, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: IntegrationAccountsAPI#get_ams_integration_account_schema\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List integration accounts. + # + # @see #list_ams_integration_accounts_with_http_info + def list_ams_integration_accounts(integration_name, interface_id, opts = {}) + data, _status_code, _headers = list_ams_integration_accounts_with_http_info(integration_name, interface_id, opts) + data + end + + # List integration accounts. + # + # Retrieve all configured accounts for a specific integration within your organization. + # + # Rate limit: 50 requests per user every 20 seconds. + # + # @param integration_name [String] The name of the integration. + # @param interface_id [String] The unique identifier of the interface. + # @param opts [Hash] the optional parameters + # @return [Array<(AmsIntegrationAccountsResponse, Integer, Hash)>] AmsIntegrationAccountsResponse data, response status code and response headers + def list_ams_integration_accounts_with_http_info(integration_name, interface_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IntegrationAccountsAPI.list_ams_integration_accounts ...' + end + # verify the required parameter 'integration_name' is set + if @api_client.config.client_side_validation && integration_name.nil? + fail ArgumentError, "Missing the required parameter 'integration_name' when calling IntegrationAccountsAPI.list_ams_integration_accounts" + end + # verify the required parameter 'interface_id' is set + if @api_client.config.client_side_validation && interface_id.nil? + fail ArgumentError, "Missing the required parameter 'interface_id' when calling IntegrationAccountsAPI.list_ams_integration_accounts" + end + # resource path + local_var_path = '/api/v2/integrations/{integration_name}/interfaces/{interface_id}/accounts'.sub('{integration_name}', CGI.escape(integration_name.to_s).gsub('%2F', '/')).sub('{interface_id}', CGI.escape(interface_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'AmsIntegrationAccountsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_ams_integration_accounts, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: IntegrationAccountsAPI#list_ams_integration_accounts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update integration account. + # + # @see #update_ams_integration_account_with_http_info + def update_ams_integration_account(integration_name, interface_id, account_id, body, opts = {}) + data, _status_code, _headers = update_ams_integration_account_with_http_info(integration_name, interface_id, account_id, body, opts) + data + end + + # Update integration account. + # + # Update an existing account for a specific integration. You can update the name, settings, + # and secrets. Only the fields provided in the request are updated. + # + # Rate limit: 50 requests per user every 20 seconds. + # + # @param integration_name [String] The name of the integration. + # @param interface_id [String] The unique identifier of the interface. + # @param account_id [String] The unique identifier of the account. + # @param body [AmsIntegrationAccountUpdateRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(AmsIntegrationAccountResponse, Integer, Hash)>] AmsIntegrationAccountResponse data, response status code and response headers + def update_ams_integration_account_with_http_info(integration_name, interface_id, account_id, body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IntegrationAccountsAPI.update_ams_integration_account ...' + end + # verify the required parameter 'integration_name' is set + if @api_client.config.client_side_validation && integration_name.nil? + fail ArgumentError, "Missing the required parameter 'integration_name' when calling IntegrationAccountsAPI.update_ams_integration_account" + end + # verify the required parameter 'interface_id' is set + if @api_client.config.client_side_validation && interface_id.nil? + fail ArgumentError, "Missing the required parameter 'interface_id' when calling IntegrationAccountsAPI.update_ams_integration_account" + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling IntegrationAccountsAPI.update_ams_integration_account" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling IntegrationAccountsAPI.update_ams_integration_account" + end + # resource path + local_var_path = '/api/v2/integrations/{integration_name}/interfaces/{interface_id}/accounts/{account_id}'.sub('{integration_name}', CGI.escape(integration_name.to_s).gsub('%2F', '/')).sub('{interface_id}', CGI.escape(interface_id.to_s).gsub('%2F', '/')).sub('{account_id}', CGI.escape(account_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'AmsIntegrationAccountResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :update_ams_integration_account, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: IntegrationAccountsAPI#update_ams_integration_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/datadog_api_client/v2/models/ams_integration_account_attributes.rb b/lib/datadog_api_client/v2/models/ams_integration_account_attributes.rb new file mode 100644 index 000000000000..8cbe71fce137 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ams_integration_account_attributes.rb @@ -0,0 +1,145 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for a web integration account. + class AmsIntegrationAccountAttributes + include BaseGenericModel + + # The name of the account. + attr_reader :name + + # 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. + attr_reader :settings + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'name' => :'name', + :'settings' => :'settings' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'name' => :'String', + :'settings' => :'Hash' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AmsIntegrationAccountAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'settings') + self.settings = attributes[:'settings'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @name.nil? + return false if @settings.nil? + true + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param settings [Object] Object to be assigned + # @!visibility private + def settings=(settings) + if settings.nil? + fail ArgumentError, 'invalid value for "settings", settings cannot be nil.' + end + @settings = settings + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + settings == o.settings && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [name, settings, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/ams_integration_account_create_request.rb b/lib/datadog_api_client/v2/models/ams_integration_account_create_request.rb new file mode 100644 index 000000000000..70d10b0ba8b5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ams_integration_account_create_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Payload for creating a web integration account. + class AmsIntegrationAccountCreateRequest + include BaseGenericModel + + # Data object for creating a web integration account. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'AmsIntegrationAccountCreateRequestData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AmsIntegrationAccountCreateRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/ams_integration_account_create_request_attributes.rb b/lib/datadog_api_client/v2/models/ams_integration_account_create_request_attributes.rb new file mode 100644 index 000000000000..7905223d2789 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ams_integration_account_create_request_attributes.rb @@ -0,0 +1,168 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for creating a web integration account. + class AmsIntegrationAccountCreateRequestAttributes + include BaseGenericModel + + # The name of the account. + attr_reader :name + + # Sensitive credentials for the account. The structure and required fields vary by integration type. + # These values are write-only and never returned in responses. + attr_reader :secrets + + # Integration-specific settings for the account. The structure and required fields vary by integration type. + # Use the schema endpoint (GET /api/v2/integrations/{integration_name}/accounts/schema) to retrieve + # the specific requirements for your integration before creating an account. + attr_reader :settings + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'name' => :'name', + :'secrets' => :'secrets', + :'settings' => :'settings' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'name' => :'String', + :'secrets' => :'Hash', + :'settings' => :'Hash' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AmsIntegrationAccountCreateRequestAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'secrets') + self.secrets = attributes[:'secrets'] + end + + if attributes.key?(:'settings') + self.settings = attributes[:'settings'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @name.nil? + return false if @secrets.nil? + return false if @settings.nil? + true + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param secrets [Object] Object to be assigned + # @!visibility private + def secrets=(secrets) + if secrets.nil? + fail ArgumentError, 'invalid value for "secrets", secrets cannot be nil.' + end + @secrets = secrets + end + + # Custom attribute writer method with validation + # @param settings [Object] Object to be assigned + # @!visibility private + def settings=(settings) + if settings.nil? + fail ArgumentError, 'invalid value for "settings", settings cannot be nil.' + end + @settings = settings + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + secrets == o.secrets && + settings == o.settings && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [name, secrets, settings, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/ams_integration_account_create_request_data.rb b/lib/datadog_api_client/v2/models/ams_integration_account_create_request_data.rb new file mode 100644 index 000000000000..b046558fe2e4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ams_integration_account_create_request_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data object for creating a web integration account. + class AmsIntegrationAccountCreateRequestData + include BaseGenericModel + + # Attributes for creating a web integration account. + attr_reader :attributes + + # The JSON:API type for web integration accounts. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'AmsIntegrationAccountCreateRequestAttributes', + :'type' => :'AmsIntegrationAccountType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AmsIntegrationAccountCreateRequestData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/ams_integration_account_response.rb b/lib/datadog_api_client/v2/models/ams_integration_account_response.rb new file mode 100644 index 000000000000..73d6ac42b88b --- /dev/null +++ b/lib/datadog_api_client/v2/models/ams_integration_account_response.rb @@ -0,0 +1,115 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing a single web integration account. + class AmsIntegrationAccountResponse + include BaseGenericModel + + # Data object for a web integration account response. + attr_accessor :data + + # The name of the integration. + attr_accessor :integration_name + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'integration_name' => :'integration_name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'AmsIntegrationAccountResponseData', + :'integration_name' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AmsIntegrationAccountResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + + if attributes.key?(:'integration_name') + self.integration_name = attributes[:'integration_name'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + integration_name == o.integration_name && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, integration_name, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/ams_integration_account_response_data.rb b/lib/datadog_api_client/v2/models/ams_integration_account_response_data.rb new file mode 100644 index 000000000000..233190e5c066 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ams_integration_account_response_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data object for a web integration account response. + class AmsIntegrationAccountResponseData + include BaseGenericModel + + # Attributes for a web integration account. + attr_reader :attributes + + # The unique identifier for the account. + attr_reader :id + + # The JSON:API type for web integration accounts. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'AmsIntegrationAccountAttributes', + :'id' => :'String', + :'type' => :'AmsIntegrationAccountType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AmsIntegrationAccountResponseData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/ams_integration_account_schema_response.rb b/lib/datadog_api_client/v2/models/ams_integration_account_schema_response.rb new file mode 100644 index 000000000000..25fd18dc0b30 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ams_integration_account_schema_response.rb @@ -0,0 +1,184 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # 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. + class AmsIntegrationAccountSchemaResponse + include BaseGenericModel + + # Whether additional properties are allowed at the root level (typically false). + attr_accessor :additional_properties + + # The properties object containing settings and secrets schema definitions. + # Both are always present in every integration schema, but the fields within each + # vary depending on the specific integration. + attr_reader :properties + + # List of required top-level properties. + attr_reader :required + + # The root type of the schema (always "object"). + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'additional_properties' => :'additionalProperties', + :'properties' => :'properties', + :'required' => :'required', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'additional_properties' => :'Boolean', + :'properties' => :'AmsIntegrationAccountSchemaResponseProperties', + :'required' => :'Array', + :'type' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AmsIntegrationAccountSchemaResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'additional_properties') + self.additional_properties = attributes[:'additional_properties'] + end + + if attributes.key?(:'properties') + self.properties = attributes[:'properties'] + end + + if attributes.key?(:'required') + if (value = attributes[:'required']).is_a?(Array) + self.required = value + end + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @properties.nil? + return false if @required.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param properties [Object] Object to be assigned + # @!visibility private + def properties=(properties) + if properties.nil? + fail ArgumentError, 'invalid value for "properties", properties cannot be nil.' + end + @properties = properties + end + + # Custom attribute writer method with validation + # @param required [Object] Object to be assigned + # @!visibility private + def required=(required) + if required.nil? + fail ArgumentError, 'invalid value for "required", required cannot be nil.' + end + @required = required + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + additional_properties == o.additional_properties && + properties == o.properties && + required == o.required && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [additional_properties, properties, required, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/ams_integration_account_schema_response_properties.rb b/lib/datadog_api_client/v2/models/ams_integration_account_schema_response_properties.rb new file mode 100644 index 000000000000..941ac5dbcecd --- /dev/null +++ b/lib/datadog_api_client/v2/models/ams_integration_account_schema_response_properties.rb @@ -0,0 +1,150 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # 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. + class AmsIntegrationAccountSchemaResponseProperties + include BaseGenericModel + + # 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. + attr_reader :secrets + + # JSON Schema definition for the settings object. + # Contains integration-specific configuration fields such as account identifiers, + # feature toggles, and non-sensitive configuration options. + attr_reader :settings + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'secrets' => :'secrets', + :'settings' => :'settings' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'secrets' => :'AmsIntegrationAccountSchemaResponseSecretsObject', + :'settings' => :'AmsIntegrationAccountSchemaResponseSettingsObject' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AmsIntegrationAccountSchemaResponseProperties` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'secrets') + self.secrets = attributes[:'secrets'] + end + + if attributes.key?(:'settings') + self.settings = attributes[:'settings'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @secrets.nil? + return false if @settings.nil? + true + end + + # Custom attribute writer method with validation + # @param secrets [Object] Object to be assigned + # @!visibility private + def secrets=(secrets) + if secrets.nil? + fail ArgumentError, 'invalid value for "secrets", secrets cannot be nil.' + end + @secrets = secrets + end + + # Custom attribute writer method with validation + # @param settings [Object] Object to be assigned + # @!visibility private + def settings=(settings) + if settings.nil? + fail ArgumentError, 'invalid value for "settings", settings cannot be nil.' + end + @settings = settings + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + secrets == o.secrets && + settings == o.settings && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [secrets, settings, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/ams_integration_account_schema_response_secrets_object.rb b/lib/datadog_api_client/v2/models/ams_integration_account_schema_response_secrets_object.rb new file mode 100644 index 000000000000..727b34fd9f4a --- /dev/null +++ b/lib/datadog_api_client/v2/models/ams_integration_account_schema_response_secrets_object.rb @@ -0,0 +1,140 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # 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. + class AmsIntegrationAccountSchemaResponseSecretsObject + include BaseGenericModel + + # Whether additional properties are allowed (typically false). + attr_accessor :additional_properties + + # The individual secret fields for this integration. + # Field names and types vary by integration. + attr_accessor :properties + + # List of required secret field names. + attr_accessor :required + + # Always "object" for the secrets container. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'additional_properties' => :'additionalProperties', + :'properties' => :'properties', + :'required' => :'required', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'additional_properties' => :'Boolean', + :'properties' => :'Hash', + :'required' => :'Array', + :'type' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AmsIntegrationAccountSchemaResponseSecretsObject` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'additional_properties') + self.additional_properties = attributes[:'additional_properties'] + end + + if attributes.key?(:'properties') + self.properties = attributes[:'properties'] + end + + if attributes.key?(:'required') + if (value = attributes[:'required']).is_a?(Array) + self.required = value + end + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + additional_properties == o.additional_properties && + properties == o.properties && + required == o.required && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [additional_properties, properties, required, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/ams_integration_account_schema_response_settings_field.rb b/lib/datadog_api_client/v2/models/ams_integration_account_schema_response_settings_field.rb new file mode 100644 index 000000000000..ce66582d1485 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ams_integration_account_schema_response_settings_field.rb @@ -0,0 +1,156 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # JSON Schema definition for a single field within settings or secrets. + # The exact fields vary by integration. + class AmsIntegrationAccountSchemaResponseSettingsField + include BaseGenericModel + + # Whether additional properties are allowed for this field. + attr_accessor :additional_properties + + # Default value for the field if not provided. + attr_accessor :default + + # Human-readable description of the field's purpose. + attr_accessor :description + + # Schema for array items when type is "array". + attr_accessor :items + + # Minimum length for string fields. + attr_accessor :min_length + + # The data type of the field (string, boolean, integer, array, object). + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'additional_properties' => :'additionalProperties', + :'default' => :'default', + :'description' => :'description', + :'items' => :'items', + :'min_length' => :'minLength', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'additional_properties' => :'Boolean', + :'default' => :'Object', + :'description' => :'String', + :'items' => :'Object', + :'min_length' => :'Integer', + :'type' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AmsIntegrationAccountSchemaResponseSettingsField` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'additional_properties') + self.additional_properties = attributes[:'additional_properties'] + end + + if attributes.key?(:'default') + self.default = attributes[:'default'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'items') + self.items = attributes[:'items'] + end + + if attributes.key?(:'min_length') + self.min_length = attributes[:'min_length'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + additional_properties == o.additional_properties && + default == o.default && + description == o.description && + items == o.items && + min_length == o.min_length && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [additional_properties, default, description, items, min_length, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/ams_integration_account_schema_response_settings_object.rb b/lib/datadog_api_client/v2/models/ams_integration_account_schema_response_settings_object.rb new file mode 100644 index 000000000000..e3dbfe8a5d60 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ams_integration_account_schema_response_settings_object.rb @@ -0,0 +1,140 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # JSON Schema definition for the settings object. + # Contains integration-specific configuration fields such as account identifiers, + # feature toggles, and non-sensitive configuration options. + class AmsIntegrationAccountSchemaResponseSettingsObject + include BaseGenericModel + + # Whether additional properties are allowed (typically false). + attr_accessor :additional_properties + + # The individual setting fields for this integration. + # Field names and types vary by integration. + attr_accessor :properties + + # List of required setting field names. + attr_accessor :required + + # Always "object" for the settings container. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'additional_properties' => :'additionalProperties', + :'properties' => :'properties', + :'required' => :'required', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'additional_properties' => :'Boolean', + :'properties' => :'Hash', + :'required' => :'Array', + :'type' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AmsIntegrationAccountSchemaResponseSettingsObject` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'additional_properties') + self.additional_properties = attributes[:'additional_properties'] + end + + if attributes.key?(:'properties') + self.properties = attributes[:'properties'] + end + + if attributes.key?(:'required') + if (value = attributes[:'required']).is_a?(Array) + self.required = value + end + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + additional_properties == o.additional_properties && + properties == o.properties && + required == o.required && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [additional_properties, properties, required, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/ams_integration_account_type.rb b/lib/datadog_api_client/v2/models/ams_integration_account_type.rb new file mode 100644 index 000000000000..faedf39bdf3d --- /dev/null +++ b/lib/datadog_api_client/v2/models/ams_integration_account_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The JSON:API type for web integration accounts. + class AmsIntegrationAccountType + include BaseEnumModel + + ACCOUNT = "Account".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/ams_integration_account_update_request.rb b/lib/datadog_api_client/v2/models/ams_integration_account_update_request.rb new file mode 100644 index 000000000000..785963cccaf2 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ams_integration_account_update_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Payload for updating a web integration account. + class AmsIntegrationAccountUpdateRequest + include BaseGenericModel + + # Data object for updating a web integration account. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'AmsIntegrationAccountUpdateRequestData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AmsIntegrationAccountUpdateRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/ams_integration_account_update_request_attributes.rb b/lib/datadog_api_client/v2/models/ams_integration_account_update_request_attributes.rb new file mode 100644 index 000000000000..5c043133a8c8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ams_integration_account_update_request_attributes.rb @@ -0,0 +1,128 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for updating a web integration account. All fields are optional; + # only provide the fields you want to update. + class AmsIntegrationAccountUpdateRequestAttributes + include BaseGenericModel + + # The name of the account. + attr_accessor :name + + # Sensitive credentials to update. Only the secrets provided are updated. + # These values are write-only and never returned in responses. + attr_accessor :secrets + + # 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. + attr_accessor :settings + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'name' => :'name', + :'secrets' => :'secrets', + :'settings' => :'settings' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'name' => :'String', + :'secrets' => :'Hash', + :'settings' => :'Hash' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AmsIntegrationAccountUpdateRequestAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'secrets') + self.secrets = attributes[:'secrets'] + end + + if attributes.key?(:'settings') + self.settings = attributes[:'settings'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + secrets == o.secrets && + settings == o.settings && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [name, secrets, settings, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/ams_integration_account_update_request_data.rb b/lib/datadog_api_client/v2/models/ams_integration_account_update_request_data.rb new file mode 100644 index 000000000000..cc8bd63b8d44 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ams_integration_account_update_request_data.rb @@ -0,0 +1,134 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data object for updating a web integration account. + class AmsIntegrationAccountUpdateRequestData + include BaseGenericModel + + # Attributes for updating a web integration account. All fields are optional; + # only provide the fields you want to update. + attr_accessor :attributes + + # The JSON:API type for web integration accounts. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'AmsIntegrationAccountUpdateRequestAttributes', + :'type' => :'AmsIntegrationAccountType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AmsIntegrationAccountUpdateRequestData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/ams_integration_accounts_response.rb b/lib/datadog_api_client/v2/models/ams_integration_accounts_response.rb new file mode 100644 index 000000000000..a96c566f9a3d --- /dev/null +++ b/lib/datadog_api_client/v2/models/ams_integration_accounts_response.rb @@ -0,0 +1,117 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing a list of web integration accounts. + class AmsIntegrationAccountsResponse + include BaseGenericModel + + # + attr_accessor :data + + # The name of the integration. + attr_accessor :integration_name + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'integration_name' => :'integration_name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array', + :'integration_name' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AmsIntegrationAccountsResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + + if attributes.key?(:'integration_name') + self.integration_name = attributes[:'integration_name'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + integration_name == o.integration_name && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, integration_name, additional_properties].hash + end + end +end