diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 51127c3aea..500a331990 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -22843,7 +22843,6 @@ components: status: $ref: "#/components/schemas/CreateMaintenanceRequestDataAttributesUpdatesItemsStatus" required: - - components_affected - description - started_at - status @@ -23789,7 +23788,6 @@ components: example: "API Maintenance" type: string required: - - components_affected - title - completed_date - completed_description @@ -24472,6 +24470,9 @@ components: description: Base64-encoded image data included in email notifications sent to status page subscribers. example: data:image/png;base64,pQSLAw0KGgoAAAANSUhEUgAAAQ4AASJKFF type: string + enabled: + description: Whether the status page is enabled. + type: boolean favicon: description: Base64-encoded image data displayed in the browser tab. example: data:image/png;base64,kWMRNw0KGgoAAAANSUhEUgAAAEAAAABACA @@ -24480,6 +24481,12 @@ components: description: The name of the status page. example: Status Page US1 type: string + slack_app_icon: + description: The Slack app icon URL for the status page. + type: string + slack_subscriptions_enabled: + description: Whether Slack subscriptions are enabled for the status page. + type: boolean subscriptions_enabled: description: Whether users can subscribe to the status page. example: true @@ -29747,6 +29754,12 @@ components: format: date-time readOnly: true type: string + deleted_at: + description: The date and time the resource was deleted. + type: string + deleted_by_user_uuid: + description: UUID of the user who deleted the resource. + type: string description: description: Description of the update. type: string @@ -29871,6 +29884,162 @@ components: oneOf: - $ref: "#/components/schemas/StatusPagesUser" - $ref: "#/components/schemas/StatusPageAsIncluded" + DegradationUpdate: + description: Response object for a degradation update. + properties: + data: + $ref: "#/components/schemas/DegradationUpdateData" + included: + description: Resources related to the degradation update. + items: + $ref: "#/components/schemas/DegradationUpdateIncluded" + type: array + type: object + DegradationUpdateData: + description: The data object for a degradation update. + properties: + attributes: + $ref: "#/components/schemas/DegradationUpdateDataAttributes" + id: + description: The ID of the degradation update. + type: string + relationships: + $ref: "#/components/schemas/DegradationUpdateDataRelationships" + type: + $ref: "#/components/schemas/PatchDegradationUpdateRequestDataType" + required: + - type + type: object + DegradationUpdateDataAttributes: + description: Attributes of a degradation update resource. + properties: + components_affected: + description: Components affected by this update. + items: + $ref: "#/components/schemas/DegradationUpdateDataAttributesComponentsAffectedItems" + type: array + created_at: + description: The date and time the update was created. + format: date-time + type: string + deleted_at: + description: The date and time the update was soft-deleted. + format: date-time + type: string + description: + description: The message body of the update. + type: string + modified_at: + description: The date and time the update was last modified. + format: date-time + type: string + started_at: + description: The date and time the update started. + format: date-time + type: string + status: + $ref: "#/components/schemas/CreateDegradationRequestDataAttributesStatus" + type: object + DegradationUpdateDataAttributesComponentsAffectedItems: + description: A component affected by a degradation update. + properties: + id: + description: The ID of the affected component. + example: "" + type: string + name: + description: The name of the affected component. + readOnly: true + type: string + status: + $ref: "#/components/schemas/StatusPagesComponentDataAttributesStatus" + required: + - id + - status + type: object + DegradationUpdateDataRelationships: + description: Relationships of a degradation update resource. + properties: + created_by_user: + $ref: "#/components/schemas/DegradationUpdateDataRelationshipsUser" + degradation: + $ref: "#/components/schemas/DegradationUpdateDataRelationshipsDegradation" + deleted_by_user: + $ref: "#/components/schemas/DegradationUpdateDataRelationshipsUser" + last_modified_by_user: + $ref: "#/components/schemas/DegradationUpdateDataRelationshipsUser" + status_page: + $ref: "#/components/schemas/DegradationUpdateDataRelationshipsStatusPage" + type: object + DegradationUpdateDataRelationshipsDegradation: + description: The degradation relationship of a degradation update. + properties: + data: + $ref: "#/components/schemas/DegradationUpdateDataRelationshipsDegradationData" + required: + - data + type: object + DegradationUpdateDataRelationshipsDegradationData: + description: The degradation linked to a degradation update. + properties: + id: + description: The ID of the degradation. + example: "" + type: string + type: + $ref: "#/components/schemas/PatchDegradationRequestDataType" + required: + - type + - id + type: object + DegradationUpdateDataRelationshipsStatusPage: + description: The status page relationship of a degradation update. + properties: + data: + $ref: "#/components/schemas/DegradationUpdateDataRelationshipsStatusPageData" + required: + - data + type: object + DegradationUpdateDataRelationshipsStatusPageData: + description: The status page linked to a degradation update. + properties: + id: + description: The ID of the status page. + example: "" + type: string + type: + $ref: "#/components/schemas/StatusPageDataType" + required: + - type + - id + type: object + DegradationUpdateDataRelationshipsUser: + description: A user relationship of a degradation update. + properties: + data: + $ref: "#/components/schemas/DegradationUpdateDataRelationshipsUserData" + required: + - data + type: object + DegradationUpdateDataRelationshipsUserData: + description: A Datadog user linked to a degradation update. + properties: + id: + description: The ID of the user. + example: "" + type: string + type: + $ref: "#/components/schemas/StatusPagesUserType" + required: + - type + - id + type: object + DegradationUpdateIncluded: + description: Resources included in a degradation update response. + oneOf: + - $ref: "#/components/schemas/StatusPagesUser" + - $ref: "#/components/schemas/Degradation" + - $ref: "#/components/schemas/StatusPageAsIncluded" DeleteAppResponse: description: The response object after an app is successfully deleted. properties: @@ -71960,6 +72129,61 @@ components: type: string x-enum-varnames: - DEGRADATIONS + PatchDegradationUpdateRequest: + description: Request object for editing a degradation update. + example: + data: + attributes: + description: We've identified the source of the latency increase and are deploying a fix. + status: identified + id: 00000000-0000-0000-0000-000000000000 + type: degradation_updates + properties: + data: + $ref: "#/components/schemas/PatchDegradationUpdateRequestData" + type: object + PatchDegradationUpdateRequestData: + description: The data object for editing a degradation update. + properties: + attributes: + $ref: "#/components/schemas/PatchDegradationUpdateRequestDataAttributes" + id: + description: The ID of the degradation update to edit. + type: string + type: + $ref: "#/components/schemas/PatchDegradationUpdateRequestDataType" + required: + - type + type: object + PatchDegradationUpdateRequestDataAttributes: + description: Attributes for editing a degradation update. + properties: + description: + description: The message body of the update. + type: string + status: + $ref: "#/components/schemas/PatchDegradationUpdateRequestDataAttributesStatus" + type: object + PatchDegradationUpdateRequestDataAttributesStatus: + description: The status of the degradation update. + enum: + - investigating + - identified + - monitoring + type: string + x-enum-varnames: + - INVESTIGATING + - IDENTIFIED + - MONITORING + PatchDegradationUpdateRequestDataType: + default: degradation_updates + description: Degradation updates resource type. + enum: + - degradation_updates + example: degradation_updates + type: string + x-enum-varnames: + - DEGRADATION_UPDATES PatchIncidentNotificationTemplateRequest: description: Update request for a notification template. properties: @@ -72174,6 +72398,12 @@ components: description: The name of the status page. example: Status Page US1 type: string + slack_app_icon: + description: The Slack app icon URL for the status page. + type: string + slack_subscriptions_enabled: + description: Whether Slack subscriptions are enabled for the status page. + type: boolean subscriptions_enabled: description: Whether users can subscribe to the status page. example: true @@ -93878,6 +94108,12 @@ components: page_url: description: The url that the status page is accessible at. type: string + slack_app_icon: + description: The Slack app icon URL for the status page. + type: string + slack_subscriptions_enabled: + description: Whether Slack subscriptions are enabled for the status page. + type: boolean subscriptions_enabled: description: Whether users can subscribe to the status page. type: boolean @@ -94046,6 +94282,12 @@ components: page_url: description: The url that the status page is accessible at. type: string + slack_app_icon: + description: The Slack app icon URL for the status page. + type: string + slack_subscriptions_enabled: + description: Whether Slack subscriptions are enabled for the status page. + type: boolean subscriptions_enabled: description: Whether users can subscribe to the status page. type: boolean @@ -182940,7 +183182,8 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - - AuthZ: [] + - AuthZ: + - status_pages_settings_read summary: List status pages tags: - Status Pages @@ -183020,7 +183263,8 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - - AuthZ: [] + - AuthZ: + - status_pages_settings_write summary: Create status page tags: - Status Pages @@ -183093,7 +183337,8 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - - AuthZ: [] + - AuthZ: + - status_pages_settings_read summary: List degradations tags: - Status Pages @@ -183167,7 +183412,8 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - - AuthZ: [] + - AuthZ: + - status_pages_settings_read summary: List maintenances tags: - Status Pages @@ -183196,7 +183442,8 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - - AuthZ: [] + - AuthZ: + - status_pages_settings_write summary: Delete status page tags: - Status Pages @@ -183247,7 +183494,8 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - - AuthZ: [] + - AuthZ: + - status_pages_settings_read summary: Get status page tags: - Status Pages @@ -183326,7 +183574,8 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - - AuthZ: [] + - AuthZ: + - status_pages_settings_write summary: Update status page tags: - Status Pages @@ -183375,7 +183624,8 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - - AuthZ: [] + - AuthZ: + - status_pages_settings_read summary: List components tags: - Status Pages @@ -183441,7 +183691,8 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - - AuthZ: [] + - AuthZ: + - status_pages_settings_write summary: Create component tags: - Status Pages @@ -183478,7 +183729,8 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - - AuthZ: [] + - AuthZ: + - status_pages_settings_write summary: Delete component tags: - Status Pages @@ -183534,7 +183786,8 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - - AuthZ: [] + - AuthZ: + - status_pages_settings_read summary: Get component tags: - Status Pages @@ -183605,7 +183858,8 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - - AuthZ: [] + - AuthZ: + - status_pages_settings_write summary: Update component tags: - Status Pages @@ -183683,7 +183937,8 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - - AuthZ: [] + - AuthZ: + - status_pages_incident_write summary: Create degradation tags: - Status Pages @@ -183762,7 +184017,8 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - - AuthZ: [] + - AuthZ: + - status_pages_incident_write summary: Create backfilled degradation tags: - Status Pages @@ -183799,7 +184055,8 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - - AuthZ: [] + - AuthZ: + - status_pages_incident_write summary: Delete degradation tags: - Status Pages @@ -183860,7 +184117,8 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - - AuthZ: [] + - AuthZ: + - status_pages_settings_read summary: Get degradation tags: - Status Pages @@ -183946,7 +184204,8 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - - AuthZ: [] + - AuthZ: + - status_pages_incident_write summary: Update degradation tags: - Status Pages @@ -183954,6 +184213,116 @@ paths: operator: AND permissions: - status_pages_incident_write + /api/v2/statuspages/{page_id}/degradations/{degradation_id}/updates/{update_id}: + delete: + description: Soft-deletes a degradation update. + operationId: SoftDeleteDegradationUpdate + parameters: + - description: The ID of the degradation. + in: path + name: degradation_id + required: true + schema: + format: uuid + type: string + - description: The ID of the status page. + in: path + name: page_id + required: true + schema: + format: uuid + type: string + - description: The ID of the degradation update. + in: path + name: update_id + required: true + schema: + format: uuid + type: string + responses: + "204": + description: No Content + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - status_pages_incident_write + summary: Soft delete degradation update + tags: + - Status Pages + patch: + description: Edits a specific degradation update. + operationId: EditDegradationUpdate + parameters: + - description: The ID of the degradation. + in: path + name: degradation_id + required: true + schema: + format: uuid + type: string + - description: "Comma-separated list of resources to include. Supported values: created_by_user, last_modified_by_user, degradation, status_page." + in: query + name: include + schema: + type: string + - description: The ID of the status page. + in: path + name: page_id + required: true + schema: + format: uuid + type: string + - description: The ID of the degradation update. + in: path + name: update_id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + description: We've identified the source of the latency increase and are deploying a fix. + status: identified + id: 00000000-0000-0000-0000-000000000000 + type: degradation_updates + schema: + $ref: "#/components/schemas/PatchDegradationUpdateRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + description: We've identified the source of the latency increase and are deploying a fix. + status: identified + id: 00000000-0000-0000-0000-000000000000 + type: degradation_updates + schema: + $ref: "#/components/schemas/DegradationUpdate" + description: OK + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - status_pages_incident_write + summary: Edit degradation update + tags: + - Status Pages /api/v2/statuspages/{page_id}/maintenances: post: description: Schedules a new maintenance. @@ -184025,7 +184394,8 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - - AuthZ: [] + - AuthZ: + - status_pages_incident_write summary: Schedule maintenance tags: - Status Pages @@ -184103,7 +184473,8 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - - AuthZ: [] + - AuthZ: + - status_pages_incident_write summary: Create backfilled maintenance tags: - Status Pages @@ -184162,7 +184533,8 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - - AuthZ: [] + - AuthZ: + - status_pages_settings_read summary: Get maintenance tags: - Status Pages @@ -184244,7 +184616,8 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - - AuthZ: [] + - AuthZ: + - status_pages_incident_write summary: Update maintenance tags: - Status Pages @@ -184272,7 +184645,10 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - - AuthZ: [] + - AuthZ: + - status_pages_internal_page_publish + - status_pages_public_page_publish + - status_pages_settings_write summary: Publish status page tags: - Status Pages @@ -184302,7 +184678,10 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - - AuthZ: [] + - AuthZ: + - status_pages_internal_page_publish + - status_pages_public_page_publish + - status_pages_settings_write summary: Unpublish status page tags: - Status Pages diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index 791e481a7b..14023429c7 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -11400,6 +11400,90 @@ datadog\_api\_client.v2.model.degradation\_included module :members: :show-inheritance: +datadog\_api\_client.v2.model.degradation\_update module +-------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.degradation_update + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.degradation\_update\_data module +-------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.degradation_update_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.degradation\_update\_data\_attributes module +-------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.degradation_update_data_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.degradation\_update\_data\_attributes\_components\_affected\_items module +------------------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.degradation_update_data_attributes_components_affected_items + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.degradation\_update\_data\_relationships module +----------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.degradation_update_data_relationships + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.degradation\_update\_data\_relationships\_degradation module +------------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.degradation_update_data_relationships_degradation + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.degradation\_update\_data\_relationships\_degradation\_data module +------------------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.degradation_update_data_relationships_degradation_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.degradation\_update\_data\_relationships\_status\_page module +------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.degradation_update_data_relationships_status_page + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.degradation\_update\_data\_relationships\_status\_page\_data module +------------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.degradation_update_data_relationships_status_page_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.degradation\_update\_data\_relationships\_user module +----------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.degradation_update_data_relationships_user + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.degradation\_update\_data\_relationships\_user\_data module +----------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.degradation_update_data_relationships_user_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.degradation\_update\_included module +------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.degradation_update_included + :members: + :show-inheritance: + datadog\_api\_client.v2.model.delete\_app\_response module ---------------------------------------------------------- @@ -30265,6 +30349,41 @@ datadog\_api\_client.v2.model.patch\_degradation\_request\_data\_type module :members: :show-inheritance: +datadog\_api\_client.v2.model.patch\_degradation\_update\_request module +------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.patch_degradation_update_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.patch\_degradation\_update\_request\_data module +------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.patch_degradation_update_request_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.patch\_degradation\_update\_request\_data\_attributes module +------------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.patch_degradation_update_request_data_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.patch\_degradation\_update\_request\_data\_attributes\_status module +-------------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.patch_degradation_update_request_data_attributes_status + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.patch\_degradation\_update\_request\_data\_type module +------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.patch_degradation_update_request_data_type + :members: + :show-inheritance: + datadog\_api\_client.v2.model.patch\_incident\_notification\_template\_request module ------------------------------------------------------------------------------------- diff --git a/examples/v2/status-pages/EditDegradationUpdate.py b/examples/v2/status-pages/EditDegradationUpdate.py new file mode 100644 index 0000000000..909f0dd199 --- /dev/null +++ b/examples/v2/status-pages/EditDegradationUpdate.py @@ -0,0 +1,39 @@ +""" +Edit degradation update returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.status_pages_api import StatusPagesApi +from datadog_api_client.v2.model.patch_degradation_update_request import PatchDegradationUpdateRequest +from datadog_api_client.v2.model.patch_degradation_update_request_data import PatchDegradationUpdateRequestData +from datadog_api_client.v2.model.patch_degradation_update_request_data_attributes import ( + PatchDegradationUpdateRequestDataAttributes, +) +from datadog_api_client.v2.model.patch_degradation_update_request_data_attributes_status import ( + PatchDegradationUpdateRequestDataAttributesStatus, +) +from datadog_api_client.v2.model.patch_degradation_update_request_data_type import PatchDegradationUpdateRequestDataType +from uuid import UUID + +body = PatchDegradationUpdateRequest( + data=PatchDegradationUpdateRequestData( + attributes=PatchDegradationUpdateRequestDataAttributes( + description="We've identified the source of the latency increase and are deploying a fix.", + status=PatchDegradationUpdateRequestDataAttributesStatus.IDENTIFIED, + ), + id="00000000-0000-0000-0000-000000000000", + type=PatchDegradationUpdateRequestDataType.DEGRADATION_UPDATES, + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = StatusPagesApi(api_client) + response = api_instance.edit_degradation_update( + degradation_id=UUID("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"), + page_id=UUID("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"), + update_id=UUID("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"), + body=body, + ) + + print(response) diff --git a/examples/v2/status-pages/SoftDeleteDegradationUpdate.py b/examples/v2/status-pages/SoftDeleteDegradationUpdate.py new file mode 100644 index 0000000000..611a234add --- /dev/null +++ b/examples/v2/status-pages/SoftDeleteDegradationUpdate.py @@ -0,0 +1,16 @@ +""" +Soft delete degradation update returns "No Content" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.status_pages_api import StatusPagesApi +from uuid import UUID + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = StatusPagesApi(api_client) + api_instance.soft_delete_degradation_update( + degradation_id=UUID("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"), + page_id=UUID("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"), + update_id=UUID("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"), + ) diff --git a/src/datadog_api_client/v2/api/status_pages_api.py b/src/datadog_api_client/v2/api/status_pages_api.py index ca955e6994..b0c0452cf0 100644 --- a/src/datadog_api_client/v2/api/status_pages_api.py +++ b/src/datadog_api_client/v2/api/status_pages_api.py @@ -26,6 +26,8 @@ from datadog_api_client.v2.model.create_degradation_request import CreateDegradationRequest from datadog_api_client.v2.model.create_backfilled_degradation_request import CreateBackfilledDegradationRequest from datadog_api_client.v2.model.patch_degradation_request import PatchDegradationRequest +from datadog_api_client.v2.model.degradation_update import DegradationUpdate +from datadog_api_client.v2.model.patch_degradation_update_request import PatchDegradationUpdateRequest from datadog_api_client.v2.model.maintenance import Maintenance from datadog_api_client.v2.model.create_maintenance_request import CreateMaintenanceRequest from datadog_api_client.v2.model.create_backfilled_maintenance_request import CreateBackfilledMaintenanceRequest @@ -313,6 +315,49 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._edit_degradation_update_endpoint = _Endpoint( + settings={ + "response_type": (DegradationUpdate,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/statuspages/{page_id}/degradations/{degradation_id}/updates/{update_id}", + "operation_id": "edit_degradation_update", + "http_method": "PATCH", + "version": "v2", + }, + params_map={ + "degradation_id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "degradation_id", + "location": "path", + }, + "include": { + "openapi_types": (str,), + "attribute": "include", + "location": "query", + }, + "page_id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "page_id", + "location": "path", + }, + "update_id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "update_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (PatchDegradationUpdateRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + self._get_component_endpoint = _Endpoint( settings={ "response_type": (StatusPagesComponent,), @@ -625,6 +670,41 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._soft_delete_degradation_update_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/statuspages/{page_id}/degradations/{degradation_id}/updates/{update_id}", + "operation_id": "soft_delete_degradation_update", + "http_method": "DELETE", + "version": "v2", + }, + params_map={ + "degradation_id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "degradation_id", + "location": "path", + }, + "page_id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "page_id", + "location": "path", + }, + "update_id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "update_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["*/*"], + }, + api_client=api_client, + ) + self._unpublish_status_page_endpoint = _Endpoint( settings={ "response_type": None, @@ -1041,6 +1121,44 @@ def delete_status_page( return self._delete_status_page_endpoint.call_with_http_info(**kwargs) + def edit_degradation_update( + self, + degradation_id: UUID, + page_id: UUID, + update_id: UUID, + body: PatchDegradationUpdateRequest, + *, + include: Union[str, UnsetType] = unset, + ) -> DegradationUpdate: + """Edit degradation update. + + Edits a specific degradation update. + + :param degradation_id: The ID of the degradation. + :type degradation_id: UUID + :param page_id: The ID of the status page. + :type page_id: UUID + :param update_id: The ID of the degradation update. + :type update_id: UUID + :type body: PatchDegradationUpdateRequest + :param include: Comma-separated list of resources to include. Supported values: created_by_user, last_modified_by_user, degradation, status_page. + :type include: str, optional + :rtype: DegradationUpdate + """ + kwargs: Dict[str, Any] = {} + kwargs["degradation_id"] = degradation_id + + if include is not unset: + kwargs["include"] = include + + kwargs["page_id"] = page_id + + kwargs["update_id"] = update_id + + kwargs["body"] = body + + return self._edit_degradation_update_endpoint.call_with_http_info(**kwargs) + def get_component( self, page_id: UUID, @@ -1328,6 +1446,33 @@ def publish_status_page( return self._publish_status_page_endpoint.call_with_http_info(**kwargs) + def soft_delete_degradation_update( + self, + degradation_id: UUID, + page_id: UUID, + update_id: UUID, + ) -> None: + """Soft delete degradation update. + + Soft-deletes a degradation update. + + :param degradation_id: The ID of the degradation. + :type degradation_id: UUID + :param page_id: The ID of the status page. + :type page_id: UUID + :param update_id: The ID of the degradation update. + :type update_id: UUID + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["degradation_id"] = degradation_id + + kwargs["page_id"] = page_id + + kwargs["update_id"] = update_id + + return self._soft_delete_degradation_update_endpoint.call_with_http_info(**kwargs) + def unpublish_status_page( self, page_id: UUID, diff --git a/src/datadog_api_client/v2/model/create_backfilled_maintenance_request_data_attributes_updates_items.py b/src/datadog_api_client/v2/model/create_backfilled_maintenance_request_data_attributes_updates_items.py index 83c41ee0f0..c6ec065ab0 100644 --- a/src/datadog_api_client/v2/model/create_backfilled_maintenance_request_data_attributes_updates_items.py +++ b/src/datadog_api_client/v2/model/create_backfilled_maintenance_request_data_attributes_updates_items.py @@ -3,12 +3,14 @@ # Copyright 2019-Present Datadog, Inc. from __future__ import annotations -from typing import List, TYPE_CHECKING +from typing import List, Union, TYPE_CHECKING from datadog_api_client.model_utils import ( ModelNormal, cached_property, datetime, + unset, + UnsetType, ) @@ -47,17 +49,19 @@ def openapi_types(_): def __init__( self_, - components_affected: List[CreateMaintenanceRequestDataAttributesComponentsAffectedItems], description: str, started_at: datetime, status: CreateMaintenanceRequestDataAttributesUpdatesItemsStatus, + components_affected: Union[ + List[CreateMaintenanceRequestDataAttributesComponentsAffectedItems], UnsetType + ] = unset, **kwargs, ): """ A backfilled maintenance update entry. :param components_affected: The components affected. - :type components_affected: [CreateMaintenanceRequestDataAttributesComponentsAffectedItems] + :type components_affected: [CreateMaintenanceRequestDataAttributesComponentsAffectedItems], optional :param description: A description of the update. :type description: str @@ -68,9 +72,10 @@ def __init__( :param status: The status of a maintenance update. :type status: CreateMaintenanceRequestDataAttributesUpdatesItemsStatus """ + if components_affected is not unset: + kwargs["components_affected"] = components_affected super().__init__(kwargs) - self_.components_affected = components_affected self_.description = description self_.started_at = started_at self_.status = status diff --git a/src/datadog_api_client/v2/model/create_maintenance_request_data_attributes.py b/src/datadog_api_client/v2/model/create_maintenance_request_data_attributes.py index f9c14319c3..ca16188630 100644 --- a/src/datadog_api_client/v2/model/create_maintenance_request_data_attributes.py +++ b/src/datadog_api_client/v2/model/create_maintenance_request_data_attributes.py @@ -3,12 +3,14 @@ # Copyright 2019-Present Datadog, Inc. from __future__ import annotations -from typing import List, TYPE_CHECKING +from typing import List, Union, TYPE_CHECKING from datadog_api_client.model_utils import ( ModelNormal, cached_property, datetime, + unset, + UnsetType, ) @@ -49,11 +51,13 @@ def __init__( self_, completed_date: datetime, completed_description: str, - components_affected: List[CreateMaintenanceRequestDataAttributesComponentsAffectedItems], in_progress_description: str, scheduled_description: str, start_date: datetime, title: str, + components_affected: Union[ + List[CreateMaintenanceRequestDataAttributesComponentsAffectedItems], UnsetType + ] = unset, **kwargs, ): """ @@ -66,7 +70,7 @@ def __init__( :type completed_description: str :param components_affected: The components affected by the maintenance. - :type components_affected: [CreateMaintenanceRequestDataAttributesComponentsAffectedItems] + :type components_affected: [CreateMaintenanceRequestDataAttributesComponentsAffectedItems], optional :param in_progress_description: The description shown while the maintenance is in progress. :type in_progress_description: str @@ -80,11 +84,12 @@ def __init__( :param title: The title of the maintenance. :type title: str """ + if components_affected is not unset: + kwargs["components_affected"] = components_affected super().__init__(kwargs) self_.completed_date = completed_date self_.completed_description = completed_description - self_.components_affected = components_affected self_.in_progress_description = in_progress_description self_.scheduled_description = scheduled_description self_.start_date = start_date diff --git a/src/datadog_api_client/v2/model/create_status_page_request_data_attributes.py b/src/datadog_api_client/v2/model/create_status_page_request_data_attributes.py index 965f1f95f5..8234071041 100644 --- a/src/datadog_api_client/v2/model/create_status_page_request_data_attributes.py +++ b/src/datadog_api_client/v2/model/create_status_page_request_data_attributes.py @@ -43,8 +43,11 @@ def openapi_types(_): "components": ([CreateStatusPageRequestDataAttributesComponentsItems],), "domain_prefix": (str,), "email_header_image": (str,), + "enabled": (bool,), "favicon": (str,), "name": (str,), + "slack_app_icon": (str,), + "slack_subscriptions_enabled": (bool,), "subscriptions_enabled": (bool,), "type": (CreateStatusPageRequestDataAttributesType,), "visualization_type": (CreateStatusPageRequestDataAttributesVisualizationType,), @@ -55,8 +58,11 @@ def openapi_types(_): "components": "components", "domain_prefix": "domain_prefix", "email_header_image": "email_header_image", + "enabled": "enabled", "favicon": "favicon", "name": "name", + "slack_app_icon": "slack_app_icon", + "slack_subscriptions_enabled": "slack_subscriptions_enabled", "subscriptions_enabled": "subscriptions_enabled", "type": "type", "visualization_type": "visualization_type", @@ -71,7 +77,10 @@ def __init__( company_logo: Union[str, UnsetType] = unset, components: Union[List[CreateStatusPageRequestDataAttributesComponentsItems], UnsetType] = unset, email_header_image: Union[str, UnsetType] = unset, + enabled: Union[bool, UnsetType] = unset, favicon: Union[str, UnsetType] = unset, + slack_app_icon: Union[str, UnsetType] = unset, + slack_subscriptions_enabled: Union[bool, UnsetType] = unset, subscriptions_enabled: Union[bool, UnsetType] = unset, **kwargs, ): @@ -90,12 +99,21 @@ def __init__( :param email_header_image: Base64-encoded image data included in email notifications sent to status page subscribers. :type email_header_image: str, optional + :param enabled: Whether the status page is enabled. + :type enabled: bool, optional + :param favicon: Base64-encoded image data displayed in the browser tab. :type favicon: str, optional :param name: The name of the status page. :type name: str + :param slack_app_icon: The Slack app icon URL for the status page. + :type slack_app_icon: str, optional + + :param slack_subscriptions_enabled: Whether Slack subscriptions are enabled for the status page. + :type slack_subscriptions_enabled: bool, optional + :param subscriptions_enabled: Whether users can subscribe to the status page. :type subscriptions_enabled: bool, optional @@ -111,8 +129,14 @@ def __init__( kwargs["components"] = components if email_header_image is not unset: kwargs["email_header_image"] = email_header_image + if enabled is not unset: + kwargs["enabled"] = enabled if favicon is not unset: kwargs["favicon"] = favicon + if slack_app_icon is not unset: + kwargs["slack_app_icon"] = slack_app_icon + if slack_subscriptions_enabled is not unset: + kwargs["slack_subscriptions_enabled"] = slack_subscriptions_enabled if subscriptions_enabled is not unset: kwargs["subscriptions_enabled"] = subscriptions_enabled super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/degradation_data_attributes_updates_items.py b/src/datadog_api_client/v2/model/degradation_data_attributes_updates_items.py index d863a9cb13..c4a045d9c2 100644 --- a/src/datadog_api_client/v2/model/degradation_data_attributes_updates_items.py +++ b/src/datadog_api_client/v2/model/degradation_data_attributes_updates_items.py @@ -37,6 +37,8 @@ def openapi_types(_): return { "components_affected": ([DegradationDataAttributesUpdatesItemsComponentsAffectedItems],), "created_at": (datetime,), + "deleted_at": (str,), + "deleted_by_user_uuid": (str,), "description": (str,), "id": (UUID,), "last_modified_by_user_uuid": (str,), @@ -48,6 +50,8 @@ def openapi_types(_): attribute_map = { "components_affected": "components_affected", "created_at": "created_at", + "deleted_at": "deleted_at", + "deleted_by_user_uuid": "deleted_by_user_uuid", "description": "description", "id": "id", "last_modified_by_user_uuid": "last_modified_by_user_uuid", @@ -67,6 +71,8 @@ def __init__( List[DegradationDataAttributesUpdatesItemsComponentsAffectedItems], UnsetType ] = unset, created_at: Union[datetime, UnsetType] = unset, + deleted_at: Union[str, UnsetType] = unset, + deleted_by_user_uuid: Union[str, UnsetType] = unset, description: Union[str, UnsetType] = unset, id: Union[UUID, UnsetType] = unset, last_modified_by_user_uuid: Union[str, UnsetType] = unset, @@ -84,6 +90,12 @@ def __init__( :param created_at: Timestamp of when the update was created. :type created_at: datetime, optional + :param deleted_at: The date and time the resource was deleted. + :type deleted_at: str, optional + + :param deleted_by_user_uuid: UUID of the user who deleted the resource. + :type deleted_by_user_uuid: str, optional + :param description: Description of the update. :type description: str, optional @@ -106,6 +118,10 @@ def __init__( kwargs["components_affected"] = components_affected if created_at is not unset: kwargs["created_at"] = created_at + if deleted_at is not unset: + kwargs["deleted_at"] = deleted_at + if deleted_by_user_uuid is not unset: + kwargs["deleted_by_user_uuid"] = deleted_by_user_uuid if description is not unset: kwargs["description"] = description if id is not unset: diff --git a/src/datadog_api_client/v2/model/degradation_update.py b/src/datadog_api_client/v2/model/degradation_update.py new file mode 100644 index 0000000000..9f17ff3d94 --- /dev/null +++ b/src/datadog_api_client/v2/model/degradation_update.py @@ -0,0 +1,61 @@ +# 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, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.degradation_update_data import DegradationUpdateData + from datadog_api_client.v2.model.degradation_update_included import DegradationUpdateIncluded + from datadog_api_client.v2.model.status_pages_user import StatusPagesUser + from datadog_api_client.v2.model.degradation import Degradation + from datadog_api_client.v2.model.status_page_as_included import StatusPageAsIncluded + + +class DegradationUpdate(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.degradation_update_data import DegradationUpdateData + from datadog_api_client.v2.model.degradation_update_included import DegradationUpdateIncluded + + return { + "data": (DegradationUpdateData,), + "included": ([DegradationUpdateIncluded],), + } + + attribute_map = { + "data": "data", + "included": "included", + } + + def __init__( + self_, + data: Union[DegradationUpdateData, UnsetType] = unset, + included: Union[ + List[Union[DegradationUpdateIncluded, StatusPagesUser, Degradation, StatusPageAsIncluded]], UnsetType + ] = unset, + **kwargs, + ): + """ + Response object for a degradation update. + + :param data: The data object for a degradation update. + :type data: DegradationUpdateData, optional + + :param included: Resources related to the degradation update. + :type included: [DegradationUpdateIncluded], optional + """ + if data is not unset: + kwargs["data"] = data + if included is not unset: + kwargs["included"] = included + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/degradation_update_data.py b/src/datadog_api_client/v2/model/degradation_update_data.py new file mode 100644 index 0000000000..26a789643e --- /dev/null +++ b/src/datadog_api_client/v2/model/degradation_update_data.py @@ -0,0 +1,78 @@ +# 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, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.degradation_update_data_attributes import DegradationUpdateDataAttributes + from datadog_api_client.v2.model.degradation_update_data_relationships import DegradationUpdateDataRelationships + from datadog_api_client.v2.model.patch_degradation_update_request_data_type import ( + PatchDegradationUpdateRequestDataType, + ) + + +class DegradationUpdateData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.degradation_update_data_attributes import DegradationUpdateDataAttributes + from datadog_api_client.v2.model.degradation_update_data_relationships import DegradationUpdateDataRelationships + from datadog_api_client.v2.model.patch_degradation_update_request_data_type import ( + PatchDegradationUpdateRequestDataType, + ) + + return { + "attributes": (DegradationUpdateDataAttributes,), + "id": (str,), + "relationships": (DegradationUpdateDataRelationships,), + "type": (PatchDegradationUpdateRequestDataType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "relationships": "relationships", + "type": "type", + } + + def __init__( + self_, + type: PatchDegradationUpdateRequestDataType, + attributes: Union[DegradationUpdateDataAttributes, UnsetType] = unset, + id: Union[str, UnsetType] = unset, + relationships: Union[DegradationUpdateDataRelationships, UnsetType] = unset, + **kwargs, + ): + """ + The data object for a degradation update. + + :param attributes: Attributes of a degradation update resource. + :type attributes: DegradationUpdateDataAttributes, optional + + :param id: The ID of the degradation update. + :type id: str, optional + + :param relationships: Relationships of a degradation update resource. + :type relationships: DegradationUpdateDataRelationships, optional + + :param type: Degradation updates resource type. + :type type: PatchDegradationUpdateRequestDataType + """ + if attributes is not unset: + kwargs["attributes"] = attributes + if id is not unset: + kwargs["id"] = id + if relationships is not unset: + kwargs["relationships"] = relationships + super().__init__(kwargs) + + self_.type = type diff --git a/src/datadog_api_client/v2/model/degradation_update_data_attributes.py b/src/datadog_api_client/v2/model/degradation_update_data_attributes.py new file mode 100644 index 0000000000..3bc77afeb1 --- /dev/null +++ b/src/datadog_api_client/v2/model/degradation_update_data_attributes.py @@ -0,0 +1,105 @@ +# 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, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + datetime, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.degradation_update_data_attributes_components_affected_items import ( + DegradationUpdateDataAttributesComponentsAffectedItems, + ) + from datadog_api_client.v2.model.create_degradation_request_data_attributes_status import ( + CreateDegradationRequestDataAttributesStatus, + ) + + +class DegradationUpdateDataAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.degradation_update_data_attributes_components_affected_items import ( + DegradationUpdateDataAttributesComponentsAffectedItems, + ) + from datadog_api_client.v2.model.create_degradation_request_data_attributes_status import ( + CreateDegradationRequestDataAttributesStatus, + ) + + return { + "components_affected": ([DegradationUpdateDataAttributesComponentsAffectedItems],), + "created_at": (datetime,), + "deleted_at": (datetime,), + "description": (str,), + "modified_at": (datetime,), + "started_at": (datetime,), + "status": (CreateDegradationRequestDataAttributesStatus,), + } + + attribute_map = { + "components_affected": "components_affected", + "created_at": "created_at", + "deleted_at": "deleted_at", + "description": "description", + "modified_at": "modified_at", + "started_at": "started_at", + "status": "status", + } + + def __init__( + self_, + components_affected: Union[List[DegradationUpdateDataAttributesComponentsAffectedItems], UnsetType] = unset, + created_at: Union[datetime, UnsetType] = unset, + deleted_at: Union[datetime, UnsetType] = unset, + description: Union[str, UnsetType] = unset, + modified_at: Union[datetime, UnsetType] = unset, + started_at: Union[datetime, UnsetType] = unset, + status: Union[CreateDegradationRequestDataAttributesStatus, UnsetType] = unset, + **kwargs, + ): + """ + Attributes of a degradation update resource. + + :param components_affected: Components affected by this update. + :type components_affected: [DegradationUpdateDataAttributesComponentsAffectedItems], optional + + :param created_at: The date and time the update was created. + :type created_at: datetime, optional + + :param deleted_at: The date and time the update was soft-deleted. + :type deleted_at: datetime, optional + + :param description: The message body of the update. + :type description: str, optional + + :param modified_at: The date and time the update was last modified. + :type modified_at: datetime, optional + + :param started_at: The date and time the update started. + :type started_at: datetime, optional + + :param status: The status of the degradation. + :type status: CreateDegradationRequestDataAttributesStatus, optional + """ + if components_affected is not unset: + kwargs["components_affected"] = components_affected + if created_at is not unset: + kwargs["created_at"] = created_at + if deleted_at is not unset: + kwargs["deleted_at"] = deleted_at + if description is not unset: + kwargs["description"] = description + if modified_at is not unset: + kwargs["modified_at"] = modified_at + if started_at is not unset: + kwargs["started_at"] = started_at + if status is not unset: + kwargs["status"] = status + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/degradation_update_data_attributes_components_affected_items.py b/src/datadog_api_client/v2/model/degradation_update_data_attributes_components_affected_items.py new file mode 100644 index 0000000000..ce511d3230 --- /dev/null +++ b/src/datadog_api_client/v2/model/degradation_update_data_attributes_components_affected_items.py @@ -0,0 +1,64 @@ +# 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, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.status_pages_component_data_attributes_status import ( + StatusPagesComponentDataAttributesStatus, + ) + + +class DegradationUpdateDataAttributesComponentsAffectedItems(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.status_pages_component_data_attributes_status import ( + StatusPagesComponentDataAttributesStatus, + ) + + return { + "id": (str,), + "name": (str,), + "status": (StatusPagesComponentDataAttributesStatus,), + } + + attribute_map = { + "id": "id", + "name": "name", + "status": "status", + } + read_only_vars = { + "name", + } + + def __init__( + self_, id: str, status: StatusPagesComponentDataAttributesStatus, name: Union[str, UnsetType] = unset, **kwargs + ): + """ + A component affected by a degradation update. + + :param id: The ID of the affected component. + :type id: str + + :param name: The name of the affected component. + :type name: str, optional + + :param status: The status of the component. + :type status: StatusPagesComponentDataAttributesStatus + """ + if name is not unset: + kwargs["name"] = name + super().__init__(kwargs) + + self_.id = id + self_.status = status diff --git a/src/datadog_api_client/v2/model/degradation_update_data_relationships.py b/src/datadog_api_client/v2/model/degradation_update_data_relationships.py new file mode 100644 index 0000000000..a5b777bc3a --- /dev/null +++ b/src/datadog_api_client/v2/model/degradation_update_data_relationships.py @@ -0,0 +1,94 @@ +# 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, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.degradation_update_data_relationships_user import ( + DegradationUpdateDataRelationshipsUser, + ) + from datadog_api_client.v2.model.degradation_update_data_relationships_degradation import ( + DegradationUpdateDataRelationshipsDegradation, + ) + from datadog_api_client.v2.model.degradation_update_data_relationships_status_page import ( + DegradationUpdateDataRelationshipsStatusPage, + ) + + +class DegradationUpdateDataRelationships(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.degradation_update_data_relationships_user import ( + DegradationUpdateDataRelationshipsUser, + ) + from datadog_api_client.v2.model.degradation_update_data_relationships_degradation import ( + DegradationUpdateDataRelationshipsDegradation, + ) + from datadog_api_client.v2.model.degradation_update_data_relationships_status_page import ( + DegradationUpdateDataRelationshipsStatusPage, + ) + + return { + "created_by_user": (DegradationUpdateDataRelationshipsUser,), + "degradation": (DegradationUpdateDataRelationshipsDegradation,), + "deleted_by_user": (DegradationUpdateDataRelationshipsUser,), + "last_modified_by_user": (DegradationUpdateDataRelationshipsUser,), + "status_page": (DegradationUpdateDataRelationshipsStatusPage,), + } + + attribute_map = { + "created_by_user": "created_by_user", + "degradation": "degradation", + "deleted_by_user": "deleted_by_user", + "last_modified_by_user": "last_modified_by_user", + "status_page": "status_page", + } + + def __init__( + self_, + created_by_user: Union[DegradationUpdateDataRelationshipsUser, UnsetType] = unset, + degradation: Union[DegradationUpdateDataRelationshipsDegradation, UnsetType] = unset, + deleted_by_user: Union[DegradationUpdateDataRelationshipsUser, UnsetType] = unset, + last_modified_by_user: Union[DegradationUpdateDataRelationshipsUser, UnsetType] = unset, + status_page: Union[DegradationUpdateDataRelationshipsStatusPage, UnsetType] = unset, + **kwargs, + ): + """ + Relationships of a degradation update resource. + + :param created_by_user: A user relationship of a degradation update. + :type created_by_user: DegradationUpdateDataRelationshipsUser, optional + + :param degradation: The degradation relationship of a degradation update. + :type degradation: DegradationUpdateDataRelationshipsDegradation, optional + + :param deleted_by_user: A user relationship of a degradation update. + :type deleted_by_user: DegradationUpdateDataRelationshipsUser, optional + + :param last_modified_by_user: A user relationship of a degradation update. + :type last_modified_by_user: DegradationUpdateDataRelationshipsUser, optional + + :param status_page: The status page relationship of a degradation update. + :type status_page: DegradationUpdateDataRelationshipsStatusPage, optional + """ + if created_by_user is not unset: + kwargs["created_by_user"] = created_by_user + if degradation is not unset: + kwargs["degradation"] = degradation + if deleted_by_user is not unset: + kwargs["deleted_by_user"] = deleted_by_user + if last_modified_by_user is not unset: + kwargs["last_modified_by_user"] = last_modified_by_user + if status_page is not unset: + kwargs["status_page"] = status_page + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/degradation_update_data_relationships_degradation.py b/src/datadog_api_client/v2/model/degradation_update_data_relationships_degradation.py new file mode 100644 index 0000000000..82f6feb75f --- /dev/null +++ b/src/datadog_api_client/v2/model/degradation_update_data_relationships_degradation.py @@ -0,0 +1,44 @@ +# 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.degradation_update_data_relationships_degradation_data import ( + DegradationUpdateDataRelationshipsDegradationData, + ) + + +class DegradationUpdateDataRelationshipsDegradation(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.degradation_update_data_relationships_degradation_data import ( + DegradationUpdateDataRelationshipsDegradationData, + ) + + return { + "data": (DegradationUpdateDataRelationshipsDegradationData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: DegradationUpdateDataRelationshipsDegradationData, **kwargs): + """ + The degradation relationship of a degradation update. + + :param data: The degradation linked to a degradation update. + :type data: DegradationUpdateDataRelationshipsDegradationData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/degradation_update_data_relationships_degradation_data.py b/src/datadog_api_client/v2/model/degradation_update_data_relationships_degradation_data.py new file mode 100644 index 0000000000..fab30fba6d --- /dev/null +++ b/src/datadog_api_client/v2/model/degradation_update_data_relationships_degradation_data.py @@ -0,0 +1,46 @@ +# 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.patch_degradation_request_data_type import PatchDegradationRequestDataType + + +class DegradationUpdateDataRelationshipsDegradationData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.patch_degradation_request_data_type import PatchDegradationRequestDataType + + return { + "id": (str,), + "type": (PatchDegradationRequestDataType,), + } + + attribute_map = { + "id": "id", + "type": "type", + } + + def __init__(self_, id: str, type: PatchDegradationRequestDataType, **kwargs): + """ + The degradation linked to a degradation update. + + :param id: The ID of the degradation. + :type id: str + + :param type: Degradations resource type. + :type type: PatchDegradationRequestDataType + """ + super().__init__(kwargs) + + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/degradation_update_data_relationships_status_page.py b/src/datadog_api_client/v2/model/degradation_update_data_relationships_status_page.py new file mode 100644 index 0000000000..2d298543b1 --- /dev/null +++ b/src/datadog_api_client/v2/model/degradation_update_data_relationships_status_page.py @@ -0,0 +1,44 @@ +# 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.degradation_update_data_relationships_status_page_data import ( + DegradationUpdateDataRelationshipsStatusPageData, + ) + + +class DegradationUpdateDataRelationshipsStatusPage(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.degradation_update_data_relationships_status_page_data import ( + DegradationUpdateDataRelationshipsStatusPageData, + ) + + return { + "data": (DegradationUpdateDataRelationshipsStatusPageData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: DegradationUpdateDataRelationshipsStatusPageData, **kwargs): + """ + The status page relationship of a degradation update. + + :param data: The status page linked to a degradation update. + :type data: DegradationUpdateDataRelationshipsStatusPageData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/degradation_update_data_relationships_status_page_data.py b/src/datadog_api_client/v2/model/degradation_update_data_relationships_status_page_data.py new file mode 100644 index 0000000000..de6bc4d067 --- /dev/null +++ b/src/datadog_api_client/v2/model/degradation_update_data_relationships_status_page_data.py @@ -0,0 +1,46 @@ +# 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.status_page_data_type import StatusPageDataType + + +class DegradationUpdateDataRelationshipsStatusPageData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.status_page_data_type import StatusPageDataType + + return { + "id": (str,), + "type": (StatusPageDataType,), + } + + attribute_map = { + "id": "id", + "type": "type", + } + + def __init__(self_, id: str, type: StatusPageDataType, **kwargs): + """ + The status page linked to a degradation update. + + :param id: The ID of the status page. + :type id: str + + :param type: Status pages resource type. + :type type: StatusPageDataType + """ + super().__init__(kwargs) + + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/degradation_update_data_relationships_user.py b/src/datadog_api_client/v2/model/degradation_update_data_relationships_user.py new file mode 100644 index 0000000000..e9822bea7e --- /dev/null +++ b/src/datadog_api_client/v2/model/degradation_update_data_relationships_user.py @@ -0,0 +1,44 @@ +# 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.degradation_update_data_relationships_user_data import ( + DegradationUpdateDataRelationshipsUserData, + ) + + +class DegradationUpdateDataRelationshipsUser(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.degradation_update_data_relationships_user_data import ( + DegradationUpdateDataRelationshipsUserData, + ) + + return { + "data": (DegradationUpdateDataRelationshipsUserData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: DegradationUpdateDataRelationshipsUserData, **kwargs): + """ + A user relationship of a degradation update. + + :param data: A Datadog user linked to a degradation update. + :type data: DegradationUpdateDataRelationshipsUserData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/degradation_update_data_relationships_user_data.py b/src/datadog_api_client/v2/model/degradation_update_data_relationships_user_data.py new file mode 100644 index 0000000000..fead48491a --- /dev/null +++ b/src/datadog_api_client/v2/model/degradation_update_data_relationships_user_data.py @@ -0,0 +1,46 @@ +# 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.status_pages_user_type import StatusPagesUserType + + +class DegradationUpdateDataRelationshipsUserData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.status_pages_user_type import StatusPagesUserType + + return { + "id": (str,), + "type": (StatusPagesUserType,), + } + + attribute_map = { + "id": "id", + "type": "type", + } + + def __init__(self_, id: str, type: StatusPagesUserType, **kwargs): + """ + A Datadog user linked to a degradation update. + + :param id: The ID of the user. + :type id: str + + :param type: Users resource type. + :type type: StatusPagesUserType + """ + super().__init__(kwargs) + + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/degradation_update_included.py b/src/datadog_api_client/v2/model/degradation_update_included.py new file mode 100644 index 0000000000..710ef9bf5f --- /dev/null +++ b/src/datadog_api_client/v2/model/degradation_update_included.py @@ -0,0 +1,57 @@ +# 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 ( + ModelComposed, + cached_property, +) + + +class DegradationUpdateIncluded(ModelComposed): + def __init__(self, **kwargs): + """ + Resources included in a degradation update response. + + :param attributes: Attributes of the Datadog user. + :type attributes: StatusPagesUserAttributes, optional + + :param id: The ID of the Datadog user. + :type id: UUID, optional + + :param type: Users resource type. + :type type: StatusPagesUserType + + :param data: The data object for a degradation. + :type data: DegradationData, optional + + :param included: The included related resources of a degradation. Client must explicitly request these resources by name in the `include` query parameter. + :type included: [DegradationIncluded], optional + + :param relationships: The relationships of a status page. + :type relationships: StatusPageAsIncludedRelationships, optional + """ + super().__init__(kwargs) + + @cached_property + def _composed_schemas(_): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + from datadog_api_client.v2.model.status_pages_user import StatusPagesUser + from datadog_api_client.v2.model.degradation import Degradation + from datadog_api_client.v2.model.status_page_as_included import StatusPageAsIncluded + + return { + "oneOf": [ + StatusPagesUser, + Degradation, + StatusPageAsIncluded, + ], + } diff --git a/src/datadog_api_client/v2/model/patch_degradation_update_request.py b/src/datadog_api_client/v2/model/patch_degradation_update_request.py new file mode 100644 index 0000000000..aea1394b8e --- /dev/null +++ b/src/datadog_api_client/v2/model/patch_degradation_update_request.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, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.patch_degradation_update_request_data import PatchDegradationUpdateRequestData + + +class PatchDegradationUpdateRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.patch_degradation_update_request_data import PatchDegradationUpdateRequestData + + return { + "data": (PatchDegradationUpdateRequestData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[PatchDegradationUpdateRequestData, UnsetType] = unset, **kwargs): + """ + Request object for editing a degradation update. + + :param data: The data object for editing a degradation update. + :type data: PatchDegradationUpdateRequestData, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/patch_degradation_update_request_data.py b/src/datadog_api_client/v2/model/patch_degradation_update_request_data.py new file mode 100644 index 0000000000..975f1e7f7c --- /dev/null +++ b/src/datadog_api_client/v2/model/patch_degradation_update_request_data.py @@ -0,0 +1,72 @@ +# 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, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.patch_degradation_update_request_data_attributes import ( + PatchDegradationUpdateRequestDataAttributes, + ) + from datadog_api_client.v2.model.patch_degradation_update_request_data_type import ( + PatchDegradationUpdateRequestDataType, + ) + + +class PatchDegradationUpdateRequestData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.patch_degradation_update_request_data_attributes import ( + PatchDegradationUpdateRequestDataAttributes, + ) + from datadog_api_client.v2.model.patch_degradation_update_request_data_type import ( + PatchDegradationUpdateRequestDataType, + ) + + return { + "attributes": (PatchDegradationUpdateRequestDataAttributes,), + "id": (str,), + "type": (PatchDegradationUpdateRequestDataType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + type: PatchDegradationUpdateRequestDataType, + attributes: Union[PatchDegradationUpdateRequestDataAttributes, UnsetType] = unset, + id: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + The data object for editing a degradation update. + + :param attributes: Attributes for editing a degradation update. + :type attributes: PatchDegradationUpdateRequestDataAttributes, optional + + :param id: The ID of the degradation update to edit. + :type id: str, optional + + :param type: Degradation updates resource type. + :type type: PatchDegradationUpdateRequestDataType + """ + if attributes is not unset: + kwargs["attributes"] = attributes + if id is not unset: + kwargs["id"] = id + super().__init__(kwargs) + + self_.type = type diff --git a/src/datadog_api_client/v2/model/patch_degradation_update_request_data_attributes.py b/src/datadog_api_client/v2/model/patch_degradation_update_request_data_attributes.py new file mode 100644 index 0000000000..f45e655c8b --- /dev/null +++ b/src/datadog_api_client/v2/model/patch_degradation_update_request_data_attributes.py @@ -0,0 +1,58 @@ +# 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, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.patch_degradation_update_request_data_attributes_status import ( + PatchDegradationUpdateRequestDataAttributesStatus, + ) + + +class PatchDegradationUpdateRequestDataAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.patch_degradation_update_request_data_attributes_status import ( + PatchDegradationUpdateRequestDataAttributesStatus, + ) + + return { + "description": (str,), + "status": (PatchDegradationUpdateRequestDataAttributesStatus,), + } + + attribute_map = { + "description": "description", + "status": "status", + } + + def __init__( + self_, + description: Union[str, UnsetType] = unset, + status: Union[PatchDegradationUpdateRequestDataAttributesStatus, UnsetType] = unset, + **kwargs, + ): + """ + Attributes for editing a degradation update. + + :param description: The message body of the update. + :type description: str, optional + + :param status: The status of the degradation update. + :type status: PatchDegradationUpdateRequestDataAttributesStatus, optional + """ + if description is not unset: + kwargs["description"] = description + if status is not unset: + kwargs["status"] = status + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/patch_degradation_update_request_data_attributes_status.py b/src/datadog_api_client/v2/model/patch_degradation_update_request_data_attributes_status.py new file mode 100644 index 0000000000..187d490ea4 --- /dev/null +++ b/src/datadog_api_client/v2/model/patch_degradation_update_request_data_attributes_status.py @@ -0,0 +1,47 @@ +# 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 PatchDegradationUpdateRequestDataAttributesStatus(ModelSimple): + """ + The status of the degradation update. + + :param value: Must be one of ["investigating", "identified", "monitoring"]. + :type value: str + """ + + allowed_values = { + "investigating", + "identified", + "monitoring", + } + INVESTIGATING: ClassVar["PatchDegradationUpdateRequestDataAttributesStatus"] + IDENTIFIED: ClassVar["PatchDegradationUpdateRequestDataAttributesStatus"] + MONITORING: ClassVar["PatchDegradationUpdateRequestDataAttributesStatus"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +PatchDegradationUpdateRequestDataAttributesStatus.INVESTIGATING = PatchDegradationUpdateRequestDataAttributesStatus( + "investigating" +) +PatchDegradationUpdateRequestDataAttributesStatus.IDENTIFIED = PatchDegradationUpdateRequestDataAttributesStatus( + "identified" +) +PatchDegradationUpdateRequestDataAttributesStatus.MONITORING = PatchDegradationUpdateRequestDataAttributesStatus( + "monitoring" +) diff --git a/src/datadog_api_client/v2/model/patch_degradation_update_request_data_type.py b/src/datadog_api_client/v2/model/patch_degradation_update_request_data_type.py new file mode 100644 index 0000000000..ff84452496 --- /dev/null +++ b/src/datadog_api_client/v2/model/patch_degradation_update_request_data_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 PatchDegradationUpdateRequestDataType(ModelSimple): + """ + Degradation updates resource type. + + :param value: If omitted defaults to "degradation_updates". Must be one of ["degradation_updates"]. + :type value: str + """ + + allowed_values = { + "degradation_updates", + } + DEGRADATION_UPDATES: ClassVar["PatchDegradationUpdateRequestDataType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +PatchDegradationUpdateRequestDataType.DEGRADATION_UPDATES = PatchDegradationUpdateRequestDataType("degradation_updates") diff --git a/src/datadog_api_client/v2/model/patch_status_page_request_data_attributes.py b/src/datadog_api_client/v2/model/patch_status_page_request_data_attributes.py index 5a5a8ead6c..d03b83ee97 100644 --- a/src/datadog_api_client/v2/model/patch_status_page_request_data_attributes.py +++ b/src/datadog_api_client/v2/model/patch_status_page_request_data_attributes.py @@ -39,6 +39,8 @@ def openapi_types(_): "enabled": (bool,), "favicon": (str,), "name": (str,), + "slack_app_icon": (str,), + "slack_subscriptions_enabled": (bool,), "subscriptions_enabled": (bool,), "type": (CreateStatusPageRequestDataAttributesType,), "visualization_type": (CreateStatusPageRequestDataAttributesVisualizationType,), @@ -51,6 +53,8 @@ def openapi_types(_): "enabled": "enabled", "favicon": "favicon", "name": "name", + "slack_app_icon": "slack_app_icon", + "slack_subscriptions_enabled": "slack_subscriptions_enabled", "subscriptions_enabled": "subscriptions_enabled", "type": "type", "visualization_type": "visualization_type", @@ -64,6 +68,8 @@ def __init__( enabled: Union[bool, UnsetType] = unset, favicon: Union[str, UnsetType] = unset, name: Union[str, UnsetType] = unset, + slack_app_icon: Union[str, UnsetType] = unset, + slack_subscriptions_enabled: Union[bool, UnsetType] = unset, subscriptions_enabled: Union[bool, UnsetType] = unset, type: Union[CreateStatusPageRequestDataAttributesType, UnsetType] = unset, visualization_type: Union[CreateStatusPageRequestDataAttributesVisualizationType, UnsetType] = unset, @@ -90,6 +96,12 @@ def __init__( :param name: The name of the status page. :type name: str, optional + :param slack_app_icon: The Slack app icon URL for the status page. + :type slack_app_icon: str, optional + + :param slack_subscriptions_enabled: Whether Slack subscriptions are enabled for the status page. + :type slack_subscriptions_enabled: bool, optional + :param subscriptions_enabled: Whether users can subscribe to the status page. :type subscriptions_enabled: bool, optional @@ -111,6 +123,10 @@ def __init__( kwargs["favicon"] = favicon if name is not unset: kwargs["name"] = name + if slack_app_icon is not unset: + kwargs["slack_app_icon"] = slack_app_icon + if slack_subscriptions_enabled is not unset: + kwargs["slack_subscriptions_enabled"] = slack_subscriptions_enabled if subscriptions_enabled is not unset: kwargs["subscriptions_enabled"] = subscriptions_enabled if type is not unset: diff --git a/src/datadog_api_client/v2/model/status_page_as_included_attributes.py b/src/datadog_api_client/v2/model/status_page_as_included_attributes.py index 49aa47d908..29ea560bd0 100644 --- a/src/datadog_api_client/v2/model/status_page_as_included_attributes.py +++ b/src/datadog_api_client/v2/model/status_page_as_included_attributes.py @@ -52,6 +52,8 @@ def openapi_types(_): "modified_at": (datetime,), "name": (str,), "page_url": (str,), + "slack_app_icon": (str,), + "slack_subscriptions_enabled": (bool,), "subscriptions_enabled": (bool,), "type": (CreateStatusPageRequestDataAttributesType,), "visualization_type": (CreateStatusPageRequestDataAttributesVisualizationType,), @@ -70,6 +72,8 @@ def openapi_types(_): "modified_at": "modified_at", "name": "name", "page_url": "page_url", + "slack_app_icon": "slack_app_icon", + "slack_subscriptions_enabled": "slack_subscriptions_enabled", "subscriptions_enabled": "subscriptions_enabled", "type": "type", "visualization_type": "visualization_type", @@ -89,6 +93,8 @@ def __init__( modified_at: Union[datetime, UnsetType] = unset, name: Union[str, UnsetType] = unset, page_url: Union[str, UnsetType] = unset, + slack_app_icon: Union[str, UnsetType] = unset, + slack_subscriptions_enabled: Union[bool, UnsetType] = unset, subscriptions_enabled: Union[bool, UnsetType] = unset, type: Union[CreateStatusPageRequestDataAttributesType, UnsetType] = unset, visualization_type: Union[CreateStatusPageRequestDataAttributesVisualizationType, UnsetType] = unset, @@ -133,6 +139,12 @@ def __init__( :param page_url: The url that the status page is accessible at. :type page_url: str, optional + :param slack_app_icon: The Slack app icon URL for the status page. + :type slack_app_icon: str, optional + + :param slack_subscriptions_enabled: Whether Slack subscriptions are enabled for the status page. + :type slack_subscriptions_enabled: bool, optional + :param subscriptions_enabled: Whether users can subscribe to the status page. :type subscriptions_enabled: bool, optional @@ -166,6 +178,10 @@ def __init__( kwargs["name"] = name if page_url is not unset: kwargs["page_url"] = page_url + if slack_app_icon is not unset: + kwargs["slack_app_icon"] = slack_app_icon + if slack_subscriptions_enabled is not unset: + kwargs["slack_subscriptions_enabled"] = slack_subscriptions_enabled if subscriptions_enabled is not unset: kwargs["subscriptions_enabled"] = subscriptions_enabled if type is not unset: diff --git a/src/datadog_api_client/v2/model/status_page_data_attributes.py b/src/datadog_api_client/v2/model/status_page_data_attributes.py index e9c32912e6..b2a4503435 100644 --- a/src/datadog_api_client/v2/model/status_page_data_attributes.py +++ b/src/datadog_api_client/v2/model/status_page_data_attributes.py @@ -53,6 +53,8 @@ def openapi_types(_): "modified_at": (datetime,), "name": (str,), "page_url": (str,), + "slack_app_icon": (str,), + "slack_subscriptions_enabled": (bool,), "subscriptions_enabled": (bool,), "type": (CreateStatusPageRequestDataAttributesType,), "visualization_type": (CreateStatusPageRequestDataAttributesVisualizationType,), @@ -71,6 +73,8 @@ def openapi_types(_): "modified_at": "modified_at", "name": "name", "page_url": "page_url", + "slack_app_icon": "slack_app_icon", + "slack_subscriptions_enabled": "slack_subscriptions_enabled", "subscriptions_enabled": "subscriptions_enabled", "type": "type", "visualization_type": "visualization_type", @@ -90,6 +94,8 @@ def __init__( modified_at: Union[datetime, UnsetType] = unset, name: Union[str, UnsetType] = unset, page_url: Union[str, UnsetType] = unset, + slack_app_icon: Union[str, UnsetType] = unset, + slack_subscriptions_enabled: Union[bool, UnsetType] = unset, subscriptions_enabled: Union[bool, UnsetType] = unset, type: Union[CreateStatusPageRequestDataAttributesType, UnsetType] = unset, visualization_type: Union[CreateStatusPageRequestDataAttributesVisualizationType, UnsetType] = unset, @@ -134,6 +140,12 @@ def __init__( :param page_url: The url that the status page is accessible at. :type page_url: str, optional + :param slack_app_icon: The Slack app icon URL for the status page. + :type slack_app_icon: str, optional + + :param slack_subscriptions_enabled: Whether Slack subscriptions are enabled for the status page. + :type slack_subscriptions_enabled: bool, optional + :param subscriptions_enabled: Whether users can subscribe to the status page. :type subscriptions_enabled: bool, optional @@ -167,6 +179,10 @@ def __init__( kwargs["name"] = name if page_url is not unset: kwargs["page_url"] = page_url + if slack_app_icon is not unset: + kwargs["slack_app_icon"] = slack_app_icon + if slack_subscriptions_enabled is not unset: + kwargs["slack_subscriptions_enabled"] = slack_subscriptions_enabled if subscriptions_enabled is not unset: kwargs["subscriptions_enabled"] = subscriptions_enabled if type is not unset: diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 7f93761202..9413425cce 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -2198,6 +2198,32 @@ DegradationDataRelationshipsStatusPageData, ) from datadog_api_client.v2.model.degradation_included import DegradationIncluded +from datadog_api_client.v2.model.degradation_update import DegradationUpdate +from datadog_api_client.v2.model.degradation_update_data import DegradationUpdateData +from datadog_api_client.v2.model.degradation_update_data_attributes import DegradationUpdateDataAttributes +from datadog_api_client.v2.model.degradation_update_data_attributes_components_affected_items import ( + DegradationUpdateDataAttributesComponentsAffectedItems, +) +from datadog_api_client.v2.model.degradation_update_data_relationships import DegradationUpdateDataRelationships +from datadog_api_client.v2.model.degradation_update_data_relationships_degradation import ( + DegradationUpdateDataRelationshipsDegradation, +) +from datadog_api_client.v2.model.degradation_update_data_relationships_degradation_data import ( + DegradationUpdateDataRelationshipsDegradationData, +) +from datadog_api_client.v2.model.degradation_update_data_relationships_status_page import ( + DegradationUpdateDataRelationshipsStatusPage, +) +from datadog_api_client.v2.model.degradation_update_data_relationships_status_page_data import ( + DegradationUpdateDataRelationshipsStatusPageData, +) +from datadog_api_client.v2.model.degradation_update_data_relationships_user import ( + DegradationUpdateDataRelationshipsUser, +) +from datadog_api_client.v2.model.degradation_update_data_relationships_user_data import ( + DegradationUpdateDataRelationshipsUserData, +) +from datadog_api_client.v2.model.degradation_update_included import DegradationUpdateIncluded from datadog_api_client.v2.model.delete_app_response import DeleteAppResponse from datadog_api_client.v2.model.delete_app_response_data import DeleteAppResponseData from datadog_api_client.v2.model.delete_apps_datastore_item_request import DeleteAppsDatastoreItemRequest @@ -6043,6 +6069,15 @@ PatchDegradationRequestDataAttributesStatus, ) from datadog_api_client.v2.model.patch_degradation_request_data_type import PatchDegradationRequestDataType +from datadog_api_client.v2.model.patch_degradation_update_request import PatchDegradationUpdateRequest +from datadog_api_client.v2.model.patch_degradation_update_request_data import PatchDegradationUpdateRequestData +from datadog_api_client.v2.model.patch_degradation_update_request_data_attributes import ( + PatchDegradationUpdateRequestDataAttributes, +) +from datadog_api_client.v2.model.patch_degradation_update_request_data_attributes_status import ( + PatchDegradationUpdateRequestDataAttributesStatus, +) +from datadog_api_client.v2.model.patch_degradation_update_request_data_type import PatchDegradationUpdateRequestDataType from datadog_api_client.v2.model.patch_incident_notification_template_request import ( PatchIncidentNotificationTemplateRequest, ) @@ -11019,6 +11054,18 @@ "DegradationDataRelationshipsStatusPage", "DegradationDataRelationshipsStatusPageData", "DegradationIncluded", + "DegradationUpdate", + "DegradationUpdateData", + "DegradationUpdateDataAttributes", + "DegradationUpdateDataAttributesComponentsAffectedItems", + "DegradationUpdateDataRelationships", + "DegradationUpdateDataRelationshipsDegradation", + "DegradationUpdateDataRelationshipsDegradationData", + "DegradationUpdateDataRelationshipsStatusPage", + "DegradationUpdateDataRelationshipsStatusPageData", + "DegradationUpdateDataRelationshipsUser", + "DegradationUpdateDataRelationshipsUserData", + "DegradationUpdateIncluded", "DeleteAppResponse", "DeleteAppResponseData", "DeleteAppsDatastoreItemRequest", @@ -13682,6 +13729,11 @@ "PatchDegradationRequestDataAttributesComponentsAffectedItems", "PatchDegradationRequestDataAttributesStatus", "PatchDegradationRequestDataType", + "PatchDegradationUpdateRequest", + "PatchDegradationUpdateRequestData", + "PatchDegradationUpdateRequestDataAttributes", + "PatchDegradationUpdateRequestDataAttributesStatus", + "PatchDegradationUpdateRequestDataType", "PatchIncidentNotificationTemplateRequest", "PatchMaintenanceRequest", "PatchMaintenanceRequestData", diff --git a/tests/v2/features/status_pages.feature b/tests/v2/features/status_pages.feature index 4e671f186d..99cb8e3ed6 100644 --- a/tests/v2/features/status_pages.feature +++ b/tests/v2/features/status_pages.feature @@ -94,6 +94,16 @@ Feature: Status Pages When the request is sent Then the response status is 204 No Content + @generated @skip @team:DataDog/incident-app + Scenario: Edit degradation update returns "OK" response + Given new "EditDegradationUpdate" request + And request contains "degradation_id" parameter from "REPLACE.ME" + And request contains "page_id" parameter from "REPLACE.ME" + And request contains "update_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "We've identified the source of the latency increase and are deploying a fix.", "status": "identified"}, "id": "00000000-0000-0000-0000-000000000000", "type": "degradation_updates"}} + When the request is sent + Then the response status is 200 OK + @team:DataDog/incident-app Scenario: Get component returns "OK" response Given new "GetComponent" request @@ -178,6 +188,15 @@ Feature: Status Pages When the request is sent Then the response status is 201 Created + @generated @skip @team:DataDog/incident-app + Scenario: Soft delete degradation update returns "No Content" response + Given new "SoftDeleteDegradationUpdate" request + And request contains "degradation_id" parameter from "REPLACE.ME" + And request contains "page_id" parameter from "REPLACE.ME" + And request contains "update_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + @generated @skip @team:DataDog/incident-app Scenario: Unpublish status page returns "No Content" response Given new "UnpublishStatusPage" request diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index 89626bc569..a5c43f6c0f 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -8521,6 +8521,18 @@ "type": "idempotent" } }, + "SoftDeleteDegradationUpdate": { + "tag": "Status Pages", + "undo": { + "type": "idempotent" + } + }, + "EditDegradationUpdate": { + "tag": "Status Pages", + "undo": { + "type": "idempotent" + } + }, "CreateMaintenance": { "tag": "Status Pages", "undo": {