diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 4d59bfade193..8262c1a98b2c 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -1713,6 +1713,13 @@ components: required: true schema: type: string + StatuspageUrlSettingIDPathParameter: + description: The UUID of the Statuspage URL setting. + in: path + name: statuspage_url_setting_id + required: true + schema: + type: string TagKey: description: The Cloud Cost Management tag key. Tag keys can contain forward slashes (for example, `kubernetes/instance`). in: path @@ -83947,6 +83954,235 @@ components: type: string x-enum-varnames: - USERS + StatuspageAccountCreateAttributes: + description: The Statuspage account attributes for a create request. + properties: + api_key: + description: The Statuspage API key for your Statuspage account. + example: "00000000-0000-0000-0000-000000000000" + minLength: 1 + type: string + required: + - api_key + type: object + StatuspageAccountCreateData: + description: Statuspage account data for a create request. + properties: + attributes: + $ref: "#/components/schemas/StatuspageAccountCreateAttributes" + type: + $ref: "#/components/schemas/StatuspageAccountType" + required: + - type + - attributes + type: object + StatuspageAccountCreateRequest: + description: Create request for a Statuspage account. + properties: + data: + $ref: "#/components/schemas/StatuspageAccountCreateData" + required: + - data + type: object + StatuspageAccountResponse: + description: Response containing a Statuspage account. + properties: + data: + $ref: "#/components/schemas/StatuspageAccountResponseData" + required: + - data + type: object + StatuspageAccountResponseAttributes: + description: The attributes from a Statuspage account response. + properties: + api_key: + description: The Statuspage API key for your Statuspage account. The value is always returned masked. + example: "*****" + type: string + type: object + StatuspageAccountResponseData: + description: Statuspage account data from a response. + properties: + attributes: + $ref: "#/components/schemas/StatuspageAccountResponseAttributes" + type: + $ref: "#/components/schemas/StatuspageAccountType" + required: + - type + - attributes + type: object + StatuspageAccountType: + default: statuspage-account + description: Statuspage account resource type. + enum: + - statuspage-account + example: statuspage-account + type: string + x-enum-varnames: + - STATUSPAGE_ACCOUNT + StatuspageAccountUpdateAttributes: + description: The Statuspage account attributes for an update request. + properties: + api_key: + description: The Statuspage API key for your Statuspage account. + example: "00000000-0000-0000-0000-000000000000" + minLength: 1 + type: string + type: object + StatuspageAccountUpdateData: + description: Statuspage account data for an update request. + properties: + attributes: + $ref: "#/components/schemas/StatuspageAccountUpdateAttributes" + type: + $ref: "#/components/schemas/StatuspageAccountType" + required: + - type + - attributes + type: object + StatuspageAccountUpdateRequest: + description: Update request for a Statuspage account. + properties: + data: + $ref: "#/components/schemas/StatuspageAccountUpdateData" + required: + - data + type: object + StatuspageUrlSettingCreateAttributes: + description: The Statuspage URL setting attributes for a create request. + properties: + custom_tags: + description: Comma-separated list of custom tags to apply to events generated from this Statuspage URL. + example: "team:collaboration-integrations,env:prod" + minLength: 1 + type: string + url: + description: The Statuspage URL to monitor. Must be a `status.io` or `statuspage.com` URL. + example: "https://example.statuspage.io" + minLength: 1 + type: string + required: + - url + - custom_tags + type: object + StatuspageUrlSettingCreateData: + description: Statuspage URL setting data for a create request. + properties: + attributes: + $ref: "#/components/schemas/StatuspageUrlSettingCreateAttributes" + type: + $ref: "#/components/schemas/StatuspageUrlSettingType" + required: + - type + - attributes + type: object + StatuspageUrlSettingCreateRequest: + description: Create request for a Statuspage URL setting. + properties: + data: + $ref: "#/components/schemas/StatuspageUrlSettingCreateData" + required: + - data + type: object + StatuspageUrlSettingResponse: + description: Response containing a Statuspage URL setting. + properties: + data: + $ref: "#/components/schemas/StatuspageUrlSettingResponseData" + required: + - data + type: object + StatuspageUrlSettingResponseAttributes: + description: The attributes from a Statuspage URL setting response. + properties: + custom_tags: + description: Comma-separated list of custom tags applied to events generated from this Statuspage URL. + example: "team:collaboration-integrations,env:prod" + type: string + url: + description: The Statuspage URL being monitored. + example: "https://example.statuspage.io" + type: string + type: object + StatuspageUrlSettingResponseData: + description: Statuspage URL setting data from a response. + properties: + attributes: + $ref: "#/components/schemas/StatuspageUrlSettingResponseAttributes" + id: + description: The ID of the Statuspage URL setting. + example: "596da4af-0563-4097-90ff-07230c3f9db3" + maxLength: 100 + minLength: 1 + type: string + type: + $ref: "#/components/schemas/StatuspageUrlSettingType" + required: + - id + - type + - attributes + type: object + StatuspageUrlSettingType: + default: statuspage-url-setting + description: Statuspage URL setting resource type. + enum: + - statuspage-url-setting + example: statuspage-url-setting + type: string + x-enum-varnames: + - STATUSPAGE_URL_SETTING + StatuspageUrlSettingUpdateAttributes: + description: The Statuspage URL setting attributes for an update request. + properties: + custom_tags: + description: Comma-separated list of custom tags to apply to events generated from this Statuspage URL. + example: "team:collaboration-integrations,env:prod" + minLength: 1 + type: string + url: + description: The Statuspage URL to monitor. + example: "https://example.statuspage.io" + minLength: 1 + type: string + type: object + StatuspageUrlSettingUpdateData: + description: Statuspage URL setting data for an update request. + properties: + attributes: + $ref: "#/components/schemas/StatuspageUrlSettingUpdateAttributes" + id: + description: The ID of the Statuspage URL setting. + example: "596da4af-0563-4097-90ff-07230c3f9db3" + maxLength: 100 + minLength: 1 + type: string + type: + $ref: "#/components/schemas/StatuspageUrlSettingType" + required: + - id + - type + - attributes + type: object + StatuspageUrlSettingUpdateRequest: + description: Update request for a Statuspage URL setting. + properties: + data: + $ref: "#/components/schemas/StatuspageUrlSettingUpdateData" + required: + - data + type: object + StatuspageUrlSettingsResponse: + description: Response with a list of Statuspage URL settings. + properties: + data: + description: An array of Statuspage URL settings. + example: [{"attributes": {"custom_tags": "team:collaboration-integrations", "url": "https://example.statuspage.io"}, "id": "596da4af-0563-4097-90ff-07230c3f9db3", "type": "statuspage-url-setting"}] + items: + $ref: "#/components/schemas/StatuspageUrlSettingResponseData" + type: array + required: + - data + type: object Step: description: A Step is a sub-component of a workflow. Each Step performs an action. properties: @@ -125611,6 +125847,316 @@ paths: summary: List ServiceNow users tags: - ServiceNow Integration + /api/v2/integration/statuspage/account: + delete: + description: Delete the Statuspage account configured for your organization. + operationId: DeleteStatuspageAccount + 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 the Statuspage account + tags: + - Statuspage Integration + "x-permission": + operator: OR + permissions: + - manage_integrations + get: + description: Get the Statuspage account configured for your organization. + operationId: GetStatuspageAccount + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + api_key: "*****" + type: statuspage-account + schema: + $ref: "#/components/schemas/StatuspageAccountResponse" + description: OK + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get the Statuspage account + tags: + - Statuspage Integration + "x-permission": + operator: OR + permissions: + - integrations_read + patch: + description: Update the Statuspage account configured for your organization. + operationId: UpdateStatuspageAccount + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + api_key: 00000000-0000-0000-0000-000000000000 + type: statuspage-account + schema: + $ref: "#/components/schemas/StatuspageAccountUpdateRequest" + description: Statuspage account payload. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + api_key: "*****" + type: statuspage-account + schema: + $ref: "#/components/schemas/StatuspageAccountResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Update the Statuspage account + tags: + - Statuspage Integration + x-codegen-request-body-name: body + "x-permission": + operator: OR + permissions: + - manage_integrations + post: + description: |- + Create a Statuspage account for your organization. Only one Statuspage + account can be configured per organization. + operationId: CreateStatuspageAccount + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + api_key: 00000000-0000-0000-0000-000000000000 + type: statuspage-account + schema: + $ref: "#/components/schemas/StatuspageAccountCreateRequest" + description: Statuspage account payload. + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + api_key: "*****" + type: statuspage-account + schema: + $ref: "#/components/schemas/StatuspageAccountResponse" + description: CREATED + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "409": + $ref: "#/components/responses/ConflictResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Create the Statuspage account + tags: + - Statuspage Integration + x-codegen-request-body-name: body + "x-permission": + operator: OR + permissions: + - manage_integrations + /api/v2/integration/statuspage/url_settings: + get: + description: Get all Statuspage URL settings configured for your organization. + operationId: ListStatuspageUrlSettings + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + custom_tags: "team:collaboration-integrations" + url: "https://example.statuspage.io" + id: 00000000-0000-0000-0000-000000000001 + type: statuspage-url-setting + schema: + $ref: "#/components/schemas/StatuspageUrlSettingsResponse" + description: OK + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get all Statuspage URL settings + tags: + - Statuspage Integration + "x-permission": + operator: OR + permissions: + - integrations_read + post: + description: Create a Statuspage URL setting for your organization. + operationId: CreateStatuspageUrlSetting + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + custom_tags: "team:collaboration-integrations" + url: "https://example.statuspage.io" + type: statuspage-url-setting + schema: + $ref: "#/components/schemas/StatuspageUrlSettingCreateRequest" + description: Statuspage URL setting payload. + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + custom_tags: "team:collaboration-integrations" + url: "https://example.statuspage.io" + id: 00000000-0000-0000-0000-000000000002 + type: statuspage-url-setting + schema: + $ref: "#/components/schemas/StatuspageUrlSettingResponse" + description: CREATED + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "409": + $ref: "#/components/responses/ConflictResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Create a Statuspage URL setting + tags: + - Statuspage Integration + x-codegen-request-body-name: body + "x-permission": + operator: OR + permissions: + - manage_integrations + /api/v2/integration/statuspage/url_settings/{statuspage_url_setting_id}: + delete: + description: Delete a single Statuspage URL setting from your organization. + operationId: DeleteStatuspageUrlSetting + parameters: + - $ref: "#/components/parameters/StatuspageUrlSettingIDPathParameter" + 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 Statuspage URL setting + tags: + - Statuspage Integration + "x-permission": + operator: OR + permissions: + - manage_integrations + patch: + description: Update a single Statuspage URL setting in your organization. + operationId: UpdateStatuspageUrlSetting + parameters: + - $ref: "#/components/parameters/StatuspageUrlSettingIDPathParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + custom_tags: "team:collaboration-integrations" + url: "https://example.statuspage.io" + id: 596da4af-0563-4097-90ff-07230c3f9db3 + type: statuspage-url-setting + schema: + $ref: "#/components/schemas/StatuspageUrlSettingUpdateRequest" + description: Statuspage URL setting payload. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + custom_tags: "team:collaboration-integrations" + url: "https://example.statuspage.io" + id: 00000000-0000-0000-0000-000000000003 + type: statuspage-url-setting + schema: + $ref: "#/components/schemas/StatuspageUrlSettingResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "409": + $ref: "#/components/responses/ConflictResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Update a Statuspage URL setting + tags: + - Statuspage Integration + x-codegen-request-body-name: body + "x-permission": + operator: OR + permissions: + - manage_integrations /api/v2/integrations: get: operationId: ListIntegrations @@ -170247,6 +170793,12 @@ tags: name: Static Analysis - description: Manage your status pages and communicate service disruptions to stakeholders via Datadog's API. See the [Status Pages documentation](https://docs.datadoghq.com/incident_response/status_pages/) for more information. name: Status Pages + - description: |- + Configure your [Datadog Statuspage integration](https://docs.datadoghq.com/integrations/statuspage/) + directly through the Datadog API. + externalDocs: + url: https://docs.datadoghq.com/api/latest/statuspage-integration + name: Statuspage Integration - description: |- Enable Storage Management for S3 buckets, GCS buckets, and Azure containers. Each configuration registers the destination that holds inventory reports for the storage being monitored. name: Storage Management diff --git a/examples/v2/statuspage-integration/CreateStatuspageAccount.rb b/examples/v2/statuspage-integration/CreateStatuspageAccount.rb new file mode 100644 index 000000000000..a820b52dd959 --- /dev/null +++ b/examples/v2/statuspage-integration/CreateStatuspageAccount.rb @@ -0,0 +1,14 @@ +# Create the Statuspage account returns "CREATED" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::StatuspageIntegrationAPI.new + +body = DatadogAPIClient::V2::StatuspageAccountCreateRequest.new({ + data: DatadogAPIClient::V2::StatuspageAccountCreateData.new({ + attributes: DatadogAPIClient::V2::StatuspageAccountCreateAttributes.new({ + api_key: "00000000-0000-0000-0000-000000000000", + }), + type: DatadogAPIClient::V2::StatuspageAccountType::STATUSPAGE_ACCOUNT, + }), +}) +p api_instance.create_statuspage_account(body) diff --git a/examples/v2/statuspage-integration/CreateStatuspageUrlSetting.rb b/examples/v2/statuspage-integration/CreateStatuspageUrlSetting.rb new file mode 100644 index 000000000000..5b1a3a9b239b --- /dev/null +++ b/examples/v2/statuspage-integration/CreateStatuspageUrlSetting.rb @@ -0,0 +1,15 @@ +# Create a Statuspage URL setting returns "CREATED" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::StatuspageIntegrationAPI.new + +body = DatadogAPIClient::V2::StatuspageUrlSettingCreateRequest.new({ + data: DatadogAPIClient::V2::StatuspageUrlSettingCreateData.new({ + attributes: DatadogAPIClient::V2::StatuspageUrlSettingCreateAttributes.new({ + custom_tags: "team:collaboration-integrations,env:prod", + url: "https://example.statuspage.io", + }), + type: DatadogAPIClient::V2::StatuspageUrlSettingType::STATUSPAGE_URL_SETTING, + }), +}) +p api_instance.create_statuspage_url_setting(body) diff --git a/examples/v2/statuspage-integration/DeleteStatuspageAccount.rb b/examples/v2/statuspage-integration/DeleteStatuspageAccount.rb new file mode 100644 index 000000000000..4b61b71273d1 --- /dev/null +++ b/examples/v2/statuspage-integration/DeleteStatuspageAccount.rb @@ -0,0 +1,5 @@ +# Delete the Statuspage account returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::StatuspageIntegrationAPI.new +api_instance.delete_statuspage_account() diff --git a/examples/v2/statuspage-integration/DeleteStatuspageUrlSetting.rb b/examples/v2/statuspage-integration/DeleteStatuspageUrlSetting.rb new file mode 100644 index 000000000000..1d6f2fb0d756 --- /dev/null +++ b/examples/v2/statuspage-integration/DeleteStatuspageUrlSetting.rb @@ -0,0 +1,5 @@ +# Delete a Statuspage URL setting returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::StatuspageIntegrationAPI.new +api_instance.delete_statuspage_url_setting("statuspage_url_setting_id") diff --git a/examples/v2/statuspage-integration/GetStatuspageAccount.rb b/examples/v2/statuspage-integration/GetStatuspageAccount.rb new file mode 100644 index 000000000000..0d5712920236 --- /dev/null +++ b/examples/v2/statuspage-integration/GetStatuspageAccount.rb @@ -0,0 +1,5 @@ +# Get the Statuspage account returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::StatuspageIntegrationAPI.new +p api_instance.get_statuspage_account() diff --git a/examples/v2/statuspage-integration/ListStatuspageUrlSettings.rb b/examples/v2/statuspage-integration/ListStatuspageUrlSettings.rb new file mode 100644 index 000000000000..958b44495bc8 --- /dev/null +++ b/examples/v2/statuspage-integration/ListStatuspageUrlSettings.rb @@ -0,0 +1,5 @@ +# Get all Statuspage URL settings returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::StatuspageIntegrationAPI.new +p api_instance.list_statuspage_url_settings() diff --git a/examples/v2/statuspage-integration/UpdateStatuspageAccount.rb b/examples/v2/statuspage-integration/UpdateStatuspageAccount.rb new file mode 100644 index 000000000000..23bfd7842bf5 --- /dev/null +++ b/examples/v2/statuspage-integration/UpdateStatuspageAccount.rb @@ -0,0 +1,14 @@ +# Update the Statuspage account returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::StatuspageIntegrationAPI.new + +body = DatadogAPIClient::V2::StatuspageAccountUpdateRequest.new({ + data: DatadogAPIClient::V2::StatuspageAccountUpdateData.new({ + attributes: DatadogAPIClient::V2::StatuspageAccountUpdateAttributes.new({ + api_key: "00000000-0000-0000-0000-000000000000", + }), + type: DatadogAPIClient::V2::StatuspageAccountType::STATUSPAGE_ACCOUNT, + }), +}) +p api_instance.update_statuspage_account(body) diff --git a/examples/v2/statuspage-integration/UpdateStatuspageUrlSetting.rb b/examples/v2/statuspage-integration/UpdateStatuspageUrlSetting.rb new file mode 100644 index 000000000000..9af250b1aba6 --- /dev/null +++ b/examples/v2/statuspage-integration/UpdateStatuspageUrlSetting.rb @@ -0,0 +1,16 @@ +# Update a Statuspage URL setting returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::StatuspageIntegrationAPI.new + +body = DatadogAPIClient::V2::StatuspageUrlSettingUpdateRequest.new({ + data: DatadogAPIClient::V2::StatuspageUrlSettingUpdateData.new({ + attributes: DatadogAPIClient::V2::StatuspageUrlSettingUpdateAttributes.new({ + custom_tags: "team:collaboration-integrations,env:prod", + url: "https://example.statuspage.io", + }), + id: "596da4af-0563-4097-90ff-07230c3f9db3", + type: DatadogAPIClient::V2::StatuspageUrlSettingType::STATUSPAGE_URL_SETTING, + }), +}) +p api_instance.update_statuspage_url_setting("statuspage_url_setting_id", body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index fb9b295c7eca..c0367a4553b8 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -3470,6 +3470,22 @@ "v2.ListServiceNowUsers" => { "instance_id" => "UUID", }, + "v2.UpdateStatuspageAccount" => { + "body" => "StatuspageAccountUpdateRequest", + }, + "v2.CreateStatuspageAccount" => { + "body" => "StatuspageAccountCreateRequest", + }, + "v2.CreateStatuspageUrlSetting" => { + "body" => "StatuspageUrlSettingCreateRequest", + }, + "v2.DeleteStatuspageUrlSetting" => { + "statuspage_url_setting_id" => "String", + }, + "v2.UpdateStatuspageUrlSetting" => { + "statuspage_url_setting_id" => "String", + "body" => "StatuspageUrlSettingUpdateRequest", + }, "v2.CreateCloudflareAccount" => { "body" => "CloudflareAccountCreateRequest", }, diff --git a/features/v2/given.json b/features/v2/given.json index 7139a86ede5c..4ee2038f819e 100644 --- a/features/v2/given.json +++ b/features/v2/given.json @@ -686,6 +686,30 @@ "tag": "Opsgenie Integration", "operationId": "CreateOpsgenieService" }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"attributes\": {\n \"api_key\": \"00000000-0000-0000-0000-000000000000\"\n },\n \"type\": \"statuspage-account\"\n }\n}" + } + ], + "step": "there is a valid \"statuspage_account\" in the system", + "key": "statuspage_account", + "tag": "Statuspage Integration", + "operationId": "CreateStatuspageAccount" + }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"attributes\": {\n \"url\": \"https://example.statuspage.io\",\n \"custom_tags\": \"team:collaboration-integrations\"\n },\n \"type\": \"statuspage-url-setting\"\n }\n}" + } + ], + "step": "there is a valid \"statuspage_url_setting\" in the system", + "key": "statuspage_url_setting", + "tag": "Statuspage Integration", + "operationId": "CreateStatuspageUrlSetting" + }, { "parameters": [ { diff --git a/features/v2/statuspage_integration.feature b/features/v2/statuspage_integration.feature new file mode 100644 index 000000000000..453997ce7dc9 --- /dev/null +++ b/features/v2/statuspage_integration.feature @@ -0,0 +1,168 @@ +@endpoint(statuspage-integration) @endpoint(statuspage-integration-v2) +Feature: Statuspage Integration + Configure your [Datadog Statuspage + integration](https://docs.datadoghq.com/integrations/statuspage/) directly + through the Datadog API. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "StatuspageIntegration" API + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Create a Statuspage URL setting returns "Bad Request" response + Given new "CreateStatuspageUrlSetting" request + And body with value {"data": {"attributes": {"custom_tags": "team:collaboration-integrations,env:prod", "url": "https://example.statuspage.io"}, "type": "statuspage-url-setting"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Create a Statuspage URL setting returns "CREATED" response + Given new "CreateStatuspageUrlSetting" request + And body with value {"data": {"attributes": {"custom_tags": "team:collaboration-integrations,env:prod", "url": "https://example.statuspage.io"}, "type": "statuspage-url-setting"}} + When the request is sent + Then the response status is 201 CREATED + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Create a Statuspage URL setting returns "Conflict" response + Given new "CreateStatuspageUrlSetting" request + And body with value {"data": {"attributes": {"custom_tags": "team:collaboration-integrations,env:prod", "url": "https://example.statuspage.io"}, "type": "statuspage-url-setting"}} + When the request is sent + Then the response status is 409 Conflict + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Create the Statuspage account returns "Bad Request" response + Given new "CreateStatuspageAccount" request + And body with value {"data": {"attributes": {"api_key": "00000000-0000-0000-0000-000000000000"}, "type": "statuspage-account"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Create the Statuspage account returns "CREATED" response + Given new "CreateStatuspageAccount" request + And body with value {"data": {"attributes": {"api_key": "00000000-0000-0000-0000-000000000000"}, "type": "statuspage-account"}} + When the request is sent + Then the response status is 201 CREATED + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Create the Statuspage account returns "Conflict" response + Given new "CreateStatuspageAccount" request + And body with value {"data": {"attributes": {"api_key": "00000000-0000-0000-0000-000000000000"}, "type": "statuspage-account"}} + When the request is sent + Then the response status is 409 Conflict + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Delete a Statuspage URL setting returns "Bad Request" response + Given new "DeleteStatuspageUrlSetting" request + And request contains "statuspage_url_setting_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Delete a Statuspage URL setting returns "Not Found" response + Given new "DeleteStatuspageUrlSetting" request + And request contains "statuspage_url_setting_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Delete a Statuspage URL setting returns "OK" response + Given new "DeleteStatuspageUrlSetting" request + And request contains "statuspage_url_setting_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 OK + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Delete the Statuspage account returns "Bad Request" response + Given new "DeleteStatuspageAccount" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Delete the Statuspage account returns "Not Found" response + Given new "DeleteStatuspageAccount" request + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Delete the Statuspage account returns "OK" response + Given new "DeleteStatuspageAccount" request + When the request is sent + Then the response status is 204 OK + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Get all Statuspage URL settings returns "Not Found" response + Given new "ListStatuspageUrlSettings" request + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Get all Statuspage URL settings returns "OK" response + Given new "ListStatuspageUrlSettings" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Get the Statuspage account returns "Not Found" response + Given new "GetStatuspageAccount" request + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Get the Statuspage account returns "OK" response + Given new "GetStatuspageAccount" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Update a Statuspage URL setting returns "Bad Request" response + Given new "UpdateStatuspageUrlSetting" request + And request contains "statuspage_url_setting_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"custom_tags": "team:collaboration-integrations,env:prod", "url": "https://example.statuspage.io"}, "id": "596da4af-0563-4097-90ff-07230c3f9db3", "type": "statuspage-url-setting"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Update a Statuspage URL setting returns "Conflict" response + Given new "UpdateStatuspageUrlSetting" request + And request contains "statuspage_url_setting_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"custom_tags": "team:collaboration-integrations,env:prod", "url": "https://example.statuspage.io"}, "id": "596da4af-0563-4097-90ff-07230c3f9db3", "type": "statuspage-url-setting"}} + When the request is sent + Then the response status is 409 Conflict + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Update a Statuspage URL setting returns "Not Found" response + Given new "UpdateStatuspageUrlSetting" request + And request contains "statuspage_url_setting_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"custom_tags": "team:collaboration-integrations,env:prod", "url": "https://example.statuspage.io"}, "id": "596da4af-0563-4097-90ff-07230c3f9db3", "type": "statuspage-url-setting"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Update a Statuspage URL setting returns "OK" response + Given new "UpdateStatuspageUrlSetting" request + And request contains "statuspage_url_setting_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"custom_tags": "team:collaboration-integrations,env:prod", "url": "https://example.statuspage.io"}, "id": "596da4af-0563-4097-90ff-07230c3f9db3", "type": "statuspage-url-setting"}} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Update the Statuspage account returns "Bad Request" response + Given new "UpdateStatuspageAccount" request + And body with value {"data": {"attributes": {"api_key": "00000000-0000-0000-0000-000000000000"}, "type": "statuspage-account"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Update the Statuspage account returns "Not Found" response + Given new "UpdateStatuspageAccount" request + And body with value {"data": {"attributes": {"api_key": "00000000-0000-0000-0000-000000000000"}, "type": "statuspage-account"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Update the Statuspage account returns "OK" response + Given new "UpdateStatuspageAccount" request + And body with value {"data": {"attributes": {"api_key": "00000000-0000-0000-0000-000000000000"}, "type": "statuspage-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 b6003df86834..36f16afbea1e 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -3554,6 +3554,62 @@ "type": "safe" } }, + "DeleteStatuspageAccount": { + "tag": "Statuspage Integration", + "undo": { + "type": "idempotent" + } + }, + "GetStatuspageAccount": { + "tag": "Statuspage Integration", + "undo": { + "type": "safe" + } + }, + "UpdateStatuspageAccount": { + "tag": "Statuspage Integration", + "undo": { + "type": "idempotent" + } + }, + "CreateStatuspageAccount": { + "tag": "Statuspage Integration", + "undo": { + "operationId": "DeleteStatuspageAccount", + "type": "unsafe" + } + }, + "ListStatuspageUrlSettings": { + "tag": "Statuspage Integration", + "undo": { + "type": "safe" + } + }, + "CreateStatuspageUrlSetting": { + "tag": "Statuspage Integration", + "undo": { + "operationId": "DeleteStatuspageUrlSetting", + "parameters": [ + { + "name": "statuspage_url_setting_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "DeleteStatuspageUrlSetting": { + "tag": "Statuspage Integration", + "undo": { + "type": "idempotent" + } + }, + "UpdateStatuspageUrlSetting": { + "tag": "Statuspage Integration", + "undo": { + "type": "idempotent" + } + }, "ListIntegrations": { "tag": "Integrations", "undo": { diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 6ed9f06191bc..b5a28f354daf 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -6262,6 +6262,16 @@ def overrides "v2.statsig_integration_type" => "StatsigIntegrationType", "v2.statsig_integration_update" => "StatsigIntegrationUpdate", "v2.status_page" => "StatusPage", + "v2.statuspage_account_create_attributes" => "StatuspageAccountCreateAttributes", + "v2.statuspage_account_create_data" => "StatuspageAccountCreateData", + "v2.statuspage_account_create_request" => "StatuspageAccountCreateRequest", + "v2.statuspage_account_response" => "StatuspageAccountResponse", + "v2.statuspage_account_response_attributes" => "StatuspageAccountResponseAttributes", + "v2.statuspage_account_response_data" => "StatuspageAccountResponseData", + "v2.statuspage_account_type" => "StatuspageAccountType", + "v2.statuspage_account_update_attributes" => "StatuspageAccountUpdateAttributes", + "v2.statuspage_account_update_data" => "StatuspageAccountUpdateData", + "v2.statuspage_account_update_request" => "StatuspageAccountUpdateRequest", "v2.status_page_array" => "StatusPageArray", "v2.status_page_array_included" => "StatusPageArrayIncluded", "v2.status_page_as_included" => "StatusPageAsIncluded", @@ -6317,6 +6327,17 @@ def overrides "v2.status_pages_user" => "StatusPagesUser", "v2.status_pages_user_attributes" => "StatusPagesUserAttributes", "v2.status_pages_user_type" => "StatusPagesUserType", + "v2.statuspage_url_setting_create_attributes" => "StatuspageUrlSettingCreateAttributes", + "v2.statuspage_url_setting_create_data" => "StatuspageUrlSettingCreateData", + "v2.statuspage_url_setting_create_request" => "StatuspageUrlSettingCreateRequest", + "v2.statuspage_url_setting_response" => "StatuspageUrlSettingResponse", + "v2.statuspage_url_setting_response_attributes" => "StatuspageUrlSettingResponseAttributes", + "v2.statuspage_url_setting_response_data" => "StatuspageUrlSettingResponseData", + "v2.statuspage_url_settings_response" => "StatuspageUrlSettingsResponse", + "v2.statuspage_url_setting_type" => "StatuspageUrlSettingType", + "v2.statuspage_url_setting_update_attributes" => "StatuspageUrlSettingUpdateAttributes", + "v2.statuspage_url_setting_update_data" => "StatuspageUrlSettingUpdateData", + "v2.statuspage_url_setting_update_request" => "StatuspageUrlSettingUpdateRequest", "v2.step" => "Step", "v2.step_display" => "StepDisplay", "v2.step_display_bounds" => "StepDisplayBounds", @@ -7189,6 +7210,7 @@ def overrides "v2.spans_metrics_api" => "SpansMetricsAPI", "v2.static_analysis_api" => "StaticAnalysisAPI", "v2.status_pages_api" => "StatusPagesAPI", + "v2.statuspage_integration_api" => "StatuspageIntegrationAPI", "v2.storage_management_api" => "StorageManagementAPI", "v2.synthetics_api" => "SyntheticsAPI", "v2.teams_api" => "TeamsAPI", diff --git a/lib/datadog_api_client/v2/api/statuspage_integration_api.rb b/lib/datadog_api_client/v2/api/statuspage_integration_api.rb new file mode 100644 index 000000000000..03aebf206375 --- /dev/null +++ b/lib/datadog_api_client/v2/api/statuspage_integration_api.rb @@ -0,0 +1,545 @@ +=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 StatuspageIntegrationAPI + attr_accessor :api_client + + def initialize(api_client = DatadogAPIClient::APIClient.default) + @api_client = api_client + end + + # Create the Statuspage account. + # + # @see #create_statuspage_account_with_http_info + def create_statuspage_account(body, opts = {}) + data, _status_code, _headers = create_statuspage_account_with_http_info(body, opts) + data + end + + # Create the Statuspage account. + # + # Create a Statuspage account for your organization. Only one Statuspage + # account can be configured per organization. + # + # @param body [StatuspageAccountCreateRequest] Statuspage account payload. + # @param opts [Hash] the optional parameters + # @return [Array<(StatuspageAccountResponse, Integer, Hash)>] StatuspageAccountResponse data, response status code and response headers + def create_statuspage_account_with_http_info(body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: StatuspageIntegrationAPI.create_statuspage_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 StatuspageIntegrationAPI.create_statuspage_account" + end + # resource path + local_var_path = '/api/v2/integration/statuspage/account' + + # 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] || 'StatuspageAccountResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :create_statuspage_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: StatuspageIntegrationAPI#create_statuspage_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Create a Statuspage URL setting. + # + # @see #create_statuspage_url_setting_with_http_info + def create_statuspage_url_setting(body, opts = {}) + data, _status_code, _headers = create_statuspage_url_setting_with_http_info(body, opts) + data + end + + # Create a Statuspage URL setting. + # + # Create a Statuspage URL setting for your organization. + # + # @param body [StatuspageUrlSettingCreateRequest] Statuspage URL setting payload. + # @param opts [Hash] the optional parameters + # @return [Array<(StatuspageUrlSettingResponse, Integer, Hash)>] StatuspageUrlSettingResponse data, response status code and response headers + def create_statuspage_url_setting_with_http_info(body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: StatuspageIntegrationAPI.create_statuspage_url_setting ...' + 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 StatuspageIntegrationAPI.create_statuspage_url_setting" + end + # resource path + local_var_path = '/api/v2/integration/statuspage/url_settings' + + # 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] || 'StatuspageUrlSettingResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :create_statuspage_url_setting, + :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: StatuspageIntegrationAPI#create_statuspage_url_setting\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Delete the Statuspage account. + # + # @see #delete_statuspage_account_with_http_info + def delete_statuspage_account(opts = {}) + delete_statuspage_account_with_http_info(opts) + nil + end + + # Delete the Statuspage account. + # + # Delete the Statuspage account configured for your organization. + # + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_statuspage_account_with_http_info(opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: StatuspageIntegrationAPI.delete_statuspage_account ...' + end + # resource path + local_var_path = '/api/v2/integration/statuspage/account' + + # 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_statuspage_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: StatuspageIntegrationAPI#delete_statuspage_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Delete a Statuspage URL setting. + # + # @see #delete_statuspage_url_setting_with_http_info + def delete_statuspage_url_setting(statuspage_url_setting_id, opts = {}) + delete_statuspage_url_setting_with_http_info(statuspage_url_setting_id, opts) + nil + end + + # Delete a Statuspage URL setting. + # + # Delete a single Statuspage URL setting from your organization. + # + # @param statuspage_url_setting_id [String] The UUID of the Statuspage URL setting. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_statuspage_url_setting_with_http_info(statuspage_url_setting_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: StatuspageIntegrationAPI.delete_statuspage_url_setting ...' + end + # verify the required parameter 'statuspage_url_setting_id' is set + if @api_client.config.client_side_validation && statuspage_url_setting_id.nil? + fail ArgumentError, "Missing the required parameter 'statuspage_url_setting_id' when calling StatuspageIntegrationAPI.delete_statuspage_url_setting" + end + # resource path + local_var_path = '/api/v2/integration/statuspage/url_settings/{statuspage_url_setting_id}'.sub('{statuspage_url_setting_id}', CGI.escape(statuspage_url_setting_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_statuspage_url_setting, + :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: StatuspageIntegrationAPI#delete_statuspage_url_setting\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get the Statuspage account. + # + # @see #get_statuspage_account_with_http_info + def get_statuspage_account(opts = {}) + data, _status_code, _headers = get_statuspage_account_with_http_info(opts) + data + end + + # Get the Statuspage account. + # + # Get the Statuspage account configured for your organization. + # + # @param opts [Hash] the optional parameters + # @return [Array<(StatuspageAccountResponse, Integer, Hash)>] StatuspageAccountResponse data, response status code and response headers + def get_statuspage_account_with_http_info(opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: StatuspageIntegrationAPI.get_statuspage_account ...' + end + # resource path + local_var_path = '/api/v2/integration/statuspage/account' + + # 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] || 'StatuspageAccountResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_statuspage_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: StatuspageIntegrationAPI#get_statuspage_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get all Statuspage URL settings. + # + # @see #list_statuspage_url_settings_with_http_info + def list_statuspage_url_settings(opts = {}) + data, _status_code, _headers = list_statuspage_url_settings_with_http_info(opts) + data + end + + # Get all Statuspage URL settings. + # + # Get all Statuspage URL settings configured for your organization. + # + # @param opts [Hash] the optional parameters + # @return [Array<(StatuspageUrlSettingsResponse, Integer, Hash)>] StatuspageUrlSettingsResponse data, response status code and response headers + def list_statuspage_url_settings_with_http_info(opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: StatuspageIntegrationAPI.list_statuspage_url_settings ...' + end + # resource path + local_var_path = '/api/v2/integration/statuspage/url_settings' + + # 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] || 'StatuspageUrlSettingsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_statuspage_url_settings, + :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: StatuspageIntegrationAPI#list_statuspage_url_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update the Statuspage account. + # + # @see #update_statuspage_account_with_http_info + def update_statuspage_account(body, opts = {}) + data, _status_code, _headers = update_statuspage_account_with_http_info(body, opts) + data + end + + # Update the Statuspage account. + # + # Update the Statuspage account configured for your organization. + # + # @param body [StatuspageAccountUpdateRequest] Statuspage account payload. + # @param opts [Hash] the optional parameters + # @return [Array<(StatuspageAccountResponse, Integer, Hash)>] StatuspageAccountResponse data, response status code and response headers + def update_statuspage_account_with_http_info(body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: StatuspageIntegrationAPI.update_statuspage_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 StatuspageIntegrationAPI.update_statuspage_account" + end + # resource path + local_var_path = '/api/v2/integration/statuspage/account' + + # 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] || 'StatuspageAccountResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :update_statuspage_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: StatuspageIntegrationAPI#update_statuspage_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update a Statuspage URL setting. + # + # @see #update_statuspage_url_setting_with_http_info + def update_statuspage_url_setting(statuspage_url_setting_id, body, opts = {}) + data, _status_code, _headers = update_statuspage_url_setting_with_http_info(statuspage_url_setting_id, body, opts) + data + end + + # Update a Statuspage URL setting. + # + # Update a single Statuspage URL setting in your organization. + # + # @param statuspage_url_setting_id [String] The UUID of the Statuspage URL setting. + # @param body [StatuspageUrlSettingUpdateRequest] Statuspage URL setting payload. + # @param opts [Hash] the optional parameters + # @return [Array<(StatuspageUrlSettingResponse, Integer, Hash)>] StatuspageUrlSettingResponse data, response status code and response headers + def update_statuspage_url_setting_with_http_info(statuspage_url_setting_id, body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: StatuspageIntegrationAPI.update_statuspage_url_setting ...' + end + # verify the required parameter 'statuspage_url_setting_id' is set + if @api_client.config.client_side_validation && statuspage_url_setting_id.nil? + fail ArgumentError, "Missing the required parameter 'statuspage_url_setting_id' when calling StatuspageIntegrationAPI.update_statuspage_url_setting" + 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 StatuspageIntegrationAPI.update_statuspage_url_setting" + end + # resource path + local_var_path = '/api/v2/integration/statuspage/url_settings/{statuspage_url_setting_id}'.sub('{statuspage_url_setting_id}', CGI.escape(statuspage_url_setting_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] || 'StatuspageUrlSettingResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :update_statuspage_url_setting, + :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: StatuspageIntegrationAPI#update_statuspage_url_setting\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/statuspage_account_create_attributes.rb b/lib/datadog_api_client/v2/models/statuspage_account_create_attributes.rb new file mode 100644 index 000000000000..6242895c54e9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/statuspage_account_create_attributes.rb @@ -0,0 +1,127 @@ +=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 Statuspage account attributes for a create request. + class StatuspageAccountCreateAttributes + include BaseGenericModel + + # The Statuspage API key for your Statuspage account. + attr_reader :api_key + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'api_key' => :'api_key' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'api_key' => :'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::StatuspageAccountCreateAttributes` 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 + 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.to_s.length < 1 + 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 + if api_key.to_s.length < 1 + fail ArgumentError, 'invalid value for "api_key", the character length must be great than or equal to 1.' + end + @api_key = api_key + 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 && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [api_key, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/statuspage_account_create_data.rb b/lib/datadog_api_client/v2/models/statuspage_account_create_data.rb new file mode 100644 index 000000000000..7a9d21a26557 --- /dev/null +++ b/lib/datadog_api_client/v2/models/statuspage_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 + # Statuspage account data for a create request. + class StatuspageAccountCreateData + include BaseGenericModel + + # The Statuspage account attributes for a create request. + attr_reader :attributes + + # Statuspage 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' => :'StatuspageAccountCreateAttributes', + :'type' => :'StatuspageAccountType' + } + 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::StatuspageAccountCreateData` 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/statuspage_account_create_request.rb b/lib/datadog_api_client/v2/models/statuspage_account_create_request.rb new file mode 100644 index 000000000000..f6404fdf73ae --- /dev/null +++ b/lib/datadog_api_client/v2/models/statuspage_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 + # Create request for a Statuspage account. + class StatuspageAccountCreateRequest + include BaseGenericModel + + # Statuspage account data for a create request. + 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' => :'StatuspageAccountCreateData' + } + 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::StatuspageAccountCreateRequest` 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/statuspage_account_response.rb b/lib/datadog_api_client/v2/models/statuspage_account_response.rb new file mode 100644 index 000000000000..7195707f25ba --- /dev/null +++ b/lib/datadog_api_client/v2/models/statuspage_account_response.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 + # Response containing a Statuspage account. + class StatuspageAccountResponse + include BaseGenericModel + + # Statuspage account data from a response. + 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' => :'StatuspageAccountResponseData' + } + 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::StatuspageAccountResponse` 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/statuspage_account_response_attributes.rb b/lib/datadog_api_client/v2/models/statuspage_account_response_attributes.rb new file mode 100644 index 000000000000..5523c117ec5b --- /dev/null +++ b/lib/datadog_api_client/v2/models/statuspage_account_response_attributes.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 attributes from a Statuspage account response. + class StatuspageAccountResponseAttributes + include BaseGenericModel + + # The Statuspage API key for your Statuspage account. The value is always returned masked. + attr_accessor :api_key + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'api_key' => :'api_key' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'api_key' => :'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::StatuspageAccountResponseAttributes` 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 + 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 && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [api_key, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/statuspage_account_response_data.rb b/lib/datadog_api_client/v2/models/statuspage_account_response_data.rb new file mode 100644 index 000000000000..aee96b952d62 --- /dev/null +++ b/lib/datadog_api_client/v2/models/statuspage_account_response_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 + # Statuspage account data from a response. + class StatuspageAccountResponseData + include BaseGenericModel + + # The attributes from a Statuspage account response. + attr_reader :attributes + + # Statuspage 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' => :'StatuspageAccountResponseAttributes', + :'type' => :'StatuspageAccountType' + } + 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::StatuspageAccountResponseData` 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/statuspage_account_type.rb b/lib/datadog_api_client/v2/models/statuspage_account_type.rb new file mode 100644 index 000000000000..9243dcd2abe6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/statuspage_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 + # Statuspage account resource type. + class StatuspageAccountType + include BaseEnumModel + + STATUSPAGE_ACCOUNT = "statuspage-account".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/statuspage_account_update_attributes.rb b/lib/datadog_api_client/v2/models/statuspage_account_update_attributes.rb new file mode 100644 index 000000000000..2b5945ea5a05 --- /dev/null +++ b/lib/datadog_api_client/v2/models/statuspage_account_update_attributes.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 + # The Statuspage account attributes for an update request. + class StatuspageAccountUpdateAttributes + include BaseGenericModel + + # The Statuspage API key for your Statuspage account. + attr_reader :api_key + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'api_key' => :'api_key' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'api_key' => :'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::StatuspageAccountUpdateAttributes` 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 + 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? && @api_key.to_s.length < 1 + 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? && api_key.to_s.length < 1 + fail ArgumentError, 'invalid value for "api_key", the character length must be great than or equal to 1.' + end + @api_key = api_key + 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 && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [api_key, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/statuspage_account_update_data.rb b/lib/datadog_api_client/v2/models/statuspage_account_update_data.rb new file mode 100644 index 000000000000..49dba68086b4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/statuspage_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 + # Statuspage account data for an update request. + class StatuspageAccountUpdateData + include BaseGenericModel + + # The Statuspage account attributes for an update request. + attr_reader :attributes + + # Statuspage 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' => :'StatuspageAccountUpdateAttributes', + :'type' => :'StatuspageAccountType' + } + 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::StatuspageAccountUpdateData` 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/statuspage_account_update_request.rb b/lib/datadog_api_client/v2/models/statuspage_account_update_request.rb new file mode 100644 index 000000000000..30bcbca20622 --- /dev/null +++ b/lib/datadog_api_client/v2/models/statuspage_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 + # Update request for a Statuspage account. + class StatuspageAccountUpdateRequest + include BaseGenericModel + + # Statuspage account data for an update request. + 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' => :'StatuspageAccountUpdateData' + } + 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::StatuspageAccountUpdateRequest` 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/statuspage_url_setting_create_attributes.rb b/lib/datadog_api_client/v2/models/statuspage_url_setting_create_attributes.rb new file mode 100644 index 000000000000..c49ae261efd8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/statuspage_url_setting_create_attributes.rb @@ -0,0 +1,152 @@ +=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 Statuspage URL setting attributes for a create request. + class StatuspageUrlSettingCreateAttributes + include BaseGenericModel + + # Comma-separated list of custom tags to apply to events generated from this Statuspage URL. + attr_reader :custom_tags + + # The Statuspage URL to monitor. Must be a `status.io` or `statuspage.com` URL. + attr_reader :url + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'custom_tags' => :'custom_tags', + :'url' => :'url' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'custom_tags' => :'String', + :'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::StatuspageUrlSettingCreateAttributes` 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?(:'custom_tags') + self.custom_tags = attributes[:'custom_tags'] + 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 @custom_tags.nil? + return false if @custom_tags.to_s.length < 1 + return false if @url.nil? + return false if @url.to_s.length < 1 + true + end + + # Custom attribute writer method with validation + # @param custom_tags [Object] Object to be assigned + # @!visibility private + def custom_tags=(custom_tags) + if custom_tags.nil? + fail ArgumentError, 'invalid value for "custom_tags", custom_tags cannot be nil.' + end + if custom_tags.to_s.length < 1 + fail ArgumentError, 'invalid value for "custom_tags", the character length must be great than or equal to 1.' + end + @custom_tags = custom_tags + 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 + if url.to_s.length < 1 + fail ArgumentError, 'invalid value for "url", the character length must be great than or equal to 1.' + 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 && + custom_tags == o.custom_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 + [custom_tags, url, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/statuspage_url_setting_create_data.rb b/lib/datadog_api_client/v2/models/statuspage_url_setting_create_data.rb new file mode 100644 index 000000000000..c3475e899930 --- /dev/null +++ b/lib/datadog_api_client/v2/models/statuspage_url_setting_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 + # Statuspage URL setting data for a create request. + class StatuspageUrlSettingCreateData + include BaseGenericModel + + # The Statuspage URL setting attributes for a create request. + attr_reader :attributes + + # Statuspage URL setting 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' => :'StatuspageUrlSettingCreateAttributes', + :'type' => :'StatuspageUrlSettingType' + } + 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::StatuspageUrlSettingCreateData` 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/statuspage_url_setting_create_request.rb b/lib/datadog_api_client/v2/models/statuspage_url_setting_create_request.rb new file mode 100644 index 000000000000..51e669c8663a --- /dev/null +++ b/lib/datadog_api_client/v2/models/statuspage_url_setting_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 + # Create request for a Statuspage URL setting. + class StatuspageUrlSettingCreateRequest + include BaseGenericModel + + # Statuspage URL setting data for a create request. + 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' => :'StatuspageUrlSettingCreateData' + } + 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::StatuspageUrlSettingCreateRequest` 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/statuspage_url_setting_response.rb b/lib/datadog_api_client/v2/models/statuspage_url_setting_response.rb new file mode 100644 index 000000000000..b393c88b72c2 --- /dev/null +++ b/lib/datadog_api_client/v2/models/statuspage_url_setting_response.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 + # Response containing a Statuspage URL setting. + class StatuspageUrlSettingResponse + include BaseGenericModel + + # Statuspage URL setting data from a response. + 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' => :'StatuspageUrlSettingResponseData' + } + 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::StatuspageUrlSettingResponse` 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/statuspage_url_setting_response_attributes.rb b/lib/datadog_api_client/v2/models/statuspage_url_setting_response_attributes.rb new file mode 100644 index 000000000000..402d21f06fc5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/statuspage_url_setting_response_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 + # The attributes from a Statuspage URL setting response. + class StatuspageUrlSettingResponseAttributes + include BaseGenericModel + + # Comma-separated list of custom tags applied to events generated from this Statuspage URL. + attr_accessor :custom_tags + + # The Statuspage URL being monitored. + attr_accessor :url + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'custom_tags' => :'custom_tags', + :'url' => :'url' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'custom_tags' => :'String', + :'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::StatuspageUrlSettingResponseAttributes` 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?(:'custom_tags') + self.custom_tags = attributes[:'custom_tags'] + 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 && + custom_tags == o.custom_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 + [custom_tags, url, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/statuspage_url_setting_response_data.rb b/lib/datadog_api_client/v2/models/statuspage_url_setting_response_data.rb new file mode 100644 index 000000000000..b0214e88e4b1 --- /dev/null +++ b/lib/datadog_api_client/v2/models/statuspage_url_setting_response_data.rb @@ -0,0 +1,173 @@ +=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 + # Statuspage URL setting data from a response. + class StatuspageUrlSettingResponseData + include BaseGenericModel + + # The attributes from a Statuspage URL setting response. + attr_reader :attributes + + # The ID of the Statuspage URL setting. + attr_reader :id + + # Statuspage URL setting 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' => :'StatuspageUrlSettingResponseAttributes', + :'id' => :'String', + :'type' => :'StatuspageUrlSettingType' + } + 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::StatuspageUrlSettingResponseData` 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 @id.to_s.length > 100 + return false if @id.to_s.length < 1 + 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 + if id.to_s.length > 100 + fail ArgumentError, 'invalid value for "id", the character length must be smaller than or equal to 100.' + end + if id.to_s.length < 1 + fail ArgumentError, 'invalid value for "id", the character length must be great than or equal to 1.' + 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/statuspage_url_setting_type.rb b/lib/datadog_api_client/v2/models/statuspage_url_setting_type.rb new file mode 100644 index 000000000000..ed518dffa406 --- /dev/null +++ b/lib/datadog_api_client/v2/models/statuspage_url_setting_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 + # Statuspage URL setting resource type. + class StatuspageUrlSettingType + include BaseEnumModel + + STATUSPAGE_URL_SETTING = "statuspage-url-setting".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/statuspage_url_setting_update_attributes.rb b/lib/datadog_api_client/v2/models/statuspage_url_setting_update_attributes.rb new file mode 100644 index 000000000000..5cf128b3fd38 --- /dev/null +++ b/lib/datadog_api_client/v2/models/statuspage_url_setting_update_attributes.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 + # The Statuspage URL setting attributes for an update request. + class StatuspageUrlSettingUpdateAttributes + include BaseGenericModel + + # Comma-separated list of custom tags to apply to events generated from this Statuspage URL. + attr_reader :custom_tags + + # The Statuspage URL to monitor. + attr_reader :url + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'custom_tags' => :'custom_tags', + :'url' => :'url' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'custom_tags' => :'String', + :'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::StatuspageUrlSettingUpdateAttributes` 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?(:'custom_tags') + self.custom_tags = attributes[:'custom_tags'] + 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 !@custom_tags.nil? && @custom_tags.to_s.length < 1 + return false if !@url.nil? && @url.to_s.length < 1 + true + end + + # Custom attribute writer method with validation + # @param custom_tags [Object] Object to be assigned + # @!visibility private + def custom_tags=(custom_tags) + if !custom_tags.nil? && custom_tags.to_s.length < 1 + fail ArgumentError, 'invalid value for "custom_tags", the character length must be great than or equal to 1.' + end + @custom_tags = custom_tags + end + + # Custom attribute writer method with validation + # @param url [Object] Object to be assigned + # @!visibility private + def url=(url) + if !url.nil? && url.to_s.length < 1 + fail ArgumentError, 'invalid value for "url", the character length must be great than or equal to 1.' + 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 && + custom_tags == o.custom_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 + [custom_tags, url, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/statuspage_url_setting_update_data.rb b/lib/datadog_api_client/v2/models/statuspage_url_setting_update_data.rb new file mode 100644 index 000000000000..41ab6a96e06a --- /dev/null +++ b/lib/datadog_api_client/v2/models/statuspage_url_setting_update_data.rb @@ -0,0 +1,173 @@ +=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 + # Statuspage URL setting data for an update request. + class StatuspageUrlSettingUpdateData + include BaseGenericModel + + # The Statuspage URL setting attributes for an update request. + attr_reader :attributes + + # The ID of the Statuspage URL setting. + attr_reader :id + + # Statuspage URL setting 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' => :'StatuspageUrlSettingUpdateAttributes', + :'id' => :'String', + :'type' => :'StatuspageUrlSettingType' + } + 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::StatuspageUrlSettingUpdateData` 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 @id.to_s.length > 100 + return false if @id.to_s.length < 1 + 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 + if id.to_s.length > 100 + fail ArgumentError, 'invalid value for "id", the character length must be smaller than or equal to 100.' + end + if id.to_s.length < 1 + fail ArgumentError, 'invalid value for "id", the character length must be great than or equal to 1.' + 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/statuspage_url_setting_update_request.rb b/lib/datadog_api_client/v2/models/statuspage_url_setting_update_request.rb new file mode 100644 index 000000000000..b6b5c5df4217 --- /dev/null +++ b/lib/datadog_api_client/v2/models/statuspage_url_setting_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 + # Update request for a Statuspage URL setting. + class StatuspageUrlSettingUpdateRequest + include BaseGenericModel + + # Statuspage URL setting data for an update request. + 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' => :'StatuspageUrlSettingUpdateData' + } + 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::StatuspageUrlSettingUpdateRequest` 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/statuspage_url_settings_response.rb b/lib/datadog_api_client/v2/models/statuspage_url_settings_response.rb new file mode 100644 index 000000000000..59ca4bf9185d --- /dev/null +++ b/lib/datadog_api_client/v2/models/statuspage_url_settings_response.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 + # Response with a list of Statuspage URL settings. + class StatuspageUrlSettingsResponse + include BaseGenericModel + + # An array of Statuspage URL settings. + 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' => :'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::StatuspageUrlSettingsResponse` 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 + + # 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