From f4db6d92dc400d3a72642c6e6ded6ddab0e50e0a Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 30 Jul 2026 11:57:39 +0000 Subject: [PATCH] Regenerate client from commit 7fabc08 of spec repo --- .generator/schemas/v2/openapi.yaml | 1219 +++++++++++++++++ .../CreateElasticCloudIntegrationAccount.rb | 44 + .../DeleteElasticCloudIntegrationAccount.rb | 8 + .../GetElasticCloudIntegrationAccount.rb | 8 + .../ListElasticCloudIntegrationAccounts.rb | 8 + .../UpdateElasticCloudIntegrationAccount.rb | 44 + .../CreateTwilioIntegrationAccount.rb | 35 + .../DeleteTwilioIntegrationAccount.rb | 8 + .../GetTwilioIntegrationAccount.rb | 8 + .../ListTwilioIntegrationAccounts.rb | 8 + .../UpdateTwilioIntegrationAccount.rb | 35 + features/scenarios_model_mapping.rb | 40 + ...elastic_cloud_integration_accounts.feature | 146 ++ .../v2/twilio_integration_accounts.feature | 145 ++ features/v2/undo.json | 82 ++ lib/datadog_api_client/configuration.rb | 10 + lib/datadog_api_client/inflector.rb | 57 + .../elastic_cloud_integration_accounts_api.rb | 435 ++++++ .../v2/api/twilio_integration_accounts_api.rb | 435 ++++++ .../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 + ...ic_cloud_integration_account_attributes.rb | 154 +++ ...c_cloud_integration_account_create_data.rb | 144 ++ .../elastic_cloud_integration_account_data.rb | 165 +++ ...astic_cloud_integration_account_request.rb | 123 ++ ...stic_cloud_integration_account_response.rb | 105 ++ ...d_integration_account_update_attributes.rb | 115 ++ ...c_cloud_integration_account_update_data.rb | 144 ++ ...loud_integration_account_update_request.rb | 123 ++ ...tic_cloud_integration_accounts_response.rb | 107 ++ .../v2/models/elastic_cloud_interface.rb | 63 + .../v2/models/elastic_cloud_interface_id.rb | 27 + .../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 +++ .../integration_account_dataflow_health.rb | 28 + .../integration_account_dataflow_status.rb | 125 ++ .../models/integration_account_permissions.rb | 115 ++ .../v2/models/integration_account_type.rb | 26 + .../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 + .../twilio_integration_account_attributes.rb | 154 +++ .../twilio_integration_account_create_data.rb | 144 ++ .../models/twilio_integration_account_data.rb | 165 +++ .../twilio_integration_account_request.rb | 123 ++ .../twilio_integration_account_response.rb | 105 ++ ...o_integration_account_update_attributes.rb | 115 ++ .../twilio_integration_account_update_data.rb | 144 ++ ...ilio_integration_account_update_request.rb | 123 ++ .../twilio_integration_accounts_response.rb | 107 ++ .../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 ++ 74 files changed, 8740 insertions(+) create mode 100644 examples/v2/elastic-cloud-integration-accounts/CreateElasticCloudIntegrationAccount.rb create mode 100644 examples/v2/elastic-cloud-integration-accounts/DeleteElasticCloudIntegrationAccount.rb create mode 100644 examples/v2/elastic-cloud-integration-accounts/GetElasticCloudIntegrationAccount.rb create mode 100644 examples/v2/elastic-cloud-integration-accounts/ListElasticCloudIntegrationAccounts.rb create mode 100644 examples/v2/elastic-cloud-integration-accounts/UpdateElasticCloudIntegrationAccount.rb create mode 100644 examples/v2/twilio-integration-accounts/CreateTwilioIntegrationAccount.rb create mode 100644 examples/v2/twilio-integration-accounts/DeleteTwilioIntegrationAccount.rb create mode 100644 examples/v2/twilio-integration-accounts/GetTwilioIntegrationAccount.rb create mode 100644 examples/v2/twilio-integration-accounts/ListTwilioIntegrationAccounts.rb create mode 100644 examples/v2/twilio-integration-accounts/UpdateTwilioIntegrationAccount.rb create mode 100644 features/v2/elastic_cloud_integration_accounts.feature create mode 100644 features/v2/twilio_integration_accounts.feature create mode 100644 lib/datadog_api_client/v2/api/elastic_cloud_integration_accounts_api.rb create mode 100644 lib/datadog_api_client/v2/api/twilio_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_account_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/elastic_cloud_integration_account_create_data.rb create mode 100644 lib/datadog_api_client/v2/models/elastic_cloud_integration_account_data.rb create mode 100644 lib/datadog_api_client/v2/models/elastic_cloud_integration_account_request.rb create mode 100644 lib/datadog_api_client/v2/models/elastic_cloud_integration_account_response.rb create mode 100644 lib/datadog_api_client/v2/models/elastic_cloud_integration_account_update_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/elastic_cloud_integration_account_update_data.rb create mode 100644 lib/datadog_api_client/v2/models/elastic_cloud_integration_account_update_request.rb create mode 100644 lib/datadog_api_client/v2/models/elastic_cloud_integration_accounts_response.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_id.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_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_permissions.rb create mode 100644 lib/datadog_api_client/v2/models/integration_account_type.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_account_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/twilio_integration_account_create_data.rb create mode 100644 lib/datadog_api_client/v2/models/twilio_integration_account_data.rb create mode 100644 lib/datadog_api_client/v2/models/twilio_integration_account_request.rb create mode 100644 lib/datadog_api_client/v2/models/twilio_integration_account_response.rb create mode 100644 lib/datadog_api_client/v2/models/twilio_integration_account_update_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/twilio_integration_account_update_data.rb create mode 100644 lib/datadog_api_client/v2/models/twilio_integration_account_update_request.rb create mode 100644 lib/datadog_api_client/v2/models/twilio_integration_accounts_response.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 93f9955949ca..94d676409b1a 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -505,6 +505,13 @@ components: default: false example: false type: boolean + ElasticCloudInterfaceIdParameter: + description: "Selects the Elastic Cloud interface (source-type). Supported values: `elastic-cloud`, `elastic-cloud-ccm`." + in: path + name: interface_id + required: true + schema: + $ref: "#/components/schemas/ElasticCloudInterfaceId" EntityID: description: UUID or Entity Ref. in: path @@ -885,6 +892,13 @@ components: required: true schema: type: string + IntegrationAccountIdParameter: + description: Unique identifier of the integration account. + in: path + name: account_id + required: true + schema: + type: string IssueIDPathParameter: description: The identifier of the issue. example: "c1726a66-1f64-11ee-b338-da7ad0900002" @@ -1977,6 +1991,13 @@ components: required: true schema: type: string + TwilioInterfaceIdParameter: + description: "Selects the Twilio interface (source-type). Supported values: `twilio`." + in: path + name: interface_id + required: true + schema: + $ref: "#/components/schemas/TwilioInterfaceType" UserAuthorizedClientId: description: The ID of the user authorized client. in: path @@ -33979,6 +34000,422 @@ 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. This field is not returned by the API. + 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. This field is not returned by the API. + 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 + ElasticCloudIntegrationAccountAttributes: + description: Attributes of an Elastic Cloud integration account. + properties: + interface: + $ref: "#/components/schemas/ElasticCloudInterface" + name: + description: Human-readable name of the account. + example: elastic-cloud-prod + type: string + permissions: + $ref: "#/components/schemas/IntegrationAccountPermissions" + required: + - name + - interface + type: object + ElasticCloudIntegrationAccountCreateData: + description: Data envelope for creating an Elastic Cloud integration account. + properties: + attributes: + $ref: "#/components/schemas/ElasticCloudIntegrationAccountAttributes" + type: + $ref: "#/components/schemas/IntegrationAccountType" + required: + - type + - attributes + type: object + ElasticCloudIntegrationAccountData: + description: Data envelope of an Elastic Cloud integration account, including server-assigned identity. + properties: + attributes: + $ref: "#/components/schemas/ElasticCloudIntegrationAccountAttributes" + 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 + ElasticCloudIntegrationAccountRequest: + description: Request payload to create an Elastic Cloud integration account. + properties: + data: + $ref: "#/components/schemas/ElasticCloudIntegrationAccountCreateData" + required: + - data + type: object + ElasticCloudIntegrationAccountResponse: + description: Response payload for a single Elastic Cloud integration account. + properties: + data: + $ref: "#/components/schemas/ElasticCloudIntegrationAccountData" + type: object + ElasticCloudIntegrationAccountUpdateAttributes: + description: >- + Updatable attributes of an Elastic Cloud integration account. Every field is optional; only the fields provided are changed. + properties: + interface: + $ref: "#/components/schemas/ElasticCloudInterfaceUpdate" + name: + description: Human-readable name of the account. + example: elastic-cloud-prod + type: string + type: object + ElasticCloudIntegrationAccountUpdateData: + description: Data envelope for updating an Elastic Cloud integration account. + properties: + attributes: + $ref: "#/components/schemas/ElasticCloudIntegrationAccountUpdateAttributes" + type: + $ref: "#/components/schemas/IntegrationAccountType" + required: + - type + - attributes + type: object + ElasticCloudIntegrationAccountUpdateRequest: + description: Request payload to update an Elastic Cloud integration account as a partial merge. + properties: + data: + $ref: "#/components/schemas/ElasticCloudIntegrationAccountUpdateData" + required: + - data + type: object + ElasticCloudIntegrationAccountsResponse: + description: Response payload for a list of Elastic Cloud integration accounts. + properties: + data: + description: List of Elastic Cloud integration accounts. + items: + $ref: "#/components/schemas/ElasticCloudIntegrationAccountData" + type: array + 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" + ElasticCloudInterfaceId: + description: Supported Elastic Cloud interface (source-type) ids. + enum: + - elastic-cloud + - elastic-cloud-ccm + example: elastic-cloud + type: string + x-enum-varnames: + - ELASTIC_CLOUD + - ELASTIC_CLOUD_CCM + 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 @@ -48666,6 +49103,58 @@ components: - id - 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 + 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 + 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 IntegrationAttributes: description: Attributes for an integration. properties: @@ -110576,6 +111065,234 @@ 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. This field is not returned by the API. + 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 + TwilioIntegrationAccountAttributes: + description: Attributes of a Twilio integration account. + properties: + interface: + $ref: "#/components/schemas/TwilioInterface" + name: + description: Human-readable name of the account. + example: twilio-prod + type: string + permissions: + $ref: "#/components/schemas/IntegrationAccountPermissions" + required: + - name + - interface + type: object + TwilioIntegrationAccountCreateData: + description: Data envelope for creating a Twilio integration account. + properties: + attributes: + $ref: "#/components/schemas/TwilioIntegrationAccountAttributes" + type: + $ref: "#/components/schemas/IntegrationAccountType" + required: + - type + - attributes + type: object + TwilioIntegrationAccountData: + description: Data envelope of a Twilio integration account, including server-assigned identity. + properties: + attributes: + $ref: "#/components/schemas/TwilioIntegrationAccountAttributes" + 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 + TwilioIntegrationAccountRequest: + description: Request payload to create a Twilio integration account. + properties: + data: + $ref: "#/components/schemas/TwilioIntegrationAccountCreateData" + required: + - data + type: object + TwilioIntegrationAccountResponse: + description: Response payload for a single Twilio integration account. + properties: + data: + $ref: "#/components/schemas/TwilioIntegrationAccountData" + type: object + TwilioIntegrationAccountUpdateAttributes: + description: >- + Updatable attributes of a Twilio integration account. Every field is optional; only the fields provided are changed. + properties: + interface: + $ref: "#/components/schemas/TwilioInterfaceUpdate" + name: + description: Human-readable name of the account. + example: twilio-prod + type: string + type: object + TwilioIntegrationAccountUpdateData: + description: Data envelope for updating a Twilio integration account. + properties: + attributes: + $ref: "#/components/schemas/TwilioIntegrationAccountUpdateAttributes" + type: + $ref: "#/components/schemas/IntegrationAccountType" + required: + - type + - attributes + type: object + TwilioIntegrationAccountUpdateRequest: + description: Request payload to update a Twilio integration account as a partial merge. + properties: + data: + $ref: "#/components/schemas/TwilioIntegrationAccountUpdateData" + required: + - data + type: object + TwilioIntegrationAccountsResponse: + description: Response payload for a list of Twilio integration accounts. + properties: + data: + description: List of Twilio integration accounts. + items: + $ref: "#/components/schemas/TwilioIntegrationAccountData" + type: array + 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: @@ -151264,6 +151981,256 @@ paths: operator: OR permissions: - manage_integrations + /api/v2/integrations/elastic-cloud/interfaces/{interface_id}/accounts: + get: + description: List the Elastic Cloud integration accounts for a given interface. + operationId: ListElasticCloudIntegrationAccounts + parameters: + - $ref: "#/components/parameters/ElasticCloudInterfaceIdParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + interface: + authentication: + type: basic + username: datadog + dataflows: + - enabled: true + id: elastic-cloud-metrics + status: + health: DATAFLOW_HEALTH_OK + updated_at: "2026-06-25T08:30:50Z" + settings: + tags: + - env:prod + url: "https://example.es.us-central1.gcp.cloud.es.io:9243" + type: elastic-cloud + name: elastic-cloud-prod + permissions: + resource_id: "integration-account:elastic-cloud:953a0060-81ec-4221-aed4-d4733b59cd96" + user_can_edit: true + id: 953a0060-81ec-4221-aed4-d4733b59cd96 + type: integration-account + schema: + $ref: "#/components/schemas/ElasticCloudIntegrationAccountsResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: List Elastic Cloud integration accounts + tags: + - Elastic Cloud 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 Elastic Cloud integration account for a given interface. + operationId: CreateElasticCloudIntegrationAccount + parameters: + - $ref: "#/components/parameters/ElasticCloudInterfaceIdParameter" + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/ElasticCloudIntegrationAccountRequest" + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + interface: + authentication: + type: basic + username: datadog + dataflows: + - enabled: true + id: elastic-cloud-metrics + status: + health: DATAFLOW_HEALTH_OK + updated_at: "2026-06-25T08:30:50Z" + settings: + tags: + - env:prod + url: "https://example.es.us-central1.gcp.cloud.es.io:9243" + type: elastic-cloud + name: elastic-cloud-prod + permissions: + resource_id: "integration-account:elastic-cloud:953a0060-81ec-4221-aed4-d4733b59cd96" + user_can_edit: true + id: 953a0060-81ec-4221-aed4-d4733b59cd96 + type: integration-account + schema: + $ref: "#/components/schemas/ElasticCloudIntegrationAccountResponse" + 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 Elastic Cloud integration account + tags: + - Elastic Cloud 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/elastic-cloud/interfaces/{interface_id}/accounts/{account_id}: + delete: + description: Delete an Elastic Cloud integration account. + operationId: DeleteElasticCloudIntegrationAccount + parameters: + - $ref: "#/components/parameters/ElasticCloudInterfaceIdParameter" + - $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 Elastic Cloud integration account + tags: + - Elastic Cloud 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 Elastic Cloud integration account. + operationId: GetElasticCloudIntegrationAccount + parameters: + - $ref: "#/components/parameters/ElasticCloudInterfaceIdParameter" + - $ref: "#/components/parameters/IntegrationAccountIdParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + interface: + authentication: + type: basic + username: datadog + dataflows: + - enabled: true + id: elastic-cloud-metrics + status: + health: DATAFLOW_HEALTH_OK + updated_at: "2026-06-25T08:30:50Z" + settings: + tags: + - env:prod + url: "https://example.es.us-central1.gcp.cloud.es.io:9243" + type: elastic-cloud + name: elastic-cloud-prod + permissions: + resource_id: "integration-account:elastic-cloud:953a0060-81ec-4221-aed4-d4733b59cd96" + user_can_edit: true + id: 953a0060-81ec-4221-aed4-d4733b59cd96 + type: integration-account + schema: + $ref: "#/components/schemas/ElasticCloudIntegrationAccountResponse" + 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 Elastic Cloud integration account + tags: + - Elastic Cloud 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 Elastic Cloud 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 payload or write-only credentials. + operationId: UpdateElasticCloudIntegrationAccount + parameters: + - $ref: "#/components/parameters/ElasticCloudInterfaceIdParameter" + - $ref: "#/components/parameters/IntegrationAccountIdParameter" + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/ElasticCloudIntegrationAccountUpdateRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + interface: + authentication: + type: basic + username: datadog + dataflows: + - enabled: true + id: elastic-cloud-metrics + status: + health: DATAFLOW_HEALTH_OK + updated_at: "2026-06-25T08:30:50Z" + settings: + tags: + - env:prod + url: "https://example.es.us-central1.gcp.cloud.es.io:9243" + type: elastic-cloud + name: elastic-cloud-prod + permissions: + resource_id: "integration-account:elastic-cloud:953a0060-81ec-4221-aed4-d4733b59cd96" + user_can_edit: true + id: 953a0060-81ec-4221-aed4-d4733b59cd96 + type: integration-account + schema: + $ref: "#/components/schemas/ElasticCloudIntegrationAccountResponse" + 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 Elastic Cloud integration account + tags: + - Elastic Cloud 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/fastly/accounts: get: description: List Fastly accounts. @@ -151887,6 +152854,252 @@ paths: operator: OR permissions: - manage_integrations + /api/v2/integrations/twilio/interfaces/{interface_id}/accounts: + get: + description: List the Twilio integration accounts for a given interface. + operationId: ListTwilioIntegrationAccounts + parameters: + - $ref: "#/components/parameters/TwilioInterfaceIdParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + 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 + 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/TwilioIntegrationAccountsResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: List Twilio integration accounts + tags: + - Twilio 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 a Twilio integration account for a given interface. + operationId: CreateTwilioIntegrationAccount + parameters: + - $ref: "#/components/parameters/TwilioInterfaceIdParameter" + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/TwilioIntegrationAccountRequest" + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + 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 + 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/TwilioIntegrationAccountResponse" + description: Created + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Create a Twilio integration account + tags: + - Twilio 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/twilio/interfaces/{interface_id}/accounts/{account_id}: + delete: + description: Delete a Twilio integration account. + operationId: DeleteTwilioIntegrationAccount + parameters: + - $ref: "#/components/parameters/TwilioInterfaceIdParameter" + - $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 a Twilio integration account + tags: + - Twilio 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 Twilio integration account. + operationId: GetTwilioIntegrationAccount + parameters: + - $ref: "#/components/parameters/TwilioInterfaceIdParameter" + - $ref: "#/components/parameters/IntegrationAccountIdParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + 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 + 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/TwilioIntegrationAccountResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get a Twilio integration account + tags: + - Twilio 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 a Twilio 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 payload or write-only credentials. + operationId: UpdateTwilioIntegrationAccount + parameters: + - $ref: "#/components/parameters/TwilioInterfaceIdParameter" + - $ref: "#/components/parameters/IntegrationAccountIdParameter" + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/TwilioIntegrationAccountUpdateRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + 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 + 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/TwilioIntegrationAccountResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Update a Twilio integration account + tags: + - Twilio 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. @@ -206303,6 +207516,9 @@ tags: scopes from alerting. Downtime settings, which can be scheduled with start and end times, prevent all alerting related to specified Datadog tags. name: Downtimes + - description: >- + Manage Elastic Cloud accounts for the Elastic Cloud integration, served by the Account Management Service (AMS). The account payload is strongly typed to Elastic Cloud; the supported interfaces (monitoring and Cloud Cost Management) are modeled as a nested union. + name: Elastic Cloud Integration Accounts - description: Manage per-integration configurations for the Internal Developer Portal (IDP). These configurations control which external resources (for example, GitHub repositories, Jira projects, or PagerDuty services) are synced as entities into the Software Catalog. name: Entity Integration Configs - description: Retrieves security risk scores for entities in your organization. @@ -206730,6 +207946,9 @@ tags: - description: |- Search and manage flaky tests through Test Optimization. See the [Test Optimization page](https://docs.datadoghq.com/tests/) for more information. name: Test Optimization + - description: >- + Manage Twilio accounts for the Twilio integration, served by the Account Management Service (AMS). The account payload is strongly typed to Twilio; the Twilio interface and its authentication are modeled inline. + name: Twilio Integration Accounts - description: |- The usage metering API allows you to get hourly, daily, and monthly usage across multiple facets of Datadog. diff --git a/examples/v2/elastic-cloud-integration-accounts/CreateElasticCloudIntegrationAccount.rb b/examples/v2/elastic-cloud-integration-accounts/CreateElasticCloudIntegrationAccount.rb new file mode 100644 index 000000000000..114f9cd74b21 --- /dev/null +++ b/examples/v2/elastic-cloud-integration-accounts/CreateElasticCloudIntegrationAccount.rb @@ -0,0 +1,44 @@ +# Create an Elastic Cloud integration account returns "Created" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.create_elastic_cloud_integration_account".to_sym] = true +end +api_instance = DatadogAPIClient::V2::ElasticCloudIntegrationAccountsAPI.new + +body = DatadogAPIClient::V2::ElasticCloudIntegrationAccountRequest.new({ + data: DatadogAPIClient::V2::ElasticCloudIntegrationAccountCreateData.new({ + attributes: DatadogAPIClient::V2::ElasticCloudIntegrationAccountAttributes.new({ + interface: DatadogAPIClient::V2::ElasticCloudMonitoringInterface.new({ + authentication: DatadogAPIClient::V2::ElasticCloudBasicAuth.new({ + password: "your-password", + type: DatadogAPIClient::V2::ElasticCloudBasicAuthType::BASIC, + username: "datadog", + }), + dataflows: [ + DatadogAPIClient::V2::ElasticCloudDataflow.new({ + enabled: true, + id: DatadogAPIClient::V2::ElasticCloudDataflowId::METRICS, + }), + ], + settings: DatadogAPIClient::V2::ElasticCloudSettings.new({ + cat_allocation_stats_enabled: false, + detailed_index_stats_enabled: false, + index_stats_enabled: false, + pending_task_stats_enabled: false, + pshard_graceful_to_enabled: false, + pshard_stats_enabled: false, + slm_stats_enabled: false, + tags: [ + "env:prod", + ], + url: "https://example.es.us-central1.gcp.cloud.es.io:9243", + }), + type: DatadogAPIClient::V2::ElasticCloudMonitoringInterfaceType::ELASTIC_CLOUD, + }), + name: "elastic-cloud-prod", + }), + type: DatadogAPIClient::V2::IntegrationAccountType::INTEGRATION_ACCOUNT, + }), +}) +p api_instance.create_elastic_cloud_integration_account(ElasticCloudInterfaceId::ELASTIC_CLOUD, body) diff --git a/examples/v2/elastic-cloud-integration-accounts/DeleteElasticCloudIntegrationAccount.rb b/examples/v2/elastic-cloud-integration-accounts/DeleteElasticCloudIntegrationAccount.rb new file mode 100644 index 000000000000..2f26a40f2c55 --- /dev/null +++ b/examples/v2/elastic-cloud-integration-accounts/DeleteElasticCloudIntegrationAccount.rb @@ -0,0 +1,8 @@ +# Delete an Elastic Cloud integration account returns "No Content" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.delete_elastic_cloud_integration_account".to_sym] = true +end +api_instance = DatadogAPIClient::V2::ElasticCloudIntegrationAccountsAPI.new +api_instance.delete_elastic_cloud_integration_account(ElasticCloudInterfaceId::ELASTIC_CLOUD, "account_id") diff --git a/examples/v2/elastic-cloud-integration-accounts/GetElasticCloudIntegrationAccount.rb b/examples/v2/elastic-cloud-integration-accounts/GetElasticCloudIntegrationAccount.rb new file mode 100644 index 000000000000..c611aa3fab91 --- /dev/null +++ b/examples/v2/elastic-cloud-integration-accounts/GetElasticCloudIntegrationAccount.rb @@ -0,0 +1,8 @@ +# Get an Elastic Cloud integration account returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_elastic_cloud_integration_account".to_sym] = true +end +api_instance = DatadogAPIClient::V2::ElasticCloudIntegrationAccountsAPI.new +p api_instance.get_elastic_cloud_integration_account(ElasticCloudInterfaceId::ELASTIC_CLOUD, "account_id") diff --git a/examples/v2/elastic-cloud-integration-accounts/ListElasticCloudIntegrationAccounts.rb b/examples/v2/elastic-cloud-integration-accounts/ListElasticCloudIntegrationAccounts.rb new file mode 100644 index 000000000000..9149741a0cf1 --- /dev/null +++ b/examples/v2/elastic-cloud-integration-accounts/ListElasticCloudIntegrationAccounts.rb @@ -0,0 +1,8 @@ +# List Elastic Cloud integration accounts returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_elastic_cloud_integration_accounts".to_sym] = true +end +api_instance = DatadogAPIClient::V2::ElasticCloudIntegrationAccountsAPI.new +p api_instance.list_elastic_cloud_integration_accounts(ElasticCloudInterfaceId::ELASTIC_CLOUD) diff --git a/examples/v2/elastic-cloud-integration-accounts/UpdateElasticCloudIntegrationAccount.rb b/examples/v2/elastic-cloud-integration-accounts/UpdateElasticCloudIntegrationAccount.rb new file mode 100644 index 000000000000..36b32a026a44 --- /dev/null +++ b/examples/v2/elastic-cloud-integration-accounts/UpdateElasticCloudIntegrationAccount.rb @@ -0,0 +1,44 @@ +# Update an Elastic Cloud integration account returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.update_elastic_cloud_integration_account".to_sym] = true +end +api_instance = DatadogAPIClient::V2::ElasticCloudIntegrationAccountsAPI.new + +body = DatadogAPIClient::V2::ElasticCloudIntegrationAccountUpdateRequest.new({ + data: DatadogAPIClient::V2::ElasticCloudIntegrationAccountUpdateData.new({ + attributes: DatadogAPIClient::V2::ElasticCloudIntegrationAccountUpdateAttributes.new({ + interface: DatadogAPIClient::V2::ElasticCloudMonitoringInterfaceUpdate.new({ + authentication: DatadogAPIClient::V2::ElasticCloudBasicAuth.new({ + password: "your-password", + type: DatadogAPIClient::V2::ElasticCloudBasicAuthType::BASIC, + username: "datadog", + }), + dataflows: [ + DatadogAPIClient::V2::ElasticCloudDataflow.new({ + enabled: true, + id: DatadogAPIClient::V2::ElasticCloudDataflowId::METRICS, + }), + ], + settings: DatadogAPIClient::V2::ElasticCloudSettingsUpdate.new({ + cat_allocation_stats_enabled: false, + detailed_index_stats_enabled: false, + index_stats_enabled: false, + pending_task_stats_enabled: false, + pshard_graceful_to_enabled: false, + pshard_stats_enabled: false, + slm_stats_enabled: false, + tags: [ + "env:prod", + ], + url: "https://example.es.us-central1.gcp.cloud.es.io:9243", + }), + type: DatadogAPIClient::V2::ElasticCloudMonitoringInterfaceType::ELASTIC_CLOUD, + }), + name: "elastic-cloud-prod", + }), + type: DatadogAPIClient::V2::IntegrationAccountType::INTEGRATION_ACCOUNT, + }), +}) +p api_instance.update_elastic_cloud_integration_account(ElasticCloudInterfaceId::ELASTIC_CLOUD, "account_id", body) diff --git a/examples/v2/twilio-integration-accounts/CreateTwilioIntegrationAccount.rb b/examples/v2/twilio-integration-accounts/CreateTwilioIntegrationAccount.rb new file mode 100644 index 000000000000..5180fa9f0c5a --- /dev/null +++ b/examples/v2/twilio-integration-accounts/CreateTwilioIntegrationAccount.rb @@ -0,0 +1,35 @@ +# Create a Twilio integration account returns "Created" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.create_twilio_integration_account".to_sym] = true +end +api_instance = DatadogAPIClient::V2::TwilioIntegrationAccountsAPI.new + +body = DatadogAPIClient::V2::TwilioIntegrationAccountRequest.new({ + data: DatadogAPIClient::V2::TwilioIntegrationAccountCreateData.new({ + attributes: DatadogAPIClient::V2::TwilioIntegrationAccountAttributes.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, + }), + name: "twilio-prod", + }), + type: DatadogAPIClient::V2::IntegrationAccountType::INTEGRATION_ACCOUNT, + }), +}) +p api_instance.create_twilio_integration_account(TwilioInterfaceType::TWILIO, body) diff --git a/examples/v2/twilio-integration-accounts/DeleteTwilioIntegrationAccount.rb b/examples/v2/twilio-integration-accounts/DeleteTwilioIntegrationAccount.rb new file mode 100644 index 000000000000..a23ecbce55ba --- /dev/null +++ b/examples/v2/twilio-integration-accounts/DeleteTwilioIntegrationAccount.rb @@ -0,0 +1,8 @@ +# Delete a Twilio integration account returns "No Content" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.delete_twilio_integration_account".to_sym] = true +end +api_instance = DatadogAPIClient::V2::TwilioIntegrationAccountsAPI.new +api_instance.delete_twilio_integration_account(TwilioInterfaceType::TWILIO, "account_id") diff --git a/examples/v2/twilio-integration-accounts/GetTwilioIntegrationAccount.rb b/examples/v2/twilio-integration-accounts/GetTwilioIntegrationAccount.rb new file mode 100644 index 000000000000..9cd4467f3a4d --- /dev/null +++ b/examples/v2/twilio-integration-accounts/GetTwilioIntegrationAccount.rb @@ -0,0 +1,8 @@ +# Get a Twilio integration account returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_twilio_integration_account".to_sym] = true +end +api_instance = DatadogAPIClient::V2::TwilioIntegrationAccountsAPI.new +p api_instance.get_twilio_integration_account(TwilioInterfaceType::TWILIO, "account_id") diff --git a/examples/v2/twilio-integration-accounts/ListTwilioIntegrationAccounts.rb b/examples/v2/twilio-integration-accounts/ListTwilioIntegrationAccounts.rb new file mode 100644 index 000000000000..79817ef3b3af --- /dev/null +++ b/examples/v2/twilio-integration-accounts/ListTwilioIntegrationAccounts.rb @@ -0,0 +1,8 @@ +# List Twilio integration accounts returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_twilio_integration_accounts".to_sym] = true +end +api_instance = DatadogAPIClient::V2::TwilioIntegrationAccountsAPI.new +p api_instance.list_twilio_integration_accounts(TwilioInterfaceType::TWILIO) diff --git a/examples/v2/twilio-integration-accounts/UpdateTwilioIntegrationAccount.rb b/examples/v2/twilio-integration-accounts/UpdateTwilioIntegrationAccount.rb new file mode 100644 index 000000000000..d31f7cea76cc --- /dev/null +++ b/examples/v2/twilio-integration-accounts/UpdateTwilioIntegrationAccount.rb @@ -0,0 +1,35 @@ +# Update a Twilio integration account returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.update_twilio_integration_account".to_sym] = true +end +api_instance = DatadogAPIClient::V2::TwilioIntegrationAccountsAPI.new + +body = DatadogAPIClient::V2::TwilioIntegrationAccountUpdateRequest.new({ + data: DatadogAPIClient::V2::TwilioIntegrationAccountUpdateData.new({ + attributes: DatadogAPIClient::V2::TwilioIntegrationAccountUpdateAttributes.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, + }), + name: "twilio-prod", + }), + type: DatadogAPIClient::V2::IntegrationAccountType::INTEGRATION_ACCOUNT, + }), +}) +p api_instance.update_twilio_integration_account(TwilioInterfaceType::TWILIO, "account_id", body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 9442a906c5c3..99b842d5ed01 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -4054,6 +4054,26 @@ "resource_id" => "String", "body" => "ConfluentResourceRequest", }, + "v2.ListElasticCloudIntegrationAccounts" => { + "interface_id" => "ElasticCloudInterfaceId", + }, + "v2.CreateElasticCloudIntegrationAccount" => { + "interface_id" => "ElasticCloudInterfaceId", + "body" => "ElasticCloudIntegrationAccountRequest", + }, + "v2.DeleteElasticCloudIntegrationAccount" => { + "interface_id" => "ElasticCloudInterfaceId", + "account_id" => "String", + }, + "v2.GetElasticCloudIntegrationAccount" => { + "interface_id" => "ElasticCloudInterfaceId", + "account_id" => "String", + }, + "v2.UpdateElasticCloudIntegrationAccount" => { + "interface_id" => "ElasticCloudInterfaceId", + "account_id" => "String", + "body" => "ElasticCloudIntegrationAccountUpdateRequest", + }, "v2.CreateFastlyAccount" => { "body" => "FastlyAccountCreateRequest", }, @@ -4100,6 +4120,26 @@ "account_id" => "String", "body" => "OktaAccountUpdateRequest", }, + "v2.ListTwilioIntegrationAccounts" => { + "interface_id" => "TwilioInterfaceType", + }, + "v2.CreateTwilioIntegrationAccount" => { + "interface_id" => "TwilioInterfaceType", + "body" => "TwilioIntegrationAccountRequest", + }, + "v2.DeleteTwilioIntegrationAccount" => { + "interface_id" => "TwilioInterfaceType", + "account_id" => "String", + }, + "v2.GetTwilioIntegrationAccount" => { + "interface_id" => "TwilioInterfaceType", + "account_id" => "String", + }, + "v2.UpdateTwilioIntegrationAccount" => { + "interface_id" => "TwilioInterfaceType", + "account_id" => "String", + "body" => "TwilioIntegrationAccountUpdateRequest", + }, "v2.UpdateIPAllowlist" => { "body" => "IPAllowlistUpdateRequest", }, diff --git a/features/v2/elastic_cloud_integration_accounts.feature b/features/v2/elastic_cloud_integration_accounts.feature new file mode 100644 index 000000000000..a1f24638a2eb --- /dev/null +++ b/features/v2/elastic_cloud_integration_accounts.feature @@ -0,0 +1,146 @@ +@endpoint(elastic-cloud-integration-accounts) @endpoint(elastic-cloud-integration-accounts-v2) +Feature: Elastic Cloud Integration Accounts + Manage Elastic Cloud accounts for the Elastic Cloud integration, served by + the Account Management Service (AMS). The account payload is strongly + typed to Elastic Cloud; the supported interfaces (monitoring and Cloud + Cost Management) are modeled as a nested union. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "ElasticCloudIntegrationAccounts" API + + @generated @skip @team:DataDog/saas-integrations + Scenario: Create an Elastic Cloud integration account returns "Bad Request" response + Given operation "CreateElasticCloudIntegrationAccount" enabled + And new "CreateElasticCloudIntegrationAccount" request + And request contains "interface_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"interface": {"authentication": {"password": "your-password", "type": "basic", "username": "datadog"}, "dataflows": [{"enabled": true, "id": "elastic-cloud-metrics"}], "settings": {"cat_allocation_stats_enabled": false, "detailed_index_stats_enabled": false, "index_stats_enabled": false, "pending_task_stats_enabled": false, "pshard_graceful_to_enabled": false, "pshard_stats_enabled": false, "slm_stats_enabled": false, "tags": ["env:prod"], "url": "https://example.es.us-central1.gcp.cloud.es.io:9243"}, "type": "elastic-cloud"}, "name": "elastic-cloud-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 Elastic Cloud integration account returns "Created" response + Given operation "CreateElasticCloudIntegrationAccount" enabled + And new "CreateElasticCloudIntegrationAccount" request + And request contains "interface_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"interface": {"authentication": {"password": "your-password", "type": "basic", "username": "datadog"}, "dataflows": [{"enabled": true, "id": "elastic-cloud-metrics"}], "settings": {"cat_allocation_stats_enabled": false, "detailed_index_stats_enabled": false, "index_stats_enabled": false, "pending_task_stats_enabled": false, "pshard_graceful_to_enabled": false, "pshard_stats_enabled": false, "slm_stats_enabled": false, "tags": ["env:prod"], "url": "https://example.es.us-central1.gcp.cloud.es.io:9243"}, "type": "elastic-cloud"}, "name": "elastic-cloud-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 Elastic Cloud integration account returns "Not Found" response + Given operation "CreateElasticCloudIntegrationAccount" enabled + And new "CreateElasticCloudIntegrationAccount" request + And request contains "interface_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"interface": {"authentication": {"password": "your-password", "type": "basic", "username": "datadog"}, "dataflows": [{"enabled": true, "id": "elastic-cloud-metrics"}], "settings": {"cat_allocation_stats_enabled": false, "detailed_index_stats_enabled": false, "index_stats_enabled": false, "pending_task_stats_enabled": false, "pshard_graceful_to_enabled": false, "pshard_stats_enabled": false, "slm_stats_enabled": false, "tags": ["env:prod"], "url": "https://example.es.us-central1.gcp.cloud.es.io:9243"}, "type": "elastic-cloud"}, "name": "elastic-cloud-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 Elastic Cloud integration account returns "Bad Request" response + Given operation "DeleteElasticCloudIntegrationAccount" enabled + And new "DeleteElasticCloudIntegrationAccount" request + 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 Elastic Cloud integration account returns "No Content" response + Given operation "DeleteElasticCloudIntegrationAccount" enabled + And new "DeleteElasticCloudIntegrationAccount" request + 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 Elastic Cloud integration account returns "Not Found" response + Given operation "DeleteElasticCloudIntegrationAccount" enabled + And new "DeleteElasticCloudIntegrationAccount" request + 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 Elastic Cloud integration account returns "Bad Request" response + Given operation "GetElasticCloudIntegrationAccount" enabled + And new "GetElasticCloudIntegrationAccount" request + 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 Elastic Cloud integration account returns "Not Found" response + Given operation "GetElasticCloudIntegrationAccount" enabled + And new "GetElasticCloudIntegrationAccount" request + 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 Elastic Cloud integration account returns "OK" response + Given operation "GetElasticCloudIntegrationAccount" enabled + And new "GetElasticCloudIntegrationAccount" request + 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 Elastic Cloud integration accounts returns "Bad Request" response + Given operation "ListElasticCloudIntegrationAccounts" enabled + And new "ListElasticCloudIntegrationAccounts" request + 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 Elastic Cloud integration accounts returns "Not Found" response + Given operation "ListElasticCloudIntegrationAccounts" enabled + And new "ListElasticCloudIntegrationAccounts" request + 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 Elastic Cloud integration accounts returns "OK" response + Given operation "ListElasticCloudIntegrationAccounts" enabled + And new "ListElasticCloudIntegrationAccounts" request + 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 Elastic Cloud integration account returns "Bad Request" response + Given operation "UpdateElasticCloudIntegrationAccount" enabled + And new "UpdateElasticCloudIntegrationAccount" request + And request contains "interface_id" parameter from "REPLACE.ME" + And request contains "account_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"interface": {"authentication": {"password": "your-password", "type": "basic", "username": "datadog"}, "dataflows": [{"enabled": true, "id": "elastic-cloud-metrics"}], "settings": {"cat_allocation_stats_enabled": false, "detailed_index_stats_enabled": false, "index_stats_enabled": false, "pending_task_stats_enabled": false, "pshard_graceful_to_enabled": false, "pshard_stats_enabled": false, "slm_stats_enabled": false, "tags": ["env:prod"], "url": "https://example.es.us-central1.gcp.cloud.es.io:9243"}, "type": "elastic-cloud"}, "name": "elastic-cloud-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 Elastic Cloud integration account returns "Not Found" response + Given operation "UpdateElasticCloudIntegrationAccount" enabled + And new "UpdateElasticCloudIntegrationAccount" request + And request contains "interface_id" parameter from "REPLACE.ME" + And request contains "account_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"interface": {"authentication": {"password": "your-password", "type": "basic", "username": "datadog"}, "dataflows": [{"enabled": true, "id": "elastic-cloud-metrics"}], "settings": {"cat_allocation_stats_enabled": false, "detailed_index_stats_enabled": false, "index_stats_enabled": false, "pending_task_stats_enabled": false, "pshard_graceful_to_enabled": false, "pshard_stats_enabled": false, "slm_stats_enabled": false, "tags": ["env:prod"], "url": "https://example.es.us-central1.gcp.cloud.es.io:9243"}, "type": "elastic-cloud"}, "name": "elastic-cloud-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 Elastic Cloud integration account returns "OK" response + Given operation "UpdateElasticCloudIntegrationAccount" enabled + And new "UpdateElasticCloudIntegrationAccount" request + And request contains "interface_id" parameter from "REPLACE.ME" + And request contains "account_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"interface": {"authentication": {"password": "your-password", "type": "basic", "username": "datadog"}, "dataflows": [{"enabled": true, "id": "elastic-cloud-metrics"}], "settings": {"cat_allocation_stats_enabled": false, "detailed_index_stats_enabled": false, "index_stats_enabled": false, "pending_task_stats_enabled": false, "pshard_graceful_to_enabled": false, "pshard_stats_enabled": false, "slm_stats_enabled": false, "tags": ["env:prod"], "url": "https://example.es.us-central1.gcp.cloud.es.io:9243"}, "type": "elastic-cloud"}, "name": "elastic-cloud-prod"}, "type": "integration-account"}} + When the request is sent + Then the response status is 200 OK diff --git a/features/v2/twilio_integration_accounts.feature b/features/v2/twilio_integration_accounts.feature new file mode 100644 index 000000000000..0ed94af222e9 --- /dev/null +++ b/features/v2/twilio_integration_accounts.feature @@ -0,0 +1,145 @@ +@endpoint(twilio-integration-accounts) @endpoint(twilio-integration-accounts-v2) +Feature: Twilio Integration Accounts + Manage Twilio accounts for the Twilio integration, served by the Account + Management Service (AMS). The account payload is strongly typed to Twilio; + the Twilio interface and its authentication are modeled inline. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "TwilioIntegrationAccounts" API + + @generated @skip @team:DataDog/saas-integrations + Scenario: Create a Twilio integration account returns "Bad Request" response + Given operation "CreateTwilioIntegrationAccount" enabled + And new "CreateTwilioIntegrationAccount" request + And request contains "interface_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"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"}, "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 a Twilio integration account returns "Created" response + Given operation "CreateTwilioIntegrationAccount" enabled + And new "CreateTwilioIntegrationAccount" request + And request contains "interface_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"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"}, "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 a Twilio integration account returns "Not Found" response + Given operation "CreateTwilioIntegrationAccount" enabled + And new "CreateTwilioIntegrationAccount" request + And request contains "interface_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"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"}, "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 a Twilio integration account returns "Bad Request" response + Given operation "DeleteTwilioIntegrationAccount" enabled + And new "DeleteTwilioIntegrationAccount" request + 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 a Twilio integration account returns "No Content" response + Given operation "DeleteTwilioIntegrationAccount" enabled + And new "DeleteTwilioIntegrationAccount" request + 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 a Twilio integration account returns "Not Found" response + Given operation "DeleteTwilioIntegrationAccount" enabled + And new "DeleteTwilioIntegrationAccount" request + 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 a Twilio integration account returns "Bad Request" response + Given operation "GetTwilioIntegrationAccount" enabled + And new "GetTwilioIntegrationAccount" request + 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 a Twilio integration account returns "Not Found" response + Given operation "GetTwilioIntegrationAccount" enabled + And new "GetTwilioIntegrationAccount" request + 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 a Twilio integration account returns "OK" response + Given operation "GetTwilioIntegrationAccount" enabled + And new "GetTwilioIntegrationAccount" request + 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 Twilio integration accounts returns "Bad Request" response + Given operation "ListTwilioIntegrationAccounts" enabled + And new "ListTwilioIntegrationAccounts" request + 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 Twilio integration accounts returns "Not Found" response + Given operation "ListTwilioIntegrationAccounts" enabled + And new "ListTwilioIntegrationAccounts" request + 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 Twilio integration accounts returns "OK" response + Given operation "ListTwilioIntegrationAccounts" enabled + And new "ListTwilioIntegrationAccounts" request + 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 a Twilio integration account returns "Bad Request" response + Given operation "UpdateTwilioIntegrationAccount" enabled + And new "UpdateTwilioIntegrationAccount" request + And request contains "interface_id" parameter from "REPLACE.ME" + And request contains "account_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"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"}, "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 a Twilio integration account returns "Not Found" response + Given operation "UpdateTwilioIntegrationAccount" enabled + And new "UpdateTwilioIntegrationAccount" request + And request contains "interface_id" parameter from "REPLACE.ME" + And request contains "account_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"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"}, "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 a Twilio integration account returns "OK" response + Given operation "UpdateTwilioIntegrationAccount" enabled + And new "UpdateTwilioIntegrationAccount" request + And request contains "interface_id" parameter from "REPLACE.ME" + And request contains "account_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"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"}, "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 3e0cca0a0be8..40f6c39ceaea 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -4238,6 +4238,47 @@ "type": "idempotent" } }, + "ListElasticCloudIntegrationAccounts": { + "tag": "Elastic Cloud Integration Accounts", + "undo": { + "type": "safe" + } + }, + "CreateElasticCloudIntegrationAccount": { + "tag": "Elastic Cloud Integration Accounts", + "undo": { + "operationId": "DeleteElasticCloudIntegrationAccount", + "parameters": [ + { + "name": "interface_id", + "source": "interface_id" + }, + { + "name": "account_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "DeleteElasticCloudIntegrationAccount": { + "tag": "Elastic Cloud Integration Accounts", + "undo": { + "type": "idempotent" + } + }, + "GetElasticCloudIntegrationAccount": { + "tag": "Elastic Cloud Integration Accounts", + "undo": { + "type": "safe" + } + }, + "UpdateElasticCloudIntegrationAccount": { + "tag": "Elastic Cloud Integration Accounts", + "undo": { + "type": "idempotent" + } + }, "ListFastlyAccounts": { "tag": "Fastly Integration", "undo": { @@ -4349,6 +4390,47 @@ "type": "idempotent" } }, + "ListTwilioIntegrationAccounts": { + "tag": "Twilio Integration Accounts", + "undo": { + "type": "safe" + } + }, + "CreateTwilioIntegrationAccount": { + "tag": "Twilio Integration Accounts", + "undo": { + "operationId": "DeleteTwilioIntegrationAccount", + "parameters": [ + { + "name": "interface_id", + "source": "interface_id" + }, + { + "name": "account_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "DeleteTwilioIntegrationAccount": { + "tag": "Twilio Integration Accounts", + "undo": { + "type": "idempotent" + } + }, + "GetTwilioIntegrationAccount": { + "tag": "Twilio Integration Accounts", + "undo": { + "type": "safe" + } + }, + "UpdateTwilioIntegrationAccount": { + "tag": "Twilio 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 b20871c46d35..f95180deef9e 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -541,6 +541,16 @@ def initialize "v2.update_jira_issue_template": false, "v2.create_tenancy_config": false, "v2.get_tenancy_configs": false, + "v2.create_elastic_cloud_integration_account": false, + "v2.delete_elastic_cloud_integration_account": false, + "v2.get_elastic_cloud_integration_account": false, + "v2.list_elastic_cloud_integration_accounts": false, + "v2.update_elastic_cloud_integration_account": false, + "v2.create_twilio_integration_account": false, + "v2.delete_twilio_integration_account": false, + "v2.get_twilio_integration_account": false, + "v2.list_twilio_integration_accounts": false, + "v2.update_twilio_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 8b02789b65d9..db2f5f71e0cc 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -3075,6 +3075,38 @@ 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_account_attributes" => "ElasticCloudIntegrationAccountAttributes", + "v2.elastic_cloud_integration_account_create_data" => "ElasticCloudIntegrationAccountCreateData", + "v2.elastic_cloud_integration_account_data" => "ElasticCloudIntegrationAccountData", + "v2.elastic_cloud_integration_account_request" => "ElasticCloudIntegrationAccountRequest", + "v2.elastic_cloud_integration_account_response" => "ElasticCloudIntegrationAccountResponse", + "v2.elastic_cloud_integration_accounts_response" => "ElasticCloudIntegrationAccountsResponse", + "v2.elastic_cloud_integration_account_update_attributes" => "ElasticCloudIntegrationAccountUpdateAttributes", + "v2.elastic_cloud_integration_account_update_data" => "ElasticCloudIntegrationAccountUpdateData", + "v2.elastic_cloud_integration_account_update_request" => "ElasticCloudIntegrationAccountUpdateRequest", + "v2.elastic_cloud_interface" => "ElasticCloudInterface", + "v2.elastic_cloud_interface_id" => "ElasticCloudInterfaceId", + "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", @@ -3968,6 +4000,10 @@ def overrides "v2.input_schema_parameters_type" => "InputSchemaParametersType", "v2.intake_payload_accepted" => "IntakePayloadAccepted", "v2.integration" => "Integration", + "v2.integration_account_dataflow_health" => "IntegrationAccountDataflowHealth", + "v2.integration_account_dataflow_status" => "IntegrationAccountDataflowStatus", + "v2.integration_account_permissions" => "IntegrationAccountPermissions", + "v2.integration_account_type" => "IntegrationAccountType", "v2.integration_attributes" => "IntegrationAttributes", "v2.integration_incident" => "IntegrationIncident", "v2.integration_incident_field_mappings_items" => "IntegrationIncidentFieldMappingsItems", @@ -7873,6 +7909,25 @@ 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_account_attributes" => "TwilioIntegrationAccountAttributes", + "v2.twilio_integration_account_create_data" => "TwilioIntegrationAccountCreateData", + "v2.twilio_integration_account_data" => "TwilioIntegrationAccountData", + "v2.twilio_integration_account_request" => "TwilioIntegrationAccountRequest", + "v2.twilio_integration_account_response" => "TwilioIntegrationAccountResponse", + "v2.twilio_integration_accounts_response" => "TwilioIntegrationAccountsResponse", + "v2.twilio_integration_account_update_attributes" => "TwilioIntegrationAccountUpdateAttributes", + "v2.twilio_integration_account_update_data" => "TwilioIntegrationAccountUpdateData", + "v2.twilio_integration_account_update_request" => "TwilioIntegrationAccountUpdateRequest", + "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", @@ -8305,6 +8360,7 @@ def overrides "v2.domain_allowlist_api" => "DomainAllowlistAPI", "v2.dora_metrics_api" => "DORAMetricsAPI", "v2.downtimes_api" => "DowntimesAPI", + "v2.elastic_cloud_integration_accounts_api" => "ElasticCloudIntegrationAccountsAPI", "v2.entity_integration_configs_api" => "EntityIntegrationConfigsAPI", "v2.entity_risk_scores_api" => "EntityRiskScoresAPI", "v2.error_tracking_api" => "ErrorTrackingAPI", @@ -8391,6 +8447,7 @@ def overrides "v2.tag_policies_api" => "TagPoliciesAPI", "v2.teams_api" => "TeamsAPI", "v2.test_optimization_api" => "TestOptimizationAPI", + "v2.twilio_integration_accounts_api" => "TwilioIntegrationAccountsAPI", "v2.usage_metering_api" => "UsageMeteringAPI", "v2.user_authorized_clients_api" => "UserAuthorizedClientsAPI", "v2.users_api" => "UsersAPI", diff --git a/lib/datadog_api_client/v2/api/elastic_cloud_integration_accounts_api.rb b/lib/datadog_api_client/v2/api/elastic_cloud_integration_accounts_api.rb new file mode 100644 index 000000000000..759525e0f51a --- /dev/null +++ b/lib/datadog_api_client/v2/api/elastic_cloud_integration_accounts_api.rb @@ -0,0 +1,435 @@ +=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 ElasticCloudIntegrationAccountsAPI + attr_accessor :api_client + + def initialize(api_client = DatadogAPIClient::APIClient.default) + @api_client = api_client + end + + # Create an Elastic Cloud integration account. + # + # @see #create_elastic_cloud_integration_account_with_http_info + def create_elastic_cloud_integration_account(interface_id, body, opts = {}) + data, _status_code, _headers = create_elastic_cloud_integration_account_with_http_info(interface_id, body, opts) + data + end + + # Create an Elastic Cloud integration account. + # + # Create an Elastic Cloud integration account for a given interface. + # + # @param interface_id [ElasticCloudInterfaceId] Selects the Elastic Cloud interface (source-type). Supported values: `elastic-cloud`, `elastic-cloud-ccm`. + # @param body [ElasticCloudIntegrationAccountRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(ElasticCloudIntegrationAccountResponse, Integer, Hash)>] ElasticCloudIntegrationAccountResponse data, response status code and response headers + def create_elastic_cloud_integration_account_with_http_info(interface_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_elastic_cloud_integration_account".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_elastic_cloud_integration_account") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_elastic_cloud_integration_account")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ElasticCloudIntegrationAccountsAPI.create_elastic_cloud_integration_account ...' + end + # verify the required parameter 'interface_id' is set + if @api_client.config.client_side_validation && interface_id.nil? + fail ArgumentError, "Missing the required parameter 'interface_id' when calling ElasticCloudIntegrationAccountsAPI.create_elastic_cloud_integration_account" + end + # verify enum value + allowable_values = ['elastic-cloud', 'elastic-cloud-ccm'] + 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 ElasticCloudIntegrationAccountsAPI.create_elastic_cloud_integration_account" + end + # resource path + local_var_path = '/api/v2/integrations/elastic-cloud/interfaces/{interface_id}/accounts'.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] || 'ElasticCloudIntegrationAccountResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :create_elastic_cloud_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: ElasticCloudIntegrationAccountsAPI#create_elastic_cloud_integration_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Delete an Elastic Cloud integration account. + # + # @see #delete_elastic_cloud_integration_account_with_http_info + def delete_elastic_cloud_integration_account(interface_id, account_id, opts = {}) + delete_elastic_cloud_integration_account_with_http_info(interface_id, account_id, opts) + nil + end + + # Delete an Elastic Cloud integration account. + # + # Delete an Elastic Cloud integration account. + # + # @param interface_id [ElasticCloudInterfaceId] Selects the Elastic Cloud interface (source-type). Supported values: `elastic-cloud`, `elastic-cloud-ccm`. + # @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_elastic_cloud_integration_account_with_http_info(interface_id, account_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_elastic_cloud_integration_account".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_elastic_cloud_integration_account") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_elastic_cloud_integration_account")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ElasticCloudIntegrationAccountsAPI.delete_elastic_cloud_integration_account ...' + end + # verify the required parameter 'interface_id' is set + if @api_client.config.client_side_validation && interface_id.nil? + fail ArgumentError, "Missing the required parameter 'interface_id' when calling ElasticCloudIntegrationAccountsAPI.delete_elastic_cloud_integration_account" + end + # verify enum value + allowable_values = ['elastic-cloud', 'elastic-cloud-ccm'] + 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 ElasticCloudIntegrationAccountsAPI.delete_elastic_cloud_integration_account" + end + # resource path + local_var_path = '/api/v2/integrations/elastic-cloud/interfaces/{interface_id}/accounts/{account_id}'.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_elastic_cloud_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: ElasticCloudIntegrationAccountsAPI#delete_elastic_cloud_integration_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get an Elastic Cloud integration account. + # + # @see #get_elastic_cloud_integration_account_with_http_info + def get_elastic_cloud_integration_account(interface_id, account_id, opts = {}) + data, _status_code, _headers = get_elastic_cloud_integration_account_with_http_info(interface_id, account_id, opts) + data + end + + # Get an Elastic Cloud integration account. + # + # Get a single Elastic Cloud integration account. + # + # @param interface_id [ElasticCloudInterfaceId] Selects the Elastic Cloud interface (source-type). Supported values: `elastic-cloud`, `elastic-cloud-ccm`. + # @param account_id [String] Unique identifier of the integration account. + # @param opts [Hash] the optional parameters + # @return [Array<(ElasticCloudIntegrationAccountResponse, Integer, Hash)>] ElasticCloudIntegrationAccountResponse data, response status code and response headers + def get_elastic_cloud_integration_account_with_http_info(interface_id, account_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_elastic_cloud_integration_account".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_elastic_cloud_integration_account") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_elastic_cloud_integration_account")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ElasticCloudIntegrationAccountsAPI.get_elastic_cloud_integration_account ...' + end + # verify the required parameter 'interface_id' is set + if @api_client.config.client_side_validation && interface_id.nil? + fail ArgumentError, "Missing the required parameter 'interface_id' when calling ElasticCloudIntegrationAccountsAPI.get_elastic_cloud_integration_account" + end + # verify enum value + allowable_values = ['elastic-cloud', 'elastic-cloud-ccm'] + 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 ElasticCloudIntegrationAccountsAPI.get_elastic_cloud_integration_account" + end + # resource path + local_var_path = '/api/v2/integrations/elastic-cloud/interfaces/{interface_id}/accounts/{account_id}'.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] || 'ElasticCloudIntegrationAccountResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_elastic_cloud_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: ElasticCloudIntegrationAccountsAPI#get_elastic_cloud_integration_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List Elastic Cloud integration accounts. + # + # @see #list_elastic_cloud_integration_accounts_with_http_info + def list_elastic_cloud_integration_accounts(interface_id, opts = {}) + data, _status_code, _headers = list_elastic_cloud_integration_accounts_with_http_info(interface_id, opts) + data + end + + # List Elastic Cloud integration accounts. + # + # List the Elastic Cloud integration accounts for a given interface. + # + # @param interface_id [ElasticCloudInterfaceId] Selects the Elastic Cloud interface (source-type). Supported values: `elastic-cloud`, `elastic-cloud-ccm`. + # @param opts [Hash] the optional parameters + # @return [Array<(ElasticCloudIntegrationAccountsResponse, Integer, Hash)>] ElasticCloudIntegrationAccountsResponse data, response status code and response headers + def list_elastic_cloud_integration_accounts_with_http_info(interface_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_elastic_cloud_integration_accounts".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_elastic_cloud_integration_accounts") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_elastic_cloud_integration_accounts")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ElasticCloudIntegrationAccountsAPI.list_elastic_cloud_integration_accounts ...' + end + # verify the required parameter 'interface_id' is set + if @api_client.config.client_side_validation && interface_id.nil? + fail ArgumentError, "Missing the required parameter 'interface_id' when calling ElasticCloudIntegrationAccountsAPI.list_elastic_cloud_integration_accounts" + end + # verify enum value + allowable_values = ['elastic-cloud', 'elastic-cloud-ccm'] + 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/elastic-cloud/interfaces/{interface_id}/accounts'.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] || 'ElasticCloudIntegrationAccountsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_elastic_cloud_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: ElasticCloudIntegrationAccountsAPI#list_elastic_cloud_integration_accounts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update an Elastic Cloud integration account. + # + # @see #update_elastic_cloud_integration_account_with_http_info + def update_elastic_cloud_integration_account(interface_id, account_id, body, opts = {}) + data, _status_code, _headers = update_elastic_cloud_integration_account_with_http_info(interface_id, account_id, body, opts) + data + end + + # Update an Elastic Cloud integration account. + # + # Update an Elastic Cloud 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 payload or write-only credentials. + # + # @param interface_id [ElasticCloudInterfaceId] Selects the Elastic Cloud interface (source-type). Supported values: `elastic-cloud`, `elastic-cloud-ccm`. + # @param account_id [String] Unique identifier of the integration account. + # @param body [ElasticCloudIntegrationAccountUpdateRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(ElasticCloudIntegrationAccountResponse, Integer, Hash)>] ElasticCloudIntegrationAccountResponse data, response status code and response headers + def update_elastic_cloud_integration_account_with_http_info(interface_id, account_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.update_elastic_cloud_integration_account".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_elastic_cloud_integration_account") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_elastic_cloud_integration_account")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ElasticCloudIntegrationAccountsAPI.update_elastic_cloud_integration_account ...' + end + # verify the required parameter 'interface_id' is set + if @api_client.config.client_side_validation && interface_id.nil? + fail ArgumentError, "Missing the required parameter 'interface_id' when calling ElasticCloudIntegrationAccountsAPI.update_elastic_cloud_integration_account" + end + # verify enum value + allowable_values = ['elastic-cloud', 'elastic-cloud-ccm'] + 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 ElasticCloudIntegrationAccountsAPI.update_elastic_cloud_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 ElasticCloudIntegrationAccountsAPI.update_elastic_cloud_integration_account" + end + # resource path + local_var_path = '/api/v2/integrations/elastic-cloud/interfaces/{interface_id}/accounts/{account_id}'.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] || 'ElasticCloudIntegrationAccountResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :update_elastic_cloud_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: ElasticCloudIntegrationAccountsAPI#update_elastic_cloud_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/api/twilio_integration_accounts_api.rb b/lib/datadog_api_client/v2/api/twilio_integration_accounts_api.rb new file mode 100644 index 000000000000..376c44eef56e --- /dev/null +++ b/lib/datadog_api_client/v2/api/twilio_integration_accounts_api.rb @@ -0,0 +1,435 @@ +=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 TwilioIntegrationAccountsAPI + attr_accessor :api_client + + def initialize(api_client = DatadogAPIClient::APIClient.default) + @api_client = api_client + end + + # Create a Twilio integration account. + # + # @see #create_twilio_integration_account_with_http_info + def create_twilio_integration_account(interface_id, body, opts = {}) + data, _status_code, _headers = create_twilio_integration_account_with_http_info(interface_id, body, opts) + data + end + + # Create a Twilio integration account. + # + # Create a Twilio integration account for a given interface. + # + # @param interface_id [TwilioInterfaceType] Selects the Twilio interface (source-type). Supported values: `twilio`. + # @param body [TwilioIntegrationAccountRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(TwilioIntegrationAccountResponse, Integer, Hash)>] TwilioIntegrationAccountResponse data, response status code and response headers + def create_twilio_integration_account_with_http_info(interface_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_twilio_integration_account".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_twilio_integration_account") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_twilio_integration_account")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: TwilioIntegrationAccountsAPI.create_twilio_integration_account ...' + end + # verify the required parameter 'interface_id' is set + if @api_client.config.client_side_validation && interface_id.nil? + fail ArgumentError, "Missing the required parameter 'interface_id' when calling TwilioIntegrationAccountsAPI.create_twilio_integration_account" + end + # verify enum value + allowable_values = ['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 TwilioIntegrationAccountsAPI.create_twilio_integration_account" + end + # resource path + local_var_path = '/api/v2/integrations/twilio/interfaces/{interface_id}/accounts'.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] || 'TwilioIntegrationAccountResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :create_twilio_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: TwilioIntegrationAccountsAPI#create_twilio_integration_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Delete a Twilio integration account. + # + # @see #delete_twilio_integration_account_with_http_info + def delete_twilio_integration_account(interface_id, account_id, opts = {}) + delete_twilio_integration_account_with_http_info(interface_id, account_id, opts) + nil + end + + # Delete a Twilio integration account. + # + # Delete a Twilio integration account. + # + # @param interface_id [TwilioInterfaceType] Selects the Twilio interface (source-type). Supported values: `twilio`. + # @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_twilio_integration_account_with_http_info(interface_id, account_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_twilio_integration_account".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_twilio_integration_account") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_twilio_integration_account")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: TwilioIntegrationAccountsAPI.delete_twilio_integration_account ...' + end + # verify the required parameter 'interface_id' is set + if @api_client.config.client_side_validation && interface_id.nil? + fail ArgumentError, "Missing the required parameter 'interface_id' when calling TwilioIntegrationAccountsAPI.delete_twilio_integration_account" + end + # verify enum value + allowable_values = ['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 TwilioIntegrationAccountsAPI.delete_twilio_integration_account" + end + # resource path + local_var_path = '/api/v2/integrations/twilio/interfaces/{interface_id}/accounts/{account_id}'.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_twilio_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: TwilioIntegrationAccountsAPI#delete_twilio_integration_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get a Twilio integration account. + # + # @see #get_twilio_integration_account_with_http_info + def get_twilio_integration_account(interface_id, account_id, opts = {}) + data, _status_code, _headers = get_twilio_integration_account_with_http_info(interface_id, account_id, opts) + data + end + + # Get a Twilio integration account. + # + # Get a single Twilio integration account. + # + # @param interface_id [TwilioInterfaceType] Selects the Twilio interface (source-type). Supported values: `twilio`. + # @param account_id [String] Unique identifier of the integration account. + # @param opts [Hash] the optional parameters + # @return [Array<(TwilioIntegrationAccountResponse, Integer, Hash)>] TwilioIntegrationAccountResponse data, response status code and response headers + def get_twilio_integration_account_with_http_info(interface_id, account_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_twilio_integration_account".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_twilio_integration_account") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_twilio_integration_account")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: TwilioIntegrationAccountsAPI.get_twilio_integration_account ...' + end + # verify the required parameter 'interface_id' is set + if @api_client.config.client_side_validation && interface_id.nil? + fail ArgumentError, "Missing the required parameter 'interface_id' when calling TwilioIntegrationAccountsAPI.get_twilio_integration_account" + end + # verify enum value + allowable_values = ['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 TwilioIntegrationAccountsAPI.get_twilio_integration_account" + end + # resource path + local_var_path = '/api/v2/integrations/twilio/interfaces/{interface_id}/accounts/{account_id}'.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] || 'TwilioIntegrationAccountResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_twilio_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: TwilioIntegrationAccountsAPI#get_twilio_integration_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List Twilio integration accounts. + # + # @see #list_twilio_integration_accounts_with_http_info + def list_twilio_integration_accounts(interface_id, opts = {}) + data, _status_code, _headers = list_twilio_integration_accounts_with_http_info(interface_id, opts) + data + end + + # List Twilio integration accounts. + # + # List the Twilio integration accounts for a given interface. + # + # @param interface_id [TwilioInterfaceType] Selects the Twilio interface (source-type). Supported values: `twilio`. + # @param opts [Hash] the optional parameters + # @return [Array<(TwilioIntegrationAccountsResponse, Integer, Hash)>] TwilioIntegrationAccountsResponse data, response status code and response headers + def list_twilio_integration_accounts_with_http_info(interface_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_twilio_integration_accounts".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_twilio_integration_accounts") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_twilio_integration_accounts")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: TwilioIntegrationAccountsAPI.list_twilio_integration_accounts ...' + end + # verify the required parameter 'interface_id' is set + if @api_client.config.client_side_validation && interface_id.nil? + fail ArgumentError, "Missing the required parameter 'interface_id' when calling TwilioIntegrationAccountsAPI.list_twilio_integration_accounts" + end + # verify enum value + allowable_values = ['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/twilio/interfaces/{interface_id}/accounts'.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] || 'TwilioIntegrationAccountsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_twilio_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: TwilioIntegrationAccountsAPI#list_twilio_integration_accounts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update a Twilio integration account. + # + # @see #update_twilio_integration_account_with_http_info + def update_twilio_integration_account(interface_id, account_id, body, opts = {}) + data, _status_code, _headers = update_twilio_integration_account_with_http_info(interface_id, account_id, body, opts) + data + end + + # Update a Twilio integration account. + # + # Update a Twilio 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 payload or write-only credentials. + # + # @param interface_id [TwilioInterfaceType] Selects the Twilio interface (source-type). Supported values: `twilio`. + # @param account_id [String] Unique identifier of the integration account. + # @param body [TwilioIntegrationAccountUpdateRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(TwilioIntegrationAccountResponse, Integer, Hash)>] TwilioIntegrationAccountResponse data, response status code and response headers + def update_twilio_integration_account_with_http_info(interface_id, account_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.update_twilio_integration_account".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_twilio_integration_account") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_twilio_integration_account")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: TwilioIntegrationAccountsAPI.update_twilio_integration_account ...' + end + # verify the required parameter 'interface_id' is set + if @api_client.config.client_side_validation && interface_id.nil? + fail ArgumentError, "Missing the required parameter 'interface_id' when calling TwilioIntegrationAccountsAPI.update_twilio_integration_account" + end + # verify enum value + allowable_values = ['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 TwilioIntegrationAccountsAPI.update_twilio_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 TwilioIntegrationAccountsAPI.update_twilio_integration_account" + end + # resource path + local_var_path = '/api/v2/integrations/twilio/interfaces/{interface_id}/accounts/{account_id}'.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] || 'TwilioIntegrationAccountResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :update_twilio_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: TwilioIntegrationAccountsAPI#update_twilio_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/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..172351337fd6 --- /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. This field is not returned by the API. + 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..1cb39fb0a65c --- /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. This field is not returned by the API. + 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_account_attributes.rb b/lib/datadog_api_client/v2/models/elastic_cloud_integration_account_attributes.rb new file mode 100644 index 000000000000..498a5598c63a --- /dev/null +++ b/lib/datadog_api_client/v2/models/elastic_cloud_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 Elastic Cloud integration account. + class ElasticCloudIntegrationAccountAttributes + include BaseGenericModel + + # Elastic Cloud interface (source-type). Exactly one interface variant is set, selected by its `type`. + attr_reader :interface + + # 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 + { + :'interface' => :'interface', + :'name' => :'name', + :'permissions' => :'permissions' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'interface' => :'ElasticCloudInterface', + :'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::ElasticCloudIntegrationAccountAttributes` 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?(:'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 @interface.nil? + return false if @name.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 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 && + interface == o.interface && + 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 + [interface, name, permissions, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/elastic_cloud_integration_account_create_data.rb b/lib/datadog_api_client/v2/models/elastic_cloud_integration_account_create_data.rb new file mode 100644 index 000000000000..8176fce997e5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/elastic_cloud_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 Elastic Cloud integration account. + class ElasticCloudIntegrationAccountCreateData + include BaseGenericModel + + # Attributes of an Elastic Cloud integration account. + 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' => :'ElasticCloudIntegrationAccountAttributes', + :'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::ElasticCloudIntegrationAccountCreateData` 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/elastic_cloud_integration_account_data.rb b/lib/datadog_api_client/v2/models/elastic_cloud_integration_account_data.rb new file mode 100644 index 000000000000..eccc1b9c9a37 --- /dev/null +++ b/lib/datadog_api_client/v2/models/elastic_cloud_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 Elastic Cloud integration account, including server-assigned identity. + class ElasticCloudIntegrationAccountData + include BaseGenericModel + + # Attributes of an Elastic Cloud integration account. + 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' => :'ElasticCloudIntegrationAccountAttributes', + :'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::ElasticCloudIntegrationAccountData` 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/elastic_cloud_integration_account_request.rb b/lib/datadog_api_client/v2/models/elastic_cloud_integration_account_request.rb new file mode 100644 index 000000000000..5350eb43332f --- /dev/null +++ b/lib/datadog_api_client/v2/models/elastic_cloud_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 Elastic Cloud integration account. + class ElasticCloudIntegrationAccountRequest + include BaseGenericModel + + # Data envelope for creating an Elastic Cloud 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' => :'ElasticCloudIntegrationAccountCreateData' + } + 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::ElasticCloudIntegrationAccountRequest` 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/elastic_cloud_integration_account_response.rb b/lib/datadog_api_client/v2/models/elastic_cloud_integration_account_response.rb new file mode 100644 index 000000000000..88f558c96605 --- /dev/null +++ b/lib/datadog_api_client/v2/models/elastic_cloud_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 Elastic Cloud integration account. + class ElasticCloudIntegrationAccountResponse + include BaseGenericModel + + # Data envelope of an Elastic Cloud 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' => :'ElasticCloudIntegrationAccountData' + } + 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::ElasticCloudIntegrationAccountResponse` 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/elastic_cloud_integration_account_update_attributes.rb b/lib/datadog_api_client/v2/models/elastic_cloud_integration_account_update_attributes.rb new file mode 100644 index 000000000000..1f3fc873aace --- /dev/null +++ b/lib/datadog_api_client/v2/models/elastic_cloud_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 Elastic Cloud integration account. Every field is optional; only the fields provided are changed. + class ElasticCloudIntegrationAccountUpdateAttributes + include BaseGenericModel + + # Partial Elastic Cloud interface for updates. Exactly one interface variant is set, selected by its `type`. + attr_accessor :interface + + # 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 + { + :'interface' => :'interface', + :'name' => :'name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'interface' => :'ElasticCloudInterfaceUpdate', + :'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::ElasticCloudIntegrationAccountUpdateAttributes` 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?(:'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 && + interface == o.interface && + name == o.name && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [interface, name, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/elastic_cloud_integration_account_update_data.rb b/lib/datadog_api_client/v2/models/elastic_cloud_integration_account_update_data.rb new file mode 100644 index 000000000000..7abb43f9b0d7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/elastic_cloud_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 Elastic Cloud integration account. + class ElasticCloudIntegrationAccountUpdateData + include BaseGenericModel + + # Updatable attributes of an Elastic Cloud 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' => :'ElasticCloudIntegrationAccountUpdateAttributes', + :'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::ElasticCloudIntegrationAccountUpdateData` 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/elastic_cloud_integration_account_update_request.rb b/lib/datadog_api_client/v2/models/elastic_cloud_integration_account_update_request.rb new file mode 100644 index 000000000000..cb8f5fa9f05c --- /dev/null +++ b/lib/datadog_api_client/v2/models/elastic_cloud_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 Elastic Cloud integration account as a partial merge. + class ElasticCloudIntegrationAccountUpdateRequest + include BaseGenericModel + + # Data envelope for updating an Elastic Cloud 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' => :'ElasticCloudIntegrationAccountUpdateData' + } + 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::ElasticCloudIntegrationAccountUpdateRequest` 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/elastic_cloud_integration_accounts_response.rb b/lib/datadog_api_client/v2/models/elastic_cloud_integration_accounts_response.rb new file mode 100644 index 000000000000..d81fa9d68030 --- /dev/null +++ b/lib/datadog_api_client/v2/models/elastic_cloud_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 Elastic Cloud integration accounts. + class ElasticCloudIntegrationAccountsResponse + include BaseGenericModel + + # List of Elastic Cloud 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::ElasticCloudIntegrationAccountsResponse` 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/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_id.rb b/lib/datadog_api_client/v2/models/elastic_cloud_interface_id.rb new file mode 100644 index 000000000000..55445aa1529b --- /dev/null +++ b/lib/datadog_api_client/v2/models/elastic_cloud_interface_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 Elastic Cloud interface (source-type) ids. + class ElasticCloudInterfaceId + include BaseEnumModel + + ELASTIC_CLOUD = "elastic-cloud".freeze + ELASTIC_CLOUD_CCM = "elastic-cloud-ccm".freeze + 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_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_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_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/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..06ab7c54ceab --- /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. This field is not returned by the API. + 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_account_attributes.rb b/lib/datadog_api_client/v2/models/twilio_integration_account_attributes.rb new file mode 100644 index 000000000000..e5bcfda19c0f --- /dev/null +++ b/lib/datadog_api_client/v2/models/twilio_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 a Twilio integration account. + class TwilioIntegrationAccountAttributes + include BaseGenericModel + + # Twilio interface (source-type) configuration. + attr_reader :interface + + # 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 + { + :'interface' => :'interface', + :'name' => :'name', + :'permissions' => :'permissions' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'interface' => :'TwilioInterface', + :'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::TwilioIntegrationAccountAttributes` 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?(:'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 @interface.nil? + return false if @name.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 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 && + interface == o.interface && + 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 + [interface, name, permissions, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/twilio_integration_account_create_data.rb b/lib/datadog_api_client/v2/models/twilio_integration_account_create_data.rb new file mode 100644 index 000000000000..c36d582e9dae --- /dev/null +++ b/lib/datadog_api_client/v2/models/twilio_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 a Twilio integration account. + class TwilioIntegrationAccountCreateData + include BaseGenericModel + + # Attributes of a Twilio integration account. + 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' => :'TwilioIntegrationAccountAttributes', + :'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::TwilioIntegrationAccountCreateData` 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/twilio_integration_account_data.rb b/lib/datadog_api_client/v2/models/twilio_integration_account_data.rb new file mode 100644 index 000000000000..a4e96ec9a4ca --- /dev/null +++ b/lib/datadog_api_client/v2/models/twilio_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 a Twilio integration account, including server-assigned identity. + class TwilioIntegrationAccountData + include BaseGenericModel + + # Attributes of a Twilio integration account. + 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' => :'TwilioIntegrationAccountAttributes', + :'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::TwilioIntegrationAccountData` 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/twilio_integration_account_request.rb b/lib/datadog_api_client/v2/models/twilio_integration_account_request.rb new file mode 100644 index 000000000000..baf3cbcdbde2 --- /dev/null +++ b/lib/datadog_api_client/v2/models/twilio_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 a Twilio integration account. + class TwilioIntegrationAccountRequest + include BaseGenericModel + + # Data envelope for creating a Twilio 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' => :'TwilioIntegrationAccountCreateData' + } + 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::TwilioIntegrationAccountRequest` 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/twilio_integration_account_response.rb b/lib/datadog_api_client/v2/models/twilio_integration_account_response.rb new file mode 100644 index 000000000000..78fb48a954e5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/twilio_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 Twilio integration account. + class TwilioIntegrationAccountResponse + include BaseGenericModel + + # Data envelope of a Twilio 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' => :'TwilioIntegrationAccountData' + } + 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::TwilioIntegrationAccountResponse` 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/twilio_integration_account_update_attributes.rb b/lib/datadog_api_client/v2/models/twilio_integration_account_update_attributes.rb new file mode 100644 index 000000000000..40311690489b --- /dev/null +++ b/lib/datadog_api_client/v2/models/twilio_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 a Twilio integration account. Every field is optional; only the fields provided are changed. + class TwilioIntegrationAccountUpdateAttributes + include BaseGenericModel + + # Partial Twilio interface (source-type) configuration for updates. + attr_accessor :interface + + # 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 + { + :'interface' => :'interface', + :'name' => :'name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'interface' => :'TwilioInterfaceUpdate', + :'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::TwilioIntegrationAccountUpdateAttributes` 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?(:'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 && + interface == o.interface && + name == o.name && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [interface, name, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/twilio_integration_account_update_data.rb b/lib/datadog_api_client/v2/models/twilio_integration_account_update_data.rb new file mode 100644 index 000000000000..5ebce15404e0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/twilio_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 a Twilio integration account. + class TwilioIntegrationAccountUpdateData + include BaseGenericModel + + # Updatable attributes of a Twilio 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' => :'TwilioIntegrationAccountUpdateAttributes', + :'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::TwilioIntegrationAccountUpdateData` 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/twilio_integration_account_update_request.rb b/lib/datadog_api_client/v2/models/twilio_integration_account_update_request.rb new file mode 100644 index 000000000000..78b35a30a095 --- /dev/null +++ b/lib/datadog_api_client/v2/models/twilio_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 a Twilio integration account as a partial merge. + class TwilioIntegrationAccountUpdateRequest + include BaseGenericModel + + # Data envelope for updating a Twilio 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' => :'TwilioIntegrationAccountUpdateData' + } + 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::TwilioIntegrationAccountUpdateRequest` 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/twilio_integration_accounts_response.rb b/lib/datadog_api_client/v2/models/twilio_integration_accounts_response.rb new file mode 100644 index 000000000000..608169924ff3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/twilio_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 Twilio integration accounts. + class TwilioIntegrationAccountsResponse + include BaseGenericModel + + # List of Twilio 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::TwilioIntegrationAccountsResponse` 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_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