From 7397031025e7ecad49e4513fcfd8860e4f5257f8 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Wed, 29 Jul 2026 14:42:33 +0000 Subject: [PATCH] Regenerate client from commit d3dcf31 of spec repo --- .generator/schemas/v2/openapi.yaml | 986 +++++++++++++++++- .../CreateIntegrationAccount.rb | 38 + .../DeleteIntegrationAccount.rb | 8 + .../GetIntegrationAccount.rb | 8 + .../ListIntegrationAccounts.rb | 8 + .../UpdateIntegrationAccount.rb | 38 + features/scenarios_model_mapping.rb | 25 + features/v2/integration_accounts.feature | 160 +++ features/v2/undo.json | 45 + lib/datadog_api_client/configuration.rb | 7 +- lib/datadog_api_client/inflector.rb | 56 + lib/datadog_api_client/v2/api/ddsql_api.rb | 12 - .../v2/api/integration_accounts_api.rb | 485 +++++++++ .../v2/models/ddsql_tabular_query_column.rb | 14 +- .../v2/models/elastic_cloud_authentication.rb | 62 ++ .../v2/models/elastic_cloud_basic_auth.rb | 165 +++ .../models/elastic_cloud_basic_auth_type.rb | 26 + .../elastic_cloud_ccm_authentication.rb | 62 ++ .../v2/models/elastic_cloud_ccm_dataflow.rb | 143 +++ .../models/elastic_cloud_ccm_dataflow_id.rb | 26 + .../v2/models/elastic_cloud_ccm_interface.rb | 166 +++ .../elastic_cloud_ccm_interface_type.rb | 26 + .../elastic_cloud_ccm_interface_update.rb | 155 +++ .../v2/models/elastic_cloud_ccm_settings.rb | 123 +++ .../elastic_cloud_ccm_settings_update.rb | 105 ++ .../v2/models/elastic_cloud_ccm_token_auth.rb | 144 +++ .../elastic_cloud_ccm_token_auth_type.rb | 26 + .../v2/models/elastic_cloud_dataflow.rb | 143 +++ .../v2/models/elastic_cloud_dataflow_id.rb | 26 + .../v2/models/elastic_cloud_integration.rb | 144 +++ .../models/elastic_cloud_integration_type.rb | 26 + .../elastic_cloud_integration_update.rb | 133 +++ .../v2/models/elastic_cloud_interface.rb | 63 ++ .../models/elastic_cloud_interface_update.rb | 63 ++ .../elastic_cloud_monitoring_interface.rb | 166 +++ ...elastic_cloud_monitoring_interface_type.rb | 26 + ...astic_cloud_monitoring_interface_update.rb | 155 +++ .../v2/models/elastic_cloud_settings.rb | 205 ++++ .../models/elastic_cloud_settings_update.rb | 187 ++++ .../models/integration_account_attributes.rb | 154 +++ .../models/integration_account_create_data.rb | 144 +++ .../v2/models/integration_account_data.rb | 165 +++ .../integration_account_dataflow_health.rb | 28 + .../integration_account_dataflow_status.rb | 125 +++ .../models/integration_account_integration.rb | 63 ++ .../integration_account_integration_id.rb | 27 + .../integration_account_integration_update.rb | 63 ++ .../integration_account_interface_id.rb | 28 + .../models/integration_account_permissions.rb | 115 ++ .../v2/models/integration_account_request.rb | 123 +++ .../v2/models/integration_account_response.rb | 105 ++ .../v2/models/integration_account_type.rb | 26 + .../integration_account_update_attributes.rb | 115 ++ .../models/integration_account_update_data.rb | 144 +++ .../integration_account_update_request.rb | 123 +++ .../models/integration_accounts_response.rb | 107 ++ .../v2/models/twilio_authentication.rb | 62 ++ .../v2/models/twilio_basic_auth.rb | 165 +++ .../v2/models/twilio_basic_auth_type.rb | 26 + .../v2/models/twilio_dataflow.rb | 143 +++ .../v2/models/twilio_dataflow_id.rb | 30 + .../v2/models/twilio_integration.rb | 144 +++ .../v2/models/twilio_integration_type.rb | 26 + .../v2/models/twilio_integration_update.rb | 133 +++ .../v2/models/twilio_interface.rb | 166 +++ .../v2/models/twilio_interface_type.rb | 26 + .../v2/models/twilio_interface_update.rb | 155 +++ .../v2/models/twilio_settings.rb | 133 +++ .../v2/models/twilio_settings_update.rb | 115 ++ 69 files changed, 7409 insertions(+), 26 deletions(-) create mode 100644 examples/v2/integration-accounts/CreateIntegrationAccount.rb create mode 100644 examples/v2/integration-accounts/DeleteIntegrationAccount.rb create mode 100644 examples/v2/integration-accounts/GetIntegrationAccount.rb create mode 100644 examples/v2/integration-accounts/ListIntegrationAccounts.rb create mode 100644 examples/v2/integration-accounts/UpdateIntegrationAccount.rb create mode 100644 features/v2/integration_accounts.feature create mode 100644 lib/datadog_api_client/v2/api/integration_accounts_api.rb create mode 100644 lib/datadog_api_client/v2/models/elastic_cloud_authentication.rb create mode 100644 lib/datadog_api_client/v2/models/elastic_cloud_basic_auth.rb create mode 100644 lib/datadog_api_client/v2/models/elastic_cloud_basic_auth_type.rb create mode 100644 lib/datadog_api_client/v2/models/elastic_cloud_ccm_authentication.rb create mode 100644 lib/datadog_api_client/v2/models/elastic_cloud_ccm_dataflow.rb create mode 100644 lib/datadog_api_client/v2/models/elastic_cloud_ccm_dataflow_id.rb create mode 100644 lib/datadog_api_client/v2/models/elastic_cloud_ccm_interface.rb create mode 100644 lib/datadog_api_client/v2/models/elastic_cloud_ccm_interface_type.rb create mode 100644 lib/datadog_api_client/v2/models/elastic_cloud_ccm_interface_update.rb create mode 100644 lib/datadog_api_client/v2/models/elastic_cloud_ccm_settings.rb create mode 100644 lib/datadog_api_client/v2/models/elastic_cloud_ccm_settings_update.rb create mode 100644 lib/datadog_api_client/v2/models/elastic_cloud_ccm_token_auth.rb create mode 100644 lib/datadog_api_client/v2/models/elastic_cloud_ccm_token_auth_type.rb create mode 100644 lib/datadog_api_client/v2/models/elastic_cloud_dataflow.rb create mode 100644 lib/datadog_api_client/v2/models/elastic_cloud_dataflow_id.rb create mode 100644 lib/datadog_api_client/v2/models/elastic_cloud_integration.rb create mode 100644 lib/datadog_api_client/v2/models/elastic_cloud_integration_type.rb create mode 100644 lib/datadog_api_client/v2/models/elastic_cloud_integration_update.rb create mode 100644 lib/datadog_api_client/v2/models/elastic_cloud_interface.rb create mode 100644 lib/datadog_api_client/v2/models/elastic_cloud_interface_update.rb create mode 100644 lib/datadog_api_client/v2/models/elastic_cloud_monitoring_interface.rb create mode 100644 lib/datadog_api_client/v2/models/elastic_cloud_monitoring_interface_type.rb create mode 100644 lib/datadog_api_client/v2/models/elastic_cloud_monitoring_interface_update.rb create mode 100644 lib/datadog_api_client/v2/models/elastic_cloud_settings.rb create mode 100644 lib/datadog_api_client/v2/models/elastic_cloud_settings_update.rb create mode 100644 lib/datadog_api_client/v2/models/integration_account_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/integration_account_create_data.rb create mode 100644 lib/datadog_api_client/v2/models/integration_account_data.rb create mode 100644 lib/datadog_api_client/v2/models/integration_account_dataflow_health.rb create mode 100644 lib/datadog_api_client/v2/models/integration_account_dataflow_status.rb create mode 100644 lib/datadog_api_client/v2/models/integration_account_integration.rb create mode 100644 lib/datadog_api_client/v2/models/integration_account_integration_id.rb create mode 100644 lib/datadog_api_client/v2/models/integration_account_integration_update.rb create mode 100644 lib/datadog_api_client/v2/models/integration_account_interface_id.rb create mode 100644 lib/datadog_api_client/v2/models/integration_account_permissions.rb create mode 100644 lib/datadog_api_client/v2/models/integration_account_request.rb create mode 100644 lib/datadog_api_client/v2/models/integration_account_response.rb create mode 100644 lib/datadog_api_client/v2/models/integration_account_type.rb create mode 100644 lib/datadog_api_client/v2/models/integration_account_update_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/integration_account_update_data.rb create mode 100644 lib/datadog_api_client/v2/models/integration_account_update_request.rb create mode 100644 lib/datadog_api_client/v2/models/integration_accounts_response.rb create mode 100644 lib/datadog_api_client/v2/models/twilio_authentication.rb create mode 100644 lib/datadog_api_client/v2/models/twilio_basic_auth.rb create mode 100644 lib/datadog_api_client/v2/models/twilio_basic_auth_type.rb create mode 100644 lib/datadog_api_client/v2/models/twilio_dataflow.rb create mode 100644 lib/datadog_api_client/v2/models/twilio_dataflow_id.rb create mode 100644 lib/datadog_api_client/v2/models/twilio_integration.rb create mode 100644 lib/datadog_api_client/v2/models/twilio_integration_type.rb create mode 100644 lib/datadog_api_client/v2/models/twilio_integration_update.rb create mode 100644 lib/datadog_api_client/v2/models/twilio_interface.rb create mode 100644 lib/datadog_api_client/v2/models/twilio_interface_type.rb create mode 100644 lib/datadog_api_client/v2/models/twilio_interface_update.rb create mode 100644 lib/datadog_api_client/v2/models/twilio_settings.rb create mode 100644 lib/datadog_api_client/v2/models/twilio_settings_update.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index acd63e70a663..2db585986c6d 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -885,6 +885,27 @@ components: required: true schema: type: string + IntegrationAccountIdParameter: + description: Unique identifier of the integration account. + in: path + name: account_id + required: true + schema: + type: string + IntegrationAccountIntegrationIdParameter: + description: Grouping/RBAC scope. Selects the integration whose accounts are addressed. + in: path + name: integration_id + required: true + schema: + $ref: "#/components/schemas/IntegrationAccountIntegrationId" + IntegrationAccountInterfaceIdParameter: + description: Selects the interface (source-type) within the integration. + in: path + name: interface_id + required: true + schema: + $ref: "#/components/schemas/IntegrationAccountInterfaceId" IssueIDPathParameter: description: The identifier of the issue. example: "c1726a66-1f64-11ee-b338-da7ad0900002" @@ -31063,9 +31084,17 @@ components: type: string values: description: |- - Column values in row order. The element type matches the column's `type`; - for example a `VARCHAR` column carries strings, a `TIMESTAMP` column carries - Unix-millisecond integers. `null` is allowed for missing values. + Column values in row order, one entry per result row. The element type + follows the column's `type`. The following serialization rules should be + taken into account: + + - `BIGINT` values are encoded as JSON numbers in the signed 64-bit integer range. + - `DECIMAL` values are encoded as JSON numbers with 64-bit double precision. + - `TIMESTAMP` and `DATE` values are encoded as Unix-millisecond integers; a + `DATE` resolves to midnight UTC. + - `JSON` values are returned as a JSON-encoded string. + + `null` is allowed for any column type where a value is missing. example: - web-store - checkout @@ -33971,6 +34000,345 @@ components: - score - severity type: object + ElasticCloudAuthentication: + description: >- + Authentication methods supported by the Elastic Cloud interface. Exactly one is set, selected by its `type`. + oneOf: + - $ref: "#/components/schemas/ElasticCloudBasicAuth" + ElasticCloudBasicAuth: + description: Username & password authentication for Elastic Cloud. + properties: + password: + description: Password used to authenticate against the deployment. + example: your-password + type: string + writeOnly: true + type: + $ref: "#/components/schemas/ElasticCloudBasicAuthType" + username: + description: Username used to authenticate against the deployment. + example: datadog + type: string + required: + - type + - username + - password + type: object + ElasticCloudBasicAuthType: + default: basic + description: Authentication method discriminator. + enum: + - basic + example: basic + type: string + x-enum-varnames: + - BASIC + ElasticCloudCcmAuthentication: + description: >- + Authentication methods supported by the Elastic Cloud CCM interface. Exactly one is set, selected by its `type`. + oneOf: + - $ref: "#/components/schemas/ElasticCloudCcmTokenAuth" + ElasticCloudCcmDataflow: + description: An Elastic Cloud CCM dataflow toggle. The set of dataflow ids is fixed by the interface schema. + properties: + enabled: + description: Whether the dataflow is enabled. + example: true + type: boolean + id: + $ref: "#/components/schemas/ElasticCloudCcmDataflowId" + status: + $ref: "#/components/schemas/IntegrationAccountDataflowStatus" + required: + - id + type: object + ElasticCloudCcmDataflowId: + description: Identifier of an Elastic Cloud CCM dataflow. + enum: + - elastic-cloud-cost-data + example: elastic-cloud-cost-data + type: string + x-enum-varnames: + - COST_DATA + ElasticCloudCcmInterface: + description: Elastic Cloud CCM (Cloud Cost Management) interface configuration. + properties: + authentication: + $ref: "#/components/schemas/ElasticCloudCcmAuthentication" + dataflows: + description: Dataflows for the Elastic Cloud CCM interface. + items: + $ref: "#/components/schemas/ElasticCloudCcmDataflow" + type: array + settings: + $ref: "#/components/schemas/ElasticCloudCcmSettings" + type: + $ref: "#/components/schemas/ElasticCloudCcmInterfaceType" + required: + - type + - authentication + type: object + ElasticCloudCcmInterfaceType: + description: Interface discriminator for the Elastic Cloud CCM interface. + enum: + - elastic-cloud-ccm + example: elastic-cloud-ccm + type: string + x-enum-varnames: + - ELASTIC_CLOUD_CCM + ElasticCloudCcmInterfaceUpdate: + description: Partial Elastic Cloud CCM interface for updates. + properties: + authentication: + $ref: "#/components/schemas/ElasticCloudCcmAuthentication" + dataflows: + description: Dataflows for the Elastic Cloud CCM interface. + items: + $ref: "#/components/schemas/ElasticCloudCcmDataflow" + type: array + settings: + $ref: "#/components/schemas/ElasticCloudCcmSettingsUpdate" + type: + $ref: "#/components/schemas/ElasticCloudCcmInterfaceType" + required: + - type + type: object + ElasticCloudCcmSettings: + description: Elastic Cloud CCM interface settings. + properties: + elastic_org_id: + description: Your Elastic Cloud organization ID, found in your organization settings. + example: "2079364244" + type: string + required: + - elastic_org_id + type: object + ElasticCloudCcmSettingsUpdate: + description: Partial Elastic Cloud CCM interface settings for updates. + properties: + elastic_org_id: + description: Your Elastic Cloud organization ID, found in your organization settings. + example: "2079364244" + type: string + type: object + ElasticCloudCcmTokenAuth: + description: Encrypted token (bearer token) authentication for Elastic Cloud CCM. + properties: + api_key: + description: >- + Billing API key. An Elastic Cloud API key with read access to both Billing and Deployments. Create one under Organization settings > API Keys. + example: your-billing-api-key + type: string + writeOnly: true + type: + $ref: "#/components/schemas/ElasticCloudCcmTokenAuthType" + required: + - type + - api_key + type: object + ElasticCloudCcmTokenAuthType: + default: bearer_token + description: Authentication method discriminator. + enum: + - bearer_token + example: bearer_token + type: string + x-enum-varnames: + - BEARER_TOKEN + ElasticCloudDataflow: + description: An Elastic Cloud dataflow toggle. The set of dataflow ids is fixed by the interface schema. + properties: + enabled: + description: Whether the dataflow is enabled. + example: true + type: boolean + id: + $ref: "#/components/schemas/ElasticCloudDataflowId" + status: + $ref: "#/components/schemas/IntegrationAccountDataflowStatus" + required: + - id + type: object + ElasticCloudDataflowId: + description: Identifier of an Elastic Cloud dataflow. + enum: + - elastic-cloud-metrics + example: elastic-cloud-metrics + type: string + x-enum-varnames: + - METRICS + ElasticCloudIntegration: + description: Elastic Cloud integration configuration. + properties: + interface: + $ref: "#/components/schemas/ElasticCloudInterface" + type: + $ref: "#/components/schemas/ElasticCloudIntegrationType" + required: + - type + - interface + type: object + ElasticCloudIntegrationType: + description: Integration discriminator for Elastic Cloud. + enum: + - elastic-cloud + example: elastic-cloud + type: string + x-enum-varnames: + - ELASTIC_CLOUD + ElasticCloudIntegrationUpdate: + description: Partial Elastic Cloud integration configuration for updates. + properties: + interface: + $ref: "#/components/schemas/ElasticCloudInterfaceUpdate" + type: + $ref: "#/components/schemas/ElasticCloudIntegrationType" + required: + - type + type: object + ElasticCloudInterface: + description: >- + Elastic Cloud interface (source-type). Exactly one interface variant is set, selected by its `type`. + oneOf: + - $ref: "#/components/schemas/ElasticCloudMonitoringInterface" + - $ref: "#/components/schemas/ElasticCloudCcmInterface" + ElasticCloudInterfaceUpdate: + description: >- + Partial Elastic Cloud interface for updates. Exactly one interface variant is set, selected by its `type`. + oneOf: + - $ref: "#/components/schemas/ElasticCloudMonitoringInterfaceUpdate" + - $ref: "#/components/schemas/ElasticCloudCcmInterfaceUpdate" + ElasticCloudMonitoringInterface: + description: Elastic Cloud monitoring interface (source-type) configuration. + properties: + authentication: + $ref: "#/components/schemas/ElasticCloudAuthentication" + dataflows: + description: Dataflows for the Elastic Cloud monitoring interface. + items: + $ref: "#/components/schemas/ElasticCloudDataflow" + type: array + settings: + $ref: "#/components/schemas/ElasticCloudSettings" + type: + $ref: "#/components/schemas/ElasticCloudMonitoringInterfaceType" + required: + - type + - authentication + type: object + ElasticCloudMonitoringInterfaceType: + description: Interface discriminator for the Elastic Cloud monitoring interface. + enum: + - elastic-cloud + example: elastic-cloud + type: string + x-enum-varnames: + - ELASTIC_CLOUD + ElasticCloudMonitoringInterfaceUpdate: + description: Partial Elastic Cloud monitoring interface for updates. + properties: + authentication: + $ref: "#/components/schemas/ElasticCloudAuthentication" + dataflows: + description: Dataflows for the Elastic Cloud monitoring interface. + items: + $ref: "#/components/schemas/ElasticCloudDataflow" + type: array + settings: + $ref: "#/components/schemas/ElasticCloudSettingsUpdate" + type: + $ref: "#/components/schemas/ElasticCloudMonitoringInterfaceType" + required: + - type + type: object + ElasticCloudSettings: + description: Elastic Cloud interface settings. + properties: + cat_allocation_stats_enabled: + description: Enable to collect shard allocation metrics. + example: false + type: boolean + detailed_index_stats_enabled: + description: Enable to collect index-specific stats. + example: false + type: boolean + index_stats_enabled: + description: Enable to collect metrics about the indices in your cluster. + example: false + type: boolean + pending_task_stats_enabled: + description: Enable to collect metrics about pending tasks. + example: false + type: boolean + pshard_graceful_to_enabled: + description: Enable to collect all metrics even if primary shard metric collection times out. + example: false + type: boolean + pshard_stats_enabled: + description: Enable to collect metrics over primary shards. + example: false + type: boolean + slm_stats_enabled: + description: Enable to collect snapshot lifecycle management metrics. + example: false + type: boolean + tags: + description: Custom tags for this deployment. + example: + - env:prod + items: + type: string + type: array + url: + description: Deployment URL. + example: "https://example.es.us-central1.gcp.cloud.es.io:9243" + type: string + required: + - url + type: object + ElasticCloudSettingsUpdate: + description: Partial Elastic Cloud interface settings for updates. + properties: + cat_allocation_stats_enabled: + description: Enable to collect shard allocation metrics. + example: false + type: boolean + detailed_index_stats_enabled: + description: Enable to collect index-specific stats. + example: false + type: boolean + index_stats_enabled: + description: Enable to collect metrics about the indices in your cluster. + example: false + type: boolean + pending_task_stats_enabled: + description: Enable to collect metrics about pending tasks. + example: false + type: boolean + pshard_graceful_to_enabled: + description: Enable to collect all metrics even if primary shard metric collection times out. + example: false + type: boolean + pshard_stats_enabled: + description: Enable to collect metrics over primary shards. + example: false + type: boolean + slm_stats_enabled: + description: Enable to collect snapshot lifecycle management metrics. + example: false + type: boolean + tags: + description: Custom tags for this deployment. + example: + - env:prod + items: + type: string + type: array + url: + description: Deployment URL. + example: "https://example.es.us-central1.gcp.cloud.es.io:9243" + type: string + type: object Enabled: description: Field used to enable or disable the rule. example: true @@ -48598,6 +48966,189 @@ components: - id - attributes type: object + IntegrationAccountAttributes: + description: >- + Attributes of an integration account. The `integration` field is a strongly-typed, per-integration union. + properties: + integration: + $ref: "#/components/schemas/IntegrationAccountIntegration" + name: + description: Human-readable name of the account. + example: twilio-prod + type: string + permissions: + $ref: "#/components/schemas/IntegrationAccountPermissions" + required: + - name + - integration + type: object + IntegrationAccountCreateData: + description: Data envelope for creating an integration account. + properties: + attributes: + $ref: "#/components/schemas/IntegrationAccountAttributes" + type: + $ref: "#/components/schemas/IntegrationAccountType" + required: + - type + - attributes + type: object + IntegrationAccountData: + description: Data envelope of an integration account, including server-assigned identity. + properties: + attributes: + $ref: "#/components/schemas/IntegrationAccountAttributes" + id: + description: Server-generated unique identifier of the integration account. + example: 953a0060-81ec-4221-aed4-d4733b59cd96 + readOnly: true + type: string + type: + $ref: "#/components/schemas/IntegrationAccountType" + required: + - id + - type + - attributes + type: object + IntegrationAccountDataflowHealth: + description: Collection health of a single dataflow. + enum: + - DATAFLOW_HEALTH_OK + - DATAFLOW_HEALTH_BROKEN + - DATAFLOW_HEALTH_UNKNOWN + example: DATAFLOW_HEALTH_OK + type: string + x-enum-varnames: + - OK + - BROKEN + - UNKNOWN + IntegrationAccountDataflowStatus: + description: Read-only, server-computed collection status of a dataflow. + properties: + health: + $ref: "#/components/schemas/IntegrationAccountDataflowHealth" + message: + description: Human-readable detail, populated when the dataflow is not healthy. + example: "" + type: string + updated_at: + description: Time the status was last computed. + example: "2026-06-25T08:30:50Z" + format: date-time + type: string + readOnly: true + type: object + IntegrationAccountIntegration: + description: >- + Strongly-typed, per-integration configuration. Exactly one integration variant is set, selected by its `type`. + oneOf: + - $ref: "#/components/schemas/TwilioIntegration" + - $ref: "#/components/schemas/ElasticCloudIntegration" + IntegrationAccountIntegrationId: + description: Supported integration ids (the `integration_id` path scope). + enum: + - elastic-cloud + - twilio + example: twilio + type: string + x-enum-varnames: + - ELASTIC_CLOUD + - TWILIO + IntegrationAccountIntegrationUpdate: + description: >- + Strongly-typed, per-integration partial configuration. Exactly one integration variant is set, selected by its `type`. + oneOf: + - $ref: "#/components/schemas/TwilioIntegrationUpdate" + - $ref: "#/components/schemas/ElasticCloudIntegrationUpdate" + IntegrationAccountInterfaceId: + description: Supported interface (source-type) ids (the `interface_id` path scope). + enum: + - elastic-cloud + - elastic-cloud-ccm + - twilio + example: twilio + type: string + x-enum-varnames: + - ELASTIC_CLOUD + - ELASTIC_CLOUD_CCM + - TWILIO + IntegrationAccountPermissions: + description: Read-only permission information for the account, derived from its restriction policy. + properties: + resource_id: + description: Restriction-policy resource identifier of this account. + example: "integration-account:twilio:953a0060-81ec-4221-aed4-d4733b59cd96" + readOnly: true + type: string + user_can_edit: + description: Whether the requesting user may edit this account. + example: true + readOnly: true + type: boolean + readOnly: true + type: object + IntegrationAccountRequest: + description: Request payload to create an integration account. + properties: + data: + $ref: "#/components/schemas/IntegrationAccountCreateData" + required: + - data + type: object + IntegrationAccountResponse: + description: Response payload for a single integration account. + properties: + data: + $ref: "#/components/schemas/IntegrationAccountData" + type: object + IntegrationAccountType: + default: integration-account + description: JSON:API resource type for an integration account. Always `integration-account`. + enum: + - integration-account + example: integration-account + type: string + x-enum-varnames: + - INTEGRATION_ACCOUNT + IntegrationAccountUpdateAttributes: + description: >- + Updatable attributes of an integration account. Every field is optional; only the fields provided are changed. + properties: + integration: + $ref: "#/components/schemas/IntegrationAccountIntegrationUpdate" + name: + description: Human-readable name of the account. + example: twilio-prod + type: string + type: object + IntegrationAccountUpdateData: + description: Data envelope for updating an integration account. + properties: + attributes: + $ref: "#/components/schemas/IntegrationAccountUpdateAttributes" + type: + $ref: "#/components/schemas/IntegrationAccountType" + required: + - type + - attributes + type: object + IntegrationAccountUpdateRequest: + description: Request payload to update an integration account as a partial merge. + properties: + data: + $ref: "#/components/schemas/IntegrationAccountUpdateData" + required: + - data + type: object + IntegrationAccountsResponse: + description: Response payload for a list of integration accounts. + properties: + data: + description: List of integration accounts. + items: + $ref: "#/components/schemas/IntegrationAccountData" + type: array + type: object IntegrationAttributes: description: Attributes for an integration. properties: @@ -109798,6 +110349,167 @@ components: type: string x-enum-varnames: - TRIGGER_WORKFLOW_AUTOMATION + TwilioAuthentication: + description: >- + Authentication methods supported by the Twilio interface. Exactly one is set, selected by its `type`. + oneOf: + - $ref: "#/components/schemas/TwilioBasicAuth" + TwilioBasicAuth: + description: API Key & Secret authentication for Twilio. + properties: + api_key: + description: Twilio API Key SID for authentication. Create from Twilio Console > Account > API Keys & Tokens. + example: SKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + type: string + api_key_token: + description: Twilio API Key Secret (token) corresponding to the API Key SID. + example: your-api-key-secret + type: string + writeOnly: true + type: + $ref: "#/components/schemas/TwilioBasicAuthType" + required: + - type + - api_key + - api_key_token + type: object + TwilioBasicAuthType: + default: basic + description: Authentication method discriminator. + enum: + - basic + example: basic + type: string + x-enum-varnames: + - BASIC + TwilioDataflow: + description: A Twilio dataflow toggle. The set of dataflow ids is fixed by the interface schema. + properties: + enabled: + description: Whether the dataflow is enabled. + example: true + type: boolean + id: + $ref: "#/components/schemas/TwilioDataflowId" + status: + $ref: "#/components/schemas/IntegrationAccountDataflowStatus" + required: + - id + type: object + TwilioDataflowId: + description: Identifier of a Twilio dataflow. + enum: + - twilio-cloud-cost-metrics + - twilio-events-logs + - twilio-messages-logs + - twilio-alerts-logs + - twilio-call-summaries-logs + example: twilio-messages-logs + type: string + x-enum-varnames: + - CLOUD_COST_METRICS + - EVENTS_LOGS + - MESSAGES_LOGS + - ALERTS_LOGS + - CALL_SUMMARIES_LOGS + TwilioIntegration: + description: Twilio integration configuration. + properties: + interface: + $ref: "#/components/schemas/TwilioInterface" + type: + $ref: "#/components/schemas/TwilioIntegrationType" + required: + - type + - interface + type: object + TwilioIntegrationType: + description: Integration discriminator for Twilio. + enum: + - twilio + example: twilio + type: string + x-enum-varnames: + - TWILIO + TwilioIntegrationUpdate: + description: Partial Twilio integration configuration for updates. + properties: + interface: + $ref: "#/components/schemas/TwilioInterfaceUpdate" + type: + $ref: "#/components/schemas/TwilioIntegrationType" + required: + - type + type: object + TwilioInterface: + description: Twilio interface (source-type) configuration. + properties: + authentication: + $ref: "#/components/schemas/TwilioAuthentication" + dataflows: + description: Dataflows for the Twilio interface. + items: + $ref: "#/components/schemas/TwilioDataflow" + type: array + settings: + $ref: "#/components/schemas/TwilioSettings" + type: + $ref: "#/components/schemas/TwilioInterfaceType" + required: + - type + - authentication + type: object + TwilioInterfaceType: + description: Interface discriminator for Twilio. + enum: + - twilio + example: twilio + type: string + x-enum-varnames: + - TWILIO + TwilioInterfaceUpdate: + description: Partial Twilio interface (source-type) configuration for updates. + properties: + authentication: + $ref: "#/components/schemas/TwilioAuthentication" + dataflows: + description: Dataflows for the Twilio interface. + items: + $ref: "#/components/schemas/TwilioDataflow" + type: array + settings: + $ref: "#/components/schemas/TwilioSettingsUpdate" + type: + $ref: "#/components/schemas/TwilioInterfaceType" + required: + - type + type: object + TwilioSettings: + description: Twilio interface settings. + properties: + account_sid: + description: Twilio Account SID that uniquely identifies your Twilio account. + example: ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + type: string + censor_logs: + description: When enabled, phone numbers in the `to` field and SMS message bodies are censored for privacy. + example: true + type: boolean + required: + - account_sid + type: object + TwilioSettingsUpdate: + description: Partial Twilio interface settings for updates. + properties: + account_sid: + description: Twilio Account SID that uniquely identifies your Twilio account. + example: ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + type: string + censor_logs: + description: When enabled, phone numbers in the `to` field and SMS message bodies are censored for privacy. + example: true + type: boolean + type: object UCConfigPair: description: The definition of `UCConfigPair` object. example: @@ -135602,9 +136314,6 @@ paths: summary: Execute a tabular DDSQL query tags: - DDSQL - x-unstable: |- - **Note**: This endpoint is in preview and is subject to change. - If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/ddsql/query/tabular/fetch: post: description: |- @@ -135713,9 +136422,6 @@ paths: summary: Fetch the result of a DDSQL query tags: - DDSQL - x-unstable: |- - **Note**: This endpoint is in preview and is subject to change. - If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/deletion/data/{product}: post: description: Creates a data deletion request by providing a query and a timeframe targeting the proper data. @@ -151115,6 +151821,265 @@ paths: operator: OR permissions: - manage_integrations + /api/v2/integrations/{integration_id}/interfaces/{interface_id}/accounts: + get: + description: List the integration accounts for a given integration/interface. + operationId: ListIntegrationAccounts + parameters: + - $ref: "#/components/parameters/IntegrationAccountIntegrationIdParameter" + - $ref: "#/components/parameters/IntegrationAccountInterfaceIdParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + integration: + interface: + authentication: + api_key: SKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + type: basic + dataflows: + - enabled: true + id: twilio-messages-logs + status: + health: DATAFLOW_HEALTH_OK + updated_at: "2026-06-25T08:30:50Z" + settings: + account_sid: ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + censor_logs: true + type: twilio + type: twilio + name: twilio-prod + permissions: + resource_id: "integration-account:twilio:953a0060-81ec-4221-aed4-d4733b59cd96" + user_can_edit: true + id: 953a0060-81ec-4221-aed4-d4733b59cd96 + type: integration-account + schema: + $ref: "#/components/schemas/IntegrationAccountsResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: List integration accounts + tags: + - Integration Accounts + x-unstable: |- + **Note**: This endpoint is in public beta. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + post: + description: Create an integration account for a given integration/interface. + operationId: CreateIntegrationAccount + parameters: + - $ref: "#/components/parameters/IntegrationAccountIntegrationIdParameter" + - $ref: "#/components/parameters/IntegrationAccountInterfaceIdParameter" + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/IntegrationAccountRequest" + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + integration: + interface: + authentication: + api_key: SKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + type: basic + dataflows: + - enabled: true + id: twilio-messages-logs + status: + health: DATAFLOW_HEALTH_OK + updated_at: "2026-06-25T08:30:50Z" + settings: + account_sid: ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + censor_logs: true + type: twilio + type: twilio + name: twilio-prod + permissions: + resource_id: "integration-account:twilio:953a0060-81ec-4221-aed4-d4733b59cd96" + user_can_edit: true + id: 953a0060-81ec-4221-aed4-d4733b59cd96 + type: integration-account + schema: + $ref: "#/components/schemas/IntegrationAccountResponse" + description: Created + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Create an integration account + tags: + - Integration Accounts + x-codegen-request-body-name: body + x-unstable: |- + **Note**: This endpoint is in public beta. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/integrations/{integration_id}/interfaces/{interface_id}/accounts/{account_id}: + delete: + description: Delete an integration account. + operationId: DeleteIntegrationAccount + parameters: + - $ref: "#/components/parameters/IntegrationAccountIntegrationIdParameter" + - $ref: "#/components/parameters/IntegrationAccountInterfaceIdParameter" + - $ref: "#/components/parameters/IntegrationAccountIdParameter" + responses: + "204": + description: No Content + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Delete an integration account + tags: + - Integration Accounts + x-unstable: |- + **Note**: This endpoint is in public beta. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + get: + description: Get a single integration account. + operationId: GetIntegrationAccount + parameters: + - $ref: "#/components/parameters/IntegrationAccountIntegrationIdParameter" + - $ref: "#/components/parameters/IntegrationAccountInterfaceIdParameter" + - $ref: "#/components/parameters/IntegrationAccountIdParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + integration: + interface: + authentication: + api_key: SKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + type: basic + dataflows: + - enabled: true + id: twilio-messages-logs + status: + health: DATAFLOW_HEALTH_OK + updated_at: "2026-06-25T08:30:50Z" + settings: + account_sid: ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + censor_logs: true + type: twilio + type: twilio + name: twilio-prod + permissions: + resource_id: "integration-account:twilio:953a0060-81ec-4221-aed4-d4733b59cd96" + user_can_edit: true + id: 953a0060-81ec-4221-aed4-d4733b59cd96 + type: integration-account + schema: + $ref: "#/components/schemas/IntegrationAccountResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get an integration account + tags: + - Integration Accounts + x-unstable: |- + **Note**: This endpoint is in public beta. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + patch: + description: >- + Update an integration account. The update is a partial merge: only the fields provided are changed, so a name-only or settings-only update does not need to resend the full integration payload or write-only credentials. When present, `type` selects the integration/interface variant. Top-level attributes and the contents of `authentication` and `settings` are merged one level deep; the `dataflows` array is merged by `id`. + operationId: UpdateIntegrationAccount + parameters: + - $ref: "#/components/parameters/IntegrationAccountIntegrationIdParameter" + - $ref: "#/components/parameters/IntegrationAccountInterfaceIdParameter" + - $ref: "#/components/parameters/IntegrationAccountIdParameter" + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/IntegrationAccountUpdateRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + integration: + interface: + authentication: + api_key: SKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + type: basic + dataflows: + - enabled: true + id: twilio-messages-logs + status: + health: DATAFLOW_HEALTH_OK + updated_at: "2026-06-25T08:30:50Z" + settings: + account_sid: ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + censor_logs: true + type: twilio + type: twilio + name: twilio-prod + permissions: + resource_id: "integration-account:twilio:953a0060-81ec-4221-aed4-d4733b59cd96" + user_can_edit: true + id: 953a0060-81ec-4221-aed4-d4733b59cd96 + type: integration-account + schema: + $ref: "#/components/schemas/IntegrationAccountResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Update an integration account + tags: + - Integration Accounts + x-codegen-request-body-name: body + x-unstable: |- + **Note**: This endpoint is in public beta. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/ip_allowlist: get: description: Returns the IP allowlist and its enabled or disabled state. @@ -204600,6 +205565,9 @@ tags: name: Identity Providers - 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: >- + Manage accounts for Datadog integrations served by the Account Management Service (AMS). The account payload is strongly typed per integration and interface. + 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/CreateIntegrationAccount.rb b/examples/v2/integration-accounts/CreateIntegrationAccount.rb new file mode 100644 index 000000000000..1259ccc8d94f --- /dev/null +++ b/examples/v2/integration-accounts/CreateIntegrationAccount.rb @@ -0,0 +1,38 @@ +# Create an integration account returns "Created" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.create_integration_account".to_sym] = true +end +api_instance = DatadogAPIClient::V2::IntegrationAccountsAPI.new + +body = DatadogAPIClient::V2::IntegrationAccountRequest.new({ + data: DatadogAPIClient::V2::IntegrationAccountCreateData.new({ + attributes: DatadogAPIClient::V2::IntegrationAccountAttributes.new({ + integration: DatadogAPIClient::V2::TwilioIntegration.new({ + interface: DatadogAPIClient::V2::TwilioInterface.new({ + authentication: DatadogAPIClient::V2::TwilioBasicAuth.new({ + api_key: "SKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + api_key_token: "your-api-key-secret", + type: DatadogAPIClient::V2::TwilioBasicAuthType::BASIC, + }), + dataflows: [ + DatadogAPIClient::V2::TwilioDataflow.new({ + enabled: true, + id: DatadogAPIClient::V2::TwilioDataflowId::MESSAGES_LOGS, + }), + ], + settings: DatadogAPIClient::V2::TwilioSettings.new({ + account_sid: "ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + censor_logs: true, + }), + type: DatadogAPIClient::V2::TwilioInterfaceType::TWILIO, + }), + type: DatadogAPIClient::V2::TwilioIntegrationType::TWILIO, + }), + name: "twilio-prod", + }), + type: DatadogAPIClient::V2::IntegrationAccountType::INTEGRATION_ACCOUNT, + }), +}) +p api_instance.create_integration_account(IntegrationAccountIntegrationId::TWILIO, IntegrationAccountInterfaceId::TWILIO, body) diff --git a/examples/v2/integration-accounts/DeleteIntegrationAccount.rb b/examples/v2/integration-accounts/DeleteIntegrationAccount.rb new file mode 100644 index 000000000000..e48dd25d25ac --- /dev/null +++ b/examples/v2/integration-accounts/DeleteIntegrationAccount.rb @@ -0,0 +1,8 @@ +# Delete an integration account returns "No Content" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.delete_integration_account".to_sym] = true +end +api_instance = DatadogAPIClient::V2::IntegrationAccountsAPI.new +api_instance.delete_integration_account(IntegrationAccountIntegrationId::TWILIO, IntegrationAccountInterfaceId::TWILIO, "account_id") diff --git a/examples/v2/integration-accounts/GetIntegrationAccount.rb b/examples/v2/integration-accounts/GetIntegrationAccount.rb new file mode 100644 index 000000000000..790d19550c3c --- /dev/null +++ b/examples/v2/integration-accounts/GetIntegrationAccount.rb @@ -0,0 +1,8 @@ +# Get an integration account returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_integration_account".to_sym] = true +end +api_instance = DatadogAPIClient::V2::IntegrationAccountsAPI.new +p api_instance.get_integration_account(IntegrationAccountIntegrationId::TWILIO, IntegrationAccountInterfaceId::TWILIO, "account_id") diff --git a/examples/v2/integration-accounts/ListIntegrationAccounts.rb b/examples/v2/integration-accounts/ListIntegrationAccounts.rb new file mode 100644 index 000000000000..f9d9abcf3974 --- /dev/null +++ b/examples/v2/integration-accounts/ListIntegrationAccounts.rb @@ -0,0 +1,8 @@ +# List integration accounts returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_integration_accounts".to_sym] = true +end +api_instance = DatadogAPIClient::V2::IntegrationAccountsAPI.new +p api_instance.list_integration_accounts(IntegrationAccountIntegrationId::TWILIO, IntegrationAccountInterfaceId::TWILIO) diff --git a/examples/v2/integration-accounts/UpdateIntegrationAccount.rb b/examples/v2/integration-accounts/UpdateIntegrationAccount.rb new file mode 100644 index 000000000000..9a3340457b7b --- /dev/null +++ b/examples/v2/integration-accounts/UpdateIntegrationAccount.rb @@ -0,0 +1,38 @@ +# Update an integration account returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.update_integration_account".to_sym] = true +end +api_instance = DatadogAPIClient::V2::IntegrationAccountsAPI.new + +body = DatadogAPIClient::V2::IntegrationAccountUpdateRequest.new({ + data: DatadogAPIClient::V2::IntegrationAccountUpdateData.new({ + attributes: DatadogAPIClient::V2::IntegrationAccountUpdateAttributes.new({ + integration: DatadogAPIClient::V2::TwilioIntegrationUpdate.new({ + interface: DatadogAPIClient::V2::TwilioInterfaceUpdate.new({ + authentication: DatadogAPIClient::V2::TwilioBasicAuth.new({ + api_key: "SKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + api_key_token: "your-api-key-secret", + type: DatadogAPIClient::V2::TwilioBasicAuthType::BASIC, + }), + dataflows: [ + DatadogAPIClient::V2::TwilioDataflow.new({ + enabled: true, + id: DatadogAPIClient::V2::TwilioDataflowId::MESSAGES_LOGS, + }), + ], + settings: DatadogAPIClient::V2::TwilioSettingsUpdate.new({ + account_sid: "ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + censor_logs: true, + }), + type: DatadogAPIClient::V2::TwilioInterfaceType::TWILIO, + }), + type: DatadogAPIClient::V2::TwilioIntegrationType::TWILIO, + }), + name: "twilio-prod", + }), + type: DatadogAPIClient::V2::IntegrationAccountType::INTEGRATION_ACCOUNT, + }), +}) +p api_instance.update_integration_account(IntegrationAccountIntegrationId::TWILIO, IntegrationAccountInterfaceId::TWILIO, "account_id", body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 578f92989d3e..a1156a6fab67 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -4100,6 +4100,31 @@ "account_id" => "String", "body" => "OktaAccountUpdateRequest", }, + "v2.ListIntegrationAccounts" => { + "integration_id" => "IntegrationAccountIntegrationId", + "interface_id" => "IntegrationAccountInterfaceId", + }, + "v2.CreateIntegrationAccount" => { + "integration_id" => "IntegrationAccountIntegrationId", + "interface_id" => "IntegrationAccountInterfaceId", + "body" => "IntegrationAccountRequest", + }, + "v2.DeleteIntegrationAccount" => { + "integration_id" => "IntegrationAccountIntegrationId", + "interface_id" => "IntegrationAccountInterfaceId", + "account_id" => "String", + }, + "v2.GetIntegrationAccount" => { + "integration_id" => "IntegrationAccountIntegrationId", + "interface_id" => "IntegrationAccountInterfaceId", + "account_id" => "String", + }, + "v2.UpdateIntegrationAccount" => { + "integration_id" => "IntegrationAccountIntegrationId", + "interface_id" => "IntegrationAccountInterfaceId", + "account_id" => "String", + "body" => "IntegrationAccountUpdateRequest", + }, "v2.UpdateIPAllowlist" => { "body" => "IPAllowlistUpdateRequest", }, diff --git a/features/v2/integration_accounts.feature b/features/v2/integration_accounts.feature new file mode 100644 index 000000000000..74b2a1f78a2c --- /dev/null +++ b/features/v2/integration_accounts.feature @@ -0,0 +1,160 @@ +@endpoint(integration-accounts) @endpoint(integration-accounts-v2) +Feature: Integration Accounts + Manage accounts for Datadog integrations served by the Account Management + Service (AMS). The account payload is strongly typed per integration and + interface. + + 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 an integration account returns "Bad Request" response + Given operation "CreateIntegrationAccount" enabled + And new "CreateIntegrationAccount" request + And request contains "integration_id" parameter from "REPLACE.ME" + And request contains "interface_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"integration": {"interface": {"authentication": {"api_key": "SKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "api_key_token": "your-api-key-secret", "type": "basic"}, "dataflows": [{"enabled": true, "id": "twilio-messages-logs"}], "settings": {"account_sid": "ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "censor_logs": true}, "type": "twilio"}, "type": "twilio"}, "name": "twilio-prod"}, "type": "integration-account"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/saas-integrations + Scenario: Create an integration account returns "Created" response + Given operation "CreateIntegrationAccount" enabled + And new "CreateIntegrationAccount" request + And request contains "integration_id" parameter from "REPLACE.ME" + And request contains "interface_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"integration": {"interface": {"authentication": {"api_key": "SKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "api_key_token": "your-api-key-secret", "type": "basic"}, "dataflows": [{"enabled": true, "id": "twilio-messages-logs"}], "settings": {"account_sid": "ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "censor_logs": true}, "type": "twilio"}, "type": "twilio"}, "name": "twilio-prod"}, "type": "integration-account"}} + When the request is sent + Then the response status is 201 Created + + @generated @skip @team:DataDog/saas-integrations + Scenario: Create an integration account returns "Not Found" response + Given operation "CreateIntegrationAccount" enabled + And new "CreateIntegrationAccount" request + And request contains "integration_id" parameter from "REPLACE.ME" + And request contains "interface_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"integration": {"interface": {"authentication": {"api_key": "SKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "api_key_token": "your-api-key-secret", "type": "basic"}, "dataflows": [{"enabled": true, "id": "twilio-messages-logs"}], "settings": {"account_sid": "ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "censor_logs": true}, "type": "twilio"}, "type": "twilio"}, "name": "twilio-prod"}, "type": "integration-account"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/saas-integrations + Scenario: Delete an integration account returns "Bad Request" response + Given operation "DeleteIntegrationAccount" enabled + And new "DeleteIntegrationAccount" request + And request contains "integration_id" 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 + + @generated @skip @team:DataDog/saas-integrations + Scenario: Delete an integration account returns "No Content" response + Given operation "DeleteIntegrationAccount" enabled + And new "DeleteIntegrationAccount" request + And request contains "integration_id" 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 204 No Content + + @generated @skip @team:DataDog/saas-integrations + Scenario: Delete an integration account returns "Not Found" response + Given operation "DeleteIntegrationAccount" enabled + And new "DeleteIntegrationAccount" request + And request contains "integration_id" 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 + + @generated @skip @team:DataDog/saas-integrations + Scenario: Get an integration account returns "Bad Request" response + Given operation "GetIntegrationAccount" enabled + And new "GetIntegrationAccount" request + And request contains "integration_id" 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 + + @generated @skip @team:DataDog/saas-integrations + Scenario: Get an integration account returns "Not Found" response + Given operation "GetIntegrationAccount" enabled + And new "GetIntegrationAccount" request + And request contains "integration_id" 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 + + @generated @skip @team:DataDog/saas-integrations + Scenario: Get an integration account returns "OK" response + Given operation "GetIntegrationAccount" enabled + And new "GetIntegrationAccount" request + And request contains "integration_id" 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 + + @generated @skip @team:DataDog/saas-integrations + Scenario: List integration accounts returns "Bad Request" response + Given operation "ListIntegrationAccounts" enabled + And new "ListIntegrationAccounts" request + And request contains "integration_id" 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 + + @generated @skip @team:DataDog/saas-integrations + Scenario: List integration accounts returns "Not Found" response + Given operation "ListIntegrationAccounts" enabled + And new "ListIntegrationAccounts" request + And request contains "integration_id" 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 + + @generated @skip @team:DataDog/saas-integrations + Scenario: List integration accounts returns "OK" response + Given operation "ListIntegrationAccounts" enabled + And new "ListIntegrationAccounts" request + And request contains "integration_id" 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 + + @generated @skip @team:DataDog/saas-integrations + Scenario: Update an integration account returns "Bad Request" response + Given operation "UpdateIntegrationAccount" enabled + And new "UpdateIntegrationAccount" request + And request contains "integration_id" 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": {"integration": {"interface": {"authentication": {"api_key": "SKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "api_key_token": "your-api-key-secret", "type": "basic"}, "dataflows": [{"enabled": true, "id": "twilio-messages-logs"}], "settings": {"account_sid": "ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "censor_logs": true}, "type": "twilio"}, "type": "twilio"}, "name": "twilio-prod"}, "type": "integration-account"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/saas-integrations + Scenario: Update an integration account returns "Not Found" response + Given operation "UpdateIntegrationAccount" enabled + And new "UpdateIntegrationAccount" request + And request contains "integration_id" 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": {"integration": {"interface": {"authentication": {"api_key": "SKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "api_key_token": "your-api-key-secret", "type": "basic"}, "dataflows": [{"enabled": true, "id": "twilio-messages-logs"}], "settings": {"account_sid": "ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "censor_logs": true}, "type": "twilio"}, "type": "twilio"}, "name": "twilio-prod"}, "type": "integration-account"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/saas-integrations + Scenario: Update an integration account returns "OK" response + Given operation "UpdateIntegrationAccount" enabled + And new "UpdateIntegrationAccount" request + And request contains "integration_id" 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": {"integration": {"interface": {"authentication": {"api_key": "SKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "api_key_token": "your-api-key-secret", "type": "basic"}, "dataflows": [{"enabled": true, "id": "twilio-messages-logs"}], "settings": {"account_sid": "ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "censor_logs": true}, "type": "twilio"}, "type": "twilio"}, "name": "twilio-prod"}, "type": "integration-account"}} + When the request is sent + Then the response status is 200 OK diff --git a/features/v2/undo.json b/features/v2/undo.json index 2a7fb64a0a90..58a5a074cb5b 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -4349,6 +4349,51 @@ "type": "idempotent" } }, + "ListIntegrationAccounts": { + "tag": "Integration Accounts", + "undo": { + "type": "safe" + } + }, + "CreateIntegrationAccount": { + "tag": "Integration Accounts", + "undo": { + "operationId": "DeleteIntegrationAccount", + "parameters": [ + { + "name": "integration_id", + "source": "integration_id" + }, + { + "name": "interface_id", + "source": "interface_id" + }, + { + "name": "account_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "DeleteIntegrationAccount": { + "tag": "Integration Accounts", + "undo": { + "type": "idempotent" + } + }, + "GetIntegrationAccount": { + "tag": "Integration Accounts", + "undo": { + "type": "safe" + } + }, + "UpdateIntegrationAccount": { + "tag": "Integration Accounts", + "undo": { + "type": "idempotent" + } + }, "GetIPAllowlist": { "tag": "IP Allowlist", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index 9d1245a1250d..323aee812ace 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -432,8 +432,6 @@ def initialize "v2.get_all_datasets": false, "v2.get_dataset": false, "v2.update_dataset": false, - "v2.execute_ddsql_tabular_query": false, - "v2.fetch_ddsql_tabular_query": false, "v2.cancel_data_deletion_request": false, "v2.create_data_deletion_request": false, "v2.get_data_deletion_requests": false, @@ -543,6 +541,11 @@ def initialize "v2.update_jira_issue_template": false, "v2.create_tenancy_config": false, "v2.get_tenancy_configs": false, + "v2.create_integration_account": false, + "v2.delete_integration_account": false, + "v2.get_integration_account": false, + "v2.list_integration_accounts": false, + "v2.update_integration_account": false, "v2.add_role_to_restriction_query": false, "v2.create_restriction_query": false, "v2.delete_restriction_query": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index b82d66d48920..bc558996e70c 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -3075,6 +3075,31 @@ def overrides "v2.due_date_rule_type" => "DueDateRuleType", "v2.due_date_rule_update_request" => "DueDateRuleUpdateRequest", "v2.due_date_severity" => "DueDateSeverity", + "v2.elastic_cloud_authentication" => "ElasticCloudAuthentication", + "v2.elastic_cloud_basic_auth" => "ElasticCloudBasicAuth", + "v2.elastic_cloud_basic_auth_type" => "ElasticCloudBasicAuthType", + "v2.elastic_cloud_ccm_authentication" => "ElasticCloudCcmAuthentication", + "v2.elastic_cloud_ccm_dataflow" => "ElasticCloudCcmDataflow", + "v2.elastic_cloud_ccm_dataflow_id" => "ElasticCloudCcmDataflowId", + "v2.elastic_cloud_ccm_interface" => "ElasticCloudCcmInterface", + "v2.elastic_cloud_ccm_interface_type" => "ElasticCloudCcmInterfaceType", + "v2.elastic_cloud_ccm_interface_update" => "ElasticCloudCcmInterfaceUpdate", + "v2.elastic_cloud_ccm_settings" => "ElasticCloudCcmSettings", + "v2.elastic_cloud_ccm_settings_update" => "ElasticCloudCcmSettingsUpdate", + "v2.elastic_cloud_ccm_token_auth" => "ElasticCloudCcmTokenAuth", + "v2.elastic_cloud_ccm_token_auth_type" => "ElasticCloudCcmTokenAuthType", + "v2.elastic_cloud_dataflow" => "ElasticCloudDataflow", + "v2.elastic_cloud_dataflow_id" => "ElasticCloudDataflowId", + "v2.elastic_cloud_integration" => "ElasticCloudIntegration", + "v2.elastic_cloud_integration_type" => "ElasticCloudIntegrationType", + "v2.elastic_cloud_integration_update" => "ElasticCloudIntegrationUpdate", + "v2.elastic_cloud_interface" => "ElasticCloudInterface", + "v2.elastic_cloud_interface_update" => "ElasticCloudInterfaceUpdate", + "v2.elastic_cloud_monitoring_interface" => "ElasticCloudMonitoringInterface", + "v2.elastic_cloud_monitoring_interface_type" => "ElasticCloudMonitoringInterfaceType", + "v2.elastic_cloud_monitoring_interface_update" => "ElasticCloudMonitoringInterfaceUpdate", + "v2.elastic_cloud_settings" => "ElasticCloudSettings", + "v2.elastic_cloud_settings_update" => "ElasticCloudSettingsUpdate", "v2.elf_sourcemap_attributes" => "ELFSourcemapAttributes", "v2.elf_sourcemap_data" => "ELFSourcemapData", "v2.entity_attributes" => "EntityAttributes", @@ -3962,6 +3987,23 @@ def overrides "v2.input_schema_parameters_type" => "InputSchemaParametersType", "v2.intake_payload_accepted" => "IntakePayloadAccepted", "v2.integration" => "Integration", + "v2.integration_account_attributes" => "IntegrationAccountAttributes", + "v2.integration_account_create_data" => "IntegrationAccountCreateData", + "v2.integration_account_data" => "IntegrationAccountData", + "v2.integration_account_dataflow_health" => "IntegrationAccountDataflowHealth", + "v2.integration_account_dataflow_status" => "IntegrationAccountDataflowStatus", + "v2.integration_account_integration" => "IntegrationAccountIntegration", + "v2.integration_account_integration_id" => "IntegrationAccountIntegrationId", + "v2.integration_account_integration_update" => "IntegrationAccountIntegrationUpdate", + "v2.integration_account_interface_id" => "IntegrationAccountInterfaceId", + "v2.integration_account_permissions" => "IntegrationAccountPermissions", + "v2.integration_account_request" => "IntegrationAccountRequest", + "v2.integration_account_response" => "IntegrationAccountResponse", + "v2.integration_accounts_response" => "IntegrationAccountsResponse", + "v2.integration_account_type" => "IntegrationAccountType", + "v2.integration_account_update_attributes" => "IntegrationAccountUpdateAttributes", + "v2.integration_account_update_data" => "IntegrationAccountUpdateData", + "v2.integration_account_update_request" => "IntegrationAccountUpdateRequest", "v2.integration_attributes" => "IntegrationAttributes", "v2.integration_incident" => "IntegrationIncident", "v2.integration_incident_field_mappings_items" => "IntegrationIncidentFieldMappingsItems", @@ -7823,6 +7865,19 @@ def overrides "v2.trigger_type" => "TriggerType", "v2.trigger_workflow_automation_action" => "TriggerWorkflowAutomationAction", "v2.trigger_workflow_automation_action_type" => "TriggerWorkflowAutomationActionType", + "v2.twilio_authentication" => "TwilioAuthentication", + "v2.twilio_basic_auth" => "TwilioBasicAuth", + "v2.twilio_basic_auth_type" => "TwilioBasicAuthType", + "v2.twilio_dataflow" => "TwilioDataflow", + "v2.twilio_dataflow_id" => "TwilioDataflowId", + "v2.twilio_integration" => "TwilioIntegration", + "v2.twilio_integration_type" => "TwilioIntegrationType", + "v2.twilio_integration_update" => "TwilioIntegrationUpdate", + "v2.twilio_interface" => "TwilioInterface", + "v2.twilio_interface_type" => "TwilioInterfaceType", + "v2.twilio_interface_update" => "TwilioInterfaceUpdate", + "v2.twilio_settings" => "TwilioSettings", + "v2.twilio_settings_update" => "TwilioSettingsUpdate", "v2.uc_config_pair" => "UCConfigPair", "v2.uc_config_pair_data" => "UCConfigPairData", "v2.uc_config_pair_data_attributes" => "UCConfigPairDataAttributes", @@ -8270,6 +8325,7 @@ def overrides "v2.high_availability_multi_region_api" => "HighAvailabilityMultiRegionAPI", "v2.identity_providers_api" => "IdentityProvidersAPI", "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/ddsql_api.rb b/lib/datadog_api_client/v2/api/ddsql_api.rb index fbe77f4c1ddd..990ca327857d 100644 --- a/lib/datadog_api_client/v2/api/ddsql_api.rb +++ b/lib/datadog_api_client/v2/api/ddsql_api.rb @@ -41,12 +41,6 @@ def execute_ddsql_tabular_query(body, opts = {}) # @param opts [Hash] the optional parameters # @return [Array<(DdsqlTabularQueryResponse, Integer, Hash)>] DdsqlTabularQueryResponse data, response status code and response headers def execute_ddsql_tabular_query_with_http_info(body, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.execute_ddsql_tabular_query".to_sym] - if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.execute_ddsql_tabular_query") - else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.execute_ddsql_tabular_query")) - end if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DDSQLAPI.execute_ddsql_tabular_query ...' @@ -117,12 +111,6 @@ def fetch_ddsql_tabular_query(body, opts = {}) # @param opts [Hash] the optional parameters # @return [Array<(DdsqlTabularQueryResponse, Integer, Hash)>] DdsqlTabularQueryResponse data, response status code and response headers def fetch_ddsql_tabular_query_with_http_info(body, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.fetch_ddsql_tabular_query".to_sym] - if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.fetch_ddsql_tabular_query") - else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.fetch_ddsql_tabular_query")) - end if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DDSQLAPI.fetch_ddsql_tabular_query ...' 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..01b68e4a43aa --- /dev/null +++ b/lib/datadog_api_client/v2/api/integration_accounts_api.rb @@ -0,0 +1,485 @@ +=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 an integration account. + # + # @see #create_integration_account_with_http_info + def create_integration_account(integration_id, interface_id, body, opts = {}) + data, _status_code, _headers = create_integration_account_with_http_info(integration_id, interface_id, body, opts) + data + end + + # Create an integration account. + # + # Create an integration account for a given integration/interface. + # + # @param integration_id [IntegrationAccountIntegrationId] Grouping/RBAC scope. Selects the integration whose accounts are addressed. + # @param interface_id [IntegrationAccountInterfaceId] Selects the interface (source-type) within the integration. + # @param body [IntegrationAccountRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(IntegrationAccountResponse, Integer, Hash)>] IntegrationAccountResponse data, response status code and response headers + def create_integration_account_with_http_info(integration_id, interface_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_integration_account".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_integration_account") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_integration_account")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IntegrationAccountsAPI.create_integration_account ...' + end + # verify the required parameter 'integration_id' is set + if @api_client.config.client_side_validation && integration_id.nil? + fail ArgumentError, "Missing the required parameter 'integration_id' when calling IntegrationAccountsAPI.create_integration_account" + end + # verify enum value + allowable_values = ['elastic-cloud', 'twilio'] + if @api_client.config.client_side_validation && !allowable_values.include?(integration_id) + fail ArgumentError, "invalid value for \"integration_id\", must be one of #{allowable_values}" + 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_integration_account" + end + # verify enum value + allowable_values = ['elastic-cloud', 'elastic-cloud-ccm', 'twilio'] + if @api_client.config.client_side_validation && !allowable_values.include?(interface_id) + fail ArgumentError, "invalid value for \"interface_id\", must be one of #{allowable_values}" + 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_integration_account" + end + # resource path + local_var_path = '/api/v2/integrations/{integration_id}/interfaces/{interface_id}/accounts'.sub('{integration_id}', CGI.escape(integration_id.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] || 'IntegrationAccountResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :create_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_integration_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Delete an integration account. + # + # @see #delete_integration_account_with_http_info + def delete_integration_account(integration_id, interface_id, account_id, opts = {}) + delete_integration_account_with_http_info(integration_id, interface_id, account_id, opts) + nil + end + + # Delete an integration account. + # + # Delete an integration account. + # + # @param integration_id [IntegrationAccountIntegrationId] Grouping/RBAC scope. Selects the integration whose accounts are addressed. + # @param interface_id [IntegrationAccountInterfaceId] Selects the interface (source-type) within the integration. + # @param account_id [String] Unique identifier of the integration account. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_integration_account_with_http_info(integration_id, interface_id, account_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_integration_account".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_integration_account") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_integration_account")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IntegrationAccountsAPI.delete_integration_account ...' + end + # verify the required parameter 'integration_id' is set + if @api_client.config.client_side_validation && integration_id.nil? + fail ArgumentError, "Missing the required parameter 'integration_id' when calling IntegrationAccountsAPI.delete_integration_account" + end + # verify enum value + allowable_values = ['elastic-cloud', 'twilio'] + if @api_client.config.client_side_validation && !allowable_values.include?(integration_id) + fail ArgumentError, "invalid value for \"integration_id\", must be one of #{allowable_values}" + 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_integration_account" + end + # verify enum value + allowable_values = ['elastic-cloud', 'elastic-cloud-ccm', 'twilio'] + if @api_client.config.client_side_validation && !allowable_values.include?(interface_id) + fail ArgumentError, "invalid value for \"interface_id\", must be one of #{allowable_values}" + 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_integration_account" + end + # resource path + local_var_path = '/api/v2/integrations/{integration_id}/interfaces/{interface_id}/accounts/{account_id}'.sub('{integration_id}', CGI.escape(integration_id.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_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_integration_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get an integration account. + # + # @see #get_integration_account_with_http_info + def get_integration_account(integration_id, interface_id, account_id, opts = {}) + data, _status_code, _headers = get_integration_account_with_http_info(integration_id, interface_id, account_id, opts) + data + end + + # Get an integration account. + # + # Get a single integration account. + # + # @param integration_id [IntegrationAccountIntegrationId] Grouping/RBAC scope. Selects the integration whose accounts are addressed. + # @param interface_id [IntegrationAccountInterfaceId] Selects the interface (source-type) within the integration. + # @param account_id [String] Unique identifier of the integration account. + # @param opts [Hash] the optional parameters + # @return [Array<(IntegrationAccountResponse, Integer, Hash)>] IntegrationAccountResponse data, response status code and response headers + def get_integration_account_with_http_info(integration_id, interface_id, account_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_integration_account".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_integration_account") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_integration_account")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IntegrationAccountsAPI.get_integration_account ...' + end + # verify the required parameter 'integration_id' is set + if @api_client.config.client_side_validation && integration_id.nil? + fail ArgumentError, "Missing the required parameter 'integration_id' when calling IntegrationAccountsAPI.get_integration_account" + end + # verify enum value + allowable_values = ['elastic-cloud', 'twilio'] + if @api_client.config.client_side_validation && !allowable_values.include?(integration_id) + fail ArgumentError, "invalid value for \"integration_id\", must be one of #{allowable_values}" + 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_integration_account" + end + # verify enum value + allowable_values = ['elastic-cloud', 'elastic-cloud-ccm', 'twilio'] + if @api_client.config.client_side_validation && !allowable_values.include?(interface_id) + fail ArgumentError, "invalid value for \"interface_id\", must be one of #{allowable_values}" + 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_integration_account" + end + # resource path + local_var_path = '/api/v2/integrations/{integration_id}/interfaces/{interface_id}/accounts/{account_id}'.sub('{integration_id}', CGI.escape(integration_id.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] || 'IntegrationAccountResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_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_integration_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List integration accounts. + # + # @see #list_integration_accounts_with_http_info + def list_integration_accounts(integration_id, interface_id, opts = {}) + data, _status_code, _headers = list_integration_accounts_with_http_info(integration_id, interface_id, opts) + data + end + + # List integration accounts. + # + # List the integration accounts for a given integration/interface. + # + # @param integration_id [IntegrationAccountIntegrationId] Grouping/RBAC scope. Selects the integration whose accounts are addressed. + # @param interface_id [IntegrationAccountInterfaceId] Selects the interface (source-type) within the integration. + # @param opts [Hash] the optional parameters + # @return [Array<(IntegrationAccountsResponse, Integer, Hash)>] IntegrationAccountsResponse data, response status code and response headers + def list_integration_accounts_with_http_info(integration_id, interface_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_integration_accounts".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_integration_accounts") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_integration_accounts")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IntegrationAccountsAPI.list_integration_accounts ...' + end + # verify the required parameter 'integration_id' is set + if @api_client.config.client_side_validation && integration_id.nil? + fail ArgumentError, "Missing the required parameter 'integration_id' when calling IntegrationAccountsAPI.list_integration_accounts" + end + # verify enum value + allowable_values = ['elastic-cloud', 'twilio'] + if @api_client.config.client_side_validation && !allowable_values.include?(integration_id) + fail ArgumentError, "invalid value for \"integration_id\", must be one of #{allowable_values}" + 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_integration_accounts" + end + # verify enum value + allowable_values = ['elastic-cloud', 'elastic-cloud-ccm', 'twilio'] + if @api_client.config.client_side_validation && !allowable_values.include?(interface_id) + fail ArgumentError, "invalid value for \"interface_id\", must be one of #{allowable_values}" + end + # resource path + local_var_path = '/api/v2/integrations/{integration_id}/interfaces/{interface_id}/accounts'.sub('{integration_id}', CGI.escape(integration_id.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] || 'IntegrationAccountsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_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_integration_accounts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update an integration account. + # + # @see #update_integration_account_with_http_info + def update_integration_account(integration_id, interface_id, account_id, body, opts = {}) + data, _status_code, _headers = update_integration_account_with_http_info(integration_id, interface_id, account_id, body, opts) + data + end + + # Update an integration account. + # + # Update an integration account. The update is a partial merge: only the fields provided are changed, so a name-only or settings-only update does not need to resend the full integration payload or write-only credentials. When present, `type` selects the integration/interface variant. Top-level attributes and the contents of `authentication` and `settings` are merged one level deep; the `dataflows` array is merged by `id`. + # + # @param integration_id [IntegrationAccountIntegrationId] Grouping/RBAC scope. Selects the integration whose accounts are addressed. + # @param interface_id [IntegrationAccountInterfaceId] Selects the interface (source-type) within the integration. + # @param account_id [String] Unique identifier of the integration account. + # @param body [IntegrationAccountUpdateRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(IntegrationAccountResponse, Integer, Hash)>] IntegrationAccountResponse data, response status code and response headers + def update_integration_account_with_http_info(integration_id, interface_id, account_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.update_integration_account".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_integration_account") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_integration_account")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IntegrationAccountsAPI.update_integration_account ...' + end + # verify the required parameter 'integration_id' is set + if @api_client.config.client_side_validation && integration_id.nil? + fail ArgumentError, "Missing the required parameter 'integration_id' when calling IntegrationAccountsAPI.update_integration_account" + end + # verify enum value + allowable_values = ['elastic-cloud', 'twilio'] + if @api_client.config.client_side_validation && !allowable_values.include?(integration_id) + fail ArgumentError, "invalid value for \"integration_id\", must be one of #{allowable_values}" + 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_integration_account" + end + # verify enum value + allowable_values = ['elastic-cloud', 'elastic-cloud-ccm', 'twilio'] + if @api_client.config.client_side_validation && !allowable_values.include?(interface_id) + fail ArgumentError, "invalid value for \"interface_id\", must be one of #{allowable_values}" + 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_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_integration_account" + end + # resource path + local_var_path = '/api/v2/integrations/{integration_id}/interfaces/{interface_id}/accounts/{account_id}'.sub('{integration_id}', CGI.escape(integration_id.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] || 'IntegrationAccountResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :update_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_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/ddsql_tabular_query_column.rb b/lib/datadog_api_client/v2/models/ddsql_tabular_query_column.rb index 2fc6d124f076..d31aae87df29 100644 --- a/lib/datadog_api_client/v2/models/ddsql_tabular_query_column.rb +++ b/lib/datadog_api_client/v2/models/ddsql_tabular_query_column.rb @@ -31,9 +31,17 @@ class DdsqlTabularQueryColumn # for the full, up-to-date list. attr_reader :type - # Column values in row order. The element type matches the column's `type`; - # for example a `VARCHAR` column carries strings, a `TIMESTAMP` column carries - # Unix-millisecond integers. `null` is allowed for missing values. + # Column values in row order, one entry per result row. The element type + # follows the column's `type`. The following serialization rules should be + # taken into account: + # + # - `BIGINT` values are encoded as JSON numbers in the signed 64-bit integer range. + # - `DECIMAL` values are encoded as JSON numbers with 64-bit double precision. + # - `TIMESTAMP` and `DATE` values are encoded as Unix-millisecond integers; a + # `DATE` resolves to midnight UTC. + # - `JSON` values are returned as a JSON-encoded string. + # + # `null` is allowed for any column type where a value is missing. attr_reader :values attr_accessor :additional_properties diff --git a/lib/datadog_api_client/v2/models/elastic_cloud_authentication.rb b/lib/datadog_api_client/v2/models/elastic_cloud_authentication.rb new file mode 100644 index 000000000000..42f9f9280ac0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/elastic_cloud_authentication.rb @@ -0,0 +1,62 @@ +=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 + # Authentication methods supported by the Elastic Cloud interface. Exactly one is set, selected by its `type`. + module ElasticCloudAuthentication + class << self + include BaseOneOfModel + include BaseOneOfModelNoDiscriminator + + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'ElasticCloudBasicAuth' + ] + end + # Builds the object + # @param data [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass, data) + next if typed_data.respond_to?(:_unparsed) && typed_data._unparsed + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + if openapi_one_of.include?(:AnyType) + data + else + self._unparsed = true + DatadogAPIClient::UnparsedObject.new(data) + end + end + end + end +end diff --git a/lib/datadog_api_client/v2/models/elastic_cloud_basic_auth.rb b/lib/datadog_api_client/v2/models/elastic_cloud_basic_auth.rb new file mode 100644 index 000000000000..6cbfd78d76f8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/elastic_cloud_basic_auth.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 + # Username & password authentication for Elastic Cloud. + class ElasticCloudBasicAuth + include BaseGenericModel + + # Password used to authenticate against the deployment. + attr_reader :password + + # Authentication method discriminator. + attr_reader :type + + # Username used to authenticate against the deployment. + attr_reader :username + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'password' => :'password', + :'type' => :'type', + :'username' => :'username' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'password' => :'String', + :'type' => :'ElasticCloudBasicAuthType', + :'username' => :'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::ElasticCloudBasicAuth` 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?(:'password') + self.password = attributes[:'password'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'username') + self.username = attributes[:'username'] + 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 @password.nil? + return false if @type.nil? + return false if @username.nil? + true + end + + # Custom attribute writer method with validation + # @param password [Object] Object to be assigned + # @!visibility private + def password=(password) + if password.nil? + fail ArgumentError, 'invalid value for "password", password cannot be nil.' + end + @password = password + 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 + + # Custom attribute writer method with validation + # @param username [Object] Object to be assigned + # @!visibility private + def username=(username) + if username.nil? + fail ArgumentError, 'invalid value for "username", username cannot be nil.' + end + @username = username + 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 && + password == o.password && + type == o.type && + username == o.username && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [password, type, username, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/elastic_cloud_basic_auth_type.rb b/lib/datadog_api_client/v2/models/elastic_cloud_basic_auth_type.rb new file mode 100644 index 000000000000..dedf842452b3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/elastic_cloud_basic_auth_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 + # Authentication method discriminator. + class ElasticCloudBasicAuthType + include BaseEnumModel + + BASIC = "basic".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/elastic_cloud_ccm_authentication.rb b/lib/datadog_api_client/v2/models/elastic_cloud_ccm_authentication.rb new file mode 100644 index 000000000000..66bc1e0ce7cf --- /dev/null +++ b/lib/datadog_api_client/v2/models/elastic_cloud_ccm_authentication.rb @@ -0,0 +1,62 @@ +=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 + # Authentication methods supported by the Elastic Cloud CCM interface. Exactly one is set, selected by its `type`. + module ElasticCloudCcmAuthentication + class << self + include BaseOneOfModel + include BaseOneOfModelNoDiscriminator + + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'ElasticCloudCcmTokenAuth' + ] + end + # Builds the object + # @param data [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass, data) + next if typed_data.respond_to?(:_unparsed) && typed_data._unparsed + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + if openapi_one_of.include?(:AnyType) + data + else + self._unparsed = true + DatadogAPIClient::UnparsedObject.new(data) + end + end + end + end +end diff --git a/lib/datadog_api_client/v2/models/elastic_cloud_ccm_dataflow.rb b/lib/datadog_api_client/v2/models/elastic_cloud_ccm_dataflow.rb new file mode 100644 index 000000000000..ae41a31ebb27 --- /dev/null +++ b/lib/datadog_api_client/v2/models/elastic_cloud_ccm_dataflow.rb @@ -0,0 +1,143 @@ +=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 + # An Elastic Cloud CCM dataflow toggle. The set of dataflow ids is fixed by the interface schema. + class ElasticCloudCcmDataflow + include BaseGenericModel + + # Whether the dataflow is enabled. + attr_accessor :enabled + + # Identifier of an Elastic Cloud CCM dataflow. + attr_reader :id + + # Read-only, server-computed collection status of a dataflow. + attr_accessor :status + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'enabled' => :'enabled', + :'id' => :'id', + :'status' => :'status' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'enabled' => :'Boolean', + :'id' => :'ElasticCloudCcmDataflowId', + :'status' => :'IntegrationAccountDataflowStatus' + } + 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::ElasticCloudCcmDataflow` 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?(:'enabled') + self.enabled = attributes[:'enabled'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + 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 @id.nil? + true + 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 + + # 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 && + enabled == o.enabled && + id == o.id && + status == o.status && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [enabled, id, status, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/elastic_cloud_ccm_dataflow_id.rb b/lib/datadog_api_client/v2/models/elastic_cloud_ccm_dataflow_id.rb new file mode 100644 index 000000000000..9040e284420d --- /dev/null +++ b/lib/datadog_api_client/v2/models/elastic_cloud_ccm_dataflow_id.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 + # Identifier of an Elastic Cloud CCM dataflow. + class ElasticCloudCcmDataflowId + include BaseEnumModel + + COST_DATA = "elastic-cloud-cost-data".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/elastic_cloud_ccm_interface.rb b/lib/datadog_api_client/v2/models/elastic_cloud_ccm_interface.rb new file mode 100644 index 000000000000..b34a623e8e60 --- /dev/null +++ b/lib/datadog_api_client/v2/models/elastic_cloud_ccm_interface.rb @@ -0,0 +1,166 @@ +=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 + # Elastic Cloud CCM (Cloud Cost Management) interface configuration. + class ElasticCloudCcmInterface + include BaseGenericModel + + # Authentication methods supported by the Elastic Cloud CCM interface. Exactly one is set, selected by its `type`. + attr_reader :authentication + + # Dataflows for the Elastic Cloud CCM interface. + attr_accessor :dataflows + + # Elastic Cloud CCM interface settings. + attr_accessor :settings + + # Interface discriminator for the Elastic Cloud CCM interface. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'authentication' => :'authentication', + :'dataflows' => :'dataflows', + :'settings' => :'settings', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'authentication' => :'ElasticCloudCcmAuthentication', + :'dataflows' => :'Array', + :'settings' => :'ElasticCloudCcmSettings', + :'type' => :'ElasticCloudCcmInterfaceType' + } + 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::ElasticCloudCcmInterface` 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?(:'authentication') + self.authentication = attributes[:'authentication'] + end + + if attributes.key?(:'dataflows') + if (value = attributes[:'dataflows']).is_a?(Array) + self.dataflows = value + end + end + + if attributes.key?(:'settings') + self.settings = attributes[:'settings'] + 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 @authentication.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param authentication [Object] Object to be assigned + # @!visibility private + def authentication=(authentication) + if authentication.nil? + fail ArgumentError, 'invalid value for "authentication", authentication cannot be nil.' + end + @authentication = authentication + 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 && + authentication == o.authentication && + dataflows == o.dataflows && + settings == o.settings && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [authentication, dataflows, settings, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/elastic_cloud_ccm_interface_type.rb b/lib/datadog_api_client/v2/models/elastic_cloud_ccm_interface_type.rb new file mode 100644 index 000000000000..6121e44566cf --- /dev/null +++ b/lib/datadog_api_client/v2/models/elastic_cloud_ccm_interface_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 + # Interface discriminator for the Elastic Cloud CCM interface. + class ElasticCloudCcmInterfaceType + include BaseEnumModel + + ELASTIC_CLOUD_CCM = "elastic-cloud-ccm".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/elastic_cloud_ccm_interface_update.rb b/lib/datadog_api_client/v2/models/elastic_cloud_ccm_interface_update.rb new file mode 100644 index 000000000000..8a2771748b15 --- /dev/null +++ b/lib/datadog_api_client/v2/models/elastic_cloud_ccm_interface_update.rb @@ -0,0 +1,155 @@ +=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 + # Partial Elastic Cloud CCM interface for updates. + class ElasticCloudCcmInterfaceUpdate + include BaseGenericModel + + # Authentication methods supported by the Elastic Cloud CCM interface. Exactly one is set, selected by its `type`. + attr_accessor :authentication + + # Dataflows for the Elastic Cloud CCM interface. + attr_accessor :dataflows + + # Partial Elastic Cloud CCM interface settings for updates. + attr_accessor :settings + + # Interface discriminator for the Elastic Cloud CCM interface. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'authentication' => :'authentication', + :'dataflows' => :'dataflows', + :'settings' => :'settings', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'authentication' => :'ElasticCloudCcmAuthentication', + :'dataflows' => :'Array', + :'settings' => :'ElasticCloudCcmSettingsUpdate', + :'type' => :'ElasticCloudCcmInterfaceType' + } + 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::ElasticCloudCcmInterfaceUpdate` 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?(:'authentication') + self.authentication = attributes[:'authentication'] + end + + if attributes.key?(:'dataflows') + if (value = attributes[:'dataflows']).is_a?(Array) + self.dataflows = value + end + end + + if attributes.key?(:'settings') + self.settings = attributes[:'settings'] + 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 && + authentication == o.authentication && + dataflows == o.dataflows && + settings == o.settings && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [authentication, dataflows, settings, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/elastic_cloud_ccm_settings.rb b/lib/datadog_api_client/v2/models/elastic_cloud_ccm_settings.rb new file mode 100644 index 000000000000..a7b4493ccea7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/elastic_cloud_ccm_settings.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 + # Elastic Cloud CCM interface settings. + class ElasticCloudCcmSettings + include BaseGenericModel + + # Your Elastic Cloud organization ID, found in your organization settings. + attr_reader :elastic_org_id + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'elastic_org_id' => :'elastic_org_id' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'elastic_org_id' => :'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::ElasticCloudCcmSettings` 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?(:'elastic_org_id') + self.elastic_org_id = attributes[:'elastic_org_id'] + 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 @elastic_org_id.nil? + true + end + + # Custom attribute writer method with validation + # @param elastic_org_id [Object] Object to be assigned + # @!visibility private + def elastic_org_id=(elastic_org_id) + if elastic_org_id.nil? + fail ArgumentError, 'invalid value for "elastic_org_id", elastic_org_id cannot be nil.' + end + @elastic_org_id = elastic_org_id + 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 && + elastic_org_id == o.elastic_org_id && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [elastic_org_id, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/elastic_cloud_ccm_settings_update.rb b/lib/datadog_api_client/v2/models/elastic_cloud_ccm_settings_update.rb new file mode 100644 index 000000000000..2ad1e5a6c878 --- /dev/null +++ b/lib/datadog_api_client/v2/models/elastic_cloud_ccm_settings_update.rb @@ -0,0 +1,105 @@ +=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 + # Partial Elastic Cloud CCM interface settings for updates. + class ElasticCloudCcmSettingsUpdate + include BaseGenericModel + + # Your Elastic Cloud organization ID, found in your organization settings. + attr_accessor :elastic_org_id + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'elastic_org_id' => :'elastic_org_id' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'elastic_org_id' => :'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::ElasticCloudCcmSettingsUpdate` 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?(:'elastic_org_id') + self.elastic_org_id = attributes[:'elastic_org_id'] + 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 && + elastic_org_id == o.elastic_org_id && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [elastic_org_id, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/elastic_cloud_ccm_token_auth.rb b/lib/datadog_api_client/v2/models/elastic_cloud_ccm_token_auth.rb new file mode 100644 index 000000000000..4adb4adb5f2b --- /dev/null +++ b/lib/datadog_api_client/v2/models/elastic_cloud_ccm_token_auth.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 + # Encrypted token (bearer token) authentication for Elastic Cloud CCM. + class ElasticCloudCcmTokenAuth + include BaseGenericModel + + # Billing API key. An Elastic Cloud API key with read access to both Billing and Deployments. Create one under Organization settings > API Keys. + attr_reader :api_key + + # Authentication method discriminator. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'api_key' => :'api_key', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'api_key' => :'String', + :'type' => :'ElasticCloudCcmTokenAuthType' + } + 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::ElasticCloudCcmTokenAuth` 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?(:'api_key') + self.api_key = attributes[:'api_key'] + 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 @api_key.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param api_key [Object] Object to be assigned + # @!visibility private + def api_key=(api_key) + if api_key.nil? + fail ArgumentError, 'invalid value for "api_key", api_key cannot be nil.' + end + @api_key = api_key + 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 && + api_key == o.api_key && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [api_key, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/elastic_cloud_ccm_token_auth_type.rb b/lib/datadog_api_client/v2/models/elastic_cloud_ccm_token_auth_type.rb new file mode 100644 index 000000000000..69e08099fa55 --- /dev/null +++ b/lib/datadog_api_client/v2/models/elastic_cloud_ccm_token_auth_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 + # Authentication method discriminator. + class ElasticCloudCcmTokenAuthType + include BaseEnumModel + + BEARER_TOKEN = "bearer_token".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/elastic_cloud_dataflow.rb b/lib/datadog_api_client/v2/models/elastic_cloud_dataflow.rb new file mode 100644 index 000000000000..8e07d821648c --- /dev/null +++ b/lib/datadog_api_client/v2/models/elastic_cloud_dataflow.rb @@ -0,0 +1,143 @@ +=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 + # An Elastic Cloud dataflow toggle. The set of dataflow ids is fixed by the interface schema. + class ElasticCloudDataflow + include BaseGenericModel + + # Whether the dataflow is enabled. + attr_accessor :enabled + + # Identifier of an Elastic Cloud dataflow. + attr_reader :id + + # Read-only, server-computed collection status of a dataflow. + attr_accessor :status + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'enabled' => :'enabled', + :'id' => :'id', + :'status' => :'status' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'enabled' => :'Boolean', + :'id' => :'ElasticCloudDataflowId', + :'status' => :'IntegrationAccountDataflowStatus' + } + 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::ElasticCloudDataflow` 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?(:'enabled') + self.enabled = attributes[:'enabled'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + 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 @id.nil? + true + 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 + + # 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 && + enabled == o.enabled && + id == o.id && + status == o.status && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [enabled, id, status, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/elastic_cloud_dataflow_id.rb b/lib/datadog_api_client/v2/models/elastic_cloud_dataflow_id.rb new file mode 100644 index 000000000000..2956d3d591ad --- /dev/null +++ b/lib/datadog_api_client/v2/models/elastic_cloud_dataflow_id.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 + # Identifier of an Elastic Cloud dataflow. + class ElasticCloudDataflowId + include BaseEnumModel + + METRICS = "elastic-cloud-metrics".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/elastic_cloud_integration.rb b/lib/datadog_api_client/v2/models/elastic_cloud_integration.rb new file mode 100644 index 000000000000..11fa0fd9b426 --- /dev/null +++ b/lib/datadog_api_client/v2/models/elastic_cloud_integration.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 + # Elastic Cloud integration configuration. + class ElasticCloudIntegration + include BaseGenericModel + + # Elastic Cloud interface (source-type). Exactly one interface variant is set, selected by its `type`. + attr_reader :interface + + # Integration discriminator for Elastic Cloud. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'interface' => :'interface', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'interface' => :'ElasticCloudInterface', + :'type' => :'ElasticCloudIntegrationType' + } + 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::ElasticCloudIntegration` 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?(:'interface') + self.interface = attributes[:'interface'] + 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 @interface.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param interface [Object] Object to be assigned + # @!visibility private + def interface=(interface) + if interface.nil? + fail ArgumentError, 'invalid value for "interface", interface cannot be nil.' + end + @interface = interface + 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 && + interface == o.interface && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [interface, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/elastic_cloud_integration_type.rb b/lib/datadog_api_client/v2/models/elastic_cloud_integration_type.rb new file mode 100644 index 000000000000..e9cfa378d1c8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/elastic_cloud_integration_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 + # Integration discriminator for Elastic Cloud. + class ElasticCloudIntegrationType + include BaseEnumModel + + ELASTIC_CLOUD = "elastic-cloud".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/elastic_cloud_integration_update.rb b/lib/datadog_api_client/v2/models/elastic_cloud_integration_update.rb new file mode 100644 index 000000000000..44660525e801 --- /dev/null +++ b/lib/datadog_api_client/v2/models/elastic_cloud_integration_update.rb @@ -0,0 +1,133 @@ +=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 + # Partial Elastic Cloud integration configuration for updates. + class ElasticCloudIntegrationUpdate + include BaseGenericModel + + # Partial Elastic Cloud interface for updates. Exactly one interface variant is set, selected by its `type`. + attr_accessor :interface + + # Integration discriminator for Elastic Cloud. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'interface' => :'interface', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'interface' => :'ElasticCloudInterfaceUpdate', + :'type' => :'ElasticCloudIntegrationType' + } + 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::ElasticCloudIntegrationUpdate` 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?(:'interface') + self.interface = attributes[:'interface'] + 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 && + interface == o.interface && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [interface, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/elastic_cloud_interface.rb b/lib/datadog_api_client/v2/models/elastic_cloud_interface.rb new file mode 100644 index 000000000000..fc9132bb0d07 --- /dev/null +++ b/lib/datadog_api_client/v2/models/elastic_cloud_interface.rb @@ -0,0 +1,63 @@ +=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 + # Elastic Cloud interface (source-type). Exactly one interface variant is set, selected by its `type`. + module ElasticCloudInterface + class << self + include BaseOneOfModel + include BaseOneOfModelNoDiscriminator + + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'ElasticCloudMonitoringInterface', + :'ElasticCloudCcmInterface' + ] + end + # Builds the object + # @param data [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass, data) + next if typed_data.respond_to?(:_unparsed) && typed_data._unparsed + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + if openapi_one_of.include?(:AnyType) + data + else + self._unparsed = true + DatadogAPIClient::UnparsedObject.new(data) + end + end + end + end +end diff --git a/lib/datadog_api_client/v2/models/elastic_cloud_interface_update.rb b/lib/datadog_api_client/v2/models/elastic_cloud_interface_update.rb new file mode 100644 index 000000000000..5a3cf75d2b26 --- /dev/null +++ b/lib/datadog_api_client/v2/models/elastic_cloud_interface_update.rb @@ -0,0 +1,63 @@ +=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 + # Partial Elastic Cloud interface for updates. Exactly one interface variant is set, selected by its `type`. + module ElasticCloudInterfaceUpdate + class << self + include BaseOneOfModel + include BaseOneOfModelNoDiscriminator + + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'ElasticCloudMonitoringInterfaceUpdate', + :'ElasticCloudCcmInterfaceUpdate' + ] + end + # Builds the object + # @param data [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass, data) + next if typed_data.respond_to?(:_unparsed) && typed_data._unparsed + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + if openapi_one_of.include?(:AnyType) + data + else + self._unparsed = true + DatadogAPIClient::UnparsedObject.new(data) + end + end + end + end +end diff --git a/lib/datadog_api_client/v2/models/elastic_cloud_monitoring_interface.rb b/lib/datadog_api_client/v2/models/elastic_cloud_monitoring_interface.rb new file mode 100644 index 000000000000..a6854ffbf1d1 --- /dev/null +++ b/lib/datadog_api_client/v2/models/elastic_cloud_monitoring_interface.rb @@ -0,0 +1,166 @@ +=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 + # Elastic Cloud monitoring interface (source-type) configuration. + class ElasticCloudMonitoringInterface + include BaseGenericModel + + # Authentication methods supported by the Elastic Cloud interface. Exactly one is set, selected by its `type`. + attr_reader :authentication + + # Dataflows for the Elastic Cloud monitoring interface. + attr_accessor :dataflows + + # Elastic Cloud interface settings. + attr_accessor :settings + + # Interface discriminator for the Elastic Cloud monitoring interface. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'authentication' => :'authentication', + :'dataflows' => :'dataflows', + :'settings' => :'settings', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'authentication' => :'ElasticCloudAuthentication', + :'dataflows' => :'Array', + :'settings' => :'ElasticCloudSettings', + :'type' => :'ElasticCloudMonitoringInterfaceType' + } + 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::ElasticCloudMonitoringInterface` 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?(:'authentication') + self.authentication = attributes[:'authentication'] + end + + if attributes.key?(:'dataflows') + if (value = attributes[:'dataflows']).is_a?(Array) + self.dataflows = value + end + end + + if attributes.key?(:'settings') + self.settings = attributes[:'settings'] + 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 @authentication.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param authentication [Object] Object to be assigned + # @!visibility private + def authentication=(authentication) + if authentication.nil? + fail ArgumentError, 'invalid value for "authentication", authentication cannot be nil.' + end + @authentication = authentication + 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 && + authentication == o.authentication && + dataflows == o.dataflows && + settings == o.settings && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [authentication, dataflows, settings, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/elastic_cloud_monitoring_interface_type.rb b/lib/datadog_api_client/v2/models/elastic_cloud_monitoring_interface_type.rb new file mode 100644 index 000000000000..1946b26f3d17 --- /dev/null +++ b/lib/datadog_api_client/v2/models/elastic_cloud_monitoring_interface_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 + # Interface discriminator for the Elastic Cloud monitoring interface. + class ElasticCloudMonitoringInterfaceType + include BaseEnumModel + + ELASTIC_CLOUD = "elastic-cloud".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/elastic_cloud_monitoring_interface_update.rb b/lib/datadog_api_client/v2/models/elastic_cloud_monitoring_interface_update.rb new file mode 100644 index 000000000000..14cc6c12e9f9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/elastic_cloud_monitoring_interface_update.rb @@ -0,0 +1,155 @@ +=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 + # Partial Elastic Cloud monitoring interface for updates. + class ElasticCloudMonitoringInterfaceUpdate + include BaseGenericModel + + # Authentication methods supported by the Elastic Cloud interface. Exactly one is set, selected by its `type`. + attr_accessor :authentication + + # Dataflows for the Elastic Cloud monitoring interface. + attr_accessor :dataflows + + # Partial Elastic Cloud interface settings for updates. + attr_accessor :settings + + # Interface discriminator for the Elastic Cloud monitoring interface. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'authentication' => :'authentication', + :'dataflows' => :'dataflows', + :'settings' => :'settings', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'authentication' => :'ElasticCloudAuthentication', + :'dataflows' => :'Array', + :'settings' => :'ElasticCloudSettingsUpdate', + :'type' => :'ElasticCloudMonitoringInterfaceType' + } + 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::ElasticCloudMonitoringInterfaceUpdate` 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?(:'authentication') + self.authentication = attributes[:'authentication'] + end + + if attributes.key?(:'dataflows') + if (value = attributes[:'dataflows']).is_a?(Array) + self.dataflows = value + end + end + + if attributes.key?(:'settings') + self.settings = attributes[:'settings'] + 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 && + authentication == o.authentication && + dataflows == o.dataflows && + settings == o.settings && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [authentication, dataflows, settings, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/elastic_cloud_settings.rb b/lib/datadog_api_client/v2/models/elastic_cloud_settings.rb new file mode 100644 index 000000000000..4ffcfc13397d --- /dev/null +++ b/lib/datadog_api_client/v2/models/elastic_cloud_settings.rb @@ -0,0 +1,205 @@ +=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 + # Elastic Cloud interface settings. + class ElasticCloudSettings + include BaseGenericModel + + # Enable to collect shard allocation metrics. + attr_accessor :cat_allocation_stats_enabled + + # Enable to collect index-specific stats. + attr_accessor :detailed_index_stats_enabled + + # Enable to collect metrics about the indices in your cluster. + attr_accessor :index_stats_enabled + + # Enable to collect metrics about pending tasks. + attr_accessor :pending_task_stats_enabled + + # Enable to collect all metrics even if primary shard metric collection times out. + attr_accessor :pshard_graceful_to_enabled + + # Enable to collect metrics over primary shards. + attr_accessor :pshard_stats_enabled + + # Enable to collect snapshot lifecycle management metrics. + attr_accessor :slm_stats_enabled + + # Custom tags for this deployment. + attr_accessor :tags + + # Deployment URL. + attr_reader :url + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'cat_allocation_stats_enabled' => :'cat_allocation_stats_enabled', + :'detailed_index_stats_enabled' => :'detailed_index_stats_enabled', + :'index_stats_enabled' => :'index_stats_enabled', + :'pending_task_stats_enabled' => :'pending_task_stats_enabled', + :'pshard_graceful_to_enabled' => :'pshard_graceful_to_enabled', + :'pshard_stats_enabled' => :'pshard_stats_enabled', + :'slm_stats_enabled' => :'slm_stats_enabled', + :'tags' => :'tags', + :'url' => :'url' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'cat_allocation_stats_enabled' => :'Boolean', + :'detailed_index_stats_enabled' => :'Boolean', + :'index_stats_enabled' => :'Boolean', + :'pending_task_stats_enabled' => :'Boolean', + :'pshard_graceful_to_enabled' => :'Boolean', + :'pshard_stats_enabled' => :'Boolean', + :'slm_stats_enabled' => :'Boolean', + :'tags' => :'Array', + :'url' => :'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::ElasticCloudSettings` 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?(:'cat_allocation_stats_enabled') + self.cat_allocation_stats_enabled = attributes[:'cat_allocation_stats_enabled'] + end + + if attributes.key?(:'detailed_index_stats_enabled') + self.detailed_index_stats_enabled = attributes[:'detailed_index_stats_enabled'] + end + + if attributes.key?(:'index_stats_enabled') + self.index_stats_enabled = attributes[:'index_stats_enabled'] + end + + if attributes.key?(:'pending_task_stats_enabled') + self.pending_task_stats_enabled = attributes[:'pending_task_stats_enabled'] + end + + if attributes.key?(:'pshard_graceful_to_enabled') + self.pshard_graceful_to_enabled = attributes[:'pshard_graceful_to_enabled'] + end + + if attributes.key?(:'pshard_stats_enabled') + self.pshard_stats_enabled = attributes[:'pshard_stats_enabled'] + end + + if attributes.key?(:'slm_stats_enabled') + self.slm_stats_enabled = attributes[:'slm_stats_enabled'] + end + + if attributes.key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + end + + if attributes.key?(:'url') + self.url = attributes[:'url'] + 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 @url.nil? + true + end + + # Custom attribute writer method with validation + # @param url [Object] Object to be assigned + # @!visibility private + def url=(url) + if url.nil? + fail ArgumentError, 'invalid value for "url", url cannot be nil.' + end + @url = url + 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 && + cat_allocation_stats_enabled == o.cat_allocation_stats_enabled && + detailed_index_stats_enabled == o.detailed_index_stats_enabled && + index_stats_enabled == o.index_stats_enabled && + pending_task_stats_enabled == o.pending_task_stats_enabled && + pshard_graceful_to_enabled == o.pshard_graceful_to_enabled && + pshard_stats_enabled == o.pshard_stats_enabled && + slm_stats_enabled == o.slm_stats_enabled && + tags == o.tags && + url == o.url && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [cat_allocation_stats_enabled, detailed_index_stats_enabled, index_stats_enabled, pending_task_stats_enabled, pshard_graceful_to_enabled, pshard_stats_enabled, slm_stats_enabled, tags, url, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/elastic_cloud_settings_update.rb b/lib/datadog_api_client/v2/models/elastic_cloud_settings_update.rb new file mode 100644 index 000000000000..02434a522854 --- /dev/null +++ b/lib/datadog_api_client/v2/models/elastic_cloud_settings_update.rb @@ -0,0 +1,187 @@ +=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 + # Partial Elastic Cloud interface settings for updates. + class ElasticCloudSettingsUpdate + include BaseGenericModel + + # Enable to collect shard allocation metrics. + attr_accessor :cat_allocation_stats_enabled + + # Enable to collect index-specific stats. + attr_accessor :detailed_index_stats_enabled + + # Enable to collect metrics about the indices in your cluster. + attr_accessor :index_stats_enabled + + # Enable to collect metrics about pending tasks. + attr_accessor :pending_task_stats_enabled + + # Enable to collect all metrics even if primary shard metric collection times out. + attr_accessor :pshard_graceful_to_enabled + + # Enable to collect metrics over primary shards. + attr_accessor :pshard_stats_enabled + + # Enable to collect snapshot lifecycle management metrics. + attr_accessor :slm_stats_enabled + + # Custom tags for this deployment. + attr_accessor :tags + + # Deployment URL. + attr_accessor :url + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'cat_allocation_stats_enabled' => :'cat_allocation_stats_enabled', + :'detailed_index_stats_enabled' => :'detailed_index_stats_enabled', + :'index_stats_enabled' => :'index_stats_enabled', + :'pending_task_stats_enabled' => :'pending_task_stats_enabled', + :'pshard_graceful_to_enabled' => :'pshard_graceful_to_enabled', + :'pshard_stats_enabled' => :'pshard_stats_enabled', + :'slm_stats_enabled' => :'slm_stats_enabled', + :'tags' => :'tags', + :'url' => :'url' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'cat_allocation_stats_enabled' => :'Boolean', + :'detailed_index_stats_enabled' => :'Boolean', + :'index_stats_enabled' => :'Boolean', + :'pending_task_stats_enabled' => :'Boolean', + :'pshard_graceful_to_enabled' => :'Boolean', + :'pshard_stats_enabled' => :'Boolean', + :'slm_stats_enabled' => :'Boolean', + :'tags' => :'Array', + :'url' => :'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::ElasticCloudSettingsUpdate` 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?(:'cat_allocation_stats_enabled') + self.cat_allocation_stats_enabled = attributes[:'cat_allocation_stats_enabled'] + end + + if attributes.key?(:'detailed_index_stats_enabled') + self.detailed_index_stats_enabled = attributes[:'detailed_index_stats_enabled'] + end + + if attributes.key?(:'index_stats_enabled') + self.index_stats_enabled = attributes[:'index_stats_enabled'] + end + + if attributes.key?(:'pending_task_stats_enabled') + self.pending_task_stats_enabled = attributes[:'pending_task_stats_enabled'] + end + + if attributes.key?(:'pshard_graceful_to_enabled') + self.pshard_graceful_to_enabled = attributes[:'pshard_graceful_to_enabled'] + end + + if attributes.key?(:'pshard_stats_enabled') + self.pshard_stats_enabled = attributes[:'pshard_stats_enabled'] + end + + if attributes.key?(:'slm_stats_enabled') + self.slm_stats_enabled = attributes[:'slm_stats_enabled'] + end + + if attributes.key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + end + + if attributes.key?(:'url') + self.url = attributes[:'url'] + 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 && + cat_allocation_stats_enabled == o.cat_allocation_stats_enabled && + detailed_index_stats_enabled == o.detailed_index_stats_enabled && + index_stats_enabled == o.index_stats_enabled && + pending_task_stats_enabled == o.pending_task_stats_enabled && + pshard_graceful_to_enabled == o.pshard_graceful_to_enabled && + pshard_stats_enabled == o.pshard_stats_enabled && + slm_stats_enabled == o.slm_stats_enabled && + tags == o.tags && + url == o.url && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [cat_allocation_stats_enabled, detailed_index_stats_enabled, index_stats_enabled, pending_task_stats_enabled, pshard_graceful_to_enabled, pshard_stats_enabled, slm_stats_enabled, tags, url, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/integration_account_attributes.rb b/lib/datadog_api_client/v2/models/integration_account_attributes.rb new file mode 100644 index 000000000000..3cafab0c89ff --- /dev/null +++ b/lib/datadog_api_client/v2/models/integration_account_attributes.rb @@ -0,0 +1,154 @@ +=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 of an integration account. The `integration` field is a strongly-typed, per-integration union. + class IntegrationAccountAttributes + include BaseGenericModel + + # Strongly-typed, per-integration configuration. Exactly one integration variant is set, selected by its `type`. + attr_reader :integration + + # Human-readable name of the account. + attr_reader :name + + # Read-only permission information for the account, derived from its restriction policy. + attr_accessor :permissions + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'integration' => :'integration', + :'name' => :'name', + :'permissions' => :'permissions' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'integration' => :'IntegrationAccountIntegration', + :'name' => :'String', + :'permissions' => :'IntegrationAccountPermissions' + } + 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::IntegrationAccountAttributes` 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?(:'integration') + self.integration = attributes[:'integration'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'permissions') + self.permissions = attributes[:'permissions'] + 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 @integration.nil? + return false if @name.nil? + true + end + + # Custom attribute writer method with validation + # @param integration [Object] Object to be assigned + # @!visibility private + def integration=(integration) + if integration.nil? + fail ArgumentError, 'invalid value for "integration", integration cannot be nil.' + end + @integration = integration + 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 + + # 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 && + integration == o.integration && + name == o.name && + permissions == o.permissions && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [integration, name, permissions, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/integration_account_create_data.rb b/lib/datadog_api_client/v2/models/integration_account_create_data.rb new file mode 100644 index 000000000000..13ffc2ca5735 --- /dev/null +++ b/lib/datadog_api_client/v2/models/integration_account_create_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 envelope for creating an integration account. + class IntegrationAccountCreateData + include BaseGenericModel + + # Attributes of an integration account. The `integration` field is a strongly-typed, per-integration union. + attr_reader :attributes + + # JSON:API resource type for an integration account. Always `integration-account`. + 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' => :'IntegrationAccountAttributes', + :'type' => :'IntegrationAccountType' + } + 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::IntegrationAccountCreateData` 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/integration_account_data.rb b/lib/datadog_api_client/v2/models/integration_account_data.rb new file mode 100644 index 000000000000..d44e4b2abbed --- /dev/null +++ b/lib/datadog_api_client/v2/models/integration_account_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 envelope of an integration account, including server-assigned identity. + class IntegrationAccountData + include BaseGenericModel + + # Attributes of an integration account. The `integration` field is a strongly-typed, per-integration union. + attr_reader :attributes + + # Server-generated unique identifier of the integration account. + attr_reader :id + + # JSON:API resource type for an integration account. Always `integration-account`. + 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' => :'IntegrationAccountAttributes', + :'id' => :'String', + :'type' => :'IntegrationAccountType' + } + 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::IntegrationAccountData` 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/integration_account_dataflow_health.rb b/lib/datadog_api_client/v2/models/integration_account_dataflow_health.rb new file mode 100644 index 000000000000..8e837e515e5a --- /dev/null +++ b/lib/datadog_api_client/v2/models/integration_account_dataflow_health.rb @@ -0,0 +1,28 @@ +=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 + # Collection health of a single dataflow. + class IntegrationAccountDataflowHealth + include BaseEnumModel + + OK = "DATAFLOW_HEALTH_OK".freeze + BROKEN = "DATAFLOW_HEALTH_BROKEN".freeze + UNKNOWN = "DATAFLOW_HEALTH_UNKNOWN".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/integration_account_dataflow_status.rb b/lib/datadog_api_client/v2/models/integration_account_dataflow_status.rb new file mode 100644 index 000000000000..70a5501d62ca --- /dev/null +++ b/lib/datadog_api_client/v2/models/integration_account_dataflow_status.rb @@ -0,0 +1,125 @@ +=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 + # Read-only, server-computed collection status of a dataflow. + class IntegrationAccountDataflowStatus + include BaseGenericModel + + # Collection health of a single dataflow. + attr_accessor :health + + # Human-readable detail, populated when the dataflow is not healthy. + attr_accessor :message + + # Time the status was last computed. + attr_accessor :updated_at + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'health' => :'health', + :'message' => :'message', + :'updated_at' => :'updated_at' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'health' => :'IntegrationAccountDataflowHealth', + :'message' => :'String', + :'updated_at' => :'Time' + } + 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::IntegrationAccountDataflowStatus` 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?(:'health') + self.health = attributes[:'health'] + end + + if attributes.key?(:'message') + self.message = attributes[:'message'] + end + + if attributes.key?(:'updated_at') + self.updated_at = attributes[:'updated_at'] + 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 && + health == o.health && + message == o.message && + updated_at == o.updated_at && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [health, message, updated_at, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/integration_account_integration.rb b/lib/datadog_api_client/v2/models/integration_account_integration.rb new file mode 100644 index 000000000000..0977c9e0c21a --- /dev/null +++ b/lib/datadog_api_client/v2/models/integration_account_integration.rb @@ -0,0 +1,63 @@ +=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 + # Strongly-typed, per-integration configuration. Exactly one integration variant is set, selected by its `type`. + module IntegrationAccountIntegration + class << self + include BaseOneOfModel + include BaseOneOfModelNoDiscriminator + + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'TwilioIntegration', + :'ElasticCloudIntegration' + ] + end + # Builds the object + # @param data [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass, data) + next if typed_data.respond_to?(:_unparsed) && typed_data._unparsed + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + if openapi_one_of.include?(:AnyType) + data + else + self._unparsed = true + DatadogAPIClient::UnparsedObject.new(data) + end + end + end + end +end diff --git a/lib/datadog_api_client/v2/models/integration_account_integration_id.rb b/lib/datadog_api_client/v2/models/integration_account_integration_id.rb new file mode 100644 index 000000000000..286e68c6400e --- /dev/null +++ b/lib/datadog_api_client/v2/models/integration_account_integration_id.rb @@ -0,0 +1,27 @@ +=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 + # Supported integration ids (the `integration_id` path scope). + class IntegrationAccountIntegrationId + include BaseEnumModel + + ELASTIC_CLOUD = "elastic-cloud".freeze + TWILIO = "twilio".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/integration_account_integration_update.rb b/lib/datadog_api_client/v2/models/integration_account_integration_update.rb new file mode 100644 index 000000000000..8f7587474728 --- /dev/null +++ b/lib/datadog_api_client/v2/models/integration_account_integration_update.rb @@ -0,0 +1,63 @@ +=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 + # Strongly-typed, per-integration partial configuration. Exactly one integration variant is set, selected by its `type`. + module IntegrationAccountIntegrationUpdate + class << self + include BaseOneOfModel + include BaseOneOfModelNoDiscriminator + + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'TwilioIntegrationUpdate', + :'ElasticCloudIntegrationUpdate' + ] + end + # Builds the object + # @param data [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass, data) + next if typed_data.respond_to?(:_unparsed) && typed_data._unparsed + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + if openapi_one_of.include?(:AnyType) + data + else + self._unparsed = true + DatadogAPIClient::UnparsedObject.new(data) + end + end + end + end +end diff --git a/lib/datadog_api_client/v2/models/integration_account_interface_id.rb b/lib/datadog_api_client/v2/models/integration_account_interface_id.rb new file mode 100644 index 000000000000..f7b6baf2d4d5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/integration_account_interface_id.rb @@ -0,0 +1,28 @@ +=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 + # Supported interface (source-type) ids (the `interface_id` path scope). + class IntegrationAccountInterfaceId + include BaseEnumModel + + ELASTIC_CLOUD = "elastic-cloud".freeze + ELASTIC_CLOUD_CCM = "elastic-cloud-ccm".freeze + TWILIO = "twilio".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/integration_account_permissions.rb b/lib/datadog_api_client/v2/models/integration_account_permissions.rb new file mode 100644 index 000000000000..0bda50c076c9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/integration_account_permissions.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 + # Read-only permission information for the account, derived from its restriction policy. + class IntegrationAccountPermissions + include BaseGenericModel + + # Restriction-policy resource identifier of this account. + attr_accessor :resource_id + + # Whether the requesting user may edit this account. + attr_accessor :user_can_edit + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'resource_id' => :'resource_id', + :'user_can_edit' => :'user_can_edit' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'resource_id' => :'String', + :'user_can_edit' => :'Boolean' + } + 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::IntegrationAccountPermissions` 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?(:'resource_id') + self.resource_id = attributes[:'resource_id'] + end + + if attributes.key?(:'user_can_edit') + self.user_can_edit = attributes[:'user_can_edit'] + 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 && + resource_id == o.resource_id && + user_can_edit == o.user_can_edit && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [resource_id, user_can_edit, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/integration_account_request.rb b/lib/datadog_api_client/v2/models/integration_account_request.rb new file mode 100644 index 000000000000..8edb9a91dd20 --- /dev/null +++ b/lib/datadog_api_client/v2/models/integration_account_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 + # Request payload to create an integration account. + class IntegrationAccountRequest + include BaseGenericModel + + # Data envelope for creating an 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' => :'IntegrationAccountCreateData' + } + 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::IntegrationAccountRequest` 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/integration_account_response.rb b/lib/datadog_api_client/v2/models/integration_account_response.rb new file mode 100644 index 000000000000..f37730bea00d --- /dev/null +++ b/lib/datadog_api_client/v2/models/integration_account_response.rb @@ -0,0 +1,105 @@ +=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 payload for a single integration account. + class IntegrationAccountResponse + include BaseGenericModel + + # Data envelope of an integration account, including server-assigned identity. + attr_accessor :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' => :'IntegrationAccountData' + } + 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::IntegrationAccountResponse` 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 + + # 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/integration_account_type.rb b/lib/datadog_api_client/v2/models/integration_account_type.rb new file mode 100644 index 000000000000..3cddddc7ed0e --- /dev/null +++ b/lib/datadog_api_client/v2/models/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 + # JSON:API resource type for an integration account. Always `integration-account`. + class IntegrationAccountType + include BaseEnumModel + + INTEGRATION_ACCOUNT = "integration-account".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/integration_account_update_attributes.rb b/lib/datadog_api_client/v2/models/integration_account_update_attributes.rb new file mode 100644 index 000000000000..eff16c3c86a5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/integration_account_update_attributes.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 + # Updatable attributes of an integration account. Every field is optional; only the fields provided are changed. + class IntegrationAccountUpdateAttributes + include BaseGenericModel + + # Strongly-typed, per-integration partial configuration. Exactly one integration variant is set, selected by its `type`. + attr_accessor :integration + + # Human-readable name of the account. + attr_accessor :name + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'integration' => :'integration', + :'name' => :'name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'integration' => :'IntegrationAccountIntegrationUpdate', + :'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::IntegrationAccountUpdateAttributes` 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?(:'integration') + self.integration = attributes[:'integration'] + end + + if attributes.key?(:'name') + self.name = attributes[:'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 && + integration == o.integration && + name == o.name && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [integration, name, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/integration_account_update_data.rb b/lib/datadog_api_client/v2/models/integration_account_update_data.rb new file mode 100644 index 000000000000..b2b53f98228f --- /dev/null +++ b/lib/datadog_api_client/v2/models/integration_account_update_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 envelope for updating an integration account. + class IntegrationAccountUpdateData + include BaseGenericModel + + # Updatable attributes of an integration account. Every field is optional; only the fields provided are changed. + attr_reader :attributes + + # JSON:API resource type for an integration account. Always `integration-account`. + 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' => :'IntegrationAccountUpdateAttributes', + :'type' => :'IntegrationAccountType' + } + 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::IntegrationAccountUpdateData` 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/integration_account_update_request.rb b/lib/datadog_api_client/v2/models/integration_account_update_request.rb new file mode 100644 index 000000000000..3acc4c80e964 --- /dev/null +++ b/lib/datadog_api_client/v2/models/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 + # Request payload to update an integration account as a partial merge. + class IntegrationAccountUpdateRequest + include BaseGenericModel + + # Data envelope for updating an 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' => :'IntegrationAccountUpdateData' + } + 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::IntegrationAccountUpdateRequest` 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/integration_accounts_response.rb b/lib/datadog_api_client/v2/models/integration_accounts_response.rb new file mode 100644 index 000000000000..3e25842ced27 --- /dev/null +++ b/lib/datadog_api_client/v2/models/integration_accounts_response.rb @@ -0,0 +1,107 @@ +=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 payload for a list of integration accounts. + class IntegrationAccountsResponse + include BaseGenericModel + + # List of integration accounts. + attr_accessor :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' => :'Array' + } + 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::IntegrationAccountsResponse` 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 + 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/twilio_authentication.rb b/lib/datadog_api_client/v2/models/twilio_authentication.rb new file mode 100644 index 000000000000..a0adb4ff2e43 --- /dev/null +++ b/lib/datadog_api_client/v2/models/twilio_authentication.rb @@ -0,0 +1,62 @@ +=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 + # Authentication methods supported by the Twilio interface. Exactly one is set, selected by its `type`. + module TwilioAuthentication + class << self + include BaseOneOfModel + include BaseOneOfModelNoDiscriminator + + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'TwilioBasicAuth' + ] + end + # Builds the object + # @param data [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass, data) + next if typed_data.respond_to?(:_unparsed) && typed_data._unparsed + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + if openapi_one_of.include?(:AnyType) + data + else + self._unparsed = true + DatadogAPIClient::UnparsedObject.new(data) + end + end + end + end +end diff --git a/lib/datadog_api_client/v2/models/twilio_basic_auth.rb b/lib/datadog_api_client/v2/models/twilio_basic_auth.rb new file mode 100644 index 000000000000..bc9eb80719b4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/twilio_basic_auth.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 + # API Key & Secret authentication for Twilio. + class TwilioBasicAuth + include BaseGenericModel + + # Twilio API Key SID for authentication. Create from Twilio Console > Account > API Keys & Tokens. + attr_reader :api_key + + # Twilio API Key Secret (token) corresponding to the API Key SID. + attr_reader :api_key_token + + # Authentication method discriminator. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'api_key' => :'api_key', + :'api_key_token' => :'api_key_token', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'api_key' => :'String', + :'api_key_token' => :'String', + :'type' => :'TwilioBasicAuthType' + } + 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::TwilioBasicAuth` 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?(:'api_key') + self.api_key = attributes[:'api_key'] + end + + if attributes.key?(:'api_key_token') + self.api_key_token = attributes[:'api_key_token'] + 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 @api_key.nil? + return false if @api_key_token.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param api_key [Object] Object to be assigned + # @!visibility private + def api_key=(api_key) + if api_key.nil? + fail ArgumentError, 'invalid value for "api_key", api_key cannot be nil.' + end + @api_key = api_key + end + + # Custom attribute writer method with validation + # @param api_key_token [Object] Object to be assigned + # @!visibility private + def api_key_token=(api_key_token) + if api_key_token.nil? + fail ArgumentError, 'invalid value for "api_key_token", api_key_token cannot be nil.' + end + @api_key_token = api_key_token + 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 && + api_key == o.api_key && + api_key_token == o.api_key_token && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [api_key, api_key_token, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/twilio_basic_auth_type.rb b/lib/datadog_api_client/v2/models/twilio_basic_auth_type.rb new file mode 100644 index 000000000000..79404c48053c --- /dev/null +++ b/lib/datadog_api_client/v2/models/twilio_basic_auth_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 + # Authentication method discriminator. + class TwilioBasicAuthType + include BaseEnumModel + + BASIC = "basic".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/twilio_dataflow.rb b/lib/datadog_api_client/v2/models/twilio_dataflow.rb new file mode 100644 index 000000000000..1451ad37e3d9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/twilio_dataflow.rb @@ -0,0 +1,143 @@ +=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 + # A Twilio dataflow toggle. The set of dataflow ids is fixed by the interface schema. + class TwilioDataflow + include BaseGenericModel + + # Whether the dataflow is enabled. + attr_accessor :enabled + + # Identifier of a Twilio dataflow. + attr_reader :id + + # Read-only, server-computed collection status of a dataflow. + attr_accessor :status + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'enabled' => :'enabled', + :'id' => :'id', + :'status' => :'status' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'enabled' => :'Boolean', + :'id' => :'TwilioDataflowId', + :'status' => :'IntegrationAccountDataflowStatus' + } + 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::TwilioDataflow` 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?(:'enabled') + self.enabled = attributes[:'enabled'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + 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 @id.nil? + true + 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 + + # 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 && + enabled == o.enabled && + id == o.id && + status == o.status && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [enabled, id, status, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/twilio_dataflow_id.rb b/lib/datadog_api_client/v2/models/twilio_dataflow_id.rb new file mode 100644 index 000000000000..eb3ce0d285b0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/twilio_dataflow_id.rb @@ -0,0 +1,30 @@ +=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 + # Identifier of a Twilio dataflow. + class TwilioDataflowId + include BaseEnumModel + + CLOUD_COST_METRICS = "twilio-cloud-cost-metrics".freeze + EVENTS_LOGS = "twilio-events-logs".freeze + MESSAGES_LOGS = "twilio-messages-logs".freeze + ALERTS_LOGS = "twilio-alerts-logs".freeze + CALL_SUMMARIES_LOGS = "twilio-call-summaries-logs".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/twilio_integration.rb b/lib/datadog_api_client/v2/models/twilio_integration.rb new file mode 100644 index 000000000000..ca549eededc6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/twilio_integration.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 + # Twilio integration configuration. + class TwilioIntegration + include BaseGenericModel + + # Twilio interface (source-type) configuration. + attr_reader :interface + + # Integration discriminator for Twilio. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'interface' => :'interface', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'interface' => :'TwilioInterface', + :'type' => :'TwilioIntegrationType' + } + 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::TwilioIntegration` 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?(:'interface') + self.interface = attributes[:'interface'] + 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 @interface.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param interface [Object] Object to be assigned + # @!visibility private + def interface=(interface) + if interface.nil? + fail ArgumentError, 'invalid value for "interface", interface cannot be nil.' + end + @interface = interface + 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 && + interface == o.interface && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [interface, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/twilio_integration_type.rb b/lib/datadog_api_client/v2/models/twilio_integration_type.rb new file mode 100644 index 000000000000..b96f3ba774b9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/twilio_integration_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 + # Integration discriminator for Twilio. + class TwilioIntegrationType + include BaseEnumModel + + TWILIO = "twilio".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/twilio_integration_update.rb b/lib/datadog_api_client/v2/models/twilio_integration_update.rb new file mode 100644 index 000000000000..aa577b988fb5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/twilio_integration_update.rb @@ -0,0 +1,133 @@ +=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 + # Partial Twilio integration configuration for updates. + class TwilioIntegrationUpdate + include BaseGenericModel + + # Partial Twilio interface (source-type) configuration for updates. + attr_accessor :interface + + # Integration discriminator for Twilio. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'interface' => :'interface', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'interface' => :'TwilioInterfaceUpdate', + :'type' => :'TwilioIntegrationType' + } + 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::TwilioIntegrationUpdate` 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?(:'interface') + self.interface = attributes[:'interface'] + 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 && + interface == o.interface && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [interface, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/twilio_interface.rb b/lib/datadog_api_client/v2/models/twilio_interface.rb new file mode 100644 index 000000000000..a7649e192f75 --- /dev/null +++ b/lib/datadog_api_client/v2/models/twilio_interface.rb @@ -0,0 +1,166 @@ +=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 + # Twilio interface (source-type) configuration. + class TwilioInterface + include BaseGenericModel + + # Authentication methods supported by the Twilio interface. Exactly one is set, selected by its `type`. + attr_reader :authentication + + # Dataflows for the Twilio interface. + attr_accessor :dataflows + + # Twilio interface settings. + attr_accessor :settings + + # Interface discriminator for Twilio. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'authentication' => :'authentication', + :'dataflows' => :'dataflows', + :'settings' => :'settings', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'authentication' => :'TwilioAuthentication', + :'dataflows' => :'Array', + :'settings' => :'TwilioSettings', + :'type' => :'TwilioInterfaceType' + } + 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::TwilioInterface` 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?(:'authentication') + self.authentication = attributes[:'authentication'] + end + + if attributes.key?(:'dataflows') + if (value = attributes[:'dataflows']).is_a?(Array) + self.dataflows = value + end + end + + if attributes.key?(:'settings') + self.settings = attributes[:'settings'] + 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 @authentication.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param authentication [Object] Object to be assigned + # @!visibility private + def authentication=(authentication) + if authentication.nil? + fail ArgumentError, 'invalid value for "authentication", authentication cannot be nil.' + end + @authentication = authentication + 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 && + authentication == o.authentication && + dataflows == o.dataflows && + settings == o.settings && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [authentication, dataflows, settings, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/twilio_interface_type.rb b/lib/datadog_api_client/v2/models/twilio_interface_type.rb new file mode 100644 index 000000000000..6471ac823d3f --- /dev/null +++ b/lib/datadog_api_client/v2/models/twilio_interface_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 + # Interface discriminator for Twilio. + class TwilioInterfaceType + include BaseEnumModel + + TWILIO = "twilio".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/twilio_interface_update.rb b/lib/datadog_api_client/v2/models/twilio_interface_update.rb new file mode 100644 index 000000000000..58ff5b277f01 --- /dev/null +++ b/lib/datadog_api_client/v2/models/twilio_interface_update.rb @@ -0,0 +1,155 @@ +=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 + # Partial Twilio interface (source-type) configuration for updates. + class TwilioInterfaceUpdate + include BaseGenericModel + + # Authentication methods supported by the Twilio interface. Exactly one is set, selected by its `type`. + attr_accessor :authentication + + # Dataflows for the Twilio interface. + attr_accessor :dataflows + + # Partial Twilio interface settings for updates. + attr_accessor :settings + + # Interface discriminator for Twilio. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'authentication' => :'authentication', + :'dataflows' => :'dataflows', + :'settings' => :'settings', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'authentication' => :'TwilioAuthentication', + :'dataflows' => :'Array', + :'settings' => :'TwilioSettingsUpdate', + :'type' => :'TwilioInterfaceType' + } + 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::TwilioInterfaceUpdate` 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?(:'authentication') + self.authentication = attributes[:'authentication'] + end + + if attributes.key?(:'dataflows') + if (value = attributes[:'dataflows']).is_a?(Array) + self.dataflows = value + end + end + + if attributes.key?(:'settings') + self.settings = attributes[:'settings'] + 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 && + authentication == o.authentication && + dataflows == o.dataflows && + settings == o.settings && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [authentication, dataflows, settings, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/twilio_settings.rb b/lib/datadog_api_client/v2/models/twilio_settings.rb new file mode 100644 index 000000000000..4ddf12d2efac --- /dev/null +++ b/lib/datadog_api_client/v2/models/twilio_settings.rb @@ -0,0 +1,133 @@ +=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 + # Twilio interface settings. + class TwilioSettings + include BaseGenericModel + + # Twilio Account SID that uniquely identifies your Twilio account. + attr_reader :account_sid + + # When enabled, phone numbers in the `to` field and SMS message bodies are censored for privacy. + attr_accessor :censor_logs + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'account_sid' => :'account_sid', + :'censor_logs' => :'censor_logs' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'account_sid' => :'String', + :'censor_logs' => :'Boolean' + } + 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::TwilioSettings` 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?(:'account_sid') + self.account_sid = attributes[:'account_sid'] + end + + if attributes.key?(:'censor_logs') + self.censor_logs = attributes[:'censor_logs'] + 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 @account_sid.nil? + true + end + + # Custom attribute writer method with validation + # @param account_sid [Object] Object to be assigned + # @!visibility private + def account_sid=(account_sid) + if account_sid.nil? + fail ArgumentError, 'invalid value for "account_sid", account_sid cannot be nil.' + end + @account_sid = account_sid + 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 && + account_sid == o.account_sid && + censor_logs == o.censor_logs && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [account_sid, censor_logs, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/twilio_settings_update.rb b/lib/datadog_api_client/v2/models/twilio_settings_update.rb new file mode 100644 index 000000000000..8abba600689c --- /dev/null +++ b/lib/datadog_api_client/v2/models/twilio_settings_update.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 + # Partial Twilio interface settings for updates. + class TwilioSettingsUpdate + include BaseGenericModel + + # Twilio Account SID that uniquely identifies your Twilio account. + attr_accessor :account_sid + + # When enabled, phone numbers in the `to` field and SMS message bodies are censored for privacy. + attr_accessor :censor_logs + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'account_sid' => :'account_sid', + :'censor_logs' => :'censor_logs' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'account_sid' => :'String', + :'censor_logs' => :'Boolean' + } + 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::TwilioSettingsUpdate` 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?(:'account_sid') + self.account_sid = attributes[:'account_sid'] + end + + if attributes.key?(:'censor_logs') + self.censor_logs = attributes[:'censor_logs'] + 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 && + account_sid == o.account_sid && + censor_logs == o.censor_logs && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [account_sid, censor_logs, additional_properties].hash + end + end +end