diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index de9b3ca4f4..b8747eb334 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -26666,6 +26666,82 @@ components: required: - type type: object + GlobalIncidentSettingsAttributesRequest: + description: Global incident settings attributes + properties: + analytics_dashboard_id: + description: The analytics dashboard ID + example: abc-123-def + type: string + type: object + GlobalIncidentSettingsAttributesResponse: + description: Global incident settings attributes + properties: + analytics_dashboard_id: + description: The analytics dashboard ID + example: abc-123-def + type: string + created: + description: Timestamp when the settings were created + example: '2026-01-13T17:15:56.557278191Z' + format: date-time + type: string + modified: + description: Timestamp when the settings were last modified + example: '2026-01-13T17:15:56.557278191Z' + format: date-time + type: string + required: + - created + - modified + - analytics_dashboard_id + type: object + GlobalIncidentSettingsDataRequest: + properties: + attributes: + $ref: '#/components/schemas/GlobalIncidentSettingsAttributesRequest' + type: + $ref: '#/components/schemas/GlobalIncidentSettingsType' + required: + - type + type: object + GlobalIncidentSettingsDataResponse: + properties: + attributes: + $ref: '#/components/schemas/GlobalIncidentSettingsAttributesResponse' + id: + description: The unique identifier for the global incident settings + example: f8b9a915-ed85-48b4-9071-ceba567a3db5 + type: string + type: + $ref: '#/components/schemas/GlobalIncidentSettingsType' + required: + - id + - type + - attributes + type: object + GlobalIncidentSettingsRequest: + properties: + data: + $ref: '#/components/schemas/GlobalIncidentSettingsDataRequest' + required: + - data + type: object + GlobalIncidentSettingsResponse: + properties: + data: + $ref: '#/components/schemas/GlobalIncidentSettingsDataResponse' + required: + - data + type: object + GlobalIncidentSettingsType: + description: Global incident settings resource type + enum: + - incidents_global_settings + example: incidents_global_settings + type: string + x-enum-varnames: + - INCIDENTS_GLOBAL_SETTINGS GlobalVariableData: description: Synthetics global variable data. Wrapper around the global variable object. @@ -27694,6 +27770,184 @@ components: - TEXTARRAY - METRICTAG - AUTOCOMPLETE + IncidentHandleAttributesFields: + description: Dynamic fields associated with the handle + example: + severity: + - SEV-1 + properties: + severity: + description: Severity levels associated with the handle + items: + $ref: '#/components/schemas/IncidentHandleAttributesFieldsSeverity' + type: array + type: object + IncidentHandleAttributesFieldsSeverity: + example: SEV-1 + type: string + IncidentHandleAttributesRequest: + description: Incident handle attributes for requests + properties: + fields: + $ref: '#/components/schemas/IncidentHandleAttributesFields' + name: + description: The handle name + example: '@incident-sev-1' + type: string + required: + - name + type: object + IncidentHandleAttributesResponse: + description: Incident handle attributes for responses + properties: + created_at: + description: Timestamp when the handle was created + example: '2026-01-13T17:15:52.726905Z' + format: date-time + type: string + fields: + $ref: '#/components/schemas/IncidentHandleAttributesFields' + modified_at: + description: Timestamp when the handle was last modified + example: '2026-01-13T17:15:52.726905Z' + format: date-time + type: string + name: + description: The handle name + example: '@incident-sev-1' + type: string + required: + - name + - fields + - created_at + - modified_at + type: object + IncidentHandleDataRequest: + properties: + attributes: + $ref: '#/components/schemas/IncidentHandleAttributesRequest' + id: + description: The ID of the incident handle (required for PUT requests) + example: b2494081-cdf0-4205-b366-4e1dd4fdf0bf + type: string + relationships: + $ref: '#/components/schemas/IncidentHandleRelationshipsRequest' + type: + $ref: '#/components/schemas/IncidentHandleType' + required: + - type + - attributes + type: object + IncidentHandleDataResponse: + properties: + attributes: + $ref: '#/components/schemas/IncidentHandleAttributesResponse' + id: + description: The ID of the incident handle + example: 12ceee6d-a7c0-4407-bc54-30e54140d7f0 + type: string + relationships: + $ref: '#/components/schemas/IncidentHandleRelationships' + type: + $ref: '#/components/schemas/IncidentHandleType' + required: + - id + - type + - attributes + type: object + IncidentHandleIncludedItemResponse: + oneOf: + - $ref: '#/components/schemas/IncidentUserData' + - $ref: '#/components/schemas/IncidentTypeObject' + IncidentHandleIncludedResponse: + description: Included related resources + items: + $ref: '#/components/schemas/IncidentHandleIncludedItemResponse' + type: array + IncidentHandleRelationship: + properties: + data: + $ref: '#/components/schemas/IncidentHandleRelationshipData' + required: + - data + type: object + IncidentHandleRelationshipData: + properties: + id: + description: The ID of the related resource + example: f7b538b1-ed7c-4e84-82de-fdf84a539d40 + type: string + type: + description: The type of the related resource + example: incident_types + type: string + required: + - id + - type + type: object + IncidentHandleRelationships: + nullable: true + properties: + commander_user: + $ref: '#/components/schemas/IncidentHandleRelationship' + created_by_user: + $ref: '#/components/schemas/IncidentHandleRelationship' + incident_type: + $ref: '#/components/schemas/IncidentHandleRelationship' + last_modified_by_user: + $ref: '#/components/schemas/IncidentHandleRelationship' + required: + - incident_type + - created_by_user + - last_modified_by_user + type: object + IncidentHandleRelationshipsRequest: + nullable: true + properties: + commander_user: + $ref: '#/components/schemas/IncidentHandleRelationship' + incident_type: + $ref: '#/components/schemas/IncidentHandleRelationship' + required: + - incident_type + type: object + IncidentHandleRequest: + properties: + data: + $ref: '#/components/schemas/IncidentHandleDataRequest' + required: + - data + type: object + IncidentHandleResponse: + properties: + data: + $ref: '#/components/schemas/IncidentHandleDataResponse' + included: + $ref: '#/components/schemas/IncidentHandleIncludedResponse' + required: + - data + type: object + IncidentHandleType: + description: Incident handle resource type + enum: + - incidents_handles + example: incidents_handles + type: string + x-enum-varnames: + - INCIDENTS_HANDLES + IncidentHandlesResponse: + properties: + data: + $ref: '#/components/schemas/IncidentHandlesResponseData' + included: + $ref: '#/components/schemas/IncidentHandleIncludedResponse' + required: + - data + type: object + IncidentHandlesResponseData: + items: + $ref: '#/components/schemas/IncidentHandleDataResponse' + type: array IncidentImpactAttributes: description: The incident impact's attributes. properties: @@ -74583,6 +74837,190 @@ paths: - incident_write x-unstable: '**Note**: This endpoint is in public beta. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/incidents/config/global/incident-handles: + delete: + description: Delete a global incident handle. + operationId: DeleteGlobalIncidentHandle + responses: + '204': + description: No Content + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Delete global incident handle + tags: + - Incidents + x-unstable: '**Note**: This endpoint is in public beta and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + get: + description: Retrieve a list of global incident handles. + operationId: ListGlobalIncidentHandles + parameters: + - description: Comma-separated list of related resources to include in the response + in: query + name: include + required: false + schema: + example: created_by_user,last_modified_by_user,commander_user,incident_type + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/IncidentHandlesResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: List global incident handles + tags: + - Incidents + x-unstable: '**Note**: This endpoint is in public beta and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + post: + description: Create a new global incident handle. + operationId: CreateGlobalIncidentHandle + parameters: + - description: Comma-separated list of related resources to include in the response + in: query + name: include + required: false + schema: + example: created_by_user,last_modified_by_user,commander_user,incident_type + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/IncidentHandleRequest' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/IncidentHandleResponse' + description: Created + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Create global incident handle + tags: + - Incidents + x-unstable: '**Note**: This endpoint is in public beta and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + put: + description: Update an existing global incident handle. + operationId: UpdateGlobalIncidentHandle + parameters: + - description: Comma-separated list of related resources to include in the response + in: query + name: include + required: false + schema: + example: created_by_user,last_modified_by_user,commander_user,incident_type + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/IncidentHandleRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/IncidentHandleResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Update global incident handle + tags: + - Incidents + x-unstable: '**Note**: This endpoint is in public beta and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/incidents/config/global/settings: + get: + description: Retrieve global incident settings for the organization. + operationId: GetGlobalIncidentSettings + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/GlobalIncidentSettingsResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Get global incident settings + tags: + - Incidents + x-unstable: '**Note**: This endpoint is in public beta and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + patch: + description: Update global incident settings for the organization. + operationId: UpdateGlobalIncidentSettings + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GlobalIncidentSettingsRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/GlobalIncidentSettingsResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Update global incident settings + tags: + - Incidents + x-unstable: '**Note**: This endpoint is in public beta and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/incidents/config/notification-rules: get: diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index aaf9797538..4a28a990d9 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -11211,6 +11211,55 @@ datadog\_api\_client.v2.model.gitlab\_integration\_update module :members: :show-inheritance: +datadog\_api\_client.v2.model.global\_incident\_settings\_attributes\_request module +------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.global_incident_settings_attributes_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.global\_incident\_settings\_attributes\_response module +------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.global_incident_settings_attributes_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.global\_incident\_settings\_data\_request module +------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.global_incident_settings_data_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.global\_incident\_settings\_data\_response module +------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.global_incident_settings_data_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.global\_incident\_settings\_request module +------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.global_incident_settings_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.global\_incident\_settings\_response module +------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.global_incident_settings_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.global\_incident\_settings\_type module +--------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.global_incident_settings_type + :members: + :show-inheritance: + datadog\_api\_client.v2.model.global\_variable\_data module ----------------------------------------------------------- @@ -11680,6 +11729,104 @@ datadog\_api\_client.v2.model.incident\_field\_attributes\_value\_type module :members: :show-inheritance: +datadog\_api\_client.v2.model.incident\_handle\_attributes\_fields module +------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.incident_handle_attributes_fields + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.incident\_handle\_attributes\_request module +-------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.incident_handle_attributes_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.incident\_handle\_attributes\_response module +--------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.incident_handle_attributes_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.incident\_handle\_data\_request module +-------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.incident_handle_data_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.incident\_handle\_data\_response module +--------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.incident_handle_data_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.incident\_handle\_included\_item\_response module +------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.incident_handle_included_item_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.incident\_handle\_relationship module +------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.incident_handle_relationship + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.incident\_handle\_relationship\_data module +------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.incident_handle_relationship_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.incident\_handle\_relationships module +-------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.incident_handle_relationships + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.incident\_handle\_relationships\_request module +----------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.incident_handle_relationships_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.incident\_handle\_request module +-------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.incident_handle_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.incident\_handle\_response module +--------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.incident_handle_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.incident\_handle\_type module +----------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.incident_handle_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.incident\_handles\_response module +---------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.incident_handles_response + :members: + :show-inheritance: + datadog\_api\_client.v2.model.incident\_impact\_attributes module ----------------------------------------------------------------- diff --git a/examples/v2/incidents/CreateGlobalIncidentHandle.py b/examples/v2/incidents/CreateGlobalIncidentHandle.py new file mode 100644 index 0000000000..fa2ac245c1 --- /dev/null +++ b/examples/v2/incidents/CreateGlobalIncidentHandle.py @@ -0,0 +1,51 @@ +""" +Create global incident handle returns "Created" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.incidents_api import IncidentsApi +from datadog_api_client.v2.model.incident_handle_attributes_fields import IncidentHandleAttributesFields +from datadog_api_client.v2.model.incident_handle_attributes_request import IncidentHandleAttributesRequest +from datadog_api_client.v2.model.incident_handle_data_request import IncidentHandleDataRequest +from datadog_api_client.v2.model.incident_handle_relationship import IncidentHandleRelationship +from datadog_api_client.v2.model.incident_handle_relationship_data import IncidentHandleRelationshipData +from datadog_api_client.v2.model.incident_handle_relationships_request import IncidentHandleRelationshipsRequest +from datadog_api_client.v2.model.incident_handle_request import IncidentHandleRequest +from datadog_api_client.v2.model.incident_handle_type import IncidentHandleType + +body = IncidentHandleRequest( + data=IncidentHandleDataRequest( + attributes=IncidentHandleAttributesRequest( + fields=IncidentHandleAttributesFields( + severity=[ + "SEV-1", + ], + ), + name="@incident-sev-1", + ), + id="b2494081-cdf0-4205-b366-4e1dd4fdf0bf", + relationships=IncidentHandleRelationshipsRequest( + commander_user=IncidentHandleRelationship( + data=IncidentHandleRelationshipData( + id="f7b538b1-ed7c-4e84-82de-fdf84a539d40", + type="incident_types", + ), + ), + incident_type=IncidentHandleRelationship( + data=IncidentHandleRelationshipData( + id="f7b538b1-ed7c-4e84-82de-fdf84a539d40", + type="incident_types", + ), + ), + ), + type=IncidentHandleType.INCIDENTS_HANDLES, + ), +) + +configuration = Configuration() +configuration.unstable_operations["create_global_incident_handle"] = True +with ApiClient(configuration) as api_client: + api_instance = IncidentsApi(api_client) + response = api_instance.create_global_incident_handle(body=body) + + print(response) diff --git a/examples/v2/incidents/DeleteGlobalIncidentHandle.py b/examples/v2/incidents/DeleteGlobalIncidentHandle.py new file mode 100644 index 0000000000..20eb364f16 --- /dev/null +++ b/examples/v2/incidents/DeleteGlobalIncidentHandle.py @@ -0,0 +1,12 @@ +""" +Delete global incident handle returns "No Content" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.incidents_api import IncidentsApi + +configuration = Configuration() +configuration.unstable_operations["delete_global_incident_handle"] = True +with ApiClient(configuration) as api_client: + api_instance = IncidentsApi(api_client) + api_instance.delete_global_incident_handle() diff --git a/examples/v2/incidents/GetGlobalIncidentSettings.py b/examples/v2/incidents/GetGlobalIncidentSettings.py new file mode 100644 index 0000000000..3e5c1a1786 --- /dev/null +++ b/examples/v2/incidents/GetGlobalIncidentSettings.py @@ -0,0 +1,14 @@ +""" +Get global incident settings returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.incidents_api import IncidentsApi + +configuration = Configuration() +configuration.unstable_operations["get_global_incident_settings"] = True +with ApiClient(configuration) as api_client: + api_instance = IncidentsApi(api_client) + response = api_instance.get_global_incident_settings() + + print(response) diff --git a/examples/v2/incidents/ListGlobalIncidentHandles.py b/examples/v2/incidents/ListGlobalIncidentHandles.py new file mode 100644 index 0000000000..35950e2818 --- /dev/null +++ b/examples/v2/incidents/ListGlobalIncidentHandles.py @@ -0,0 +1,14 @@ +""" +List global incident handles returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.incidents_api import IncidentsApi + +configuration = Configuration() +configuration.unstable_operations["list_global_incident_handles"] = True +with ApiClient(configuration) as api_client: + api_instance = IncidentsApi(api_client) + response = api_instance.list_global_incident_handles() + + print(response) diff --git a/examples/v2/incidents/UpdateGlobalIncidentHandle.py b/examples/v2/incidents/UpdateGlobalIncidentHandle.py new file mode 100644 index 0000000000..f57e684ae5 --- /dev/null +++ b/examples/v2/incidents/UpdateGlobalIncidentHandle.py @@ -0,0 +1,51 @@ +""" +Update global incident handle returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.incidents_api import IncidentsApi +from datadog_api_client.v2.model.incident_handle_attributes_fields import IncidentHandleAttributesFields +from datadog_api_client.v2.model.incident_handle_attributes_request import IncidentHandleAttributesRequest +from datadog_api_client.v2.model.incident_handle_data_request import IncidentHandleDataRequest +from datadog_api_client.v2.model.incident_handle_relationship import IncidentHandleRelationship +from datadog_api_client.v2.model.incident_handle_relationship_data import IncidentHandleRelationshipData +from datadog_api_client.v2.model.incident_handle_relationships_request import IncidentHandleRelationshipsRequest +from datadog_api_client.v2.model.incident_handle_request import IncidentHandleRequest +from datadog_api_client.v2.model.incident_handle_type import IncidentHandleType + +body = IncidentHandleRequest( + data=IncidentHandleDataRequest( + attributes=IncidentHandleAttributesRequest( + fields=IncidentHandleAttributesFields( + severity=[ + "SEV-1", + ], + ), + name="@incident-sev-1", + ), + id="b2494081-cdf0-4205-b366-4e1dd4fdf0bf", + relationships=IncidentHandleRelationshipsRequest( + commander_user=IncidentHandleRelationship( + data=IncidentHandleRelationshipData( + id="f7b538b1-ed7c-4e84-82de-fdf84a539d40", + type="incident_types", + ), + ), + incident_type=IncidentHandleRelationship( + data=IncidentHandleRelationshipData( + id="f7b538b1-ed7c-4e84-82de-fdf84a539d40", + type="incident_types", + ), + ), + ), + type=IncidentHandleType.INCIDENTS_HANDLES, + ), +) + +configuration = Configuration() +configuration.unstable_operations["update_global_incident_handle"] = True +with ApiClient(configuration) as api_client: + api_instance = IncidentsApi(api_client) + response = api_instance.update_global_incident_handle(body=body) + + print(response) diff --git a/examples/v2/incidents/UpdateGlobalIncidentSettings.py b/examples/v2/incidents/UpdateGlobalIncidentSettings.py new file mode 100644 index 0000000000..1df79d05f4 --- /dev/null +++ b/examples/v2/incidents/UpdateGlobalIncidentSettings.py @@ -0,0 +1,29 @@ +""" +Update global incident settings returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.incidents_api import IncidentsApi +from datadog_api_client.v2.model.global_incident_settings_attributes_request import ( + GlobalIncidentSettingsAttributesRequest, +) +from datadog_api_client.v2.model.global_incident_settings_data_request import GlobalIncidentSettingsDataRequest +from datadog_api_client.v2.model.global_incident_settings_request import GlobalIncidentSettingsRequest +from datadog_api_client.v2.model.global_incident_settings_type import GlobalIncidentSettingsType + +body = GlobalIncidentSettingsRequest( + data=GlobalIncidentSettingsDataRequest( + attributes=GlobalIncidentSettingsAttributesRequest( + analytics_dashboard_id="abc-123-def", + ), + type=GlobalIncidentSettingsType.INCIDENTS_GLOBAL_SETTINGS, + ), +) + +configuration = Configuration() +configuration.unstable_operations["update_global_incident_settings"] = True +with ApiClient(configuration) as api_client: + api_instance = IncidentsApi(api_client) + response = api_instance.update_global_incident_settings(body=body) + + print(response) diff --git a/src/datadog_api_client/configuration.py b/src/datadog_api_client/configuration.py index 9e2b3859d4..6309158fac 100644 --- a/src/datadog_api_client/configuration.py +++ b/src/datadog_api_client/configuration.py @@ -304,6 +304,7 @@ def __init__( "v2.update_deployment_rule": False, "v2.create_hamr_org_connection": False, "v2.get_hamr_org_connection": False, + "v2.create_global_incident_handle": False, "v2.create_incident": False, "v2.create_incident_attachment": False, "v2.create_incident_integration": False, @@ -312,6 +313,7 @@ def __init__( "v2.create_incident_postmortem_attachment": False, "v2.create_incident_todo": False, "v2.create_incident_type": False, + "v2.delete_global_incident_handle": False, "v2.delete_incident": False, "v2.delete_incident_attachment": False, "v2.delete_incident_integration": False, @@ -319,12 +321,14 @@ def __init__( "v2.delete_incident_notification_template": False, "v2.delete_incident_todo": False, "v2.delete_incident_type": False, + "v2.get_global_incident_settings": False, "v2.get_incident": False, "v2.get_incident_integration": False, "v2.get_incident_notification_rule": False, "v2.get_incident_notification_template": False, "v2.get_incident_todo": False, "v2.get_incident_type": False, + "v2.list_global_incident_handles": False, "v2.list_incident_attachments": False, "v2.list_incident_integrations": False, "v2.list_incident_notification_rules": False, @@ -333,6 +337,8 @@ def __init__( "v2.list_incident_todos": False, "v2.list_incident_types": False, "v2.search_incidents": False, + "v2.update_global_incident_handle": False, + "v2.update_global_incident_settings": False, "v2.update_incident": False, "v2.update_incident_attachment": False, "v2.update_incident_integration": False, diff --git a/src/datadog_api_client/v2/api/incidents_api.py b/src/datadog_api_client/v2/api/incidents_api.py index 144ace090e..fc3297f913 100644 --- a/src/datadog_api_client/v2/api/incidents_api.py +++ b/src/datadog_api_client/v2/api/incidents_api.py @@ -20,6 +20,11 @@ from datadog_api_client.v2.model.incident_response_data import IncidentResponseData from datadog_api_client.v2.model.incident_response import IncidentResponse from datadog_api_client.v2.model.incident_create_request import IncidentCreateRequest +from datadog_api_client.v2.model.incident_handles_response import IncidentHandlesResponse +from datadog_api_client.v2.model.incident_handle_response import IncidentHandleResponse +from datadog_api_client.v2.model.incident_handle_request import IncidentHandleRequest +from datadog_api_client.v2.model.global_incident_settings_response import GlobalIncidentSettingsResponse +from datadog_api_client.v2.model.global_incident_settings_request import GlobalIncidentSettingsRequest from datadog_api_client.v2.model.incident_notification_rule_array import IncidentNotificationRuleArray from datadog_api_client.v2.model.incident_notification_rule import IncidentNotificationRule from datadog_api_client.v2.model.create_incident_notification_rule_request import CreateIncidentNotificationRuleRequest @@ -75,6 +80,31 @@ def __init__(self, api_client=None): api_client = ApiClient(Configuration()) self.api_client = api_client + self._create_global_incident_handle_endpoint = _Endpoint( + settings={ + "response_type": (IncidentHandleResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/incidents/config/global/incident-handles", + "operation_id": "create_global_incident_handle", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "include": { + "openapi_types": (str,), + "attribute": "include", + "location": "query", + }, + "body": { + "required": True, + "openapi_types": (IncidentHandleRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + self._create_incident_endpoint = _Endpoint( settings={ "response_type": (IncidentResponse,), @@ -296,6 +326,22 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._delete_global_incident_handle_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/incidents/config/global/incident-handles", + "operation_id": "delete_global_incident_handle", + "http_method": "DELETE", + "version": "v2", + }, + params_map={}, + headers_map={ + "accept": ["*/*"], + }, + api_client=api_client, + ) + self._delete_incident_endpoint = _Endpoint( settings={ "response_type": None, @@ -514,6 +560,22 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._get_global_incident_settings_endpoint = _Endpoint( + settings={ + "response_type": (GlobalIncidentSettingsResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/incidents/config/global/settings", + "operation_id": "get_global_incident_settings", + "http_method": "GET", + "version": "v2", + }, + params_map={}, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + self._get_incident_endpoint = _Endpoint( settings={ "response_type": (IncidentResponse,), @@ -680,6 +742,28 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._list_global_incident_handles_endpoint = _Endpoint( + settings={ + "response_type": (IncidentHandlesResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/incidents/config/global/incident-handles", + "operation_id": "list_global_incident_handles", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "include": { + "openapi_types": (str,), + "attribute": "include", + "location": "query", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + self._list_incident_attachments_endpoint = _Endpoint( settings={ "response_type": (AttachmentArray,), @@ -935,6 +1019,51 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._update_global_incident_handle_endpoint = _Endpoint( + settings={ + "response_type": (IncidentHandleResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/incidents/config/global/incident-handles", + "operation_id": "update_global_incident_handle", + "http_method": "PUT", + "version": "v2", + }, + params_map={ + "include": { + "openapi_types": (str,), + "attribute": "include", + "location": "query", + }, + "body": { + "required": True, + "openapi_types": (IncidentHandleRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._update_global_incident_settings_endpoint = _Endpoint( + settings={ + "response_type": (GlobalIncidentSettingsResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/incidents/config/global/settings", + "operation_id": "update_global_incident_settings", + "http_method": "PATCH", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (GlobalIncidentSettingsRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + self._update_incident_endpoint = _Endpoint( settings={ "response_type": (IncidentResponse,), @@ -1156,6 +1285,29 @@ def __init__(self, api_client=None): api_client=api_client, ) + def create_global_incident_handle( + self, + body: IncidentHandleRequest, + *, + include: Union[str, UnsetType] = unset, + ) -> IncidentHandleResponse: + """Create global incident handle. + + Create a new global incident handle. + + :type body: IncidentHandleRequest + :param include: Comma-separated list of related resources to include in the response + :type include: str, optional + :rtype: IncidentHandleResponse + """ + kwargs: Dict[str, Any] = {} + if include is not unset: + kwargs["include"] = include + + kwargs["body"] = body + + return self._create_global_incident_handle_endpoint.call_with_http_info(**kwargs) + def create_incident( self, body: IncidentCreateRequest, @@ -1344,6 +1496,18 @@ def create_incident_type( return self._create_incident_type_endpoint.call_with_http_info(**kwargs) + def delete_global_incident_handle( + self, + ) -> None: + """Delete global incident handle. + + Delete a global incident handle. + + :rtype: None + """ + kwargs: Dict[str, Any] = {} + return self._delete_global_incident_handle_endpoint.call_with_http_info(**kwargs) + def delete_incident( self, incident_id: str, @@ -1512,6 +1676,18 @@ def delete_incident_type( return self._delete_incident_type_endpoint.call_with_http_info(**kwargs) + def get_global_incident_settings( + self, + ) -> GlobalIncidentSettingsResponse: + """Get global incident settings. + + Retrieve global incident settings for the organization. + + :rtype: GlobalIncidentSettingsResponse + """ + kwargs: Dict[str, Any] = {} + return self._get_global_incident_settings_endpoint.call_with_http_info(**kwargs) + def get_incident( self, incident_id: str, @@ -1645,6 +1821,25 @@ def get_incident_type( return self._get_incident_type_endpoint.call_with_http_info(**kwargs) + def list_global_incident_handles( + self, + *, + include: Union[str, UnsetType] = unset, + ) -> IncidentHandlesResponse: + """List global incident handles. + + Retrieve a list of global incident handles. + + :param include: Comma-separated list of related resources to include in the response + :type include: str, optional + :rtype: IncidentHandlesResponse + """ + kwargs: Dict[str, Any] = {} + if include is not unset: + kwargs["include"] = include + + return self._list_global_incident_handles_endpoint.call_with_http_info(**kwargs) + def list_incident_attachments( self, incident_id: str, @@ -1970,6 +2165,45 @@ def search_incidents_with_pagination( } return endpoint.call_with_http_info_paginated(pagination) + def update_global_incident_handle( + self, + body: IncidentHandleRequest, + *, + include: Union[str, UnsetType] = unset, + ) -> IncidentHandleResponse: + """Update global incident handle. + + Update an existing global incident handle. + + :type body: IncidentHandleRequest + :param include: Comma-separated list of related resources to include in the response + :type include: str, optional + :rtype: IncidentHandleResponse + """ + kwargs: Dict[str, Any] = {} + if include is not unset: + kwargs["include"] = include + + kwargs["body"] = body + + return self._update_global_incident_handle_endpoint.call_with_http_info(**kwargs) + + def update_global_incident_settings( + self, + body: GlobalIncidentSettingsRequest, + ) -> GlobalIncidentSettingsResponse: + """Update global incident settings. + + Update global incident settings for the organization. + + :type body: GlobalIncidentSettingsRequest + :rtype: GlobalIncidentSettingsResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._update_global_incident_settings_endpoint.call_with_http_info(**kwargs) + def update_incident( self, incident_id: str, diff --git a/src/datadog_api_client/v2/model/global_incident_settings_attributes_request.py b/src/datadog_api_client/v2/model/global_incident_settings_attributes_request.py new file mode 100644 index 0000000000..5af758f53d --- /dev/null +++ b/src/datadog_api_client/v2/model/global_incident_settings_attributes_request.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 GlobalIncidentSettingsAttributesRequest(ModelNormal): + @cached_property + def openapi_types(_): + return { + "analytics_dashboard_id": (str,), + } + + attribute_map = { + "analytics_dashboard_id": "analytics_dashboard_id", + } + + def __init__(self_, analytics_dashboard_id: Union[str, UnsetType] = unset, **kwargs): + """ + Global incident settings attributes + + :param analytics_dashboard_id: The analytics dashboard ID + :type analytics_dashboard_id: str, optional + """ + if analytics_dashboard_id is not unset: + kwargs["analytics_dashboard_id"] = analytics_dashboard_id + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/global_incident_settings_attributes_response.py b/src/datadog_api_client/v2/model/global_incident_settings_attributes_response.py new file mode 100644 index 0000000000..ded61f374f --- /dev/null +++ b/src/datadog_api_client/v2/model/global_incident_settings_attributes_response.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 datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + datetime, +) + + +class GlobalIncidentSettingsAttributesResponse(ModelNormal): + @cached_property + def openapi_types(_): + return { + "analytics_dashboard_id": (str,), + "created": (datetime,), + "modified": (datetime,), + } + + attribute_map = { + "analytics_dashboard_id": "analytics_dashboard_id", + "created": "created", + "modified": "modified", + } + + def __init__(self_, analytics_dashboard_id: str, created: datetime, modified: datetime, **kwargs): + """ + Global incident settings attributes + + :param analytics_dashboard_id: The analytics dashboard ID + :type analytics_dashboard_id: str + + :param created: Timestamp when the settings were created + :type created: datetime + + :param modified: Timestamp when the settings were last modified + :type modified: datetime + """ + super().__init__(kwargs) + + self_.analytics_dashboard_id = analytics_dashboard_id + self_.created = created + self_.modified = modified diff --git a/src/datadog_api_client/v2/model/global_incident_settings_data_request.py b/src/datadog_api_client/v2/model/global_incident_settings_data_request.py new file mode 100644 index 0000000000..892510b65e --- /dev/null +++ b/src/datadog_api_client/v2/model/global_incident_settings_data_request.py @@ -0,0 +1,60 @@ +# 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.global_incident_settings_attributes_request import ( + GlobalIncidentSettingsAttributesRequest, + ) + from datadog_api_client.v2.model.global_incident_settings_type import GlobalIncidentSettingsType + + +class GlobalIncidentSettingsDataRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.global_incident_settings_attributes_request import ( + GlobalIncidentSettingsAttributesRequest, + ) + from datadog_api_client.v2.model.global_incident_settings_type import GlobalIncidentSettingsType + + return { + "attributes": (GlobalIncidentSettingsAttributesRequest,), + "type": (GlobalIncidentSettingsType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__( + self_, + type: GlobalIncidentSettingsType, + attributes: Union[GlobalIncidentSettingsAttributesRequest, UnsetType] = unset, + **kwargs, + ): + """ + + + :param attributes: Global incident settings attributes + :type attributes: GlobalIncidentSettingsAttributesRequest, optional + + :param type: Global incident settings resource type + :type type: GlobalIncidentSettingsType + """ + if attributes is not unset: + kwargs["attributes"] = attributes + super().__init__(kwargs) + + self_.type = type diff --git a/src/datadog_api_client/v2/model/global_incident_settings_data_response.py b/src/datadog_api_client/v2/model/global_incident_settings_data_response.py new file mode 100644 index 0000000000..85e1f863f0 --- /dev/null +++ b/src/datadog_api_client/v2/model/global_incident_settings_data_response.py @@ -0,0 +1,60 @@ +# 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.global_incident_settings_attributes_response import ( + GlobalIncidentSettingsAttributesResponse, + ) + from datadog_api_client.v2.model.global_incident_settings_type import GlobalIncidentSettingsType + + +class GlobalIncidentSettingsDataResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.global_incident_settings_attributes_response import ( + GlobalIncidentSettingsAttributesResponse, + ) + from datadog_api_client.v2.model.global_incident_settings_type import GlobalIncidentSettingsType + + return { + "attributes": (GlobalIncidentSettingsAttributesResponse,), + "id": (str,), + "type": (GlobalIncidentSettingsType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, attributes: GlobalIncidentSettingsAttributesResponse, id: str, type: GlobalIncidentSettingsType, **kwargs + ): + """ + + + :param attributes: Global incident settings attributes + :type attributes: GlobalIncidentSettingsAttributesResponse + + :param id: The unique identifier for the global incident settings + :type id: str + + :param type: Global incident settings resource type + :type type: GlobalIncidentSettingsType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/global_incident_settings_request.py b/src/datadog_api_client/v2/model/global_incident_settings_request.py new file mode 100644 index 0000000000..b25ef09d2d --- /dev/null +++ b/src/datadog_api_client/v2/model/global_incident_settings_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.global_incident_settings_data_request import GlobalIncidentSettingsDataRequest + + +class GlobalIncidentSettingsRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.global_incident_settings_data_request import GlobalIncidentSettingsDataRequest + + return { + "data": (GlobalIncidentSettingsDataRequest,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: GlobalIncidentSettingsDataRequest, **kwargs): + """ + + + :param data: + :type data: GlobalIncidentSettingsDataRequest + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/global_incident_settings_response.py b/src/datadog_api_client/v2/model/global_incident_settings_response.py new file mode 100644 index 0000000000..c4664ea2b8 --- /dev/null +++ b/src/datadog_api_client/v2/model/global_incident_settings_response.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 TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.global_incident_settings_data_response import GlobalIncidentSettingsDataResponse + + +class GlobalIncidentSettingsResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.global_incident_settings_data_response import ( + GlobalIncidentSettingsDataResponse, + ) + + return { + "data": (GlobalIncidentSettingsDataResponse,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: GlobalIncidentSettingsDataResponse, **kwargs): + """ + + + :param data: + :type data: GlobalIncidentSettingsDataResponse + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/global_incident_settings_type.py b/src/datadog_api_client/v2/model/global_incident_settings_type.py new file mode 100644 index 0000000000..11420c7000 --- /dev/null +++ b/src/datadog_api_client/v2/model/global_incident_settings_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 GlobalIncidentSettingsType(ModelSimple): + """ + Global incident settings resource type + + :param value: If omitted defaults to "incidents_global_settings". Must be one of ["incidents_global_settings"]. + :type value: str + """ + + allowed_values = { + "incidents_global_settings", + } + INCIDENTS_GLOBAL_SETTINGS: ClassVar["GlobalIncidentSettingsType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +GlobalIncidentSettingsType.INCIDENTS_GLOBAL_SETTINGS = GlobalIncidentSettingsType("incidents_global_settings") diff --git a/src/datadog_api_client/v2/model/incident_handle_attributes_fields.py b/src/datadog_api_client/v2/model/incident_handle_attributes_fields.py new file mode 100644 index 0000000000..e3dd48b21f --- /dev/null +++ b/src/datadog_api_client/v2/model/incident_handle_attributes_fields.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 List, Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class IncidentHandleAttributesFields(ModelNormal): + @cached_property + def openapi_types(_): + return { + "severity": ([str],), + } + + attribute_map = { + "severity": "severity", + } + + def __init__(self_, severity: Union[List[str], UnsetType] = unset, **kwargs): + """ + Dynamic fields associated with the handle + + :param severity: Severity levels associated with the handle + :type severity: [str], optional + """ + if severity is not unset: + kwargs["severity"] = severity + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/incident_handle_attributes_request.py b/src/datadog_api_client/v2/model/incident_handle_attributes_request.py new file mode 100644 index 0000000000..07170e9f90 --- /dev/null +++ b/src/datadog_api_client/v2/model/incident_handle_attributes_request.py @@ -0,0 +1,49 @@ +# 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.incident_handle_attributes_fields import IncidentHandleAttributesFields + + +class IncidentHandleAttributesRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.incident_handle_attributes_fields import IncidentHandleAttributesFields + + return { + "fields": (IncidentHandleAttributesFields,), + "name": (str,), + } + + attribute_map = { + "fields": "fields", + "name": "name", + } + + def __init__(self_, name: str, fields: Union[IncidentHandleAttributesFields, UnsetType] = unset, **kwargs): + """ + Incident handle attributes for requests + + :param fields: Dynamic fields associated with the handle + :type fields: IncidentHandleAttributesFields, optional + + :param name: The handle name + :type name: str + """ + if fields is not unset: + kwargs["fields"] = fields + super().__init__(kwargs) + + self_.name = name diff --git a/src/datadog_api_client/v2/model/incident_handle_attributes_response.py b/src/datadog_api_client/v2/model/incident_handle_attributes_response.py new file mode 100644 index 0000000000..5af72799e2 --- /dev/null +++ b/src/datadog_api_client/v2/model/incident_handle_attributes_response.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 TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + datetime, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.incident_handle_attributes_fields import IncidentHandleAttributesFields + + +class IncidentHandleAttributesResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.incident_handle_attributes_fields import IncidentHandleAttributesFields + + return { + "created_at": (datetime,), + "fields": (IncidentHandleAttributesFields,), + "modified_at": (datetime,), + "name": (str,), + } + + attribute_map = { + "created_at": "created_at", + "fields": "fields", + "modified_at": "modified_at", + "name": "name", + } + + def __init__( + self_, created_at: datetime, fields: IncidentHandleAttributesFields, modified_at: datetime, name: str, **kwargs + ): + """ + Incident handle attributes for responses + + :param created_at: Timestamp when the handle was created + :type created_at: datetime + + :param fields: Dynamic fields associated with the handle + :type fields: IncidentHandleAttributesFields + + :param modified_at: Timestamp when the handle was last modified + :type modified_at: datetime + + :param name: The handle name + :type name: str + """ + super().__init__(kwargs) + + self_.created_at = created_at + self_.fields = fields + self_.modified_at = modified_at + self_.name = name diff --git a/src/datadog_api_client/v2/model/incident_handle_data_request.py b/src/datadog_api_client/v2/model/incident_handle_data_request.py new file mode 100644 index 0000000000..267122f368 --- /dev/null +++ b/src/datadog_api_client/v2/model/incident_handle_data_request.py @@ -0,0 +1,74 @@ +# 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, + none_type, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.incident_handle_attributes_request import IncidentHandleAttributesRequest + from datadog_api_client.v2.model.incident_handle_relationships_request import IncidentHandleRelationshipsRequest + from datadog_api_client.v2.model.incident_handle_type import IncidentHandleType + + +class IncidentHandleDataRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.incident_handle_attributes_request import IncidentHandleAttributesRequest + from datadog_api_client.v2.model.incident_handle_relationships_request import IncidentHandleRelationshipsRequest + from datadog_api_client.v2.model.incident_handle_type import IncidentHandleType + + return { + "attributes": (IncidentHandleAttributesRequest,), + "id": (str,), + "relationships": (IncidentHandleRelationshipsRequest,), + "type": (IncidentHandleType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "relationships": "relationships", + "type": "type", + } + + def __init__( + self_, + attributes: IncidentHandleAttributesRequest, + type: IncidentHandleType, + id: Union[str, UnsetType] = unset, + relationships: Union[IncidentHandleRelationshipsRequest, none_type, UnsetType] = unset, + **kwargs, + ): + """ + + + :param attributes: Incident handle attributes for requests + :type attributes: IncidentHandleAttributesRequest + + :param id: The ID of the incident handle (required for PUT requests) + :type id: str, optional + + :param relationships: + :type relationships: IncidentHandleRelationshipsRequest, none_type, optional + + :param type: Incident handle resource type + :type type: IncidentHandleType + """ + if id is not unset: + kwargs["id"] = id + if relationships is not unset: + kwargs["relationships"] = relationships + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/incident_handle_data_response.py b/src/datadog_api_client/v2/model/incident_handle_data_response.py new file mode 100644 index 0000000000..c4052ea654 --- /dev/null +++ b/src/datadog_api_client/v2/model/incident_handle_data_response.py @@ -0,0 +1,73 @@ +# 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, + none_type, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.incident_handle_attributes_response import IncidentHandleAttributesResponse + from datadog_api_client.v2.model.incident_handle_relationships import IncidentHandleRelationships + from datadog_api_client.v2.model.incident_handle_type import IncidentHandleType + + +class IncidentHandleDataResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.incident_handle_attributes_response import IncidentHandleAttributesResponse + from datadog_api_client.v2.model.incident_handle_relationships import IncidentHandleRelationships + from datadog_api_client.v2.model.incident_handle_type import IncidentHandleType + + return { + "attributes": (IncidentHandleAttributesResponse,), + "id": (str,), + "relationships": (IncidentHandleRelationships,), + "type": (IncidentHandleType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "relationships": "relationships", + "type": "type", + } + + def __init__( + self_, + attributes: IncidentHandleAttributesResponse, + id: str, + type: IncidentHandleType, + relationships: Union[IncidentHandleRelationships, none_type, UnsetType] = unset, + **kwargs, + ): + """ + + + :param attributes: Incident handle attributes for responses + :type attributes: IncidentHandleAttributesResponse + + :param id: The ID of the incident handle + :type id: str + + :param relationships: + :type relationships: IncidentHandleRelationships, none_type, optional + + :param type: Incident handle resource type + :type type: IncidentHandleType + """ + if relationships is not unset: + kwargs["relationships"] = relationships + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/incident_handle_included_item_response.py b/src/datadog_api_client/v2/model/incident_handle_included_item_response.py new file mode 100644 index 0000000000..5565713137 --- /dev/null +++ b/src/datadog_api_client/v2/model/incident_handle_included_item_response.py @@ -0,0 +1,49 @@ +# 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 IncidentHandleIncludedItemResponse(ModelComposed): + def __init__(self, **kwargs): + """ + + + :param attributes: Attributes of user object returned by the API. + :type attributes: IncidentUserAttributes, optional + + :param id: ID of the user. + :type id: str, optional + + :param type: Users resource type. + :type type: UsersType, optional + + :param relationships: The incident type's resource relationships. + :type relationships: IncidentTypeRelationships, 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.incident_user_data import IncidentUserData + from datadog_api_client.v2.model.incident_type_object import IncidentTypeObject + + return { + "oneOf": [ + IncidentUserData, + IncidentTypeObject, + ], + } diff --git a/src/datadog_api_client/v2/model/incident_handle_relationship.py b/src/datadog_api_client/v2/model/incident_handle_relationship.py new file mode 100644 index 0000000000..6c3de05944 --- /dev/null +++ b/src/datadog_api_client/v2/model/incident_handle_relationship.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.incident_handle_relationship_data import IncidentHandleRelationshipData + + +class IncidentHandleRelationship(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.incident_handle_relationship_data import IncidentHandleRelationshipData + + return { + "data": (IncidentHandleRelationshipData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: IncidentHandleRelationshipData, **kwargs): + """ + + + :param data: + :type data: IncidentHandleRelationshipData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/incident_handle_relationship_data.py b/src/datadog_api_client/v2/model/incident_handle_relationship_data.py new file mode 100644 index 0000000000..f1445a024d --- /dev/null +++ b/src/datadog_api_client/v2/model/incident_handle_relationship_data.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 IncidentHandleRelationshipData(ModelNormal): + @cached_property + def openapi_types(_): + return { + "id": (str,), + "type": (str,), + } + + attribute_map = { + "id": "id", + "type": "type", + } + + def __init__(self_, id: str, type: str, **kwargs): + """ + + + :param id: The ID of the related resource + :type id: str + + :param type: The type of the related resource + :type type: str + """ + super().__init__(kwargs) + + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/incident_handle_relationships.py b/src/datadog_api_client/v2/model/incident_handle_relationships.py new file mode 100644 index 0000000000..0e7e1ddde5 --- /dev/null +++ b/src/datadog_api_client/v2/model/incident_handle_relationships.py @@ -0,0 +1,70 @@ +# 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.incident_handle_relationship import IncidentHandleRelationship + + +class IncidentHandleRelationships(ModelNormal): + _nullable = True + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.incident_handle_relationship import IncidentHandleRelationship + + return { + "commander_user": (IncidentHandleRelationship,), + "created_by_user": (IncidentHandleRelationship,), + "incident_type": (IncidentHandleRelationship,), + "last_modified_by_user": (IncidentHandleRelationship,), + } + + attribute_map = { + "commander_user": "commander_user", + "created_by_user": "created_by_user", + "incident_type": "incident_type", + "last_modified_by_user": "last_modified_by_user", + } + + def __init__( + self_, + created_by_user: IncidentHandleRelationship, + incident_type: IncidentHandleRelationship, + last_modified_by_user: IncidentHandleRelationship, + commander_user: Union[IncidentHandleRelationship, UnsetType] = unset, + **kwargs, + ): + """ + + + :param commander_user: + :type commander_user: IncidentHandleRelationship, optional + + :param created_by_user: + :type created_by_user: IncidentHandleRelationship + + :param incident_type: + :type incident_type: IncidentHandleRelationship + + :param last_modified_by_user: + :type last_modified_by_user: IncidentHandleRelationship + """ + if commander_user is not unset: + kwargs["commander_user"] = commander_user + super().__init__(kwargs) + + self_.created_by_user = created_by_user + self_.incident_type = incident_type + self_.last_modified_by_user = last_modified_by_user diff --git a/src/datadog_api_client/v2/model/incident_handle_relationships_request.py b/src/datadog_api_client/v2/model/incident_handle_relationships_request.py new file mode 100644 index 0000000000..cf71a32e42 --- /dev/null +++ b/src/datadog_api_client/v2/model/incident_handle_relationships_request.py @@ -0,0 +1,56 @@ +# 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.incident_handle_relationship import IncidentHandleRelationship + + +class IncidentHandleRelationshipsRequest(ModelNormal): + _nullable = True + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.incident_handle_relationship import IncidentHandleRelationship + + return { + "commander_user": (IncidentHandleRelationship,), + "incident_type": (IncidentHandleRelationship,), + } + + attribute_map = { + "commander_user": "commander_user", + "incident_type": "incident_type", + } + + def __init__( + self_, + incident_type: IncidentHandleRelationship, + commander_user: Union[IncidentHandleRelationship, UnsetType] = unset, + **kwargs, + ): + """ + + + :param commander_user: + :type commander_user: IncidentHandleRelationship, optional + + :param incident_type: + :type incident_type: IncidentHandleRelationship + """ + if commander_user is not unset: + kwargs["commander_user"] = commander_user + super().__init__(kwargs) + + self_.incident_type = incident_type diff --git a/src/datadog_api_client/v2/model/incident_handle_request.py b/src/datadog_api_client/v2/model/incident_handle_request.py new file mode 100644 index 0000000000..5e69eef4ed --- /dev/null +++ b/src/datadog_api_client/v2/model/incident_handle_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.incident_handle_data_request import IncidentHandleDataRequest + + +class IncidentHandleRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.incident_handle_data_request import IncidentHandleDataRequest + + return { + "data": (IncidentHandleDataRequest,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: IncidentHandleDataRequest, **kwargs): + """ + + + :param data: + :type data: IncidentHandleDataRequest + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/incident_handle_response.py b/src/datadog_api_client/v2/model/incident_handle_response.py new file mode 100644 index 0000000000..212887f1b5 --- /dev/null +++ b/src/datadog_api_client/v2/model/incident_handle_response.py @@ -0,0 +1,62 @@ +# 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.incident_handle_data_response import IncidentHandleDataResponse + from datadog_api_client.v2.model.incident_handle_included_item_response import IncidentHandleIncludedItemResponse + from datadog_api_client.v2.model.incident_user_data import IncidentUserData + from datadog_api_client.v2.model.incident_type_object import IncidentTypeObject + + +class IncidentHandleResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.incident_handle_data_response import IncidentHandleDataResponse + from datadog_api_client.v2.model.incident_handle_included_item_response import ( + IncidentHandleIncludedItemResponse, + ) + + return { + "data": (IncidentHandleDataResponse,), + "included": ([IncidentHandleIncludedItemResponse],), + } + + attribute_map = { + "data": "data", + "included": "included", + } + + def __init__( + self_, + data: IncidentHandleDataResponse, + included: Union[ + List[Union[IncidentHandleIncludedItemResponse, IncidentUserData, IncidentTypeObject]], UnsetType + ] = unset, + **kwargs, + ): + """ + + + :param data: + :type data: IncidentHandleDataResponse + + :param included: Included related resources + :type included: [IncidentHandleIncludedItemResponse], optional + """ + if included is not unset: + kwargs["included"] = included + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/incident_handle_type.py b/src/datadog_api_client/v2/model/incident_handle_type.py new file mode 100644 index 0000000000..86381a2497 --- /dev/null +++ b/src/datadog_api_client/v2/model/incident_handle_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 IncidentHandleType(ModelSimple): + """ + Incident handle resource type + + :param value: If omitted defaults to "incidents_handles". Must be one of ["incidents_handles"]. + :type value: str + """ + + allowed_values = { + "incidents_handles", + } + INCIDENTS_HANDLES: ClassVar["IncidentHandleType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +IncidentHandleType.INCIDENTS_HANDLES = IncidentHandleType("incidents_handles") diff --git a/src/datadog_api_client/v2/model/incident_handles_response.py b/src/datadog_api_client/v2/model/incident_handles_response.py new file mode 100644 index 0000000000..e9b44a4e8e --- /dev/null +++ b/src/datadog_api_client/v2/model/incident_handles_response.py @@ -0,0 +1,62 @@ +# 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.incident_handle_data_response import IncidentHandleDataResponse + from datadog_api_client.v2.model.incident_handle_included_item_response import IncidentHandleIncludedItemResponse + from datadog_api_client.v2.model.incident_user_data import IncidentUserData + from datadog_api_client.v2.model.incident_type_object import IncidentTypeObject + + +class IncidentHandlesResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.incident_handle_data_response import IncidentHandleDataResponse + from datadog_api_client.v2.model.incident_handle_included_item_response import ( + IncidentHandleIncludedItemResponse, + ) + + return { + "data": ([IncidentHandleDataResponse],), + "included": ([IncidentHandleIncludedItemResponse],), + } + + attribute_map = { + "data": "data", + "included": "included", + } + + def __init__( + self_, + data: List[IncidentHandleDataResponse], + included: Union[ + List[Union[IncidentHandleIncludedItemResponse, IncidentUserData, IncidentTypeObject]], UnsetType + ] = unset, + **kwargs, + ): + """ + + + :param data: + :type data: [IncidentHandleDataResponse] + + :param included: Included related resources + :type included: [IncidentHandleIncludedItemResponse], optional + """ + if included is not unset: + kwargs["included"] = included + 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 26def62074..cf367f97ad 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -2164,6 +2164,17 @@ from datadog_api_client.v2.model.gitlab_integration import GitlabIntegration from datadog_api_client.v2.model.gitlab_integration_type import GitlabIntegrationType from datadog_api_client.v2.model.gitlab_integration_update import GitlabIntegrationUpdate +from datadog_api_client.v2.model.global_incident_settings_attributes_request import ( + GlobalIncidentSettingsAttributesRequest, +) +from datadog_api_client.v2.model.global_incident_settings_attributes_response import ( + GlobalIncidentSettingsAttributesResponse, +) +from datadog_api_client.v2.model.global_incident_settings_data_request import GlobalIncidentSettingsDataRequest +from datadog_api_client.v2.model.global_incident_settings_data_response import GlobalIncidentSettingsDataResponse +from datadog_api_client.v2.model.global_incident_settings_request import GlobalIncidentSettingsRequest +from datadog_api_client.v2.model.global_incident_settings_response import GlobalIncidentSettingsResponse +from datadog_api_client.v2.model.global_incident_settings_type import GlobalIncidentSettingsType from datadog_api_client.v2.model.global_variable_data import GlobalVariableData from datadog_api_client.v2.model.global_variable_json_patch_request import GlobalVariableJsonPatchRequest from datadog_api_client.v2.model.global_variable_json_patch_request_data import GlobalVariableJsonPatchRequestData @@ -2244,6 +2255,20 @@ IncidentFieldAttributesSingleValueType, ) from datadog_api_client.v2.model.incident_field_attributes_value_type import IncidentFieldAttributesValueType +from datadog_api_client.v2.model.incident_handle_attributes_fields import IncidentHandleAttributesFields +from datadog_api_client.v2.model.incident_handle_attributes_request import IncidentHandleAttributesRequest +from datadog_api_client.v2.model.incident_handle_attributes_response import IncidentHandleAttributesResponse +from datadog_api_client.v2.model.incident_handle_data_request import IncidentHandleDataRequest +from datadog_api_client.v2.model.incident_handle_data_response import IncidentHandleDataResponse +from datadog_api_client.v2.model.incident_handle_included_item_response import IncidentHandleIncludedItemResponse +from datadog_api_client.v2.model.incident_handle_relationship import IncidentHandleRelationship +from datadog_api_client.v2.model.incident_handle_relationship_data import IncidentHandleRelationshipData +from datadog_api_client.v2.model.incident_handle_relationships import IncidentHandleRelationships +from datadog_api_client.v2.model.incident_handle_relationships_request import IncidentHandleRelationshipsRequest +from datadog_api_client.v2.model.incident_handle_request import IncidentHandleRequest +from datadog_api_client.v2.model.incident_handle_response import IncidentHandleResponse +from datadog_api_client.v2.model.incident_handle_type import IncidentHandleType +from datadog_api_client.v2.model.incident_handles_response import IncidentHandlesResponse from datadog_api_client.v2.model.incident_impact_attributes import IncidentImpactAttributes from datadog_api_client.v2.model.incident_impact_create_attributes import IncidentImpactCreateAttributes from datadog_api_client.v2.model.incident_impact_create_data import IncidentImpactCreateData @@ -7331,6 +7356,13 @@ "GitlabIntegration", "GitlabIntegrationType", "GitlabIntegrationUpdate", + "GlobalIncidentSettingsAttributesRequest", + "GlobalIncidentSettingsAttributesResponse", + "GlobalIncidentSettingsDataRequest", + "GlobalIncidentSettingsDataResponse", + "GlobalIncidentSettingsRequest", + "GlobalIncidentSettingsResponse", + "GlobalIncidentSettingsType", "GlobalVariableData", "GlobalVariableJsonPatchRequest", "GlobalVariableJsonPatchRequestData", @@ -7407,6 +7439,20 @@ "IncidentFieldAttributesSingleValue", "IncidentFieldAttributesSingleValueType", "IncidentFieldAttributesValueType", + "IncidentHandleAttributesFields", + "IncidentHandleAttributesRequest", + "IncidentHandleAttributesResponse", + "IncidentHandleDataRequest", + "IncidentHandleDataResponse", + "IncidentHandleIncludedItemResponse", + "IncidentHandleRelationship", + "IncidentHandleRelationshipData", + "IncidentHandleRelationships", + "IncidentHandleRelationshipsRequest", + "IncidentHandleRequest", + "IncidentHandleResponse", + "IncidentHandleType", + "IncidentHandlesResponse", "IncidentImpactAttributes", "IncidentImpactCreateAttributes", "IncidentImpactCreateData", diff --git a/tests/v2/features/incidents.feature b/tests/v2/features/incidents.feature index ad60148dd7..db70635584 100644 --- a/tests/v2/features/incidents.feature +++ b/tests/v2/features/incidents.feature @@ -186,6 +186,22 @@ Feature: Incidents When the request is sent Then the response status is 404 Not Found + @generated @skip @team:DataDog/incident-app + Scenario: Create global incident handle returns "Bad Request" response + Given operation "CreateGlobalIncidentHandle" enabled + And new "CreateGlobalIncidentHandle" request + And body with value {"data": {"attributes": {"fields": {"severity": ["SEV-1"]}, "name": "@incident-sev-1"}, "id": "b2494081-cdf0-4205-b366-4e1dd4fdf0bf", "relationships": {"commander_user": {"data": {"id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40", "type": "incident_types"}}, "incident_type": {"data": {"id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40", "type": "incident_types"}}}, "type": "incidents_handles"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/incident-app + Scenario: Create global incident handle returns "Created" response + Given operation "CreateGlobalIncidentHandle" enabled + And new "CreateGlobalIncidentHandle" request + And body with value {"data": {"attributes": {"fields": {"severity": ["SEV-1"]}, "name": "@incident-sev-1"}, "id": "b2494081-cdf0-4205-b366-4e1dd4fdf0bf", "relationships": {"commander_user": {"data": {"id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40", "type": "incident_types"}}, "incident_type": {"data": {"id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40", "type": "incident_types"}}}, "type": "incidents_handles"}} + When the request is sent + Then the response status is 201 Created + @skip @team:DataDog/incident-app Scenario: Create incident attachment returns "Bad Request" response Given operation "CreateIncidentAttachment" enabled @@ -450,6 +466,20 @@ Feature: Incidents When the request is sent Then the response status is 204 OK + @generated @skip @team:DataDog/incident-app + Scenario: Delete global incident handle returns "Bad Request" response + Given operation "DeleteGlobalIncidentHandle" enabled + And new "DeleteGlobalIncidentHandle" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/incident-app + Scenario: Delete global incident handle returns "No Content" response + Given operation "DeleteGlobalIncidentHandle" enabled + And new "DeleteGlobalIncidentHandle" request + When the request is sent + Then the response status is 204 No Content + @skip @team:DataDog/incident-app Scenario: Delete incident attachment returns "Bad Request" response Given operation "DeleteIncidentAttachment" enabled @@ -633,6 +663,20 @@ Feature: Incidents When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/incident-app + Scenario: Get global incident settings returns "Bad Request" response + Given operation "GetGlobalIncidentSettings" enabled + And new "GetGlobalIncidentSettings" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/incident-app + Scenario: Get global incident settings returns "OK" response + Given operation "GetGlobalIncidentSettings" enabled + And new "GetGlobalIncidentSettings" request + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/incident-app Scenario: Get incident integration metadata details returns "Bad Request" response Given operation "GetIncidentIntegration" enabled @@ -816,6 +860,20 @@ Feature: Incidents When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/incident-app + Scenario: List global incident handles returns "Bad Request" response + Given operation "ListGlobalIncidentHandles" enabled + And new "ListGlobalIncidentHandles" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/incident-app + Scenario: List global incident handles returns "OK" response + Given operation "ListGlobalIncidentHandles" enabled + And new "ListGlobalIncidentHandles" request + When the request is sent + Then the response status is 200 OK + @skip @team:DataDog/incident-app Scenario: List incident attachments returns "Bad Request" response Given operation "ListIncidentAttachments" enabled @@ -1081,6 +1139,38 @@ Feature: Incidents When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/incident-app + Scenario: Update global incident handle returns "Bad Request" response + Given operation "UpdateGlobalIncidentHandle" enabled + And new "UpdateGlobalIncidentHandle" request + And body with value {"data": {"attributes": {"fields": {"severity": ["SEV-1"]}, "name": "@incident-sev-1"}, "id": "b2494081-cdf0-4205-b366-4e1dd4fdf0bf", "relationships": {"commander_user": {"data": {"id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40", "type": "incident_types"}}, "incident_type": {"data": {"id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40", "type": "incident_types"}}}, "type": "incidents_handles"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/incident-app + Scenario: Update global incident handle returns "OK" response + Given operation "UpdateGlobalIncidentHandle" enabled + And new "UpdateGlobalIncidentHandle" request + And body with value {"data": {"attributes": {"fields": {"severity": ["SEV-1"]}, "name": "@incident-sev-1"}, "id": "b2494081-cdf0-4205-b366-4e1dd4fdf0bf", "relationships": {"commander_user": {"data": {"id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40", "type": "incident_types"}}, "incident_type": {"data": {"id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40", "type": "incident_types"}}}, "type": "incidents_handles"}} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/incident-app + Scenario: Update global incident settings returns "Bad Request" response + Given operation "UpdateGlobalIncidentSettings" enabled + And new "UpdateGlobalIncidentSettings" request + And body with value {"data": {"attributes": {"analytics_dashboard_id": "abc-123-def"}, "type": "incidents_global_settings"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/incident-app + Scenario: Update global incident settings returns "OK" response + Given operation "UpdateGlobalIncidentSettings" enabled + And new "UpdateGlobalIncidentSettings" request + And body with value {"data": {"attributes": {"analytics_dashboard_id": "abc-123-def"}, "type": "incidents_global_settings"}} + When the request is sent + Then the response status is 200 OK + @skip @team:DataDog/incident-app Scenario: Update incident attachment returns "Bad Request" response Given operation "UpdateIncidentAttachment" enabled diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index 7619933d2f..b8d90f223a 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -1602,6 +1602,44 @@ "type": "unsafe" } }, + "DeleteGlobalIncidentHandle": { + "tag": "Incidents", + "undo": { + "type": "idempotent" + } + }, + "ListGlobalIncidentHandles": { + "tag": "Incidents", + "undo": { + "type": "safe" + } + }, + "CreateGlobalIncidentHandle": { + "tag": "Incidents", + "undo": { + "operationId": "DeleteGlobalIncidentHandle", + "parameters": [], + "type": "unsafe" + } + }, + "UpdateGlobalIncidentHandle": { + "tag": "Incidents", + "undo": { + "type": "idempotent" + } + }, + "GetGlobalIncidentSettings": { + "tag": "Incidents", + "undo": { + "type": "safe" + } + }, + "UpdateGlobalIncidentSettings": { + "tag": "Incidents", + "undo": { + "type": "idempotent" + } + }, "ListIncidentNotificationRules": { "tag": "Incidents", "undo": {