diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 4d59bfade1..8262c1a98b 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/docs/datadog_api_client.v2.api.rst b/docs/datadog_api_client.v2.api.rst index 7ec5d64245..3a6269fb08 100644 --- a/docs/datadog_api_client.v2.api.rst +++ b/docs/datadog_api_client.v2.api.rst @@ -753,6 +753,13 @@ datadog\_api\_client.v2.api.status\_pages\_api module :members: :show-inheritance: +datadog\_api\_client.v2.api.statuspage\_integration\_api module +--------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.api.statuspage_integration_api + :members: + :show-inheritance: + datadog\_api\_client.v2.api.storage\_management\_api module ----------------------------------------------------------- diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index 5d1f8d7e30..49130424d2 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -36607,6 +36607,153 @@ datadog\_api\_client.v2.model.status\_pages\_user\_type module :members: :show-inheritance: +datadog\_api\_client.v2.model.statuspage\_account\_create\_attributes module +---------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.statuspage_account_create_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.statuspage\_account\_create\_data module +---------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.statuspage_account_create_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.statuspage\_account\_create\_request module +------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.statuspage_account_create_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.statuspage\_account\_response module +------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.statuspage_account_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.statuspage\_account\_response\_attributes module +------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.statuspage_account_response_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.statuspage\_account\_response\_data module +------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.statuspage_account_response_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.statuspage\_account\_type module +-------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.statuspage_account_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.statuspage\_account\_update\_attributes module +---------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.statuspage_account_update_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.statuspage\_account\_update\_data module +---------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.statuspage_account_update_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.statuspage\_account\_update\_request module +------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.statuspage_account_update_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.statuspage\_url\_setting\_create\_attributes module +--------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.statuspage_url_setting_create_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.statuspage\_url\_setting\_create\_data module +--------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.statuspage_url_setting_create_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.statuspage\_url\_setting\_create\_request module +------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.statuspage_url_setting_create_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.statuspage\_url\_setting\_response module +----------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.statuspage_url_setting_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.statuspage\_url\_setting\_response\_attributes module +----------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.statuspage_url_setting_response_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.statuspage\_url\_setting\_response\_data module +----------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.statuspage_url_setting_response_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.statuspage\_url\_setting\_type module +------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.statuspage_url_setting_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.statuspage\_url\_setting\_update\_attributes module +--------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.statuspage_url_setting_update_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.statuspage\_url\_setting\_update\_data module +--------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.statuspage_url_setting_update_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.statuspage\_url\_setting\_update\_request module +------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.statuspage_url_setting_update_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.statuspage\_url\_settings\_response module +------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.statuspage_url_settings_response + :members: + :show-inheritance: + datadog\_api\_client.v2.model.step module ----------------------------------------- diff --git a/examples/v2/statuspage-integration/CreateStatuspageAccount.py b/examples/v2/statuspage-integration/CreateStatuspageAccount.py new file mode 100644 index 0000000000..c2f1e0ae06 --- /dev/null +++ b/examples/v2/statuspage-integration/CreateStatuspageAccount.py @@ -0,0 +1,26 @@ +""" +Create the Statuspage account returns "CREATED" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.statuspage_integration_api import StatuspageIntegrationApi +from datadog_api_client.v2.model.statuspage_account_create_attributes import StatuspageAccountCreateAttributes +from datadog_api_client.v2.model.statuspage_account_create_data import StatuspageAccountCreateData +from datadog_api_client.v2.model.statuspage_account_create_request import StatuspageAccountCreateRequest +from datadog_api_client.v2.model.statuspage_account_type import StatuspageAccountType + +body = StatuspageAccountCreateRequest( + data=StatuspageAccountCreateData( + attributes=StatuspageAccountCreateAttributes( + api_key="00000000-0000-0000-0000-000000000000", + ), + type=StatuspageAccountType.STATUSPAGE_ACCOUNT, + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = StatuspageIntegrationApi(api_client) + response = api_instance.create_statuspage_account(body=body) + + print(response) diff --git a/examples/v2/statuspage-integration/CreateStatuspageUrlSetting.py b/examples/v2/statuspage-integration/CreateStatuspageUrlSetting.py new file mode 100644 index 0000000000..30804593ce --- /dev/null +++ b/examples/v2/statuspage-integration/CreateStatuspageUrlSetting.py @@ -0,0 +1,27 @@ +""" +Create a Statuspage URL setting returns "CREATED" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.statuspage_integration_api import StatuspageIntegrationApi +from datadog_api_client.v2.model.statuspage_url_setting_create_attributes import StatuspageUrlSettingCreateAttributes +from datadog_api_client.v2.model.statuspage_url_setting_create_data import StatuspageUrlSettingCreateData +from datadog_api_client.v2.model.statuspage_url_setting_create_request import StatuspageUrlSettingCreateRequest +from datadog_api_client.v2.model.statuspage_url_setting_type import StatuspageUrlSettingType + +body = StatuspageUrlSettingCreateRequest( + data=StatuspageUrlSettingCreateData( + attributes=StatuspageUrlSettingCreateAttributes( + custom_tags="team:collaboration-integrations,env:prod", + url="https://example.statuspage.io", + ), + type=StatuspageUrlSettingType.STATUSPAGE_URL_SETTING, + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = StatuspageIntegrationApi(api_client) + response = api_instance.create_statuspage_url_setting(body=body) + + print(response) diff --git a/examples/v2/statuspage-integration/DeleteStatuspageAccount.py b/examples/v2/statuspage-integration/DeleteStatuspageAccount.py new file mode 100644 index 0000000000..a4f5203a6d --- /dev/null +++ b/examples/v2/statuspage-integration/DeleteStatuspageAccount.py @@ -0,0 +1,11 @@ +""" +Delete the Statuspage account returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.statuspage_integration_api import StatuspageIntegrationApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = StatuspageIntegrationApi(api_client) + api_instance.delete_statuspage_account() diff --git a/examples/v2/statuspage-integration/DeleteStatuspageUrlSetting.py b/examples/v2/statuspage-integration/DeleteStatuspageUrlSetting.py new file mode 100644 index 0000000000..b0f19c0cba --- /dev/null +++ b/examples/v2/statuspage-integration/DeleteStatuspageUrlSetting.py @@ -0,0 +1,13 @@ +""" +Delete a Statuspage URL setting returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.statuspage_integration_api import StatuspageIntegrationApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = StatuspageIntegrationApi(api_client) + api_instance.delete_statuspage_url_setting( + statuspage_url_setting_id="statuspage_url_setting_id", + ) diff --git a/examples/v2/statuspage-integration/GetStatuspageAccount.py b/examples/v2/statuspage-integration/GetStatuspageAccount.py new file mode 100644 index 0000000000..213a1c0e93 --- /dev/null +++ b/examples/v2/statuspage-integration/GetStatuspageAccount.py @@ -0,0 +1,13 @@ +""" +Get the Statuspage account returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.statuspage_integration_api import StatuspageIntegrationApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = StatuspageIntegrationApi(api_client) + response = api_instance.get_statuspage_account() + + print(response) diff --git a/examples/v2/statuspage-integration/ListStatuspageUrlSettings.py b/examples/v2/statuspage-integration/ListStatuspageUrlSettings.py new file mode 100644 index 0000000000..af5214491a --- /dev/null +++ b/examples/v2/statuspage-integration/ListStatuspageUrlSettings.py @@ -0,0 +1,13 @@ +""" +Get all Statuspage URL settings returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.statuspage_integration_api import StatuspageIntegrationApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = StatuspageIntegrationApi(api_client) + response = api_instance.list_statuspage_url_settings() + + print(response) diff --git a/examples/v2/statuspage-integration/UpdateStatuspageAccount.py b/examples/v2/statuspage-integration/UpdateStatuspageAccount.py new file mode 100644 index 0000000000..002ef7005a --- /dev/null +++ b/examples/v2/statuspage-integration/UpdateStatuspageAccount.py @@ -0,0 +1,26 @@ +""" +Update the Statuspage account returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.statuspage_integration_api import StatuspageIntegrationApi +from datadog_api_client.v2.model.statuspage_account_type import StatuspageAccountType +from datadog_api_client.v2.model.statuspage_account_update_attributes import StatuspageAccountUpdateAttributes +from datadog_api_client.v2.model.statuspage_account_update_data import StatuspageAccountUpdateData +from datadog_api_client.v2.model.statuspage_account_update_request import StatuspageAccountUpdateRequest + +body = StatuspageAccountUpdateRequest( + data=StatuspageAccountUpdateData( + attributes=StatuspageAccountUpdateAttributes( + api_key="00000000-0000-0000-0000-000000000000", + ), + type=StatuspageAccountType.STATUSPAGE_ACCOUNT, + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = StatuspageIntegrationApi(api_client) + response = api_instance.update_statuspage_account(body=body) + + print(response) diff --git a/examples/v2/statuspage-integration/UpdateStatuspageUrlSetting.py b/examples/v2/statuspage-integration/UpdateStatuspageUrlSetting.py new file mode 100644 index 0000000000..cd1e2122db --- /dev/null +++ b/examples/v2/statuspage-integration/UpdateStatuspageUrlSetting.py @@ -0,0 +1,30 @@ +""" +Update a Statuspage URL setting returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.statuspage_integration_api import StatuspageIntegrationApi +from datadog_api_client.v2.model.statuspage_url_setting_type import StatuspageUrlSettingType +from datadog_api_client.v2.model.statuspage_url_setting_update_attributes import StatuspageUrlSettingUpdateAttributes +from datadog_api_client.v2.model.statuspage_url_setting_update_data import StatuspageUrlSettingUpdateData +from datadog_api_client.v2.model.statuspage_url_setting_update_request import StatuspageUrlSettingUpdateRequest + +body = StatuspageUrlSettingUpdateRequest( + data=StatuspageUrlSettingUpdateData( + attributes=StatuspageUrlSettingUpdateAttributes( + custom_tags="team:collaboration-integrations,env:prod", + url="https://example.statuspage.io", + ), + id="596da4af-0563-4097-90ff-07230c3f9db3", + type=StatuspageUrlSettingType.STATUSPAGE_URL_SETTING, + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = StatuspageIntegrationApi(api_client) + response = api_instance.update_statuspage_url_setting( + statuspage_url_setting_id="statuspage_url_setting_id", body=body + ) + + print(response) diff --git a/src/datadog_api_client/v2/api/statuspage_integration_api.py b/src/datadog_api_client/v2/api/statuspage_integration_api.py new file mode 100644 index 0000000000..a8231b737f --- /dev/null +++ b/src/datadog_api_client/v2/api/statuspage_integration_api.py @@ -0,0 +1,312 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Any, Dict + +from datadog_api_client.api_client import ApiClient, Endpoint as _Endpoint +from datadog_api_client.configuration import Configuration +from datadog_api_client.v2.model.statuspage_account_response import StatuspageAccountResponse +from datadog_api_client.v2.model.statuspage_account_update_request import StatuspageAccountUpdateRequest +from datadog_api_client.v2.model.statuspage_account_create_request import StatuspageAccountCreateRequest +from datadog_api_client.v2.model.statuspage_url_settings_response import StatuspageUrlSettingsResponse +from datadog_api_client.v2.model.statuspage_url_setting_response import StatuspageUrlSettingResponse +from datadog_api_client.v2.model.statuspage_url_setting_create_request import StatuspageUrlSettingCreateRequest +from datadog_api_client.v2.model.statuspage_url_setting_update_request import StatuspageUrlSettingUpdateRequest + + +class StatuspageIntegrationApi: + """ + Configure your `Datadog Statuspage integration `_ + directly through the Datadog API. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient(Configuration()) + self.api_client = api_client + + self._create_statuspage_account_endpoint = _Endpoint( + settings={ + "response_type": (StatuspageAccountResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/integration/statuspage/account", + "operation_id": "create_statuspage_account", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (StatuspageAccountCreateRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._create_statuspage_url_setting_endpoint = _Endpoint( + settings={ + "response_type": (StatuspageUrlSettingResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/integration/statuspage/url_settings", + "operation_id": "create_statuspage_url_setting", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (StatuspageUrlSettingCreateRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._delete_statuspage_account_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/integration/statuspage/account", + "operation_id": "delete_statuspage_account", + "http_method": "DELETE", + "version": "v2", + }, + params_map={}, + headers_map={ + "accept": ["*/*"], + }, + api_client=api_client, + ) + + self._delete_statuspage_url_setting_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/integration/statuspage/url_settings/{statuspage_url_setting_id}", + "operation_id": "delete_statuspage_url_setting", + "http_method": "DELETE", + "version": "v2", + }, + params_map={ + "statuspage_url_setting_id": { + "required": True, + "openapi_types": (str,), + "attribute": "statuspage_url_setting_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["*/*"], + }, + api_client=api_client, + ) + + self._get_statuspage_account_endpoint = _Endpoint( + settings={ + "response_type": (StatuspageAccountResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/integration/statuspage/account", + "operation_id": "get_statuspage_account", + "http_method": "GET", + "version": "v2", + }, + params_map={}, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._list_statuspage_url_settings_endpoint = _Endpoint( + settings={ + "response_type": (StatuspageUrlSettingsResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/integration/statuspage/url_settings", + "operation_id": "list_statuspage_url_settings", + "http_method": "GET", + "version": "v2", + }, + params_map={}, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._update_statuspage_account_endpoint = _Endpoint( + settings={ + "response_type": (StatuspageAccountResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/integration/statuspage/account", + "operation_id": "update_statuspage_account", + "http_method": "PATCH", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (StatuspageAccountUpdateRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._update_statuspage_url_setting_endpoint = _Endpoint( + settings={ + "response_type": (StatuspageUrlSettingResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/integration/statuspage/url_settings/{statuspage_url_setting_id}", + "operation_id": "update_statuspage_url_setting", + "http_method": "PATCH", + "version": "v2", + }, + params_map={ + "statuspage_url_setting_id": { + "required": True, + "openapi_types": (str,), + "attribute": "statuspage_url_setting_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (StatuspageUrlSettingUpdateRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + def create_statuspage_account( + self, + body: StatuspageAccountCreateRequest, + ) -> StatuspageAccountResponse: + """Create the Statuspage account. + + Create a Statuspage account for your organization. Only one Statuspage + account can be configured per organization. + + :param body: Statuspage account payload. + :type body: StatuspageAccountCreateRequest + :rtype: StatuspageAccountResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._create_statuspage_account_endpoint.call_with_http_info(**kwargs) + + def create_statuspage_url_setting( + self, + body: StatuspageUrlSettingCreateRequest, + ) -> StatuspageUrlSettingResponse: + """Create a Statuspage URL setting. + + Create a Statuspage URL setting for your organization. + + :param body: Statuspage URL setting payload. + :type body: StatuspageUrlSettingCreateRequest + :rtype: StatuspageUrlSettingResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._create_statuspage_url_setting_endpoint.call_with_http_info(**kwargs) + + def delete_statuspage_account( + self, + ) -> None: + """Delete the Statuspage account. + + Delete the Statuspage account configured for your organization. + + :rtype: None + """ + kwargs: Dict[str, Any] = {} + return self._delete_statuspage_account_endpoint.call_with_http_info(**kwargs) + + def delete_statuspage_url_setting( + self, + statuspage_url_setting_id: str, + ) -> None: + """Delete a Statuspage URL setting. + + Delete a single Statuspage URL setting from your organization. + + :param statuspage_url_setting_id: The UUID of the Statuspage URL setting. + :type statuspage_url_setting_id: str + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["statuspage_url_setting_id"] = statuspage_url_setting_id + + return self._delete_statuspage_url_setting_endpoint.call_with_http_info(**kwargs) + + def get_statuspage_account( + self, + ) -> StatuspageAccountResponse: + """Get the Statuspage account. + + Get the Statuspage account configured for your organization. + + :rtype: StatuspageAccountResponse + """ + kwargs: Dict[str, Any] = {} + return self._get_statuspage_account_endpoint.call_with_http_info(**kwargs) + + def list_statuspage_url_settings( + self, + ) -> StatuspageUrlSettingsResponse: + """Get all Statuspage URL settings. + + Get all Statuspage URL settings configured for your organization. + + :rtype: StatuspageUrlSettingsResponse + """ + kwargs: Dict[str, Any] = {} + return self._list_statuspage_url_settings_endpoint.call_with_http_info(**kwargs) + + def update_statuspage_account( + self, + body: StatuspageAccountUpdateRequest, + ) -> StatuspageAccountResponse: + """Update the Statuspage account. + + Update the Statuspage account configured for your organization. + + :param body: Statuspage account payload. + :type body: StatuspageAccountUpdateRequest + :rtype: StatuspageAccountResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._update_statuspage_account_endpoint.call_with_http_info(**kwargs) + + def update_statuspage_url_setting( + self, + statuspage_url_setting_id: str, + body: StatuspageUrlSettingUpdateRequest, + ) -> StatuspageUrlSettingResponse: + """Update a Statuspage URL setting. + + Update a single Statuspage URL setting in your organization. + + :param statuspage_url_setting_id: The UUID of the Statuspage URL setting. + :type statuspage_url_setting_id: str + :param body: Statuspage URL setting payload. + :type body: StatuspageUrlSettingUpdateRequest + :rtype: StatuspageUrlSettingResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["statuspage_url_setting_id"] = statuspage_url_setting_id + + kwargs["body"] = body + + return self._update_statuspage_url_setting_endpoint.call_with_http_info(**kwargs) diff --git a/src/datadog_api_client/v2/apis/__init__.py b/src/datadog_api_client/v2/apis/__init__.py index 54b4eab8ed..d2ce1b3e5b 100644 --- a/src/datadog_api_client/v2/apis/__init__.py +++ b/src/datadog_api_client/v2/apis/__init__.py @@ -105,6 +105,7 @@ from datadog_api_client.v2.api.spans_metrics_api import SpansMetricsApi from datadog_api_client.v2.api.static_analysis_api import StaticAnalysisApi from datadog_api_client.v2.api.status_pages_api import StatusPagesApi +from datadog_api_client.v2.api.statuspage_integration_api import StatuspageIntegrationApi from datadog_api_client.v2.api.storage_management_api import StorageManagementApi from datadog_api_client.v2.api.synthetics_api import SyntheticsApi from datadog_api_client.v2.api.teams_api import TeamsApi @@ -224,6 +225,7 @@ "SpansMetricsApi", "StaticAnalysisApi", "StatusPagesApi", + "StatuspageIntegrationApi", "StorageManagementApi", "SyntheticsApi", "TeamsApi", diff --git a/src/datadog_api_client/v2/model/statuspage_account_create_attributes.py b/src/datadog_api_client/v2/model/statuspage_account_create_attributes.py new file mode 100644 index 0000000000..a8b44b7860 --- /dev/null +++ b/src/datadog_api_client/v2/model/statuspage_account_create_attributes.py @@ -0,0 +1,39 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class StatuspageAccountCreateAttributes(ModelNormal): + validations = { + "api_key": { + "min_length": 1, + }, + } + + @cached_property + def openapi_types(_): + return { + "api_key": (str,), + } + + attribute_map = { + "api_key": "api_key", + } + + def __init__(self_, api_key: str, **kwargs): + """ + The Statuspage account attributes for a create request. + + :param api_key: The Statuspage API key for your Statuspage account. + :type api_key: str + """ + super().__init__(kwargs) + + self_.api_key = api_key diff --git a/src/datadog_api_client/v2/model/statuspage_account_create_data.py b/src/datadog_api_client/v2/model/statuspage_account_create_data.py new file mode 100644 index 0000000000..5b2b986733 --- /dev/null +++ b/src/datadog_api_client/v2/model/statuspage_account_create_data.py @@ -0,0 +1,48 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.statuspage_account_create_attributes import StatuspageAccountCreateAttributes + from datadog_api_client.v2.model.statuspage_account_type import StatuspageAccountType + + +class StatuspageAccountCreateData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.statuspage_account_create_attributes import StatuspageAccountCreateAttributes + from datadog_api_client.v2.model.statuspage_account_type import StatuspageAccountType + + return { + "attributes": (StatuspageAccountCreateAttributes,), + "type": (StatuspageAccountType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__(self_, attributes: StatuspageAccountCreateAttributes, type: StatuspageAccountType, **kwargs): + """ + Statuspage account data for a create request. + + :param attributes: The Statuspage account attributes for a create request. + :type attributes: StatuspageAccountCreateAttributes + + :param type: Statuspage account resource type. + :type type: StatuspageAccountType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/statuspage_account_create_request.py b/src/datadog_api_client/v2/model/statuspage_account_create_request.py new file mode 100644 index 0000000000..325ddc106a --- /dev/null +++ b/src/datadog_api_client/v2/model/statuspage_account_create_request.py @@ -0,0 +1,40 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.statuspage_account_create_data import StatuspageAccountCreateData + + +class StatuspageAccountCreateRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.statuspage_account_create_data import StatuspageAccountCreateData + + return { + "data": (StatuspageAccountCreateData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: StatuspageAccountCreateData, **kwargs): + """ + Create request for a Statuspage account. + + :param data: Statuspage account data for a create request. + :type data: StatuspageAccountCreateData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/statuspage_account_response.py b/src/datadog_api_client/v2/model/statuspage_account_response.py new file mode 100644 index 0000000000..bc5c2aa8d1 --- /dev/null +++ b/src/datadog_api_client/v2/model/statuspage_account_response.py @@ -0,0 +1,40 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.statuspage_account_response_data import StatuspageAccountResponseData + + +class StatuspageAccountResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.statuspage_account_response_data import StatuspageAccountResponseData + + return { + "data": (StatuspageAccountResponseData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: StatuspageAccountResponseData, **kwargs): + """ + Response containing a Statuspage account. + + :param data: Statuspage account data from a response. + :type data: StatuspageAccountResponseData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/statuspage_account_response_attributes.py b/src/datadog_api_client/v2/model/statuspage_account_response_attributes.py new file mode 100644 index 0000000000..2490ae72a8 --- /dev/null +++ b/src/datadog_api_client/v2/model/statuspage_account_response_attributes.py @@ -0,0 +1,36 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class StatuspageAccountResponseAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "api_key": (str,), + } + + attribute_map = { + "api_key": "api_key", + } + + def __init__(self_, api_key: Union[str, UnsetType] = unset, **kwargs): + """ + The attributes from a Statuspage account response. + + :param api_key: The Statuspage API key for your Statuspage account. The value is always returned masked. + :type api_key: str, optional + """ + if api_key is not unset: + kwargs["api_key"] = api_key + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/statuspage_account_response_data.py b/src/datadog_api_client/v2/model/statuspage_account_response_data.py new file mode 100644 index 0000000000..495c6741e1 --- /dev/null +++ b/src/datadog_api_client/v2/model/statuspage_account_response_data.py @@ -0,0 +1,50 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.statuspage_account_response_attributes import StatuspageAccountResponseAttributes + from datadog_api_client.v2.model.statuspage_account_type import StatuspageAccountType + + +class StatuspageAccountResponseData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.statuspage_account_response_attributes import ( + StatuspageAccountResponseAttributes, + ) + from datadog_api_client.v2.model.statuspage_account_type import StatuspageAccountType + + return { + "attributes": (StatuspageAccountResponseAttributes,), + "type": (StatuspageAccountType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__(self_, attributes: StatuspageAccountResponseAttributes, type: StatuspageAccountType, **kwargs): + """ + Statuspage account data from a response. + + :param attributes: The attributes from a Statuspage account response. + :type attributes: StatuspageAccountResponseAttributes + + :param type: Statuspage account resource type. + :type type: StatuspageAccountType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/statuspage_account_type.py b/src/datadog_api_client/v2/model/statuspage_account_type.py new file mode 100644 index 0000000000..81ac096231 --- /dev/null +++ b/src/datadog_api_client/v2/model/statuspage_account_type.py @@ -0,0 +1,35 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class StatuspageAccountType(ModelSimple): + """ + Statuspage account resource type. + + :param value: If omitted defaults to "statuspage-account". Must be one of ["statuspage-account"]. + :type value: str + """ + + allowed_values = { + "statuspage-account", + } + STATUSPAGE_ACCOUNT: ClassVar["StatuspageAccountType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +StatuspageAccountType.STATUSPAGE_ACCOUNT = StatuspageAccountType("statuspage-account") diff --git a/src/datadog_api_client/v2/model/statuspage_account_update_attributes.py b/src/datadog_api_client/v2/model/statuspage_account_update_attributes.py new file mode 100644 index 0000000000..9b03690d6f --- /dev/null +++ b/src/datadog_api_client/v2/model/statuspage_account_update_attributes.py @@ -0,0 +1,42 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class StatuspageAccountUpdateAttributes(ModelNormal): + validations = { + "api_key": { + "min_length": 1, + }, + } + + @cached_property + def openapi_types(_): + return { + "api_key": (str,), + } + + attribute_map = { + "api_key": "api_key", + } + + def __init__(self_, api_key: Union[str, UnsetType] = unset, **kwargs): + """ + The Statuspage account attributes for an update request. + + :param api_key: The Statuspage API key for your Statuspage account. + :type api_key: str, optional + """ + if api_key is not unset: + kwargs["api_key"] = api_key + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/statuspage_account_update_data.py b/src/datadog_api_client/v2/model/statuspage_account_update_data.py new file mode 100644 index 0000000000..9f41c6ccfb --- /dev/null +++ b/src/datadog_api_client/v2/model/statuspage_account_update_data.py @@ -0,0 +1,48 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.statuspage_account_update_attributes import StatuspageAccountUpdateAttributes + from datadog_api_client.v2.model.statuspage_account_type import StatuspageAccountType + + +class StatuspageAccountUpdateData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.statuspage_account_update_attributes import StatuspageAccountUpdateAttributes + from datadog_api_client.v2.model.statuspage_account_type import StatuspageAccountType + + return { + "attributes": (StatuspageAccountUpdateAttributes,), + "type": (StatuspageAccountType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__(self_, attributes: StatuspageAccountUpdateAttributes, type: StatuspageAccountType, **kwargs): + """ + Statuspage account data for an update request. + + :param attributes: The Statuspage account attributes for an update request. + :type attributes: StatuspageAccountUpdateAttributes + + :param type: Statuspage account resource type. + :type type: StatuspageAccountType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/statuspage_account_update_request.py b/src/datadog_api_client/v2/model/statuspage_account_update_request.py new file mode 100644 index 0000000000..9aa49c49a9 --- /dev/null +++ b/src/datadog_api_client/v2/model/statuspage_account_update_request.py @@ -0,0 +1,40 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.statuspage_account_update_data import StatuspageAccountUpdateData + + +class StatuspageAccountUpdateRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.statuspage_account_update_data import StatuspageAccountUpdateData + + return { + "data": (StatuspageAccountUpdateData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: StatuspageAccountUpdateData, **kwargs): + """ + Update request for a Statuspage account. + + :param data: Statuspage account data for an update request. + :type data: StatuspageAccountUpdateData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/statuspage_url_setting_create_attributes.py b/src/datadog_api_client/v2/model/statuspage_url_setting_create_attributes.py new file mode 100644 index 0000000000..dab33c6840 --- /dev/null +++ b/src/datadog_api_client/v2/model/statuspage_url_setting_create_attributes.py @@ -0,0 +1,48 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class StatuspageUrlSettingCreateAttributes(ModelNormal): + validations = { + "custom_tags": { + "min_length": 1, + }, + "url": { + "min_length": 1, + }, + } + + @cached_property + def openapi_types(_): + return { + "custom_tags": (str,), + "url": (str,), + } + + attribute_map = { + "custom_tags": "custom_tags", + "url": "url", + } + + def __init__(self_, custom_tags: str, url: str, **kwargs): + """ + The Statuspage URL setting attributes for a create request. + + :param custom_tags: Comma-separated list of custom tags to apply to events generated from this Statuspage URL. + :type custom_tags: str + + :param url: The Statuspage URL to monitor. Must be a ``status.io`` or ``statuspage.com`` URL. + :type url: str + """ + super().__init__(kwargs) + + self_.custom_tags = custom_tags + self_.url = url diff --git a/src/datadog_api_client/v2/model/statuspage_url_setting_create_data.py b/src/datadog_api_client/v2/model/statuspage_url_setting_create_data.py new file mode 100644 index 0000000000..84f00a2c89 --- /dev/null +++ b/src/datadog_api_client/v2/model/statuspage_url_setting_create_data.py @@ -0,0 +1,52 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.statuspage_url_setting_create_attributes import ( + StatuspageUrlSettingCreateAttributes, + ) + from datadog_api_client.v2.model.statuspage_url_setting_type import StatuspageUrlSettingType + + +class StatuspageUrlSettingCreateData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.statuspage_url_setting_create_attributes import ( + StatuspageUrlSettingCreateAttributes, + ) + from datadog_api_client.v2.model.statuspage_url_setting_type import StatuspageUrlSettingType + + return { + "attributes": (StatuspageUrlSettingCreateAttributes,), + "type": (StatuspageUrlSettingType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__(self_, attributes: StatuspageUrlSettingCreateAttributes, type: StatuspageUrlSettingType, **kwargs): + """ + Statuspage URL setting data for a create request. + + :param attributes: The Statuspage URL setting attributes for a create request. + :type attributes: StatuspageUrlSettingCreateAttributes + + :param type: Statuspage URL setting resource type. + :type type: StatuspageUrlSettingType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/statuspage_url_setting_create_request.py b/src/datadog_api_client/v2/model/statuspage_url_setting_create_request.py new file mode 100644 index 0000000000..7b837b9347 --- /dev/null +++ b/src/datadog_api_client/v2/model/statuspage_url_setting_create_request.py @@ -0,0 +1,40 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.statuspage_url_setting_create_data import StatuspageUrlSettingCreateData + + +class StatuspageUrlSettingCreateRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.statuspage_url_setting_create_data import StatuspageUrlSettingCreateData + + return { + "data": (StatuspageUrlSettingCreateData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: StatuspageUrlSettingCreateData, **kwargs): + """ + Create request for a Statuspage URL setting. + + :param data: Statuspage URL setting data for a create request. + :type data: StatuspageUrlSettingCreateData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/statuspage_url_setting_response.py b/src/datadog_api_client/v2/model/statuspage_url_setting_response.py new file mode 100644 index 0000000000..cb624a34dc --- /dev/null +++ b/src/datadog_api_client/v2/model/statuspage_url_setting_response.py @@ -0,0 +1,40 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.statuspage_url_setting_response_data import StatuspageUrlSettingResponseData + + +class StatuspageUrlSettingResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.statuspage_url_setting_response_data import StatuspageUrlSettingResponseData + + return { + "data": (StatuspageUrlSettingResponseData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: StatuspageUrlSettingResponseData, **kwargs): + """ + Response containing a Statuspage URL setting. + + :param data: Statuspage URL setting data from a response. + :type data: StatuspageUrlSettingResponseData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/statuspage_url_setting_response_attributes.py b/src/datadog_api_client/v2/model/statuspage_url_setting_response_attributes.py new file mode 100644 index 0000000000..7d17dc4d46 --- /dev/null +++ b/src/datadog_api_client/v2/model/statuspage_url_setting_response_attributes.py @@ -0,0 +1,43 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class StatuspageUrlSettingResponseAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "custom_tags": (str,), + "url": (str,), + } + + attribute_map = { + "custom_tags": "custom_tags", + "url": "url", + } + + def __init__(self_, custom_tags: Union[str, UnsetType] = unset, url: Union[str, UnsetType] = unset, **kwargs): + """ + The attributes from a Statuspage URL setting response. + + :param custom_tags: Comma-separated list of custom tags applied to events generated from this Statuspage URL. + :type custom_tags: str, optional + + :param url: The Statuspage URL being monitored. + :type url: str, optional + """ + if custom_tags is not unset: + kwargs["custom_tags"] = custom_tags + if url is not unset: + kwargs["url"] = url + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/statuspage_url_setting_response_data.py b/src/datadog_api_client/v2/model/statuspage_url_setting_response_data.py new file mode 100644 index 0000000000..de5550491f --- /dev/null +++ b/src/datadog_api_client/v2/model/statuspage_url_setting_response_data.py @@ -0,0 +1,67 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.statuspage_url_setting_response_attributes import ( + StatuspageUrlSettingResponseAttributes, + ) + from datadog_api_client.v2.model.statuspage_url_setting_type import StatuspageUrlSettingType + + +class StatuspageUrlSettingResponseData(ModelNormal): + validations = { + "id": { + "max_length": 100, + "min_length": 1, + }, + } + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.statuspage_url_setting_response_attributes import ( + StatuspageUrlSettingResponseAttributes, + ) + from datadog_api_client.v2.model.statuspage_url_setting_type import StatuspageUrlSettingType + + return { + "attributes": (StatuspageUrlSettingResponseAttributes,), + "id": (str,), + "type": (StatuspageUrlSettingType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, attributes: StatuspageUrlSettingResponseAttributes, id: str, type: StatuspageUrlSettingType, **kwargs + ): + """ + Statuspage URL setting data from a response. + + :param attributes: The attributes from a Statuspage URL setting response. + :type attributes: StatuspageUrlSettingResponseAttributes + + :param id: The ID of the Statuspage URL setting. + :type id: str + + :param type: Statuspage URL setting resource type. + :type type: StatuspageUrlSettingType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/statuspage_url_setting_type.py b/src/datadog_api_client/v2/model/statuspage_url_setting_type.py new file mode 100644 index 0000000000..9eb546e2d2 --- /dev/null +++ b/src/datadog_api_client/v2/model/statuspage_url_setting_type.py @@ -0,0 +1,35 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class StatuspageUrlSettingType(ModelSimple): + """ + Statuspage URL setting resource type. + + :param value: If omitted defaults to "statuspage-url-setting". Must be one of ["statuspage-url-setting"]. + :type value: str + """ + + allowed_values = { + "statuspage-url-setting", + } + STATUSPAGE_URL_SETTING: ClassVar["StatuspageUrlSettingType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +StatuspageUrlSettingType.STATUSPAGE_URL_SETTING = StatuspageUrlSettingType("statuspage-url-setting") diff --git a/src/datadog_api_client/v2/model/statuspage_url_setting_update_attributes.py b/src/datadog_api_client/v2/model/statuspage_url_setting_update_attributes.py new file mode 100644 index 0000000000..fa74646669 --- /dev/null +++ b/src/datadog_api_client/v2/model/statuspage_url_setting_update_attributes.py @@ -0,0 +1,52 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class StatuspageUrlSettingUpdateAttributes(ModelNormal): + validations = { + "custom_tags": { + "min_length": 1, + }, + "url": { + "min_length": 1, + }, + } + + @cached_property + def openapi_types(_): + return { + "custom_tags": (str,), + "url": (str,), + } + + attribute_map = { + "custom_tags": "custom_tags", + "url": "url", + } + + def __init__(self_, custom_tags: Union[str, UnsetType] = unset, url: Union[str, UnsetType] = unset, **kwargs): + """ + The Statuspage URL setting attributes for an update request. + + :param custom_tags: Comma-separated list of custom tags to apply to events generated from this Statuspage URL. + :type custom_tags: str, optional + + :param url: The Statuspage URL to monitor. + :type url: str, optional + """ + if custom_tags is not unset: + kwargs["custom_tags"] = custom_tags + if url is not unset: + kwargs["url"] = url + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/statuspage_url_setting_update_data.py b/src/datadog_api_client/v2/model/statuspage_url_setting_update_data.py new file mode 100644 index 0000000000..e33b831702 --- /dev/null +++ b/src/datadog_api_client/v2/model/statuspage_url_setting_update_data.py @@ -0,0 +1,67 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.statuspage_url_setting_update_attributes import ( + StatuspageUrlSettingUpdateAttributes, + ) + from datadog_api_client.v2.model.statuspage_url_setting_type import StatuspageUrlSettingType + + +class StatuspageUrlSettingUpdateData(ModelNormal): + validations = { + "id": { + "max_length": 100, + "min_length": 1, + }, + } + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.statuspage_url_setting_update_attributes import ( + StatuspageUrlSettingUpdateAttributes, + ) + from datadog_api_client.v2.model.statuspage_url_setting_type import StatuspageUrlSettingType + + return { + "attributes": (StatuspageUrlSettingUpdateAttributes,), + "id": (str,), + "type": (StatuspageUrlSettingType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, attributes: StatuspageUrlSettingUpdateAttributes, id: str, type: StatuspageUrlSettingType, **kwargs + ): + """ + Statuspage URL setting data for an update request. + + :param attributes: The Statuspage URL setting attributes for an update request. + :type attributes: StatuspageUrlSettingUpdateAttributes + + :param id: The ID of the Statuspage URL setting. + :type id: str + + :param type: Statuspage URL setting resource type. + :type type: StatuspageUrlSettingType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/statuspage_url_setting_update_request.py b/src/datadog_api_client/v2/model/statuspage_url_setting_update_request.py new file mode 100644 index 0000000000..7b55123d39 --- /dev/null +++ b/src/datadog_api_client/v2/model/statuspage_url_setting_update_request.py @@ -0,0 +1,40 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.statuspage_url_setting_update_data import StatuspageUrlSettingUpdateData + + +class StatuspageUrlSettingUpdateRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.statuspage_url_setting_update_data import StatuspageUrlSettingUpdateData + + return { + "data": (StatuspageUrlSettingUpdateData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: StatuspageUrlSettingUpdateData, **kwargs): + """ + Update request for a Statuspage URL setting. + + :param data: Statuspage URL setting data for an update request. + :type data: StatuspageUrlSettingUpdateData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/statuspage_url_settings_response.py b/src/datadog_api_client/v2/model/statuspage_url_settings_response.py new file mode 100644 index 0000000000..b08a17024b --- /dev/null +++ b/src/datadog_api_client/v2/model/statuspage_url_settings_response.py @@ -0,0 +1,40 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.statuspage_url_setting_response_data import StatuspageUrlSettingResponseData + + +class StatuspageUrlSettingsResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.statuspage_url_setting_response_data import StatuspageUrlSettingResponseData + + return { + "data": ([StatuspageUrlSettingResponseData],), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: List[StatuspageUrlSettingResponseData], **kwargs): + """ + Response with a list of Statuspage URL settings. + + :param data: An array of Statuspage URL settings. + :type data: [StatuspageUrlSettingResponseData] + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index cea5bec21d..0cd93da7cb 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -7470,6 +7470,29 @@ from datadog_api_client.v2.model.status_pages_user import StatusPagesUser from datadog_api_client.v2.model.status_pages_user_attributes import StatusPagesUserAttributes from datadog_api_client.v2.model.status_pages_user_type import StatusPagesUserType +from datadog_api_client.v2.model.statuspage_account_create_attributes import StatuspageAccountCreateAttributes +from datadog_api_client.v2.model.statuspage_account_create_data import StatuspageAccountCreateData +from datadog_api_client.v2.model.statuspage_account_create_request import StatuspageAccountCreateRequest +from datadog_api_client.v2.model.statuspage_account_response import StatuspageAccountResponse +from datadog_api_client.v2.model.statuspage_account_response_attributes import StatuspageAccountResponseAttributes +from datadog_api_client.v2.model.statuspage_account_response_data import StatuspageAccountResponseData +from datadog_api_client.v2.model.statuspage_account_type import StatuspageAccountType +from datadog_api_client.v2.model.statuspage_account_update_attributes import StatuspageAccountUpdateAttributes +from datadog_api_client.v2.model.statuspage_account_update_data import StatuspageAccountUpdateData +from datadog_api_client.v2.model.statuspage_account_update_request import StatuspageAccountUpdateRequest +from datadog_api_client.v2.model.statuspage_url_setting_create_attributes import StatuspageUrlSettingCreateAttributes +from datadog_api_client.v2.model.statuspage_url_setting_create_data import StatuspageUrlSettingCreateData +from datadog_api_client.v2.model.statuspage_url_setting_create_request import StatuspageUrlSettingCreateRequest +from datadog_api_client.v2.model.statuspage_url_setting_response import StatuspageUrlSettingResponse +from datadog_api_client.v2.model.statuspage_url_setting_response_attributes import ( + StatuspageUrlSettingResponseAttributes, +) +from datadog_api_client.v2.model.statuspage_url_setting_response_data import StatuspageUrlSettingResponseData +from datadog_api_client.v2.model.statuspage_url_setting_type import StatuspageUrlSettingType +from datadog_api_client.v2.model.statuspage_url_setting_update_attributes import StatuspageUrlSettingUpdateAttributes +from datadog_api_client.v2.model.statuspage_url_setting_update_data import StatuspageUrlSettingUpdateData +from datadog_api_client.v2.model.statuspage_url_setting_update_request import StatuspageUrlSettingUpdateRequest +from datadog_api_client.v2.model.statuspage_url_settings_response import StatuspageUrlSettingsResponse from datadog_api_client.v2.model.step import Step from datadog_api_client.v2.model.step_display import StepDisplay from datadog_api_client.v2.model.step_display_bounds import StepDisplayBounds @@ -13722,6 +13745,27 @@ "StatusPagesUser", "StatusPagesUserAttributes", "StatusPagesUserType", + "StatuspageAccountCreateAttributes", + "StatuspageAccountCreateData", + "StatuspageAccountCreateRequest", + "StatuspageAccountResponse", + "StatuspageAccountResponseAttributes", + "StatuspageAccountResponseData", + "StatuspageAccountType", + "StatuspageAccountUpdateAttributes", + "StatuspageAccountUpdateData", + "StatuspageAccountUpdateRequest", + "StatuspageUrlSettingCreateAttributes", + "StatuspageUrlSettingCreateData", + "StatuspageUrlSettingCreateRequest", + "StatuspageUrlSettingResponse", + "StatuspageUrlSettingResponseAttributes", + "StatuspageUrlSettingResponseData", + "StatuspageUrlSettingType", + "StatuspageUrlSettingUpdateAttributes", + "StatuspageUrlSettingUpdateData", + "StatuspageUrlSettingUpdateRequest", + "StatuspageUrlSettingsResponse", "Step", "StepDisplay", "StepDisplayBounds", diff --git a/tests/v2/features/given.json b/tests/v2/features/given.json index 7139a86ede..4ee2038f81 100644 --- a/tests/v2/features/given.json +++ b/tests/v2/features/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/tests/v2/features/statuspage_integration.feature b/tests/v2/features/statuspage_integration.feature new file mode 100644 index 0000000000..453997ce7d --- /dev/null +++ b/tests/v2/features/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/tests/v2/features/undo.json b/tests/v2/features/undo.json index b6003df868..36f16afbea 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/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": {