From 839a512a7753c2e8131c2c2095a53f0ac8a3ac50 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Fri, 6 Feb 2026 10:16:21 +0000 Subject: [PATCH] Regenerate client from commit f1b97e5 of spec repo --- .generator/schemas/v2/openapi.yaml | 472 ++++++++++++++++++ docs/datadog_api_client.v2.model.rst | 119 +++++ .../CreateIncidentTimestampOverride.py | 38 ++ .../DeleteIncidentTimestampOverride.py | 16 + .../ListIncidentTimestampOverrides.py | 17 + .../UpdateIncidentTimestampOverride.py | 36 ++ src/datadog_api_client/configuration.py | 4 + .../v2/api/incidents_api.py | 249 +++++++++ .../incident_timestamp_override_attributes.py | 82 +++ ...nt_timestamp_override_create_attributes.py | 47 ++ ...incident_timestamp_override_create_data.py | 54 ++ ...ident_timestamp_override_create_request.py | 42 ++ .../model/incident_timestamp_override_data.py | 76 +++ ...ent_timestamp_override_patch_attributes.py | 34 ++ .../incident_timestamp_override_patch_data.py | 54 ++ ...cident_timestamp_override_patch_request.py | 42 ++ ...cident_timestamp_override_relationships.py | 51 ++ .../incident_timestamp_override_response.py | 53 ++ .../incident_timestamp_overrides_response.py | 56 +++ .../incidents_timestamp_overrides_type.py | 37 ++ .../timestamp_override_user_relationship.py | 44 ++ ...mestamp_override_user_relationship_data.py | 40 ++ .../v2/model/timestamp_type.py | 44 ++ .../v2/model/user_included.py | 53 ++ .../v2/model/user_included_attributes.py | 58 +++ src/datadog_api_client/v2/models/__init__.py | 40 ++ tests/v2/features/incidents.feature | 91 ++++ tests/v2/features/undo.json | 24 + 28 files changed, 1973 insertions(+) create mode 100644 examples/v2/incidents/CreateIncidentTimestampOverride.py create mode 100644 examples/v2/incidents/DeleteIncidentTimestampOverride.py create mode 100644 examples/v2/incidents/ListIncidentTimestampOverrides.py create mode 100644 examples/v2/incidents/UpdateIncidentTimestampOverride.py create mode 100644 src/datadog_api_client/v2/model/incident_timestamp_override_attributes.py create mode 100644 src/datadog_api_client/v2/model/incident_timestamp_override_create_attributes.py create mode 100644 src/datadog_api_client/v2/model/incident_timestamp_override_create_data.py create mode 100644 src/datadog_api_client/v2/model/incident_timestamp_override_create_request.py create mode 100644 src/datadog_api_client/v2/model/incident_timestamp_override_data.py create mode 100644 src/datadog_api_client/v2/model/incident_timestamp_override_patch_attributes.py create mode 100644 src/datadog_api_client/v2/model/incident_timestamp_override_patch_data.py create mode 100644 src/datadog_api_client/v2/model/incident_timestamp_override_patch_request.py create mode 100644 src/datadog_api_client/v2/model/incident_timestamp_override_relationships.py create mode 100644 src/datadog_api_client/v2/model/incident_timestamp_override_response.py create mode 100644 src/datadog_api_client/v2/model/incident_timestamp_overrides_response.py create mode 100644 src/datadog_api_client/v2/model/incidents_timestamp_overrides_type.py create mode 100644 src/datadog_api_client/v2/model/timestamp_override_user_relationship.py create mode 100644 src/datadog_api_client/v2/model/timestamp_override_user_relationship_data.py create mode 100644 src/datadog_api_client/v2/model/timestamp_type.py create mode 100644 src/datadog_api_client/v2/model/user_included.py create mode 100644 src/datadog_api_client/v2/model/user_included_attributes.py diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index e301432aca..1fbbc43302 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -494,6 +494,15 @@ components: items: $ref: '#/components/schemas/GetIssueIncludeQueryParameterItem' type: array + IncidentID: + description: The UUID of the incident. + in: path + name: incident_id + required: true + schema: + example: 9cecfde8-e35d-4387-8985-9b30dcb9cb1c + format: uuid + type: string IncidentIDPathParameter: description: The UUID of the incident. in: path @@ -660,6 +669,14 @@ components: schema: example: ExampleTeamName type: string + IncidentTimestampOverrideInclude: + description: Specifies which types of related objects are included in the response. + in: query + name: include + required: false + schema: + example: created_by_user,last_modified_by_user + type: string IncidentTodoIDPathParameter: description: The UUID of the incident todo. in: path @@ -689,6 +706,15 @@ components: required: false schema: $ref: '#/components/schemas/IncludeType' + IncludeDeleted: + description: Specifies whether to include deleted timestamp overrides in the + response. + in: query + name: include-deleted + required: false + schema: + example: false + type: boolean InstanceId: description: The ID of the workflow instance. in: path @@ -1152,6 +1178,15 @@ components: required: true schema: type: string + TimestampOverrideID: + description: The UUID of the timestamp override. + in: path + name: timestamp_override_id + required: true + schema: + example: 6f48a86f-9a39-4bcf-a76b-9a1b20188995 + format: uuid + type: string ToTimestamp: description: The ending timestamp for the SLO status query in epoch seconds. in: query @@ -30334,6 +30369,168 @@ components: nullable: false type: string type: object + IncidentTimestampOverrideAttributes: + description: Attributes of an incident timestamp override. + properties: + created_at: + description: Timestamp of when the override was created. + example: '2026-01-13T17:15:55.379155748Z' + format: date-time + type: string + deleted_at: + description: Timestamp of when the override was deleted (soft delete). + example: null + format: date-time + nullable: true + type: string + incident_id: + description: The UUID of the incident. + example: 9cecfde8-e35d-4387-8985-9b30dcb9cb1c + format: uuid + type: string + modified_at: + description: Timestamp of when the override was last modified. + example: '2026-01-13T17:15:55.379155834Z' + format: date-time + type: string + timestamp_type: + $ref: '#/components/schemas/TimestampType' + timestamp_value: + description: The timestamp value for the override. + example: '2024-12-29T10:00:00Z' + format: date-time + type: string + required: + - incident_id + - timestamp_type + - timestamp_value + - created_at + - modified_at + - deleted_at + type: object + IncidentTimestampOverrideCreateAttributes: + description: Attributes for creating an incident timestamp override. + properties: + timestamp_type: + $ref: '#/components/schemas/TimestampType' + timestamp_value: + description: The timestamp value for the override. + example: '2024-12-29T10:00:00Z' + format: date-time + type: string + required: + - timestamp_type + - timestamp_value + type: object + IncidentTimestampOverrideCreateData: + description: Data for creating an incident timestamp override. + properties: + attributes: + $ref: '#/components/schemas/IncidentTimestampOverrideCreateAttributes' + type: + $ref: '#/components/schemas/IncidentsTimestampOverridesType' + required: + - type + - attributes + type: object + IncidentTimestampOverrideCreateRequest: + description: Request to create an incident timestamp override. + properties: + data: + $ref: '#/components/schemas/IncidentTimestampOverrideCreateData' + required: + - data + type: object + IncidentTimestampOverrideData: + description: Data for a single incident timestamp override. + properties: + attributes: + $ref: '#/components/schemas/IncidentTimestampOverrideAttributes' + id: + description: The UUID of the timestamp override. + example: 35301c93-75c0-4ec4-a889-28e1dfc092a9 + format: uuid + type: string + relationships: + $ref: '#/components/schemas/IncidentTimestampOverrideRelationships' + type: + $ref: '#/components/schemas/IncidentsTimestampOverridesType' + required: + - id + - type + - attributes + - relationships + type: object + IncidentTimestampOverridePatchAttributes: + description: Attributes for patching an incident timestamp override. + properties: + timestamp_value: + description: The timestamp value for the override. + example: '2024-12-29T11:00:00Z' + format: date-time + type: string + required: + - timestamp_value + type: object + IncidentTimestampOverridePatchData: + description: Data for patching an incident timestamp override. + properties: + attributes: + $ref: '#/components/schemas/IncidentTimestampOverridePatchAttributes' + type: + $ref: '#/components/schemas/IncidentsTimestampOverridesType' + required: + - type + - attributes + type: object + IncidentTimestampOverridePatchRequest: + description: Request to patch an incident timestamp override. + properties: + data: + $ref: '#/components/schemas/IncidentTimestampOverridePatchData' + required: + - data + type: object + IncidentTimestampOverrideRelationships: + description: Relationships for incident timestamp override. + properties: + created_by_user: + $ref: '#/components/schemas/TimestampOverrideUserRelationship' + last_modified_by_user: + $ref: '#/components/schemas/TimestampOverrideUserRelationship' + required: + - created_by_user + - last_modified_by_user + type: object + IncidentTimestampOverrideResponse: + description: Response containing a single incident timestamp override. + properties: + data: + $ref: '#/components/schemas/IncidentTimestampOverrideData' + included: + description: Included related resources. + items: + $ref: '#/components/schemas/UserIncluded' + type: array + required: + - data + type: object + IncidentTimestampOverridesResponse: + description: Response containing a list of incident timestamp overrides. + properties: + data: + description: Array of incident timestamp overrides. + items: + $ref: '#/components/schemas/IncidentTimestampOverrideData' + type: array + included: + description: Included related resources. + items: + $ref: '#/components/schemas/UserIncluded' + type: array + required: + - data + type: object IncidentTodoAnonymousAssignee: description: Anonymous assignee entity. properties: @@ -30994,6 +31191,15 @@ components: required: - data type: object + IncidentsTimestampOverridesType: + default: incidents_timestamp_overrides + description: The JSON:API type for timestamp overrides. + enum: + - incidents_timestamp_overrides + example: incidents_timestamp_overrides + type: string + x-enum-varnames: + - INCIDENTS_TIMESTAMP_OVERRIDES IncludeType: description: Supported include types. enum: @@ -64053,6 +64259,44 @@ components: items: $ref: '#/components/schemas/TimeseriesResponseValues' type: array + TimestampOverrideUserRelationship: + description: Relationship to a user. + properties: + data: + $ref: '#/components/schemas/TimestampOverrideUserRelationshipData' + required: + - data + type: object + TimestampOverrideUserRelationshipData: + description: User relationship data. + properties: + id: + description: The UUID of the user. + example: 8ec982dd-cd99-41c6-992a-c47fc9168cad + format: uuid + type: string + type: + description: The type of the related resource. + example: users + type: string + required: + - id + - type + type: object + TimestampType: + description: The type of timestamp being overridden. + enum: + - created + - detected + - resolved + - declared + example: created + type: string + x-enum-varnames: + - CREATED + - DETECTED + - RESOLVED + - DECLARED TokenName: description: Name for tokens. example: MyTokenName @@ -65792,6 +66036,56 @@ components: required: - data type: object + UserIncluded: + description: Included user data. + properties: + attributes: + $ref: '#/components/schemas/UserIncludedAttributes' + id: + description: The UUID of the user. + example: 8ec982dd-cd99-41c6-992a-c47fc9168cad + format: uuid + type: string + type: + description: The type of the included resource. + example: users + type: string + required: + - id + - type + - attributes + type: object + UserIncludedAttributes: + description: Attributes of an included user. + properties: + email: + description: The email address of the user. + example: fake1@email.com + type: string + handle: + description: The handle of the user. + example: fakeUserHandle1 + type: string + icon: + description: The icon URL for the user. + example: http://a.com/some-icon-1.jpg + type: string + name: + description: The name of the user. + example: fakeUserName1 + type: string + uuid: + description: The UUID of the user. + example: 8ec982dd-cd99-41c6-992a-c47fc9168cad + format: uuid + type: string + required: + - email + - handle + - icon + - name + - uuid + type: object UserInvitationData: description: Object to create a user invitation. properties: @@ -79659,6 +79953,184 @@ 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/{incident_id}/timestamp-overrides: + get: + description: Get all timestamp overrides for a specific incident. + operationId: ListIncidentTimestampOverrides + parameters: + - $ref: '#/components/parameters/IncidentID' + - $ref: '#/components/parameters/IncidentTimestampOverrideInclude' + - $ref: '#/components/parameters/IncludeDeleted' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/IncidentTimestampOverridesResponse' + description: OK + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_read + summary: List timestamp overrides for an incident + tags: + - Incidents + x-unstable: '**Note**: This endpoint is in preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + post: + description: Create a new timestamp override for a specific incident. + operationId: CreateIncidentTimestampOverride + parameters: + - $ref: '#/components/parameters/IncidentID' + - $ref: '#/components/parameters/IncidentTimestampOverrideInclude' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/IncidentTimestampOverrideCreateRequest' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/IncidentTimestampOverrideResponse' + description: Created + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_write + summary: Create a timestamp override for an incident + tags: + - Incidents + x-codegen-request-body-name: body + x-unstable: '**Note**: This endpoint is in preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/incidents/{incident_id}/timestamp-overrides/{timestamp_override_id}: + delete: + description: Delete an existing timestamp override for a specific incident. + operationId: DeleteIncidentTimestampOverride + parameters: + - $ref: '#/components/parameters/IncidentID' + - $ref: '#/components/parameters/TimestampOverrideID' + responses: + '204': + description: No Content + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_write + summary: Delete a timestamp override for an incident + tags: + - Incidents + x-unstable: '**Note**: This endpoint is in preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + patch: + description: Update an existing timestamp override for a specific incident. + operationId: UpdateIncidentTimestampOverride + parameters: + - $ref: '#/components/parameters/IncidentID' + - $ref: '#/components/parameters/TimestampOverrideID' + - $ref: '#/components/parameters/IncidentTimestampOverrideInclude' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/IncidentTimestampOverridePatchRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/IncidentTimestampOverrideResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_write + summary: Update a timestamp override for an incident + tags: + - Incidents + x-codegen-request-body-name: body + x-unstable: '**Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/integration/aws/accounts: get: diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index ca47cf72a1..371b528926 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -12835,6 +12835,83 @@ datadog\_api\_client.v2.model.incident\_timeline\_cell\_markdown\_create\_attrib :members: :show-inheritance: +datadog\_api\_client.v2.model.incident\_timestamp\_override\_attributes module +------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.incident_timestamp_override_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.incident\_timestamp\_override\_create\_attributes module +-------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.incident_timestamp_override_create_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.incident\_timestamp\_override\_create\_data module +-------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.incident_timestamp_override_create_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.incident\_timestamp\_override\_create\_request module +----------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.incident_timestamp_override_create_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.incident\_timestamp\_override\_data module +------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.incident_timestamp_override_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.incident\_timestamp\_override\_patch\_attributes module +------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.incident_timestamp_override_patch_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.incident\_timestamp\_override\_patch\_data module +------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.incident_timestamp_override_patch_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.incident\_timestamp\_override\_patch\_request module +---------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.incident_timestamp_override_patch_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.incident\_timestamp\_override\_relationships module +--------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.incident_timestamp_override_relationships + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.incident\_timestamp\_override\_response module +---------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.incident_timestamp_override_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.incident\_timestamp\_overrides\_response module +----------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.incident_timestamp_overrides_response + :members: + :show-inheritance: + datadog\_api\_client.v2.model.incident\_todo\_anonymous\_assignee module ------------------------------------------------------------------------ @@ -13094,6 +13171,13 @@ datadog\_api\_client.v2.model.incidents\_response module :members: :show-inheritance: +datadog\_api\_client.v2.model.incidents\_timestamp\_overrides\_type module +-------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.incidents_timestamp_overrides_type + :members: + :show-inheritance: + datadog\_api\_client.v2.model.include\_type module -------------------------------------------------- @@ -28214,6 +28298,27 @@ datadog\_api\_client.v2.model.timeseries\_response\_values\_list module :members: :show-inheritance: +datadog\_api\_client.v2.model.timestamp\_override\_user\_relationship module +---------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.timestamp_override_user_relationship + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.timestamp\_override\_user\_relationship\_data module +---------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.timestamp_override_user_relationship_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.timestamp\_type module +---------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.timestamp_type + :members: + :show-inheritance: + datadog\_api\_client.v2.model.token\_type module ------------------------------------------------ @@ -28991,6 +29096,20 @@ datadog\_api\_client.v2.model.user\_create\_request module :members: :show-inheritance: +datadog\_api\_client.v2.model.user\_included module +--------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.user_included + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.user\_included\_attributes module +--------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.user_included_attributes + :members: + :show-inheritance: + datadog\_api\_client.v2.model.user\_invitation\_data module ----------------------------------------------------------- diff --git a/examples/v2/incidents/CreateIncidentTimestampOverride.py b/examples/v2/incidents/CreateIncidentTimestampOverride.py new file mode 100644 index 0000000000..d4038a75a1 --- /dev/null +++ b/examples/v2/incidents/CreateIncidentTimestampOverride.py @@ -0,0 +1,38 @@ +""" +Create a timestamp override for an incident 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_timestamp_override_create_attributes import ( + IncidentTimestampOverrideCreateAttributes, +) +from datadog_api_client.v2.model.incident_timestamp_override_create_data import IncidentTimestampOverrideCreateData +from datadog_api_client.v2.model.incident_timestamp_override_create_request import ( + IncidentTimestampOverrideCreateRequest, +) +from datadog_api_client.v2.model.incidents_timestamp_overrides_type import IncidentsTimestampOverridesType +from datadog_api_client.v2.model.timestamp_type import TimestampType +from datetime import datetime +from dateutil.tz import tzutc +from uuid import UUID + +body = IncidentTimestampOverrideCreateRequest( + data=IncidentTimestampOverrideCreateData( + attributes=IncidentTimestampOverrideCreateAttributes( + timestamp_type=TimestampType.CREATED, + timestamp_value=datetime(2024, 12, 29, 10, 0, tzinfo=tzutc()), + ), + type=IncidentsTimestampOverridesType.INCIDENTS_TIMESTAMP_OVERRIDES, + ), +) + +configuration = Configuration() +configuration.unstable_operations["create_incident_timestamp_override"] = True +with ApiClient(configuration) as api_client: + api_instance = IncidentsApi(api_client) + response = api_instance.create_incident_timestamp_override( + incident_id=UUID("9cecfde8-e35d-4387-8985-9b30dcb9cb1c"), body=body + ) + + print(response) diff --git a/examples/v2/incidents/DeleteIncidentTimestampOverride.py b/examples/v2/incidents/DeleteIncidentTimestampOverride.py new file mode 100644 index 0000000000..39c9593bf5 --- /dev/null +++ b/examples/v2/incidents/DeleteIncidentTimestampOverride.py @@ -0,0 +1,16 @@ +""" +Delete a timestamp override for an incident returns "No Content" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.incidents_api import IncidentsApi +from uuid import UUID + +configuration = Configuration() +configuration.unstable_operations["delete_incident_timestamp_override"] = True +with ApiClient(configuration) as api_client: + api_instance = IncidentsApi(api_client) + api_instance.delete_incident_timestamp_override( + incident_id=UUID("9cecfde8-e35d-4387-8985-9b30dcb9cb1c"), + timestamp_override_id=UUID("6f48a86f-9a39-4bcf-a76b-9a1b20188995"), + ) diff --git a/examples/v2/incidents/ListIncidentTimestampOverrides.py b/examples/v2/incidents/ListIncidentTimestampOverrides.py new file mode 100644 index 0000000000..d7111c0c4a --- /dev/null +++ b/examples/v2/incidents/ListIncidentTimestampOverrides.py @@ -0,0 +1,17 @@ +""" +List timestamp overrides for an incident returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.incidents_api import IncidentsApi +from uuid import UUID + +configuration = Configuration() +configuration.unstable_operations["list_incident_timestamp_overrides"] = True +with ApiClient(configuration) as api_client: + api_instance = IncidentsApi(api_client) + response = api_instance.list_incident_timestamp_overrides( + incident_id=UUID("9cecfde8-e35d-4387-8985-9b30dcb9cb1c"), + ) + + print(response) diff --git a/examples/v2/incidents/UpdateIncidentTimestampOverride.py b/examples/v2/incidents/UpdateIncidentTimestampOverride.py new file mode 100644 index 0000000000..dc9eac20ed --- /dev/null +++ b/examples/v2/incidents/UpdateIncidentTimestampOverride.py @@ -0,0 +1,36 @@ +""" +Update a timestamp override for an incident 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_timestamp_override_patch_attributes import ( + IncidentTimestampOverridePatchAttributes, +) +from datadog_api_client.v2.model.incident_timestamp_override_patch_data import IncidentTimestampOverridePatchData +from datadog_api_client.v2.model.incident_timestamp_override_patch_request import IncidentTimestampOverridePatchRequest +from datadog_api_client.v2.model.incidents_timestamp_overrides_type import IncidentsTimestampOverridesType +from datetime import datetime +from dateutil.tz import tzutc +from uuid import UUID + +body = IncidentTimestampOverridePatchRequest( + data=IncidentTimestampOverridePatchData( + attributes=IncidentTimestampOverridePatchAttributes( + timestamp_value=datetime(2024, 12, 29, 11, 0, tzinfo=tzutc()), + ), + type=IncidentsTimestampOverridesType.INCIDENTS_TIMESTAMP_OVERRIDES, + ), +) + +configuration = Configuration() +configuration.unstable_operations["update_incident_timestamp_override"] = True +with ApiClient(configuration) as api_client: + api_instance = IncidentsApi(api_client) + response = api_instance.update_incident_timestamp_override( + incident_id=UUID("9cecfde8-e35d-4387-8985-9b30dcb9cb1c"), + timestamp_override_id=UUID("6f48a86f-9a39-4bcf-a76b-9a1b20188995"), + body=body, + ) + + print(response) diff --git a/src/datadog_api_client/configuration.py b/src/datadog_api_client/configuration.py index f715f758fc..20ed2d8adb 100644 --- a/src/datadog_api_client/configuration.py +++ b/src/datadog_api_client/configuration.py @@ -315,6 +315,7 @@ def __init__( "v2.create_incident_notification_template": False, "v2.create_incident_postmortem_attachment": False, "v2.create_incident_postmortem_template": False, + "v2.create_incident_timestamp_override": False, "v2.create_incident_todo": False, "v2.create_incident_type": False, "v2.delete_global_incident_handle": False, @@ -324,6 +325,7 @@ def __init__( "v2.delete_incident_notification_rule": False, "v2.delete_incident_notification_template": False, "v2.delete_incident_postmortem_template": False, + "v2.delete_incident_timestamp_override": False, "v2.delete_incident_todo": False, "v2.delete_incident_type": False, "v2.get_global_incident_settings": False, @@ -341,6 +343,7 @@ def __init__( "v2.list_incident_notification_templates": False, "v2.list_incident_postmortem_templates": False, "v2.list_incidents": False, + "v2.list_incident_timestamp_overrides": False, "v2.list_incident_todos": False, "v2.list_incident_types": False, "v2.search_incidents": False, @@ -352,6 +355,7 @@ def __init__( "v2.update_incident_notification_rule": False, "v2.update_incident_notification_template": False, "v2.update_incident_postmortem_template": False, + "v2.update_incident_timestamp_override": False, "v2.update_incident_todo": False, "v2.update_incident_type": False, "v2.create_jira_issue_template": False, diff --git a/src/datadog_api_client/v2/api/incidents_api.py b/src/datadog_api_client/v2/api/incidents_api.py index 3e0dadd2c5..1991dec853 100644 --- a/src/datadog_api_client/v2/api/incidents_api.py +++ b/src/datadog_api_client/v2/api/incidents_api.py @@ -71,6 +71,12 @@ from datadog_api_client.v2.model.incident_todo_response import IncidentTodoResponse from datadog_api_client.v2.model.incident_todo_create_request import IncidentTodoCreateRequest from datadog_api_client.v2.model.incident_todo_patch_request import IncidentTodoPatchRequest +from datadog_api_client.v2.model.incident_timestamp_overrides_response import IncidentTimestampOverridesResponse +from datadog_api_client.v2.model.incident_timestamp_override_response import IncidentTimestampOverrideResponse +from datadog_api_client.v2.model.incident_timestamp_override_create_request import ( + IncidentTimestampOverrideCreateRequest, +) +from datadog_api_client.v2.model.incident_timestamp_override_patch_request import IncidentTimestampOverridePatchRequest class IncidentsApi: @@ -303,6 +309,37 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._create_incident_timestamp_override_endpoint = _Endpoint( + settings={ + "response_type": (IncidentTimestampOverrideResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/incidents/{incident_id}/timestamp-overrides", + "operation_id": "create_incident_timestamp_override", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "incident_id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "incident_id", + "location": "path", + }, + "include": { + "openapi_types": (str,), + "attribute": "include", + "location": "query", + }, + "body": { + "required": True, + "openapi_types": (IncidentTimestampOverrideCreateRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + self._create_incident_todo_endpoint = _Endpoint( settings={ "response_type": (IncidentTodoResponse,), @@ -554,6 +591,35 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._delete_incident_timestamp_override_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/incidents/{incident_id}/timestamp-overrides/{timestamp_override_id}", + "operation_id": "delete_incident_timestamp_override", + "http_method": "DELETE", + "version": "v2", + }, + params_map={ + "incident_id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "incident_id", + "location": "path", + }, + "timestamp_override_id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "timestamp_override_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["*/*"], + }, + api_client=api_client, + ) + self._delete_incident_todo_endpoint = _Endpoint( settings={ "response_type": None, @@ -1016,6 +1082,39 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._list_incident_timestamp_overrides_endpoint = _Endpoint( + settings={ + "response_type": (IncidentTimestampOverridesResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/incidents/{incident_id}/timestamp-overrides", + "operation_id": "list_incident_timestamp_overrides", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "incident_id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "incident_id", + "location": "path", + }, + "include": { + "openapi_types": (str,), + "attribute": "include", + "location": "query", + }, + "include_deleted": { + "openapi_types": (bool,), + "attribute": "include-deleted", + "location": "query", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + self._list_incident_todos_endpoint = _Endpoint( settings={ "response_type": (IncidentTodoListResponse,), @@ -1338,6 +1437,43 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._update_incident_timestamp_override_endpoint = _Endpoint( + settings={ + "response_type": (IncidentTimestampOverrideResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/incidents/{incident_id}/timestamp-overrides/{timestamp_override_id}", + "operation_id": "update_incident_timestamp_override", + "http_method": "PATCH", + "version": "v2", + }, + params_map={ + "incident_id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "incident_id", + "location": "path", + }, + "timestamp_override_id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "timestamp_override_id", + "location": "path", + }, + "include": { + "openapi_types": (str,), + "attribute": "include", + "location": "query", + }, + "body": { + "required": True, + "openapi_types": (IncidentTimestampOverridePatchRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + self._update_incident_todo_endpoint = _Endpoint( settings={ "response_type": (IncidentTodoResponse,), @@ -1588,6 +1724,34 @@ def create_incident_postmortem_template( return self._create_incident_postmortem_template_endpoint.call_with_http_info(**kwargs) + def create_incident_timestamp_override( + self, + incident_id: UUID, + body: IncidentTimestampOverrideCreateRequest, + *, + include: Union[str, UnsetType] = unset, + ) -> IncidentTimestampOverrideResponse: + """Create a timestamp override for an incident. + + Create a new timestamp override for a specific incident. + + :param incident_id: The UUID of the incident. + :type incident_id: UUID + :type body: IncidentTimestampOverrideCreateRequest + :param include: Specifies which types of related objects are included in the response. + :type include: str, optional + :rtype: IncidentTimestampOverrideResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["incident_id"] = incident_id + + if include is not unset: + kwargs["include"] = include + + kwargs["body"] = body + + return self._create_incident_timestamp_override_endpoint.call_with_http_info(**kwargs) + def create_incident_todo( self, incident_id: str, @@ -1785,6 +1949,28 @@ def delete_incident_postmortem_template( return self._delete_incident_postmortem_template_endpoint.call_with_http_info(**kwargs) + def delete_incident_timestamp_override( + self, + incident_id: UUID, + timestamp_override_id: UUID, + ) -> None: + """Delete a timestamp override for an incident. + + Delete an existing timestamp override for a specific incident. + + :param incident_id: The UUID of the incident. + :type incident_id: UUID + :param timestamp_override_id: The UUID of the timestamp override. + :type timestamp_override_id: UUID + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["incident_id"] = incident_id + + kwargs["timestamp_override_id"] = timestamp_override_id + + return self._delete_incident_timestamp_override_endpoint.call_with_http_info(**kwargs) + def delete_incident_todo( self, incident_id: str, @@ -2206,6 +2392,36 @@ def list_incidents_with_pagination( } return endpoint.call_with_http_info_paginated(pagination) + def list_incident_timestamp_overrides( + self, + incident_id: UUID, + *, + include: Union[str, UnsetType] = unset, + include_deleted: Union[bool, UnsetType] = unset, + ) -> IncidentTimestampOverridesResponse: + """List timestamp overrides for an incident. + + Get all timestamp overrides for a specific incident. + + :param incident_id: The UUID of the incident. + :type incident_id: UUID + :param include: Specifies which types of related objects are included in the response. + :type include: str, optional + :param include_deleted: Specifies whether to include deleted timestamp overrides in the response. + :type include_deleted: bool, optional + :rtype: IncidentTimestampOverridesResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["incident_id"] = incident_id + + if include is not unset: + kwargs["include"] = include + + if include_deleted is not unset: + kwargs["include_deleted"] = include_deleted + + return self._list_incident_timestamp_overrides_endpoint.call_with_http_info(**kwargs) + def list_incident_todos( self, incident_id: str, @@ -2545,6 +2761,39 @@ def update_incident_postmortem_template( return self._update_incident_postmortem_template_endpoint.call_with_http_info(**kwargs) + def update_incident_timestamp_override( + self, + incident_id: UUID, + timestamp_override_id: UUID, + body: IncidentTimestampOverridePatchRequest, + *, + include: Union[str, UnsetType] = unset, + ) -> IncidentTimestampOverrideResponse: + """Update a timestamp override for an incident. + + Update an existing timestamp override for a specific incident. + + :param incident_id: The UUID of the incident. + :type incident_id: UUID + :param timestamp_override_id: The UUID of the timestamp override. + :type timestamp_override_id: UUID + :type body: IncidentTimestampOverridePatchRequest + :param include: Specifies which types of related objects are included in the response. + :type include: str, optional + :rtype: IncidentTimestampOverrideResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["incident_id"] = incident_id + + kwargs["timestamp_override_id"] = timestamp_override_id + + if include is not unset: + kwargs["include"] = include + + kwargs["body"] = body + + return self._update_incident_timestamp_override_endpoint.call_with_http_info(**kwargs) + def update_incident_todo( self, incident_id: str, diff --git a/src/datadog_api_client/v2/model/incident_timestamp_override_attributes.py b/src/datadog_api_client/v2/model/incident_timestamp_override_attributes.py new file mode 100644 index 0000000000..481923a973 --- /dev/null +++ b/src/datadog_api_client/v2/model/incident_timestamp_override_attributes.py @@ -0,0 +1,82 @@ +# 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, + datetime, + none_type, + UUID, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.timestamp_type import TimestampType + + +class IncidentTimestampOverrideAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.timestamp_type import TimestampType + + return { + "created_at": (datetime,), + "deleted_at": (datetime, none_type), + "incident_id": (UUID,), + "modified_at": (datetime,), + "timestamp_type": (TimestampType,), + "timestamp_value": (datetime,), + } + + attribute_map = { + "created_at": "created_at", + "deleted_at": "deleted_at", + "incident_id": "incident_id", + "modified_at": "modified_at", + "timestamp_type": "timestamp_type", + "timestamp_value": "timestamp_value", + } + + def __init__( + self_, + created_at: datetime, + deleted_at: Union[datetime, none_type], + incident_id: UUID, + modified_at: datetime, + timestamp_type: TimestampType, + timestamp_value: datetime, + **kwargs, + ): + """ + Attributes of an incident timestamp override. + + :param created_at: Timestamp of when the override was created. + :type created_at: datetime + + :param deleted_at: Timestamp of when the override was deleted (soft delete). + :type deleted_at: datetime, none_type + + :param incident_id: The UUID of the incident. + :type incident_id: UUID + + :param modified_at: Timestamp of when the override was last modified. + :type modified_at: datetime + + :param timestamp_type: The type of timestamp being overridden. + :type timestamp_type: TimestampType + + :param timestamp_value: The timestamp value for the override. + :type timestamp_value: datetime + """ + super().__init__(kwargs) + + self_.created_at = created_at + self_.deleted_at = deleted_at + self_.incident_id = incident_id + self_.modified_at = modified_at + self_.timestamp_type = timestamp_type + self_.timestamp_value = timestamp_value diff --git a/src/datadog_api_client/v2/model/incident_timestamp_override_create_attributes.py b/src/datadog_api_client/v2/model/incident_timestamp_override_create_attributes.py new file mode 100644 index 0000000000..0be21a4021 --- /dev/null +++ b/src/datadog_api_client/v2/model/incident_timestamp_override_create_attributes.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 typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + datetime, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.timestamp_type import TimestampType + + +class IncidentTimestampOverrideCreateAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.timestamp_type import TimestampType + + return { + "timestamp_type": (TimestampType,), + "timestamp_value": (datetime,), + } + + attribute_map = { + "timestamp_type": "timestamp_type", + "timestamp_value": "timestamp_value", + } + + def __init__(self_, timestamp_type: TimestampType, timestamp_value: datetime, **kwargs): + """ + Attributes for creating an incident timestamp override. + + :param timestamp_type: The type of timestamp being overridden. + :type timestamp_type: TimestampType + + :param timestamp_value: The timestamp value for the override. + :type timestamp_value: datetime + """ + super().__init__(kwargs) + + self_.timestamp_type = timestamp_type + self_.timestamp_value = timestamp_value diff --git a/src/datadog_api_client/v2/model/incident_timestamp_override_create_data.py b/src/datadog_api_client/v2/model/incident_timestamp_override_create_data.py new file mode 100644 index 0000000000..81cecaf709 --- /dev/null +++ b/src/datadog_api_client/v2/model/incident_timestamp_override_create_data.py @@ -0,0 +1,54 @@ +# 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_timestamp_override_create_attributes import ( + IncidentTimestampOverrideCreateAttributes, + ) + from datadog_api_client.v2.model.incidents_timestamp_overrides_type import IncidentsTimestampOverridesType + + +class IncidentTimestampOverrideCreateData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.incident_timestamp_override_create_attributes import ( + IncidentTimestampOverrideCreateAttributes, + ) + from datadog_api_client.v2.model.incidents_timestamp_overrides_type import IncidentsTimestampOverridesType + + return { + "attributes": (IncidentTimestampOverrideCreateAttributes,), + "type": (IncidentsTimestampOverridesType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__( + self_, attributes: IncidentTimestampOverrideCreateAttributes, type: IncidentsTimestampOverridesType, **kwargs + ): + """ + Data for creating an incident timestamp override. + + :param attributes: Attributes for creating an incident timestamp override. + :type attributes: IncidentTimestampOverrideCreateAttributes + + :param type: The JSON:API type for timestamp overrides. + :type type: IncidentsTimestampOverridesType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/incident_timestamp_override_create_request.py b/src/datadog_api_client/v2/model/incident_timestamp_override_create_request.py new file mode 100644 index 0000000000..ef890fde0c --- /dev/null +++ b/src/datadog_api_client/v2/model/incident_timestamp_override_create_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 TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.incident_timestamp_override_create_data import IncidentTimestampOverrideCreateData + + +class IncidentTimestampOverrideCreateRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.incident_timestamp_override_create_data import ( + IncidentTimestampOverrideCreateData, + ) + + return { + "data": (IncidentTimestampOverrideCreateData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: IncidentTimestampOverrideCreateData, **kwargs): + """ + Request to create an incident timestamp override. + + :param data: Data for creating an incident timestamp override. + :type data: IncidentTimestampOverrideCreateData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/incident_timestamp_override_data.py b/src/datadog_api_client/v2/model/incident_timestamp_override_data.py new file mode 100644 index 0000000000..9ef58eee4f --- /dev/null +++ b/src/datadog_api_client/v2/model/incident_timestamp_override_data.py @@ -0,0 +1,76 @@ +# 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, + UUID, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.incident_timestamp_override_attributes import IncidentTimestampOverrideAttributes + from datadog_api_client.v2.model.incident_timestamp_override_relationships import ( + IncidentTimestampOverrideRelationships, + ) + from datadog_api_client.v2.model.incidents_timestamp_overrides_type import IncidentsTimestampOverridesType + + +class IncidentTimestampOverrideData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.incident_timestamp_override_attributes import ( + IncidentTimestampOverrideAttributes, + ) + from datadog_api_client.v2.model.incident_timestamp_override_relationships import ( + IncidentTimestampOverrideRelationships, + ) + from datadog_api_client.v2.model.incidents_timestamp_overrides_type import IncidentsTimestampOverridesType + + return { + "attributes": (IncidentTimestampOverrideAttributes,), + "id": (UUID,), + "relationships": (IncidentTimestampOverrideRelationships,), + "type": (IncidentsTimestampOverridesType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "relationships": "relationships", + "type": "type", + } + + def __init__( + self_, + attributes: IncidentTimestampOverrideAttributes, + id: UUID, + relationships: IncidentTimestampOverrideRelationships, + type: IncidentsTimestampOverridesType, + **kwargs, + ): + """ + Data for a single incident timestamp override. + + :param attributes: Attributes of an incident timestamp override. + :type attributes: IncidentTimestampOverrideAttributes + + :param id: The UUID of the timestamp override. + :type id: UUID + + :param relationships: Relationships for incident timestamp override. + :type relationships: IncidentTimestampOverrideRelationships + + :param type: The JSON:API type for timestamp overrides. + :type type: IncidentsTimestampOverridesType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.relationships = relationships + self_.type = type diff --git a/src/datadog_api_client/v2/model/incident_timestamp_override_patch_attributes.py b/src/datadog_api_client/v2/model/incident_timestamp_override_patch_attributes.py new file mode 100644 index 0000000000..b5d7230fa5 --- /dev/null +++ b/src/datadog_api_client/v2/model/incident_timestamp_override_patch_attributes.py @@ -0,0 +1,34 @@ +# 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 IncidentTimestampOverridePatchAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "timestamp_value": (datetime,), + } + + attribute_map = { + "timestamp_value": "timestamp_value", + } + + def __init__(self_, timestamp_value: datetime, **kwargs): + """ + Attributes for patching an incident timestamp override. + + :param timestamp_value: The timestamp value for the override. + :type timestamp_value: datetime + """ + super().__init__(kwargs) + + self_.timestamp_value = timestamp_value diff --git a/src/datadog_api_client/v2/model/incident_timestamp_override_patch_data.py b/src/datadog_api_client/v2/model/incident_timestamp_override_patch_data.py new file mode 100644 index 0000000000..c840f56cf4 --- /dev/null +++ b/src/datadog_api_client/v2/model/incident_timestamp_override_patch_data.py @@ -0,0 +1,54 @@ +# 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_timestamp_override_patch_attributes import ( + IncidentTimestampOverridePatchAttributes, + ) + from datadog_api_client.v2.model.incidents_timestamp_overrides_type import IncidentsTimestampOverridesType + + +class IncidentTimestampOverridePatchData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.incident_timestamp_override_patch_attributes import ( + IncidentTimestampOverridePatchAttributes, + ) + from datadog_api_client.v2.model.incidents_timestamp_overrides_type import IncidentsTimestampOverridesType + + return { + "attributes": (IncidentTimestampOverridePatchAttributes,), + "type": (IncidentsTimestampOverridesType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__( + self_, attributes: IncidentTimestampOverridePatchAttributes, type: IncidentsTimestampOverridesType, **kwargs + ): + """ + Data for patching an incident timestamp override. + + :param attributes: Attributes for patching an incident timestamp override. + :type attributes: IncidentTimestampOverridePatchAttributes + + :param type: The JSON:API type for timestamp overrides. + :type type: IncidentsTimestampOverridesType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/incident_timestamp_override_patch_request.py b/src/datadog_api_client/v2/model/incident_timestamp_override_patch_request.py new file mode 100644 index 0000000000..384197db3e --- /dev/null +++ b/src/datadog_api_client/v2/model/incident_timestamp_override_patch_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 TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.incident_timestamp_override_patch_data import IncidentTimestampOverridePatchData + + +class IncidentTimestampOverridePatchRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.incident_timestamp_override_patch_data import ( + IncidentTimestampOverridePatchData, + ) + + return { + "data": (IncidentTimestampOverridePatchData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: IncidentTimestampOverridePatchData, **kwargs): + """ + Request to patch an incident timestamp override. + + :param data: Data for patching an incident timestamp override. + :type data: IncidentTimestampOverridePatchData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/incident_timestamp_override_relationships.py b/src/datadog_api_client/v2/model/incident_timestamp_override_relationships.py new file mode 100644 index 0000000000..cb313d133f --- /dev/null +++ b/src/datadog_api_client/v2/model/incident_timestamp_override_relationships.py @@ -0,0 +1,51 @@ +# 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.timestamp_override_user_relationship import TimestampOverrideUserRelationship + + +class IncidentTimestampOverrideRelationships(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.timestamp_override_user_relationship import TimestampOverrideUserRelationship + + return { + "created_by_user": (TimestampOverrideUserRelationship,), + "last_modified_by_user": (TimestampOverrideUserRelationship,), + } + + attribute_map = { + "created_by_user": "created_by_user", + "last_modified_by_user": "last_modified_by_user", + } + + def __init__( + self_, + created_by_user: TimestampOverrideUserRelationship, + last_modified_by_user: TimestampOverrideUserRelationship, + **kwargs, + ): + """ + Relationships for incident timestamp override. + + :param created_by_user: Relationship to a user. + :type created_by_user: TimestampOverrideUserRelationship + + :param last_modified_by_user: Relationship to a user. + :type last_modified_by_user: TimestampOverrideUserRelationship + """ + super().__init__(kwargs) + + self_.created_by_user = created_by_user + self_.last_modified_by_user = last_modified_by_user diff --git a/src/datadog_api_client/v2/model/incident_timestamp_override_response.py b/src/datadog_api_client/v2/model/incident_timestamp_override_response.py new file mode 100644 index 0000000000..ad42f3ce91 --- /dev/null +++ b/src/datadog_api_client/v2/model/incident_timestamp_override_response.py @@ -0,0 +1,53 @@ +# 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_timestamp_override_data import IncidentTimestampOverrideData + from datadog_api_client.v2.model.user_included import UserIncluded + + +class IncidentTimestampOverrideResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.incident_timestamp_override_data import IncidentTimestampOverrideData + from datadog_api_client.v2.model.user_included import UserIncluded + + return { + "data": (IncidentTimestampOverrideData,), + "included": ([UserIncluded],), + } + + attribute_map = { + "data": "data", + "included": "included", + } + + def __init__( + self_, data: IncidentTimestampOverrideData, included: Union[List[UserIncluded], UnsetType] = unset, **kwargs + ): + """ + Response containing a single incident timestamp override. + + :param data: Data for a single incident timestamp override. + :type data: IncidentTimestampOverrideData + + :param included: Included related resources. + :type included: [UserIncluded], 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_timestamp_overrides_response.py b/src/datadog_api_client/v2/model/incident_timestamp_overrides_response.py new file mode 100644 index 0000000000..377b7f7a3c --- /dev/null +++ b/src/datadog_api_client/v2/model/incident_timestamp_overrides_response.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 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_timestamp_override_data import IncidentTimestampOverrideData + from datadog_api_client.v2.model.user_included import UserIncluded + + +class IncidentTimestampOverridesResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.incident_timestamp_override_data import IncidentTimestampOverrideData + from datadog_api_client.v2.model.user_included import UserIncluded + + return { + "data": ([IncidentTimestampOverrideData],), + "included": ([UserIncluded],), + } + + attribute_map = { + "data": "data", + "included": "included", + } + + def __init__( + self_, + data: List[IncidentTimestampOverrideData], + included: Union[List[UserIncluded], UnsetType] = unset, + **kwargs, + ): + """ + Response containing a list of incident timestamp overrides. + + :param data: Array of incident timestamp overrides. + :type data: [IncidentTimestampOverrideData] + + :param included: Included related resources. + :type included: [UserIncluded], optional + """ + if included is not unset: + kwargs["included"] = included + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/incidents_timestamp_overrides_type.py b/src/datadog_api_client/v2/model/incidents_timestamp_overrides_type.py new file mode 100644 index 0000000000..6f9583b4c0 --- /dev/null +++ b/src/datadog_api_client/v2/model/incidents_timestamp_overrides_type.py @@ -0,0 +1,37 @@ +# 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 IncidentsTimestampOverridesType(ModelSimple): + """ + The JSON:API type for timestamp overrides. + + :param value: If omitted defaults to "incidents_timestamp_overrides". Must be one of ["incidents_timestamp_overrides"]. + :type value: str + """ + + allowed_values = { + "incidents_timestamp_overrides", + } + INCIDENTS_TIMESTAMP_OVERRIDES: ClassVar["IncidentsTimestampOverridesType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +IncidentsTimestampOverridesType.INCIDENTS_TIMESTAMP_OVERRIDES = IncidentsTimestampOverridesType( + "incidents_timestamp_overrides" +) diff --git a/src/datadog_api_client/v2/model/timestamp_override_user_relationship.py b/src/datadog_api_client/v2/model/timestamp_override_user_relationship.py new file mode 100644 index 0000000000..19eb328e90 --- /dev/null +++ b/src/datadog_api_client/v2/model/timestamp_override_user_relationship.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.timestamp_override_user_relationship_data import ( + TimestampOverrideUserRelationshipData, + ) + + +class TimestampOverrideUserRelationship(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.timestamp_override_user_relationship_data import ( + TimestampOverrideUserRelationshipData, + ) + + return { + "data": (TimestampOverrideUserRelationshipData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: TimestampOverrideUserRelationshipData, **kwargs): + """ + Relationship to a user. + + :param data: User relationship data. + :type data: TimestampOverrideUserRelationshipData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/timestamp_override_user_relationship_data.py b/src/datadog_api_client/v2/model/timestamp_override_user_relationship_data.py new file mode 100644 index 0000000000..e5e0f36872 --- /dev/null +++ b/src/datadog_api_client/v2/model/timestamp_override_user_relationship_data.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 datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + UUID, +) + + +class TimestampOverrideUserRelationshipData(ModelNormal): + @cached_property + def openapi_types(_): + return { + "id": (UUID,), + "type": (str,), + } + + attribute_map = { + "id": "id", + "type": "type", + } + + def __init__(self_, id: UUID, type: str, **kwargs): + """ + User relationship data. + + :param id: The UUID of the user. + :type id: UUID + + :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/timestamp_type.py b/src/datadog_api_client/v2/model/timestamp_type.py new file mode 100644 index 0000000000..ca5bf38657 --- /dev/null +++ b/src/datadog_api_client/v2/model/timestamp_type.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 datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class TimestampType(ModelSimple): + """ + The type of timestamp being overridden. + + :param value: Must be one of ["created", "detected", "resolved", "declared"]. + :type value: str + """ + + allowed_values = { + "created", + "detected", + "resolved", + "declared", + } + CREATED: ClassVar["TimestampType"] + DETECTED: ClassVar["TimestampType"] + RESOLVED: ClassVar["TimestampType"] + DECLARED: ClassVar["TimestampType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +TimestampType.CREATED = TimestampType("created") +TimestampType.DETECTED = TimestampType("detected") +TimestampType.RESOLVED = TimestampType("resolved") +TimestampType.DECLARED = TimestampType("declared") diff --git a/src/datadog_api_client/v2/model/user_included.py b/src/datadog_api_client/v2/model/user_included.py new file mode 100644 index 0000000000..5ca1566efb --- /dev/null +++ b/src/datadog_api_client/v2/model/user_included.py @@ -0,0 +1,53 @@ +# 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, + UUID, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.user_included_attributes import UserIncludedAttributes + + +class UserIncluded(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.user_included_attributes import UserIncludedAttributes + + return { + "attributes": (UserIncludedAttributes,), + "id": (UUID,), + "type": (str,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__(self_, attributes: UserIncludedAttributes, id: UUID, type: str, **kwargs): + """ + Included user data. + + :param attributes: Attributes of an included user. + :type attributes: UserIncludedAttributes + + :param id: The UUID of the user. + :type id: UUID + + :param type: The type of the included resource. + :type type: str + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/user_included_attributes.py b/src/datadog_api_client/v2/model/user_included_attributes.py new file mode 100644 index 0000000000..906b2877af --- /dev/null +++ b/src/datadog_api_client/v2/model/user_included_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 datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + UUID, +) + + +class UserIncludedAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "email": (str,), + "handle": (str,), + "icon": (str,), + "name": (str,), + "uuid": (UUID,), + } + + attribute_map = { + "email": "email", + "handle": "handle", + "icon": "icon", + "name": "name", + "uuid": "uuid", + } + + def __init__(self_, email: str, handle: str, icon: str, name: str, uuid: UUID, **kwargs): + """ + Attributes of an included user. + + :param email: The email address of the user. + :type email: str + + :param handle: The handle of the user. + :type handle: str + + :param icon: The icon URL for the user. + :type icon: str + + :param name: The name of the user. + :type name: str + + :param uuid: The UUID of the user. + :type uuid: UUID + """ + super().__init__(kwargs) + + self_.email = email + self_.handle = handle + self_.icon = icon + self_.name = name + self_.uuid = uuid diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index a84dbb2a08..a5a7c507e5 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -2471,6 +2471,23 @@ from datadog_api_client.v2.model.incident_timeline_cell_markdown_create_attributes_content import ( IncidentTimelineCellMarkdownCreateAttributesContent, ) +from datadog_api_client.v2.model.incident_timestamp_override_attributes import IncidentTimestampOverrideAttributes +from datadog_api_client.v2.model.incident_timestamp_override_create_attributes import ( + IncidentTimestampOverrideCreateAttributes, +) +from datadog_api_client.v2.model.incident_timestamp_override_create_data import IncidentTimestampOverrideCreateData +from datadog_api_client.v2.model.incident_timestamp_override_create_request import ( + IncidentTimestampOverrideCreateRequest, +) +from datadog_api_client.v2.model.incident_timestamp_override_data import IncidentTimestampOverrideData +from datadog_api_client.v2.model.incident_timestamp_override_patch_attributes import ( + IncidentTimestampOverridePatchAttributes, +) +from datadog_api_client.v2.model.incident_timestamp_override_patch_data import IncidentTimestampOverridePatchData +from datadog_api_client.v2.model.incident_timestamp_override_patch_request import IncidentTimestampOverridePatchRequest +from datadog_api_client.v2.model.incident_timestamp_override_relationships import IncidentTimestampOverrideRelationships +from datadog_api_client.v2.model.incident_timestamp_override_response import IncidentTimestampOverrideResponse +from datadog_api_client.v2.model.incident_timestamp_overrides_response import IncidentTimestampOverridesResponse from datadog_api_client.v2.model.incident_todo_anonymous_assignee import IncidentTodoAnonymousAssignee from datadog_api_client.v2.model.incident_todo_anonymous_assignee_source import IncidentTodoAnonymousAssigneeSource from datadog_api_client.v2.model.incident_todo_assignee import IncidentTodoAssignee @@ -2508,6 +2525,7 @@ from datadog_api_client.v2.model.incident_user_data import IncidentUserData from datadog_api_client.v2.model.incident_user_defined_field_type import IncidentUserDefinedFieldType from datadog_api_client.v2.model.incidents_response import IncidentsResponse +from datadog_api_client.v2.model.incidents_timestamp_overrides_type import IncidentsTimestampOverridesType from datadog_api_client.v2.model.include_type import IncludeType from datadog_api_client.v2.model.input_schema import InputSchema from datadog_api_client.v2.model.input_schema_parameters import InputSchemaParameters @@ -5711,6 +5729,9 @@ from datadog_api_client.v2.model.timeseries_response_times import TimeseriesResponseTimes from datadog_api_client.v2.model.timeseries_response_values import TimeseriesResponseValues from datadog_api_client.v2.model.timeseries_response_values_list import TimeseriesResponseValuesList +from datadog_api_client.v2.model.timestamp_override_user_relationship import TimestampOverrideUserRelationship +from datadog_api_client.v2.model.timestamp_override_user_relationship_data import TimestampOverrideUserRelationshipData +from datadog_api_client.v2.model.timestamp_type import TimestampType from datadog_api_client.v2.model.token_type import TokenType from datadog_api_client.v2.model.trigger import Trigger from datadog_api_client.v2.model.trigger_rate_limit import TriggerRateLimit @@ -5874,6 +5895,8 @@ from datadog_api_client.v2.model.user_create_attributes import UserCreateAttributes from datadog_api_client.v2.model.user_create_data import UserCreateData from datadog_api_client.v2.model.user_create_request import UserCreateRequest +from datadog_api_client.v2.model.user_included import UserIncluded +from datadog_api_client.v2.model.user_included_attributes import UserIncludedAttributes from datadog_api_client.v2.model.user_invitation_data import UserInvitationData from datadog_api_client.v2.model.user_invitation_data_attributes import UserInvitationDataAttributes from datadog_api_client.v2.model.user_invitation_relationships import UserInvitationRelationships @@ -7840,6 +7863,17 @@ "IncidentTimelineCellMarkdownContentType", "IncidentTimelineCellMarkdownCreateAttributes", "IncidentTimelineCellMarkdownCreateAttributesContent", + "IncidentTimestampOverrideAttributes", + "IncidentTimestampOverrideCreateAttributes", + "IncidentTimestampOverrideCreateData", + "IncidentTimestampOverrideCreateRequest", + "IncidentTimestampOverrideData", + "IncidentTimestampOverridePatchAttributes", + "IncidentTimestampOverridePatchData", + "IncidentTimestampOverridePatchRequest", + "IncidentTimestampOverrideRelationships", + "IncidentTimestampOverrideResponse", + "IncidentTimestampOverridesResponse", "IncidentTodoAnonymousAssignee", "IncidentTodoAnonymousAssigneeSource", "IncidentTodoAssignee", @@ -7877,6 +7911,7 @@ "IncidentUserData", "IncidentUserDefinedFieldType", "IncidentsResponse", + "IncidentsTimestampOverridesType", "IncludeType", "InputSchema", "InputSchemaParameters", @@ -10034,6 +10069,9 @@ "TimeseriesResponseTimes", "TimeseriesResponseValues", "TimeseriesResponseValuesList", + "TimestampOverrideUserRelationship", + "TimestampOverrideUserRelationshipData", + "TimestampType", "TokenType", "Trigger", "TriggerRateLimit", @@ -10145,6 +10183,8 @@ "UserCreateAttributes", "UserCreateData", "UserCreateRequest", + "UserIncluded", + "UserIncludedAttributes", "UserInvitationData", "UserInvitationDataAttributes", "UserInvitationRelationships", diff --git a/tests/v2/features/incidents.feature b/tests/v2/features/incidents.feature index a683c2cac1..e906209314 100644 --- a/tests/v2/features/incidents.feature +++ b/tests/v2/features/incidents.feature @@ -21,6 +21,33 @@ Feature: Incidents When the request is sent Then the response status is 200 OK + @generated @skip @team:Datadog/incident-app + Scenario: Create a timestamp override for an incident returns "Bad Request" response + Given operation "CreateIncidentTimestampOverride" enabled + And new "CreateIncidentTimestampOverride" request + And request contains "incident_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"timestamp_type": "created", "timestamp_value": "2024-12-29T10:00:00Z"}, "type": "incidents_timestamp_overrides"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:Datadog/incident-app + Scenario: Create a timestamp override for an incident returns "Created" response + Given operation "CreateIncidentTimestampOverride" enabled + And new "CreateIncidentTimestampOverride" request + And request contains "incident_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"timestamp_type": "created", "timestamp_value": "2024-12-29T10:00:00Z"}, "type": "incidents_timestamp_overrides"}} + When the request is sent + Then the response status is 201 Created + + @generated @skip @team:Datadog/incident-app + Scenario: Create a timestamp override for an incident returns "Not Found" response + Given operation "CreateIncidentTimestampOverride" enabled + And new "CreateIncidentTimestampOverride" request + And request contains "incident_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"timestamp_type": "created", "timestamp_value": "2024-12-29T10:00:00Z"}, "type": "incidents_timestamp_overrides"}} + When the request is sent + Then the response status is 404 Not Found + @skip @team:DataDog/incident-app Scenario: Create an incident impact returns "Bad Request" response Given operation "CreateIncidentImpact" enabled @@ -330,6 +357,24 @@ Feature: Incidents When the request is sent Then the response status is 404 Not Found + @generated @skip @team:Datadog/incident-app + Scenario: Delete a timestamp override for an incident returns "No Content" response + Given operation "DeleteIncidentTimestampOverride" enabled + And new "DeleteIncidentTimestampOverride" request + And request contains "incident_id" parameter from "REPLACE.ME" + And request contains "timestamp_override_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: Delete a timestamp override for an incident returns "Not Found" response + Given operation "DeleteIncidentTimestampOverride" enabled + And new "DeleteIncidentTimestampOverride" request + And request contains "incident_id" parameter from "REPLACE.ME" + And request contains "timestamp_override_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + @generated @skip @team:DataDog/incident-app Scenario: Delete an existing incident returns "Bad Request" response Given operation "DeleteIncident" enabled @@ -1018,6 +1063,22 @@ Feature: Incidents When the request is sent Then the response status is 200 OK + @generated @skip @team:Datadog/incident-app + Scenario: List timestamp overrides for an incident returns "Not Found" response + Given operation "ListIncidentTimestampOverrides" enabled + And new "ListIncidentTimestampOverrides" request + And request contains "incident_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:Datadog/incident-app + Scenario: List timestamp overrides for an incident returns "OK" response + Given operation "ListIncidentTimestampOverrides" enabled + And new "ListIncidentTimestampOverrides" request + And request contains "incident_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @team:DataDog/incident-app Scenario: Remove commander from an incident returns "OK" response Given operation "UpdateIncident" enabled @@ -1066,6 +1127,36 @@ Feature: Incidents Then the response status is 200 OK And the response has 3 items + @generated @skip @team:Datadog/incident-app + Scenario: Update a timestamp override for an incident returns "Bad Request" response + Given operation "UpdateIncidentTimestampOverride" enabled + And new "UpdateIncidentTimestampOverride" request + And request contains "incident_id" parameter from "REPLACE.ME" + And request contains "timestamp_override_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"timestamp_value": "2024-12-29T11:00:00Z"}, "type": "incidents_timestamp_overrides"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:Datadog/incident-app + Scenario: Update a timestamp override for an incident returns "Not Found" response + Given operation "UpdateIncidentTimestampOverride" enabled + And new "UpdateIncidentTimestampOverride" request + And request contains "incident_id" parameter from "REPLACE.ME" + And request contains "timestamp_override_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"timestamp_value": "2024-12-29T11:00:00Z"}, "type": "incidents_timestamp_overrides"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:Datadog/incident-app + Scenario: Update a timestamp override for an incident returns "OK" response + Given operation "UpdateIncidentTimestampOverride" enabled + And new "UpdateIncidentTimestampOverride" request + And request contains "incident_id" parameter from "REPLACE.ME" + And request contains "timestamp_override_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"timestamp_value": "2024-12-29T11:00:00Z"}, "type": "incidents_timestamp_overrides"}} + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/incident-app Scenario: Update an existing incident integration metadata returns "Bad Request" response Given operation "UpdateIncidentIntegration" enabled diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index c77dfee335..8c4911b6c2 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -2013,6 +2013,30 @@ "type": "idempotent" } }, + "ListIncidentTimestampOverrides": { + "tag": "Incidents", + "undo": { + "type": "safe" + } + }, + "CreateIncidentTimestampOverride": { + "tag": "Incidents", + "undo": { + "type": "unsafe" + } + }, + "DeleteIncidentTimestampOverride": { + "tag": "Incidents", + "undo": { + "type": "idempotent" + } + }, + "UpdateIncidentTimestampOverride": { + "tag": "Incidents", + "undo": { + "type": "idempotent" + } + }, "ListAWSAccounts": { "tag": "AWS Integration", "undo": {