From 0c0a7f1178ba58666f6ab9f61e9d8f5c87de2026 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Fri, 8 May 2026 14:45:21 +0000 Subject: [PATCH] Regenerate client from commit 26d4ae7 of spec repo --- .generator/schemas/v2/openapi.yaml | 403 +++++++++++++++++ .../CreateWebIntegrationAccount.rb | 19 + .../DeleteWebIntegrationAccount.rb | 8 + .../GetWebIntegrationAccount.rb | 8 + .../ListWebIntegrationAccounts.rb | 8 + .../UpdateWebIntegrationAccount.rb | 19 + features/scenarios_model_mapping.rb | 20 + features/v2/given.json | 16 + features/v2/undo.json | 41 ++ features/v2/web_integrations.feature | 164 +++++++ lib/datadog_api_client/configuration.rb | 5 + lib/datadog_api_client/inflector.rb | 12 + .../v2/api/web_integrations_api.rb | 410 ++++++++++++++++++ .../web_integration_account_create_request.rb | 123 ++++++ ...ation_account_create_request_attributes.rb | 166 +++++++ ...integration_account_create_request_data.rb | 144 ++++++ .../web_integration_account_response.rb | 105 +++++ ...integration_account_response_attributes.rb | 133 ++++++ .../web_integration_account_response_data.rb | 165 +++++++ .../v2/models/web_integration_account_type.rb | 26 ++ .../web_integration_account_update_request.rb | 123 ++++++ ...ation_account_update_request_attributes.rb | 126 ++++++ ...integration_account_update_request_data.rb | 144 ++++++ .../web_integration_accounts_response.rb | 107 +++++ 24 files changed, 2495 insertions(+) create mode 100644 examples/v2/web-integrations/CreateWebIntegrationAccount.rb create mode 100644 examples/v2/web-integrations/DeleteWebIntegrationAccount.rb create mode 100644 examples/v2/web-integrations/GetWebIntegrationAccount.rb create mode 100644 examples/v2/web-integrations/ListWebIntegrationAccounts.rb create mode 100644 examples/v2/web-integrations/UpdateWebIntegrationAccount.rb create mode 100644 features/v2/web_integrations.feature create mode 100644 lib/datadog_api_client/v2/api/web_integrations_api.rb create mode 100644 lib/datadog_api_client/v2/models/web_integration_account_create_request.rb create mode 100644 lib/datadog_api_client/v2/models/web_integration_account_create_request_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/web_integration_account_create_request_data.rb create mode 100644 lib/datadog_api_client/v2/models/web_integration_account_response.rb create mode 100644 lib/datadog_api_client/v2/models/web_integration_account_response_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/web_integration_account_response_data.rb create mode 100644 lib/datadog_api_client/v2/models/web_integration_account_type.rb create mode 100644 lib/datadog_api_client/v2/models/web_integration_account_update_request.rb create mode 100644 lib/datadog_api_client/v2/models/web_integration_account_update_request_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/web_integration_account_update_request_data.rb create mode 100644 lib/datadog_api_client/v2/models/web_integration_accounts_response.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 698ab6060c1d..c3425470eae9 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -83079,6 +83079,139 @@ components: type: string x-enum-varnames: - RUM_REPLAY_WATCHER + WebIntegrationAccountCreateRequest: + description: Payload schema when adding a web integration account. + properties: + data: + $ref: "#/components/schemas/WebIntegrationAccountCreateRequestData" + required: + - data + type: object + WebIntegrationAccountCreateRequestAttributes: + description: Attributes object for creating a web integration account. + properties: + name: + description: A human-readable name for the account. Must be unique among accounts of the same integration. + example: my-databricks-account + type: string + secrets: + $ref: "#/components/schemas/WebIntegrationAccountSecrets" + settings: + $ref: "#/components/schemas/WebIntegrationAccountSettings" + required: + - name + - settings + - secrets + type: object + WebIntegrationAccountCreateRequestData: + description: Data object for creating a web integration account. + properties: + attributes: + $ref: "#/components/schemas/WebIntegrationAccountCreateRequestAttributes" + type: + $ref: "#/components/schemas/WebIntegrationAccountType" + required: + - attributes + - type + type: object + WebIntegrationAccountResponse: + description: The expected response schema when getting a single web integration account. + properties: + data: + $ref: "#/components/schemas/WebIntegrationAccountResponseData" + type: object + WebIntegrationAccountResponseAttributes: + description: Attributes object of a web integration account. Secrets are never returned. + properties: + name: + description: A human-readable name for the account. + example: my-databricks-account + type: string + settings: + $ref: "#/components/schemas/WebIntegrationAccountSettings" + required: + - name + type: object + WebIntegrationAccountResponseData: + description: Data object of a web integration account. + properties: + attributes: + $ref: "#/components/schemas/WebIntegrationAccountResponseAttributes" + id: + description: The unique identifier of the web integration account. + example: "abc123def456" + type: string + type: + $ref: "#/components/schemas/WebIntegrationAccountType" + required: + - attributes + - id + - type + type: object + WebIntegrationAccountSecrets: + additionalProperties: {} + description: |- + Integration-specific secrets. The shape of this object varies by integration. Secrets + are write-only and never returned by the API. + example: + client_secret: my-client-secret + type: object + WebIntegrationAccountSettings: + additionalProperties: {} + description: |- + Integration-specific settings. The shape of this object varies by integration. + example: + workspace_url: https://example.azuredatabricks.net + type: object + WebIntegrationAccountType: + default: Account + description: Account resource type. + enum: + - Account + example: Account + type: string + x-enum-varnames: + - ACCOUNT + WebIntegrationAccountUpdateRequest: + description: Payload schema when updating a web integration account. + properties: + data: + $ref: "#/components/schemas/WebIntegrationAccountUpdateRequestData" + required: + - data + type: object + WebIntegrationAccountUpdateRequestAttributes: + description: Attributes object for updating a web integration account. + properties: + name: + description: A human-readable name for the account. + example: my-databricks-account + type: string + secrets: + $ref: "#/components/schemas/WebIntegrationAccountSecrets" + settings: + $ref: "#/components/schemas/WebIntegrationAccountSettings" + type: object + WebIntegrationAccountUpdateRequestData: + description: Data object for updating a web integration account. + properties: + attributes: + $ref: "#/components/schemas/WebIntegrationAccountUpdateRequestAttributes" + type: + $ref: "#/components/schemas/WebIntegrationAccountType" + required: + - attributes + - type + type: object + WebIntegrationAccountsResponse: + description: The expected response schema when listing web integration accounts. + properties: + data: + description: The JSON:API data array. + items: + $ref: "#/components/schemas/WebIntegrationAccountResponseData" + type: array + type: object Weekday: description: A day of the week. enum: @@ -144872,6 +145005,272 @@ paths: operator: OR permissions: - teams_read + /api/v2/web-integrations/{integration_name}/accounts: + get: + description: List accounts for a given web integration. + operationId: ListWebIntegrationAccounts + parameters: + - description: The name of the integration (for example, `databricks`). + in: path + name: integration_name + required: true + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + name: my-databricks-account + settings: + workspace_url: https://example.azuredatabricks.net + id: abc123def456 + type: Account + schema: + $ref: "#/components/schemas/WebIntegrationAccountsResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: List web integration accounts + tags: + - Web Integrations + "x-permission": + operator: OR + permissions: + - integrations_read + x-unstable: |- + **Note**: This endpoint is for internal Datadog use only and is not part of the public API. It may change without notice. + post: + description: Create a new account for a given web integration. + operationId: CreateWebIntegrationAccount + parameters: + - description: The name of the integration (for example, `databricks`). + in: path + name: integration_name + required: true + schema: + type: string + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + name: my-databricks-account + secrets: + client_secret: my-client-secret + settings: + workspace_url: https://example.azuredatabricks.net + type: Account + schema: + $ref: "#/components/schemas/WebIntegrationAccountCreateRequest" + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + name: my-databricks-account + settings: + workspace_url: https://example.azuredatabricks.net + id: abc123def456 + type: Account + schema: + $ref: "#/components/schemas/WebIntegrationAccountResponse" + description: CREATED + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "422": + $ref: "#/components/responses/UnprocessableEntityResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Create a web integration account + tags: + - Web Integrations + x-codegen-request-body-name: body + "x-permission": + operator: OR + permissions: + - manage_integrations + x-unstable: |- + **Note**: This endpoint is for internal Datadog use only and is not part of the public API. It may change without notice. + /api/v2/web-integrations/{integration_name}/accounts/{account_id}: + delete: + description: Delete an account for a given web integration. + operationId: DeleteWebIntegrationAccount + parameters: + - description: The name of the integration (for example, `databricks`). + in: path + name: integration_name + required: true + schema: + type: string + - description: The unique identifier of the web integration account. + in: path + name: account_id + required: true + schema: + type: string + responses: + "204": + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Delete a web integration account + tags: + - Web Integrations + "x-permission": + operator: OR + permissions: + - manage_integrations + x-unstable: |- + **Note**: This endpoint is for internal Datadog use only and is not part of the public API. It may change without notice. + get: + description: Get a single account for a given web integration. + operationId: GetWebIntegrationAccount + parameters: + - description: The name of the integration (for example, `databricks`). + in: path + name: integration_name + required: true + schema: + type: string + - description: The unique identifier of the web integration account. + in: path + name: account_id + required: true + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + name: my-databricks-account + settings: + workspace_url: https://example.azuredatabricks.net + id: abc123def456 + type: Account + schema: + $ref: "#/components/schemas/WebIntegrationAccountResponse" + 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 web integration account + tags: + - Web Integrations + "x-permission": + operator: OR + permissions: + - integrations_read + x-unstable: |- + **Note**: This endpoint is for internal Datadog use only and is not part of the public API. It may change without notice. + patch: + description: Update an existing account for a given web integration. + operationId: UpdateWebIntegrationAccount + parameters: + - description: The name of the integration (for example, `databricks`). + in: path + name: integration_name + required: true + schema: + type: string + - description: The unique identifier of the web integration account. + in: path + name: account_id + required: true + schema: + type: string + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + name: my-databricks-account + secrets: + client_secret: my-new-client-secret + settings: + workspace_url: https://updated.azuredatabricks.net + type: Account + schema: + $ref: "#/components/schemas/WebIntegrationAccountUpdateRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + name: my-databricks-account + settings: + workspace_url: https://updated.azuredatabricks.net + id: abc123def456 + type: Account + schema: + $ref: "#/components/schemas/WebIntegrationAccountResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "422": + $ref: "#/components/responses/UnprocessableEntityResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Update a web integration account + tags: + - Web Integrations + x-codegen-request-body-name: body + "x-permission": + operator: OR + permissions: + - manage_integrations + x-unstable: |- + **Note**: This endpoint is for internal Datadog use only and is not part of the public API. It may change without notice. /api/v2/widgets/{experience_type}: get: description: |- @@ -146387,6 +146786,10 @@ tags: externalDocs: url: https://docs.datadoghq.com/account_management/users name: Users + - description: |- + Manage web integration accounts programmatically through the Datadog API. + See the [Web Integrations page](https://app.datadoghq.com/integrations) for more information. + name: Web Integrations - description: |- Create, read, update, and delete saved widgets. Widgets are reusable visualization components stored independently from any dashboard or notebook, diff --git a/examples/v2/web-integrations/CreateWebIntegrationAccount.rb b/examples/v2/web-integrations/CreateWebIntegrationAccount.rb new file mode 100644 index 000000000000..46ac6b13696a --- /dev/null +++ b/examples/v2/web-integrations/CreateWebIntegrationAccount.rb @@ -0,0 +1,19 @@ +# Create a web integration account returns "CREATED" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.create_web_integration_account".to_sym] = true +end +api_instance = DatadogAPIClient::V2::WebIntegrationsAPI.new + +body = DatadogAPIClient::V2::WebIntegrationAccountCreateRequest.new({ + data: DatadogAPIClient::V2::WebIntegrationAccountCreateRequestData.new({ + attributes: DatadogAPIClient::V2::WebIntegrationAccountCreateRequestAttributes.new({ + name: "my-databricks-account", + secrets: DatadogAPIClient::V2::WebIntegrationAccountSecrets.new({}), + settings: DatadogAPIClient::V2::WebIntegrationAccountSettings.new({}), + }), + type: DatadogAPIClient::V2::WebIntegrationAccountType::ACCOUNT, + }), +}) +p api_instance.create_web_integration_account("integration_name", body) diff --git a/examples/v2/web-integrations/DeleteWebIntegrationAccount.rb b/examples/v2/web-integrations/DeleteWebIntegrationAccount.rb new file mode 100644 index 000000000000..0c53cf54e621 --- /dev/null +++ b/examples/v2/web-integrations/DeleteWebIntegrationAccount.rb @@ -0,0 +1,8 @@ +# Delete a web integration account returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.delete_web_integration_account".to_sym] = true +end +api_instance = DatadogAPIClient::V2::WebIntegrationsAPI.new +api_instance.delete_web_integration_account("integration_name", "account_id") diff --git a/examples/v2/web-integrations/GetWebIntegrationAccount.rb b/examples/v2/web-integrations/GetWebIntegrationAccount.rb new file mode 100644 index 000000000000..3c8aecdcb402 --- /dev/null +++ b/examples/v2/web-integrations/GetWebIntegrationAccount.rb @@ -0,0 +1,8 @@ +# Get a web integration account returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_web_integration_account".to_sym] = true +end +api_instance = DatadogAPIClient::V2::WebIntegrationsAPI.new +p api_instance.get_web_integration_account("integration_name", "account_id") diff --git a/examples/v2/web-integrations/ListWebIntegrationAccounts.rb b/examples/v2/web-integrations/ListWebIntegrationAccounts.rb new file mode 100644 index 000000000000..c43428599d52 --- /dev/null +++ b/examples/v2/web-integrations/ListWebIntegrationAccounts.rb @@ -0,0 +1,8 @@ +# List web integration accounts returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_web_integration_accounts".to_sym] = true +end +api_instance = DatadogAPIClient::V2::WebIntegrationsAPI.new +p api_instance.list_web_integration_accounts("integration_name") diff --git a/examples/v2/web-integrations/UpdateWebIntegrationAccount.rb b/examples/v2/web-integrations/UpdateWebIntegrationAccount.rb new file mode 100644 index 000000000000..07c2471a8895 --- /dev/null +++ b/examples/v2/web-integrations/UpdateWebIntegrationAccount.rb @@ -0,0 +1,19 @@ +# Update a web integration account returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.update_web_integration_account".to_sym] = true +end +api_instance = DatadogAPIClient::V2::WebIntegrationsAPI.new + +body = DatadogAPIClient::V2::WebIntegrationAccountUpdateRequest.new({ + data: DatadogAPIClient::V2::WebIntegrationAccountUpdateRequestData.new({ + attributes: DatadogAPIClient::V2::WebIntegrationAccountUpdateRequestAttributes.new({ + name: "my-databricks-account", + secrets: DatadogAPIClient::V2::WebIntegrationAccountSecrets.new({}), + settings: DatadogAPIClient::V2::WebIntegrationAccountSettings.new({}), + }), + type: DatadogAPIClient::V2::WebIntegrationAccountType::ACCOUNT, + }), +}) +p api_instance.update_web_integration_account("integration_name", "account_id", body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index a0c4193084bc..e8a4ba26d178 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -4628,6 +4628,26 @@ "team_id" => "String", "body" => "IncidentTeamUpdateRequest", }, + "v2.ListWebIntegrationAccounts" => { + "integration_name" => "String", + }, + "v2.CreateWebIntegrationAccount" => { + "integration_name" => "String", + "body" => "WebIntegrationAccountCreateRequest", + }, + "v2.DeleteWebIntegrationAccount" => { + "integration_name" => "String", + "account_id" => "String", + }, + "v2.GetWebIntegrationAccount" => { + "integration_name" => "String", + "account_id" => "String", + }, + "v2.UpdateWebIntegrationAccount" => { + "integration_name" => "String", + "account_id" => "String", + "body" => "WebIntegrationAccountUpdateRequest", + }, "v2.SearchWidgets" => { "experience_type" => "WidgetExperienceType", "filter_widget_type" => "WidgetType", diff --git a/features/v2/given.json b/features/v2/given.json index 98e2edab7a17..e6d7025d2f28 100644 --- a/features/v2/given.json +++ b/features/v2/given.json @@ -1570,6 +1570,22 @@ "tag": "Users", "operationId": "CreateUser" }, + { + "parameters": [ + { + "name": "integration_name", + "value": "\"databricks\"" + }, + { + "name": "body", + "value": "{\n \"data\": {\n \"type\": \"Account\",\n \"attributes\": {\n \"name\": \"{{ unique_lower_alnum }}\",\n \"settings\": {\n \"workspace_url\": \"https://example.azuredatabricks.net\"\n },\n \"secrets\": {\n \"client_secret\": \"fake-client-secret\"\n }\n }\n }\n}" + } + ], + "step": "there is a valid \"web_integration_account\" in the system", + "key": "web_integration_account", + "tag": "Web Integrations", + "operationId": "CreateWebIntegrationAccount" + }, { "parameters": [ { diff --git a/features/v2/undo.json b/features/v2/undo.json index 96d9f3eb5d14..fe0e8dd656e7 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -7146,6 +7146,47 @@ "type": "safe" } }, + "ListWebIntegrationAccounts": { + "tag": "Web Integrations", + "undo": { + "type": "safe" + } + }, + "CreateWebIntegrationAccount": { + "tag": "Web Integrations", + "undo": { + "operationId": "DeleteWebIntegrationAccount", + "parameters": [ + { + "name": "integration_name", + "template": "\"{{ integration_name }}\"" + }, + { + "name": "account_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "DeleteWebIntegrationAccount": { + "tag": "Web Integrations", + "undo": { + "type": "idempotent" + } + }, + "GetWebIntegrationAccount": { + "tag": "Web Integrations", + "undo": { + "type": "safe" + } + }, + "UpdateWebIntegrationAccount": { + "tag": "Web Integrations", + "undo": { + "type": "idempotent" + } + }, "SearchWidgets": { "tag": "Widgets", "undo": { diff --git a/features/v2/web_integrations.feature b/features/v2/web_integrations.feature new file mode 100644 index 000000000000..7fb73bee4494 --- /dev/null +++ b/features/v2/web_integrations.feature @@ -0,0 +1,164 @@ +@endpoint(web-integrations) @endpoint(web-integrations-v2) +Feature: Web Integrations + Manage web integration accounts programmatically through the Datadog API. + See the [Web Integrations page](https://app.datadoghq.com/integrations) + for more information. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "WebIntegrations" API + + @generated @skip @team:DataDog/saas-integrations + Scenario: Create a web integration account returns "Bad Request" response + Given operation "CreateWebIntegrationAccount" enabled + And new "CreateWebIntegrationAccount" request + And request contains "integration_name" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"name": "my-databricks-account", "secrets": {"client_secret": "my-client-secret"}, "settings": {"workspace_url": "https://example.azuredatabricks.net"}}, "type": "Account"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/saas-integrations + Scenario: Create a web integration account returns "CREATED" response + Given operation "CreateWebIntegrationAccount" enabled + And new "CreateWebIntegrationAccount" request + And request contains "integration_name" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"name": "my-databricks-account", "secrets": {"client_secret": "my-client-secret"}, "settings": {"workspace_url": "https://example.azuredatabricks.net"}}, "type": "Account"}} + When the request is sent + Then the response status is 201 CREATED + + @generated @skip @team:DataDog/saas-integrations + Scenario: Create a web integration account returns "Not Found" response + Given operation "CreateWebIntegrationAccount" enabled + And new "CreateWebIntegrationAccount" request + And request contains "integration_name" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"name": "my-databricks-account", "secrets": {"client_secret": "my-client-secret"}, "settings": {"workspace_url": "https://example.azuredatabricks.net"}}, "type": "Account"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/saas-integrations + Scenario: Create a web integration account returns "The server cannot process the request because it contains invalid data." response + Given operation "CreateWebIntegrationAccount" enabled + And new "CreateWebIntegrationAccount" request + And request contains "integration_name" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"name": "my-databricks-account", "secrets": {"client_secret": "my-client-secret"}, "settings": {"workspace_url": "https://example.azuredatabricks.net"}}, "type": "Account"}} + When the request is sent + Then the response status is 422 The server cannot process the request because it contains invalid data. + + @generated @skip @team:DataDog/saas-integrations + Scenario: Delete a web integration account returns "Bad Request" response + Given operation "DeleteWebIntegrationAccount" enabled + And new "DeleteWebIntegrationAccount" request + And request contains "integration_name" parameter from "REPLACE.ME" + And request contains "account_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/saas-integrations + Scenario: Delete a web integration account returns "Not Found" response + Given operation "DeleteWebIntegrationAccount" enabled + And new "DeleteWebIntegrationAccount" request + And request contains "integration_name" parameter from "REPLACE.ME" + And request contains "account_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/saas-integrations + Scenario: Delete a web integration account returns "OK" response + Given operation "DeleteWebIntegrationAccount" enabled + And new "DeleteWebIntegrationAccount" request + And request contains "integration_name" parameter from "REPLACE.ME" + And request contains "account_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 OK + + @generated @skip @team:DataDog/saas-integrations + Scenario: Get a web integration account returns "Bad Request" response + Given operation "GetWebIntegrationAccount" enabled + And new "GetWebIntegrationAccount" request + And request contains "integration_name" parameter from "REPLACE.ME" + And request contains "account_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/saas-integrations + Scenario: Get a web integration account returns "Not Found" response + Given operation "GetWebIntegrationAccount" enabled + And new "GetWebIntegrationAccount" request + And request contains "integration_name" parameter from "REPLACE.ME" + And request contains "account_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/saas-integrations + Scenario: Get a web integration account returns "OK" response + Given operation "GetWebIntegrationAccount" enabled + And new "GetWebIntegrationAccount" request + And request contains "integration_name" parameter from "REPLACE.ME" + And request contains "account_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/saas-integrations + Scenario: List web integration accounts returns "Bad Request" response + Given operation "ListWebIntegrationAccounts" enabled + And new "ListWebIntegrationAccounts" request + And request contains "integration_name" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/saas-integrations + Scenario: List web integration accounts returns "Not Found" response + Given operation "ListWebIntegrationAccounts" enabled + And new "ListWebIntegrationAccounts" request + And request contains "integration_name" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/saas-integrations + Scenario: List web integration accounts returns "OK" response + Given operation "ListWebIntegrationAccounts" enabled + And new "ListWebIntegrationAccounts" request + And request contains "integration_name" 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 web integration account returns "Bad Request" response + Given operation "UpdateWebIntegrationAccount" enabled + And new "UpdateWebIntegrationAccount" request + And request contains "integration_name" parameter from "REPLACE.ME" + And request contains "account_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"name": "my-databricks-account", "secrets": {"client_secret": "my-client-secret"}, "settings": {"workspace_url": "https://example.azuredatabricks.net"}}, "type": "Account"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/saas-integrations + Scenario: Update a web integration account returns "Not Found" response + Given operation "UpdateWebIntegrationAccount" enabled + And new "UpdateWebIntegrationAccount" request + And request contains "integration_name" parameter from "REPLACE.ME" + And request contains "account_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"name": "my-databricks-account", "secrets": {"client_secret": "my-client-secret"}, "settings": {"workspace_url": "https://example.azuredatabricks.net"}}, "type": "Account"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/saas-integrations + Scenario: Update a web integration account returns "OK" response + Given operation "UpdateWebIntegrationAccount" enabled + And new "UpdateWebIntegrationAccount" request + And request contains "integration_name" parameter from "REPLACE.ME" + And request contains "account_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"name": "my-databricks-account", "secrets": {"client_secret": "my-client-secret"}, "settings": {"workspace_url": "https://example.azuredatabricks.net"}}, "type": "Account"}} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/saas-integrations + Scenario: Update a web integration account returns "The server cannot process the request because it contains invalid data." response + Given operation "UpdateWebIntegrationAccount" enabled + And new "UpdateWebIntegrationAccount" request + And request contains "integration_name" parameter from "REPLACE.ME" + And request contains "account_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"name": "my-databricks-account", "secrets": {"client_secret": "my-client-secret"}, "settings": {"workspace_url": "https://example.azuredatabricks.net"}}, "type": "Account"}} + When the request is sent + Then the response status is 422 The server cannot process the request because it contains invalid data. diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index 5ecf38d58d02..c1476b3a89cb 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -468,6 +468,11 @@ def initialize "v2.get_incident_team": false, "v2.list_incident_teams": false, "v2.update_incident_team": false, + "v2.create_web_integration_account": false, + "v2.delete_web_integration_account": false, + "v2.get_web_integration_account": false, + "v2.list_web_integration_accounts": false, + "v2.update_web_integration_account": false, } @server_variables[:site] = ENV['DD_SITE'] if ENV.key? 'DD_SITE' @api_key['apiKeyAuth'] = ENV['DD_API_KEY'] if ENV.key? 'DD_API_KEY' diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index fe048900613d..3ce17f8b5fdc 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -6311,6 +6311,17 @@ def overrides "v2.watcher_data" => "WatcherData", "v2.watcher_data_attributes" => "WatcherDataAttributes", "v2.watcher_data_type" => "WatcherDataType", + "v2.web_integration_account_create_request" => "WebIntegrationAccountCreateRequest", + "v2.web_integration_account_create_request_attributes" => "WebIntegrationAccountCreateRequestAttributes", + "v2.web_integration_account_create_request_data" => "WebIntegrationAccountCreateRequestData", + "v2.web_integration_account_response" => "WebIntegrationAccountResponse", + "v2.web_integration_account_response_attributes" => "WebIntegrationAccountResponseAttributes", + "v2.web_integration_account_response_data" => "WebIntegrationAccountResponseData", + "v2.web_integration_accounts_response" => "WebIntegrationAccountsResponse", + "v2.web_integration_account_type" => "WebIntegrationAccountType", + "v2.web_integration_account_update_request" => "WebIntegrationAccountUpdateRequest", + "v2.web_integration_account_update_request_attributes" => "WebIntegrationAccountUpdateRequestAttributes", + "v2.web_integration_account_update_request_data" => "WebIntegrationAccountUpdateRequestData", "v2.weekday" => "Weekday", "v2.widget_attributes" => "WidgetAttributes", "v2.widget_data" => "WidgetData", @@ -6494,6 +6505,7 @@ def overrides "v2.test_optimization_api" => "TestOptimizationAPI", "v2.usage_metering_api" => "UsageMeteringAPI", "v2.users_api" => "UsersAPI", + "v2.web_integrations_api" => "WebIntegrationsAPI", "v2.widgets_api" => "WidgetsAPI", "v2.workflow_automation_api" => "WorkflowAutomationAPI" } diff --git a/lib/datadog_api_client/v2/api/web_integrations_api.rb b/lib/datadog_api_client/v2/api/web_integrations_api.rb new file mode 100644 index 000000000000..e7e05836fe10 --- /dev/null +++ b/lib/datadog_api_client/v2/api/web_integrations_api.rb @@ -0,0 +1,410 @@ +=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 WebIntegrationsAPI + attr_accessor :api_client + + def initialize(api_client = DatadogAPIClient::APIClient.default) + @api_client = api_client + end + + # Create a web integration account. + # + # @see #create_web_integration_account_with_http_info + def create_web_integration_account(integration_name, body, opts = {}) + data, _status_code, _headers = create_web_integration_account_with_http_info(integration_name, body, opts) + data + end + + # Create a web integration account. + # + # Create a new account for a given web integration. + # + # @param integration_name [String] The name of the integration (for example, `databricks`). + # @param body [WebIntegrationAccountCreateRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(WebIntegrationAccountResponse, Integer, Hash)>] WebIntegrationAccountResponse data, response status code and response headers + def create_web_integration_account_with_http_info(integration_name, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_web_integration_account".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_web_integration_account") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_web_integration_account")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: WebIntegrationsAPI.create_web_integration_account ...' + end + # verify the required parameter 'integration_name' is set + if @api_client.config.client_side_validation && integration_name.nil? + fail ArgumentError, "Missing the required parameter 'integration_name' when calling WebIntegrationsAPI.create_web_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 WebIntegrationsAPI.create_web_integration_account" + end + # resource path + local_var_path = '/api/v2/web-integrations/{integration_name}/accounts'.sub('{integration_name}', CGI.escape(integration_name.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] || 'WebIntegrationAccountResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :create_web_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: WebIntegrationsAPI#create_web_integration_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Delete a web integration account. + # + # @see #delete_web_integration_account_with_http_info + def delete_web_integration_account(integration_name, account_id, opts = {}) + delete_web_integration_account_with_http_info(integration_name, account_id, opts) + nil + end + + # Delete a web integration account. + # + # Delete an account for a given web integration. + # + # @param integration_name [String] The name of the integration (for example, `databricks`). + # @param account_id [String] The unique identifier of the web integration account. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_web_integration_account_with_http_info(integration_name, account_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_web_integration_account".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_web_integration_account") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_web_integration_account")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: WebIntegrationsAPI.delete_web_integration_account ...' + end + # verify the required parameter 'integration_name' is set + if @api_client.config.client_side_validation && integration_name.nil? + fail ArgumentError, "Missing the required parameter 'integration_name' when calling WebIntegrationsAPI.delete_web_integration_account" + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling WebIntegrationsAPI.delete_web_integration_account" + end + # resource path + local_var_path = '/api/v2/web-integrations/{integration_name}/accounts/{account_id}'.sub('{integration_name}', CGI.escape(integration_name.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_web_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: WebIntegrationsAPI#delete_web_integration_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get a web integration account. + # + # @see #get_web_integration_account_with_http_info + def get_web_integration_account(integration_name, account_id, opts = {}) + data, _status_code, _headers = get_web_integration_account_with_http_info(integration_name, account_id, opts) + data + end + + # Get a web integration account. + # + # Get a single account for a given web integration. + # + # @param integration_name [String] The name of the integration (for example, `databricks`). + # @param account_id [String] The unique identifier of the web integration account. + # @param opts [Hash] the optional parameters + # @return [Array<(WebIntegrationAccountResponse, Integer, Hash)>] WebIntegrationAccountResponse data, response status code and response headers + def get_web_integration_account_with_http_info(integration_name, account_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_web_integration_account".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_web_integration_account") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_web_integration_account")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: WebIntegrationsAPI.get_web_integration_account ...' + end + # verify the required parameter 'integration_name' is set + if @api_client.config.client_side_validation && integration_name.nil? + fail ArgumentError, "Missing the required parameter 'integration_name' when calling WebIntegrationsAPI.get_web_integration_account" + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling WebIntegrationsAPI.get_web_integration_account" + end + # resource path + local_var_path = '/api/v2/web-integrations/{integration_name}/accounts/{account_id}'.sub('{integration_name}', CGI.escape(integration_name.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] || 'WebIntegrationAccountResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_web_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: WebIntegrationsAPI#get_web_integration_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List web integration accounts. + # + # @see #list_web_integration_accounts_with_http_info + def list_web_integration_accounts(integration_name, opts = {}) + data, _status_code, _headers = list_web_integration_accounts_with_http_info(integration_name, opts) + data + end + + # List web integration accounts. + # + # List accounts for a given web integration. + # + # @param integration_name [String] The name of the integration (for example, `databricks`). + # @param opts [Hash] the optional parameters + # @return [Array<(WebIntegrationAccountsResponse, Integer, Hash)>] WebIntegrationAccountsResponse data, response status code and response headers + def list_web_integration_accounts_with_http_info(integration_name, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_web_integration_accounts".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_web_integration_accounts") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_web_integration_accounts")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: WebIntegrationsAPI.list_web_integration_accounts ...' + end + # verify the required parameter 'integration_name' is set + if @api_client.config.client_side_validation && integration_name.nil? + fail ArgumentError, "Missing the required parameter 'integration_name' when calling WebIntegrationsAPI.list_web_integration_accounts" + end + # resource path + local_var_path = '/api/v2/web-integrations/{integration_name}/accounts'.sub('{integration_name}', CGI.escape(integration_name.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] || 'WebIntegrationAccountsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_web_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: WebIntegrationsAPI#list_web_integration_accounts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update a web integration account. + # + # @see #update_web_integration_account_with_http_info + def update_web_integration_account(integration_name, account_id, body, opts = {}) + data, _status_code, _headers = update_web_integration_account_with_http_info(integration_name, account_id, body, opts) + data + end + + # Update a web integration account. + # + # Update an existing account for a given web integration. + # + # @param integration_name [String] The name of the integration (for example, `databricks`). + # @param account_id [String] The unique identifier of the web integration account. + # @param body [WebIntegrationAccountUpdateRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(WebIntegrationAccountResponse, Integer, Hash)>] WebIntegrationAccountResponse data, response status code and response headers + def update_web_integration_account_with_http_info(integration_name, account_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.update_web_integration_account".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_web_integration_account") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_web_integration_account")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: WebIntegrationsAPI.update_web_integration_account ...' + end + # verify the required parameter 'integration_name' is set + if @api_client.config.client_side_validation && integration_name.nil? + fail ArgumentError, "Missing the required parameter 'integration_name' when calling WebIntegrationsAPI.update_web_integration_account" + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling WebIntegrationsAPI.update_web_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 WebIntegrationsAPI.update_web_integration_account" + end + # resource path + local_var_path = '/api/v2/web-integrations/{integration_name}/accounts/{account_id}'.sub('{integration_name}', CGI.escape(integration_name.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] || 'WebIntegrationAccountResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :update_web_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: WebIntegrationsAPI#update_web_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/web_integration_account_create_request.rb b/lib/datadog_api_client/v2/models/web_integration_account_create_request.rb new file mode 100644 index 000000000000..a2921a081a93 --- /dev/null +++ b/lib/datadog_api_client/v2/models/web_integration_account_create_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Payload schema when adding a web integration account. + class WebIntegrationAccountCreateRequest + include BaseGenericModel + + # Data object for creating a web integration account. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'WebIntegrationAccountCreateRequestData' + } + 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::WebIntegrationAccountCreateRequest` 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/web_integration_account_create_request_attributes.rb b/lib/datadog_api_client/v2/models/web_integration_account_create_request_attributes.rb new file mode 100644 index 000000000000..b9c354575806 --- /dev/null +++ b/lib/datadog_api_client/v2/models/web_integration_account_create_request_attributes.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 + # Attributes object for creating a web integration account. + class WebIntegrationAccountCreateRequestAttributes + include BaseGenericModel + + # A human-readable name for the account. Must be unique among accounts of the same integration. + attr_reader :name + + # Integration-specific secrets. The shape of this object varies by integration. Secrets + # are write-only and never returned by the API. + attr_reader :secrets + + # Integration-specific settings. The shape of this object varies by integration. + attr_reader :settings + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'name' => :'name', + :'secrets' => :'secrets', + :'settings' => :'settings' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'name' => :'String', + :'secrets' => :'Hash', + :'settings' => :'Hash' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::WebIntegrationAccountCreateRequestAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'secrets') + self.secrets = attributes[:'secrets'] + end + + if attributes.key?(:'settings') + self.settings = attributes[:'settings'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @name.nil? + return false if @secrets.nil? + return false if @settings.nil? + true + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param secrets [Object] Object to be assigned + # @!visibility private + def secrets=(secrets) + if secrets.nil? + fail ArgumentError, 'invalid value for "secrets", secrets cannot be nil.' + end + @secrets = secrets + end + + # Custom attribute writer method with validation + # @param settings [Object] Object to be assigned + # @!visibility private + def settings=(settings) + if settings.nil? + fail ArgumentError, 'invalid value for "settings", settings cannot be nil.' + end + @settings = settings + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + secrets == o.secrets && + settings == o.settings && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [name, secrets, settings, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/web_integration_account_create_request_data.rb b/lib/datadog_api_client/v2/models/web_integration_account_create_request_data.rb new file mode 100644 index 000000000000..bf4e78a3f9f7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/web_integration_account_create_request_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data object for creating a web integration account. + class WebIntegrationAccountCreateRequestData + include BaseGenericModel + + # Attributes object for creating a web integration account. + attr_reader :attributes + + # Account resource type. + 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' => :'WebIntegrationAccountCreateRequestAttributes', + :'type' => :'WebIntegrationAccountType' + } + 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::WebIntegrationAccountCreateRequestData` 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/web_integration_account_response.rb b/lib/datadog_api_client/v2/models/web_integration_account_response.rb new file mode 100644 index 000000000000..68b0415634cf --- /dev/null +++ b/lib/datadog_api_client/v2/models/web_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 + # The expected response schema when getting a single web integration account. + class WebIntegrationAccountResponse + include BaseGenericModel + + # Data object of a web integration account. + 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' => :'WebIntegrationAccountResponseData' + } + 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::WebIntegrationAccountResponse` 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/web_integration_account_response_attributes.rb b/lib/datadog_api_client/v2/models/web_integration_account_response_attributes.rb new file mode 100644 index 000000000000..d87521a513d5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/web_integration_account_response_attributes.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 + # Attributes object of a web integration account. Secrets are never returned. + class WebIntegrationAccountResponseAttributes + include BaseGenericModel + + # A human-readable name for the account. + attr_reader :name + + # Integration-specific settings. The shape of this object varies by integration. + attr_accessor :settings + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'name' => :'name', + :'settings' => :'settings' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'name' => :'String', + :'settings' => :'Hash' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::WebIntegrationAccountResponseAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'settings') + self.settings = attributes[:'settings'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @name.nil? + true + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + settings == o.settings && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [name, settings, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/web_integration_account_response_data.rb b/lib/datadog_api_client/v2/models/web_integration_account_response_data.rb new file mode 100644 index 000000000000..64c1f1e1ea51 --- /dev/null +++ b/lib/datadog_api_client/v2/models/web_integration_account_response_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data object of a web integration account. + class WebIntegrationAccountResponseData + include BaseGenericModel + + # Attributes object of a web integration account. Secrets are never returned. + attr_reader :attributes + + # The unique identifier of the web integration account. + attr_reader :id + + # Account resource type. + 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' => :'WebIntegrationAccountResponseAttributes', + :'id' => :'String', + :'type' => :'WebIntegrationAccountType' + } + 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::WebIntegrationAccountResponseData` 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/web_integration_account_type.rb b/lib/datadog_api_client/v2/models/web_integration_account_type.rb new file mode 100644 index 000000000000..74b937e39b23 --- /dev/null +++ b/lib/datadog_api_client/v2/models/web_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 + # Account resource type. + class WebIntegrationAccountType + include BaseEnumModel + + ACCOUNT = "Account".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/web_integration_account_update_request.rb b/lib/datadog_api_client/v2/models/web_integration_account_update_request.rb new file mode 100644 index 000000000000..d72c7e011732 --- /dev/null +++ b/lib/datadog_api_client/v2/models/web_integration_account_update_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Payload schema when updating a web integration account. + class WebIntegrationAccountUpdateRequest + include BaseGenericModel + + # Data object for updating a web integration account. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'WebIntegrationAccountUpdateRequestData' + } + 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::WebIntegrationAccountUpdateRequest` 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/web_integration_account_update_request_attributes.rb b/lib/datadog_api_client/v2/models/web_integration_account_update_request_attributes.rb new file mode 100644 index 000000000000..2d06a0312315 --- /dev/null +++ b/lib/datadog_api_client/v2/models/web_integration_account_update_request_attributes.rb @@ -0,0 +1,126 @@ +=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 object for updating a web integration account. + class WebIntegrationAccountUpdateRequestAttributes + include BaseGenericModel + + # A human-readable name for the account. + attr_accessor :name + + # Integration-specific secrets. The shape of this object varies by integration. Secrets + # are write-only and never returned by the API. + attr_accessor :secrets + + # Integration-specific settings. The shape of this object varies by integration. + attr_accessor :settings + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'name' => :'name', + :'secrets' => :'secrets', + :'settings' => :'settings' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'name' => :'String', + :'secrets' => :'Hash', + :'settings' => :'Hash' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::WebIntegrationAccountUpdateRequestAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'secrets') + self.secrets = attributes[:'secrets'] + end + + if attributes.key?(:'settings') + self.settings = attributes[:'settings'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + secrets == o.secrets && + settings == o.settings && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [name, secrets, settings, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/web_integration_account_update_request_data.rb b/lib/datadog_api_client/v2/models/web_integration_account_update_request_data.rb new file mode 100644 index 000000000000..5166463867ad --- /dev/null +++ b/lib/datadog_api_client/v2/models/web_integration_account_update_request_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data object for updating a web integration account. + class WebIntegrationAccountUpdateRequestData + include BaseGenericModel + + # Attributes object for updating a web integration account. + attr_reader :attributes + + # Account resource type. + 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' => :'WebIntegrationAccountUpdateRequestAttributes', + :'type' => :'WebIntegrationAccountType' + } + 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::WebIntegrationAccountUpdateRequestData` 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/web_integration_accounts_response.rb b/lib/datadog_api_client/v2/models/web_integration_accounts_response.rb new file mode 100644 index 000000000000..3d49dab436ac --- /dev/null +++ b/lib/datadog_api_client/v2/models/web_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 + # The expected response schema when listing web integration accounts. + class WebIntegrationAccountsResponse + include BaseGenericModel + + # The JSON:API data array. + 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::WebIntegrationAccountsResponse` 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