From 0808d1f9dbb4a718bf2096690ed83e6c06077a2e Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Fri, 10 Jul 2026 17:29:17 +0000 Subject: [PATCH] Regenerate client from commit 91098ba of spec repo --- .generator/schemas/v2/openapi.yaml | 451 ++++++++++++++++++ ...n-incident-returns-CREATED-response.frozen | 1 + ...r-an-incident-returns-CREATED-response.yml | 85 ++++ ...for-an-incident-returns-OK-response.frozen | 1 + ...em-for-an-incident-returns-OK-response.yml | 103 ++++ ...for-an-incident-returns-OK-response.frozen | 1 + ...em-for-an-incident-returns-OK-response.yml | 104 ++++ ...for-an-incident-returns-OK-response.frozen | 1 + ...em-for-an-incident-returns-OK-response.yml | 108 +++++ .../v2/incidents/CreateIncidentPostmortem.rb | 21 + .../v2/incidents/DeleteIncidentPostmortem.rb | 11 + .../v2/incidents/GetIncidentPostmortem.rb | 11 + .../v2/incidents/UpdateIncidentPostmortem.rb | 22 + features/scenarios_model_mapping.rb | 17 + features/v2/given.json | 16 + features/v2/incidents.feature | 122 +++++ features/v2/undo.json | 31 ++ lib/datadog_api_client/configuration.rb | 4 + lib/datadog_api_client/inflector.rb | 14 + .../v2/api/incidents_api.rb | 307 ++++++++++++ .../models/incident_postmortem_attributes.rb | 249 ++++++++++ .../incident_postmortem_create_attributes.rb | 144 ++++++ .../models/incident_postmortem_create_data.rb | 144 ++++++ .../incident_postmortem_create_request.rb | 123 +++++ .../v2/models/incident_postmortem_data.rb | 186 ++++++++ .../v2/models/incident_postmortem_included.rb | 63 +++ .../incident_postmortem_relationships.rb | 144 ++++++ .../v2/models/incident_postmortem_response.rb | 135 ++++++ .../incident_postmortem_update_attributes.rb | 105 ++++ .../models/incident_postmortem_update_data.rb | 165 +++++++ .../incident_postmortem_update_request.rb | 123 +++++ ...relationship_to_incident_responder_data.rb | 144 ++++++ .../v2/models/postmortem_status.rb | 28 ++ .../relationship_to_incident_responder.rb | 113 +++++ 34 files changed, 3297 insertions(+) create mode 100644 cassettes/features/v2/incidents/Create-postmortem-for-an-incident-returns-CREATED-response.frozen create mode 100644 cassettes/features/v2/incidents/Create-postmortem-for-an-incident-returns-CREATED-response.yml create mode 100644 cassettes/features/v2/incidents/Delete-postmortem-for-an-incident-returns-OK-response.frozen create mode 100644 cassettes/features/v2/incidents/Delete-postmortem-for-an-incident-returns-OK-response.yml create mode 100644 cassettes/features/v2/incidents/Get-postmortem-for-an-incident-returns-OK-response.frozen create mode 100644 cassettes/features/v2/incidents/Get-postmortem-for-an-incident-returns-OK-response.yml create mode 100644 cassettes/features/v2/incidents/Update-postmortem-for-an-incident-returns-OK-response.frozen create mode 100644 cassettes/features/v2/incidents/Update-postmortem-for-an-incident-returns-OK-response.yml create mode 100644 examples/v2/incidents/CreateIncidentPostmortem.rb create mode 100644 examples/v2/incidents/DeleteIncidentPostmortem.rb create mode 100644 examples/v2/incidents/GetIncidentPostmortem.rb create mode 100644 examples/v2/incidents/UpdateIncidentPostmortem.rb create mode 100644 lib/datadog_api_client/v2/models/incident_postmortem_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/incident_postmortem_create_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/incident_postmortem_create_data.rb create mode 100644 lib/datadog_api_client/v2/models/incident_postmortem_create_request.rb create mode 100644 lib/datadog_api_client/v2/models/incident_postmortem_data.rb create mode 100644 lib/datadog_api_client/v2/models/incident_postmortem_included.rb create mode 100644 lib/datadog_api_client/v2/models/incident_postmortem_relationships.rb create mode 100644 lib/datadog_api_client/v2/models/incident_postmortem_response.rb create mode 100644 lib/datadog_api_client/v2/models/incident_postmortem_update_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/incident_postmortem_update_data.rb create mode 100644 lib/datadog_api_client/v2/models/incident_postmortem_update_request.rb create mode 100644 lib/datadog_api_client/v2/models/nullable_relationship_to_incident_responder_data.rb create mode 100644 lib/datadog_api_client/v2/models/postmortem_status.rb create mode 100644 lib/datadog_api_client/v2/models/relationship_to_incident_responder.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 5638f0c0dfaf..9a2db4ea4289 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -1413,6 +1413,15 @@ components: required: false schema: $ref: "#/components/schemas/OrgGroupPolicySortOption" + PostmortemIncludeQueryParameter: + description: "Resources to include in the response. Supported values: `last_modified_by_user`, `postmortem_owner_user`, `postmortem_owner_responder`, `incident`." + explode: false + in: query + name: include + required: false + schema: + example: "postmortem_owner_user" + type: string ProductName: description: Name of the product to be deleted, either `logs` or `rum`. in: path @@ -45930,6 +45939,130 @@ components: - id - type type: object + IncidentPostmortemAttributes: + description: The postmortem's attributes. + properties: + created: + description: Timestamp when the postmortem was created. + example: "2024-01-01T00:00:00+00:00" + format: date-time + type: string + document_id: + description: The identifier of the postmortem document within its host platform. + example: "123" + type: string + document_type: + description: >- + The type of document backing the postmortem (for example, `datadog_notebooks`, `confluence`, or `google_docs`). Can be empty if the document type is unknown. + example: datadog_notebooks + type: string + document_url: + description: The URL of the postmortem document. + example: "https://app.datadoghq.com/notebook/123" + type: string + modified: + description: Timestamp when the postmortem was last modified. + example: "2024-01-01T00:00:00+00:00" + format: date-time + type: string + status: + $ref: "#/components/schemas/PostmortemStatus" + title: + description: The title of the postmortem. + example: "Postmortem for IR-123" + type: string + required: + - title + - document_url + - document_id + - document_type + - status + - created + - modified + type: object + IncidentPostmortemCreateAttributes: + description: The postmortem's attributes for a creation request. + properties: + document_url: + description: The URL of the postmortem document (for example, a Datadog notebook, Confluence page, or Google Doc). + example: "https://app.datadoghq.com/notebook/123" + type: string + title: + description: The title of the postmortem. + example: "Postmortem for IR-123" + type: string + required: + - title + - document_url + type: object + IncidentPostmortemCreateData: + description: The postmortem resource for a creation request. + properties: + attributes: + $ref: "#/components/schemas/IncidentPostmortemCreateAttributes" + type: + $ref: "#/components/schemas/IncidentPostmortemType" + required: + - type + - attributes + type: object + IncidentPostmortemCreateRequest: + description: Request to create a postmortem for an incident. + properties: + data: + $ref: "#/components/schemas/IncidentPostmortemCreateData" + required: + - data + type: object + IncidentPostmortemData: + description: The postmortem resource. + properties: + attributes: + $ref: "#/components/schemas/IncidentPostmortemAttributes" + id: + description: The UUID of the postmortem. + example: "00000000-0000-abcd-1000-000000000000" + type: string + relationships: + $ref: "#/components/schemas/IncidentPostmortemRelationships" + type: + $ref: "#/components/schemas/IncidentPostmortemType" + required: + - id + - type + - attributes + - relationships + type: object + IncidentPostmortemIncluded: + description: An object related to a postmortem that is included in the response. + oneOf: + - $ref: "#/components/schemas/IncidentUserData" + - $ref: "#/components/schemas/IncidentResponseData" + IncidentPostmortemRelationships: + description: The postmortem's relationships. + properties: + incident: + $ref: "#/components/schemas/RelationshipToIncident" + last_modified_by_user: + $ref: "#/components/schemas/RelationshipToUser" + postmortem_owner_responder: + $ref: "#/components/schemas/RelationshipToIncidentResponder" + postmortem_owner_user: + $ref: "#/components/schemas/NullableRelationshipToUser" + type: object + IncidentPostmortemResponse: + description: Response with a single incident postmortem. + properties: + data: + $ref: "#/components/schemas/IncidentPostmortemData" + included: + description: Related objects included in the response. + items: + $ref: "#/components/schemas/IncidentPostmortemIncluded" + type: array + required: + - data + type: object IncidentPostmortemType: default: incident_postmortems description: Incident postmortem resource type. @@ -45939,6 +46072,36 @@ components: type: string x-enum-varnames: - INCIDENT_POSTMORTEMS + IncidentPostmortemUpdateAttributes: + description: The postmortem's attributes for an update request. + properties: + status: + $ref: "#/components/schemas/PostmortemStatus" + type: object + IncidentPostmortemUpdateData: + description: The postmortem resource for an update request. + properties: + attributes: + $ref: "#/components/schemas/IncidentPostmortemUpdateAttributes" + id: + description: The UUID of the postmortem. + example: "00000000-0000-abcd-1000-000000000000" + type: string + type: + $ref: "#/components/schemas/IncidentPostmortemType" + required: + - id + - type + - attributes + type: object + IncidentPostmortemUpdateRequest: + description: Request to update the postmortem attached to an incident. + properties: + data: + $ref: "#/components/schemas/IncidentPostmortemUpdateData" + required: + - data + type: object IncidentRelatedObject: description: Object related to an incident. enum: @@ -64127,6 +64290,20 @@ components: required: - type type: object + NullableRelationshipToIncidentResponderData: + description: Relationship to impact object. + nullable: true + properties: + id: + description: A unique identifier that represents the responder. + example: "00000000-0000-0000-2345-000000000000" + type: string + type: + $ref: "#/components/schemas/IncidentRespondersType" + required: + - id + - type + type: object NullableRelationshipToUser: description: Relationship to user. nullable: true @@ -75323,6 +75500,18 @@ components: type: string x-enum-varnames: - MARKDOWN + PostmortemStatus: + description: The status of the postmortem. + enum: + - draft + - in_review + - completed + example: draft + type: string + x-enum-varnames: + - DRAFT + - IN_REVIEW + - COMPLETED PostmortemTemplateAttributesRequest: description: Attributes for creating or updating a postmortem template. properties: @@ -78741,6 +78930,15 @@ components: required: - data type: object + RelationshipToIncidentResponder: + description: A relationship reference for a single incident responder. + nullable: true + properties: + data: + $ref: "#/components/schemas/NullableRelationshipToIncidentResponderData" + required: + - data + type: object RelationshipToIncidentResponderData: description: Relationship to impact object. properties: @@ -140824,6 +141022,259 @@ paths: operator: OR permissions: - incident_write + /api/v2/incidents/{incident_id}/postmortem: + delete: + description: Delete the postmortem attached to an incident. + operationId: DeleteIncidentPostmortem + parameters: + - $ref: "#/components/parameters/IncidentIDPathParameter" + responses: + "204": + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_write + summary: Delete postmortem for an incident + tags: + - Incidents + x-permission: + operator: OR + permissions: + - incident_write + 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/). + get: + description: Get the postmortem attached to an incident. + operationId: GetIncidentPostmortem + parameters: + - $ref: "#/components/parameters/IncidentIDPathParameter" + - $ref: "#/components/parameters/PostmortemIncludeQueryParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + created: "2024-01-01T00:00:00+00:00" + document_id: "123" + document_type: datadog_notebooks + document_url: "https://app.datadoghq.com/notebook/123" + modified: "2024-01-01T00:00:00+00:00" + status: draft + title: "Postmortem for IR-123" + id: 00000000-0000-abcd-1000-000000000000 + relationships: + incident: + data: + id: 00000000-0000-0000-1234-000000000000 + type: incidents + last_modified_by_user: + data: + id: 00000000-0000-0000-1234-000000000000 + type: users + type: incident_postmortems + schema: + $ref: "#/components/schemas/IncidentPostmortemResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_read + summary: Get postmortem for an incident + tags: + - Incidents + x-permission: + operator: OR + permissions: + - incident_read + 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 the postmortem attached to an incident, for example to change its status. + operationId: UpdateIncidentPostmortem + parameters: + - $ref: "#/components/parameters/IncidentIDPathParameter" + - $ref: "#/components/parameters/PostmortemIncludeQueryParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + status: in_review + id: 00000000-0000-abcd-1000-000000000000 + type: incident_postmortems + schema: + $ref: "#/components/schemas/IncidentPostmortemUpdateRequest" + description: Postmortem update payload. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + created: "2024-01-01T00:00:00+00:00" + document_id: "123" + document_type: datadog_notebooks + document_url: "https://app.datadoghq.com/notebook/123" + modified: "2024-01-01T00:00:00+00:00" + status: in_review + title: "Postmortem for IR-123" + id: 00000000-0000-abcd-1000-000000000000 + relationships: + incident: + data: + id: 00000000-0000-0000-1234-000000000000 + type: incidents + last_modified_by_user: + data: + id: 00000000-0000-0000-1234-000000000000 + type: users + type: incident_postmortems + schema: + $ref: "#/components/schemas/IncidentPostmortemResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_write + summary: Update postmortem for an incident + tags: + - Incidents + x-permission: + operator: OR + permissions: + - incident_write + 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 postmortem for an incident by linking a title and document URL + (for example, a Datadog notebook, Confluence page, or Google Doc). + + Only one postmortem is allowed per incident. + operationId: CreateIncidentPostmortem + parameters: + - $ref: "#/components/parameters/IncidentIDPathParameter" + - $ref: "#/components/parameters/PostmortemIncludeQueryParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + document_url: "https://app.datadoghq.com/notebook/123" + title: "Postmortem for IR-123" + type: incident_postmortems + schema: + $ref: "#/components/schemas/IncidentPostmortemCreateRequest" + description: Postmortem creation payload. + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + created: "2024-01-01T00:00:00+00:00" + document_id: "123" + document_type: datadog_notebooks + document_url: "https://app.datadoghq.com/notebook/123" + modified: "2024-01-01T00:00:00+00:00" + status: draft + title: "Postmortem for IR-123" + id: 00000000-0000-abcd-1000-000000000000 + relationships: + incident: + data: + id: 00000000-0000-0000-1234-000000000000 + type: incidents + last_modified_by_user: + data: + id: 00000000-0000-0000-1234-000000000000 + type: users + type: incident_postmortems + schema: + $ref: "#/components/schemas/IncidentPostmortemResponse" + description: CREATED + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "409": + $ref: "#/components/responses/ConflictResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_write + summary: Create postmortem for an incident + tags: + - Incidents + x-permission: + operator: OR + permissions: + - incident_write + 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}/relationships/integrations: get: description: Get all integration metadata for an incident. diff --git a/cassettes/features/v2/incidents/Create-postmortem-for-an-incident-returns-CREATED-response.frozen b/cassettes/features/v2/incidents/Create-postmortem-for-an-incident-returns-CREATED-response.frozen new file mode 100644 index 000000000000..20dff1d9fb7e --- /dev/null +++ b/cassettes/features/v2/incidents/Create-postmortem-for-an-incident-returns-CREATED-response.frozen @@ -0,0 +1 @@ +2026-07-09T20:46:31.190Z \ No newline at end of file diff --git a/cassettes/features/v2/incidents/Create-postmortem-for-an-incident-returns-CREATED-response.yml b/cassettes/features/v2/incidents/Create-postmortem-for-an-incident-returns-CREATED-response.yml new file mode 100644 index 000000000000..eac6637ec406 --- /dev/null +++ b/cassettes/features/v2/incidents/Create-postmortem-for-an-incident-returns-CREATED-response.yml @@ -0,0 +1,85 @@ +http_interactions: +- recorded_at: Thu, 09 Jul 2026 20:46:31 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"customer_impacted":false,"title":"Test-Create_postmortem_for_an_incident_returns_CREATED_response-1783629991"},"type":"incidents"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/incidents + response: + body: + encoding: UTF-8 + string: '{"data":{"type":"incidents","id":"254910ed-d27e-5cb4-9f29-b0d5562e78d1","attributes":{"public_id":364275,"incident_type_uuid":"41d2e10b-4108-4736-92d7-791d00ea0702","title":"Test-Create_postmortem_for_an_incident_returns_CREATED_response-1783629991","resolved":null,"customer_impact_scope":null,"customer_impact_start":null,"customer_impact_end":null,"customer_impacted":false,"notification_handles":null,"last_modified_by":{"data":{"type":"users","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","attributes":{"uuid":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","email":"team-intg-tools-libs-spam@datadoghq.com","name":"CI + Account","icon":"https://secure.gravatar.com/avatar/b7c189b5b4c2c429d7c1e0bc3749330e?s=48&d=retro"}}},"last_modified_by_uuid":null,"created":"2026-07-09T20:46:33.090861+00:00","modified":"2026-07-09T20:46:33.090861+00:00","commander":null,"detected":"2026-07-09T20:46:33.080842+00:00","created_by":{"data":{"type":"users","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","attributes":{"uuid":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","email":"team-intg-tools-libs-spam@datadoghq.com","name":"CI + Account","icon":"https://secure.gravatar.com/avatar/b7c189b5b4c2c429d7c1e0bc3749330e?s=48&d=retro"}}},"created_by_uuid":null,"creation_idempotency_key":null,"customer_impact_duration":0,"time_to_detect":0,"time_to_repair":0,"time_to_internal_response":0,"time_to_resolve":0,"is_test":false,"declared":"2026-07-09T20:46:33.090861+00:00","declared_by":{"data":{"type":"users","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","attributes":{"uuid":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","email":"team-intg-tools-libs-spam@datadoghq.com","name":"CI + Account","icon":"https://secure.gravatar.com/avatar/b7c189b5b4c2c429d7c1e0bc3749330e?s=48&d=retro"}}},"declared_by_uuid":null,"fields":{"teams":{"type":"autocomplete","value":null},"severity":{"type":"dropdown","value":"UNKNOWN"},"state":{"type":"dropdown","value":"active"},"detection_method":{"type":"dropdown","value":"unknown"},"root_cause":{"type":"textbox","value":null},"summary":{"type":"textbox","value":null},"services":{"type":"autocomplete","value":null},"slug":{"type":"textbox","value":"IR-364275"}},"field_analytics":null,"severity":"UNKNOWN","state":"active","non_datadog_creator":null,"visibility":"organization","case_id":null},"relationships":{"created_by_user":{"data":{"type":"users","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"}},"last_modified_by_user":{"data":{"type":"users","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"}},"commander_user":{"data":null},"declared_by_user":{"data":{"type":"users","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"}},"user_defined_fields":{"data":[{"type":"user_defined_field","id":"3cbe9e60-d794-532c-acc0-73641f782813"},{"type":"user_defined_field","id":"33457d2a-570c-5567-b4af-979a2a8f1164"},{"type":"user_defined_field","id":"d003693c-bee9-5420-8d46-859269c20914"},{"type":"user_defined_field","id":"1ddff6f6-cb1f-51a0-9d81-dc18ef52cc9d"},{"type":"user_defined_field","id":"6bc9d32b-c2cd-591e-9b7a-74c886a5ddcf"},{"type":"user_defined_field","id":"95c53547-2ba3-5d8a-9c3b-cf245bc0c629"},{"type":"user_defined_field","id":"39044b03-cee4-555f-b1e0-3eb3aa759a86"},{"type":"user_defined_field","id":"2b9f1063-b915-4c7a-8bbd-fc3940245529"}]},"integrations":{"data":[]},"attachments":{"data":[]},"responders":{"data":[]},"impacts":{"data":[]}}}} + + ' + headers: + Content-Type: + - application/json + status: + code: 201 + message: Created +- recorded_at: Thu, 09 Jul 2026 20:46:31 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"document_url":"https://app.datadoghq.com/notebook/123","title":"Postmortem + for IR-123"},"type":"incident_postmortems"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/incidents/254910ed-d27e-5cb4-9f29-b0d5562e78d1/postmortem + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"83e96252-8ed9-4032-aa08-7c99a3229eeb","type":"incident_postmortems","attributes":{"created":"2026-07-09T20:46:33.603296Z","document_id":"","document_type":"","document_url":"https://app.datadoghq.com/notebook/123","modified":"2026-07-09T20:46:33.603296Z","status":"draft","title":"Postmortem + for IR-123"},"relationships":{"incident":{"data":{"id":"254910ed-d27e-5cb4-9f29-b0d5562e78d1","type":"incidents"}},"last_modified_by_user":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}},"postmortem_owner_responder":{"data":null},"postmortem_owner_user":{"data":null}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Thu, 09 Jul 2026 20:46:31 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/incidents/254910ed-d27e-5cb4-9f29-b0d5562e78d1/postmortem + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +- recorded_at: Thu, 09 Jul 2026 20:46:31 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/incidents/254910ed-d27e-5cb4-9f29-b0d5562e78d1 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/incidents/Delete-postmortem-for-an-incident-returns-OK-response.frozen b/cassettes/features/v2/incidents/Delete-postmortem-for-an-incident-returns-OK-response.frozen new file mode 100644 index 000000000000..7f1eefa3ee98 --- /dev/null +++ b/cassettes/features/v2/incidents/Delete-postmortem-for-an-incident-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-07-09T20:46:34.566Z \ No newline at end of file diff --git a/cassettes/features/v2/incidents/Delete-postmortem-for-an-incident-returns-OK-response.yml b/cassettes/features/v2/incidents/Delete-postmortem-for-an-incident-returns-OK-response.yml new file mode 100644 index 000000000000..8dad93c3c30d --- /dev/null +++ b/cassettes/features/v2/incidents/Delete-postmortem-for-an-incident-returns-OK-response.yml @@ -0,0 +1,103 @@ +http_interactions: +- recorded_at: Thu, 09 Jul 2026 20:46:34 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"customer_impacted":false,"title":"Test-Delete_postmortem_for_an_incident_returns_OK_response-1783629994"},"type":"incidents"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/incidents + response: + body: + encoding: UTF-8 + string: '{"data":{"type":"incidents","id":"b481c61d-b0b2-5786-b2c2-381d5334d201","attributes":{"public_id":364276,"incident_type_uuid":"41d2e10b-4108-4736-92d7-791d00ea0702","title":"Test-Delete_postmortem_for_an_incident_returns_OK_response-1783629994","resolved":null,"customer_impact_scope":null,"customer_impact_start":null,"customer_impact_end":null,"customer_impacted":false,"notification_handles":null,"last_modified_by":{"data":{"type":"users","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","attributes":{"uuid":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","email":"team-intg-tools-libs-spam@datadoghq.com","name":"CI + Account","icon":"https://secure.gravatar.com/avatar/b7c189b5b4c2c429d7c1e0bc3749330e?s=48&d=retro"}}},"last_modified_by_uuid":null,"created":"2026-07-09T20:46:34.742676+00:00","modified":"2026-07-09T20:46:34.742676+00:00","commander":null,"detected":"2026-07-09T20:46:34.734288+00:00","created_by":{"data":{"type":"users","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","attributes":{"uuid":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","email":"team-intg-tools-libs-spam@datadoghq.com","name":"CI + Account","icon":"https://secure.gravatar.com/avatar/b7c189b5b4c2c429d7c1e0bc3749330e?s=48&d=retro"}}},"created_by_uuid":null,"creation_idempotency_key":null,"customer_impact_duration":0,"time_to_detect":0,"time_to_repair":0,"time_to_internal_response":0,"time_to_resolve":0,"is_test":false,"declared":"2026-07-09T20:46:34.742676+00:00","declared_by":{"data":{"type":"users","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","attributes":{"uuid":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","email":"team-intg-tools-libs-spam@datadoghq.com","name":"CI + Account","icon":"https://secure.gravatar.com/avatar/b7c189b5b4c2c429d7c1e0bc3749330e?s=48&d=retro"}}},"declared_by_uuid":null,"fields":{"teams":{"type":"autocomplete","value":null},"severity":{"type":"dropdown","value":"UNKNOWN"},"state":{"type":"dropdown","value":"active"},"detection_method":{"type":"dropdown","value":"unknown"},"root_cause":{"type":"textbox","value":null},"summary":{"type":"textbox","value":null},"services":{"type":"autocomplete","value":null},"slug":{"type":"textbox","value":"IR-364276"}},"field_analytics":null,"severity":"UNKNOWN","state":"active","non_datadog_creator":null,"visibility":"organization","case_id":null},"relationships":{"created_by_user":{"data":{"type":"users","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"}},"last_modified_by_user":{"data":{"type":"users","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"}},"commander_user":{"data":null},"declared_by_user":{"data":{"type":"users","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"}},"user_defined_fields":{"data":[{"type":"user_defined_field","id":"3cbe9e60-d794-532c-acc0-73641f782813"},{"type":"user_defined_field","id":"33457d2a-570c-5567-b4af-979a2a8f1164"},{"type":"user_defined_field","id":"d003693c-bee9-5420-8d46-859269c20914"},{"type":"user_defined_field","id":"1ddff6f6-cb1f-51a0-9d81-dc18ef52cc9d"},{"type":"user_defined_field","id":"6bc9d32b-c2cd-591e-9b7a-74c886a5ddcf"},{"type":"user_defined_field","id":"95c53547-2ba3-5d8a-9c3b-cf245bc0c629"},{"type":"user_defined_field","id":"39044b03-cee4-555f-b1e0-3eb3aa759a86"},{"type":"user_defined_field","id":"2b9f1063-b915-4c7a-8bbd-fc3940245529"}]},"integrations":{"data":[]},"attachments":{"data":[]},"responders":{"data":[]},"impacts":{"data":[]}}}} + + ' + headers: + Content-Type: + - application/json + status: + code: 201 + message: Created +- recorded_at: Thu, 09 Jul 2026 20:46:34 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"document_url":"https://docs.example.com/postmortem-test-delete_postmortem_for_an_incident_returns_ok_response-1783629994","title":"Postmortem + for Test-Delete_postmortem_for_an_incident_returns_OK_response-1783629994"},"type":"incident_postmortems"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/incidents/b481c61d-b0b2-5786-b2c2-381d5334d201/postmortem + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"1f42ee03-8e4c-49ad-8626-875dc3c88862","type":"incident_postmortems","attributes":{"created":"2026-07-09T20:46:35.181043Z","document_id":"","document_type":"","document_url":"https://docs.example.com/postmortem-test-delete_postmortem_for_an_incident_returns_ok_response-1783629994","modified":"2026-07-09T20:46:35.181043Z","status":"draft","title":"Postmortem + for Test-Delete_postmortem_for_an_incident_returns_OK_response-1783629994"},"relationships":{"incident":{"data":{"id":"b481c61d-b0b2-5786-b2c2-381d5334d201","type":"incidents"}},"last_modified_by_user":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}},"postmortem_owner_responder":{"data":null},"postmortem_owner_user":{"data":null}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Thu, 09 Jul 2026 20:46:34 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/incidents/b481c61d-b0b2-5786-b2c2-381d5334d201/postmortem + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +- recorded_at: Thu, 09 Jul 2026 20:46:34 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/incidents/b481c61d-b0b2-5786-b2c2-381d5334d201/postmortem + response: + body: + encoding: UTF-8 + string: '{"errors":[{"title":"Generic Error","detail":"postmortem not found"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +- recorded_at: Thu, 09 Jul 2026 20:46:34 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/incidents/b481c61d-b0b2-5786-b2c2-381d5334d201 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/incidents/Get-postmortem-for-an-incident-returns-OK-response.frozen b/cassettes/features/v2/incidents/Get-postmortem-for-an-incident-returns-OK-response.frozen new file mode 100644 index 000000000000..b0c18a729026 --- /dev/null +++ b/cassettes/features/v2/incidents/Get-postmortem-for-an-incident-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-07-09T20:46:36.398Z \ No newline at end of file diff --git a/cassettes/features/v2/incidents/Get-postmortem-for-an-incident-returns-OK-response.yml b/cassettes/features/v2/incidents/Get-postmortem-for-an-incident-returns-OK-response.yml new file mode 100644 index 000000000000..4e4f64fe3491 --- /dev/null +++ b/cassettes/features/v2/incidents/Get-postmortem-for-an-incident-returns-OK-response.yml @@ -0,0 +1,104 @@ +http_interactions: +- recorded_at: Thu, 09 Jul 2026 20:46:36 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"customer_impacted":false,"title":"Test-Get_postmortem_for_an_incident_returns_OK_response-1783629996"},"type":"incidents"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/incidents + response: + body: + encoding: UTF-8 + string: '{"data":{"type":"incidents","id":"4832db36-b2ec-5f98-917a-3b2fff43a58c","attributes":{"public_id":364277,"incident_type_uuid":"41d2e10b-4108-4736-92d7-791d00ea0702","title":"Test-Get_postmortem_for_an_incident_returns_OK_response-1783629996","resolved":null,"customer_impact_scope":null,"customer_impact_start":null,"customer_impact_end":null,"customer_impacted":false,"notification_handles":null,"last_modified_by":{"data":{"type":"users","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","attributes":{"uuid":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","email":"team-intg-tools-libs-spam@datadoghq.com","name":"CI + Account","icon":"https://secure.gravatar.com/avatar/b7c189b5b4c2c429d7c1e0bc3749330e?s=48&d=retro"}}},"last_modified_by_uuid":null,"created":"2026-07-09T20:46:36.588869+00:00","modified":"2026-07-09T20:46:36.588869+00:00","commander":null,"detected":"2026-07-09T20:46:36.580740+00:00","created_by":{"data":{"type":"users","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","attributes":{"uuid":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","email":"team-intg-tools-libs-spam@datadoghq.com","name":"CI + Account","icon":"https://secure.gravatar.com/avatar/b7c189b5b4c2c429d7c1e0bc3749330e?s=48&d=retro"}}},"created_by_uuid":null,"creation_idempotency_key":null,"customer_impact_duration":0,"time_to_detect":0,"time_to_repair":0,"time_to_internal_response":0,"time_to_resolve":0,"is_test":false,"declared":"2026-07-09T20:46:36.588869+00:00","declared_by":{"data":{"type":"users","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","attributes":{"uuid":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","email":"team-intg-tools-libs-spam@datadoghq.com","name":"CI + Account","icon":"https://secure.gravatar.com/avatar/b7c189b5b4c2c429d7c1e0bc3749330e?s=48&d=retro"}}},"declared_by_uuid":null,"fields":{"teams":{"type":"autocomplete","value":null},"severity":{"type":"dropdown","value":"UNKNOWN"},"state":{"type":"dropdown","value":"active"},"detection_method":{"type":"dropdown","value":"unknown"},"root_cause":{"type":"textbox","value":null},"summary":{"type":"textbox","value":null},"services":{"type":"autocomplete","value":null},"slug":{"type":"textbox","value":"IR-364277"}},"field_analytics":null,"severity":"UNKNOWN","state":"active","non_datadog_creator":null,"visibility":"organization","case_id":null},"relationships":{"created_by_user":{"data":{"type":"users","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"}},"last_modified_by_user":{"data":{"type":"users","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"}},"commander_user":{"data":null},"declared_by_user":{"data":{"type":"users","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"}},"user_defined_fields":{"data":[{"type":"user_defined_field","id":"3cbe9e60-d794-532c-acc0-73641f782813"},{"type":"user_defined_field","id":"33457d2a-570c-5567-b4af-979a2a8f1164"},{"type":"user_defined_field","id":"d003693c-bee9-5420-8d46-859269c20914"},{"type":"user_defined_field","id":"1ddff6f6-cb1f-51a0-9d81-dc18ef52cc9d"},{"type":"user_defined_field","id":"6bc9d32b-c2cd-591e-9b7a-74c886a5ddcf"},{"type":"user_defined_field","id":"95c53547-2ba3-5d8a-9c3b-cf245bc0c629"},{"type":"user_defined_field","id":"39044b03-cee4-555f-b1e0-3eb3aa759a86"},{"type":"user_defined_field","id":"2b9f1063-b915-4c7a-8bbd-fc3940245529"}]},"integrations":{"data":[]},"attachments":{"data":[]},"responders":{"data":[]},"impacts":{"data":[]}}}} + + ' + headers: + Content-Type: + - application/json + status: + code: 201 + message: Created +- recorded_at: Thu, 09 Jul 2026 20:46:36 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"document_url":"https://docs.example.com/postmortem-test-get_postmortem_for_an_incident_returns_ok_response-1783629996","title":"Postmortem + for Test-Get_postmortem_for_an_incident_returns_OK_response-1783629996"},"type":"incident_postmortems"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/incidents/4832db36-b2ec-5f98-917a-3b2fff43a58c/postmortem + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"9a2e832e-e9b8-48f2-9251-f189ae5bae54","type":"incident_postmortems","attributes":{"created":"2026-07-09T20:46:37.029493Z","document_id":"","document_type":"","document_url":"https://docs.example.com/postmortem-test-get_postmortem_for_an_incident_returns_ok_response-1783629996","modified":"2026-07-09T20:46:37.029493Z","status":"draft","title":"Postmortem + for Test-Get_postmortem_for_an_incident_returns_OK_response-1783629996"},"relationships":{"incident":{"data":{"id":"4832db36-b2ec-5f98-917a-3b2fff43a58c","type":"incidents"}},"last_modified_by_user":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}},"postmortem_owner_responder":{"data":null},"postmortem_owner_user":{"data":null}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Thu, 09 Jul 2026 20:46:36 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/incidents/4832db36-b2ec-5f98-917a-3b2fff43a58c/postmortem + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"9a2e832e-e9b8-48f2-9251-f189ae5bae54","type":"incident_postmortems","attributes":{"created":"2026-07-09T20:46:37.029493Z","document_id":"","document_type":"","document_url":"https://docs.example.com/postmortem-test-get_postmortem_for_an_incident_returns_ok_response-1783629996","modified":"2026-07-09T20:46:37.029493Z","status":"draft","title":"Postmortem + for Test-Get_postmortem_for_an_incident_returns_OK_response-1783629996"},"relationships":{"incident":{"data":{"id":"4832db36-b2ec-5f98-917a-3b2fff43a58c","type":"incidents"}},"last_modified_by_user":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}},"postmortem_owner_responder":{"data":null},"postmortem_owner_user":{"data":null}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Thu, 09 Jul 2026 20:46:36 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/incidents/4832db36-b2ec-5f98-917a-3b2fff43a58c/postmortem + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +- recorded_at: Thu, 09 Jul 2026 20:46:36 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/incidents/4832db36-b2ec-5f98-917a-3b2fff43a58c + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/incidents/Update-postmortem-for-an-incident-returns-OK-response.frozen b/cassettes/features/v2/incidents/Update-postmortem-for-an-incident-returns-OK-response.frozen new file mode 100644 index 000000000000..de335b344d9b --- /dev/null +++ b/cassettes/features/v2/incidents/Update-postmortem-for-an-incident-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-07-09T20:46:38.293Z \ No newline at end of file diff --git a/cassettes/features/v2/incidents/Update-postmortem-for-an-incident-returns-OK-response.yml b/cassettes/features/v2/incidents/Update-postmortem-for-an-incident-returns-OK-response.yml new file mode 100644 index 000000000000..87da29ab919a --- /dev/null +++ b/cassettes/features/v2/incidents/Update-postmortem-for-an-incident-returns-OK-response.yml @@ -0,0 +1,108 @@ +http_interactions: +- recorded_at: Thu, 09 Jul 2026 20:46:38 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"customer_impacted":false,"title":"Test-Update_postmortem_for_an_incident_returns_OK_response-1783629998"},"type":"incidents"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/incidents + response: + body: + encoding: UTF-8 + string: '{"data":{"type":"incidents","id":"c22705d8-525c-52bd-89bc-c7b33823c592","attributes":{"public_id":364278,"incident_type_uuid":"41d2e10b-4108-4736-92d7-791d00ea0702","title":"Test-Update_postmortem_for_an_incident_returns_OK_response-1783629998","resolved":null,"customer_impact_scope":null,"customer_impact_start":null,"customer_impact_end":null,"customer_impacted":false,"notification_handles":null,"last_modified_by":{"data":{"type":"users","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","attributes":{"uuid":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","email":"team-intg-tools-libs-spam@datadoghq.com","name":"CI + Account","icon":"https://secure.gravatar.com/avatar/b7c189b5b4c2c429d7c1e0bc3749330e?s=48&d=retro"}}},"last_modified_by_uuid":null,"created":"2026-07-09T20:46:38.508134+00:00","modified":"2026-07-09T20:46:38.508134+00:00","commander":null,"detected":"2026-07-09T20:46:38.500429+00:00","created_by":{"data":{"type":"users","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","attributes":{"uuid":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","email":"team-intg-tools-libs-spam@datadoghq.com","name":"CI + Account","icon":"https://secure.gravatar.com/avatar/b7c189b5b4c2c429d7c1e0bc3749330e?s=48&d=retro"}}},"created_by_uuid":null,"creation_idempotency_key":null,"customer_impact_duration":0,"time_to_detect":0,"time_to_repair":0,"time_to_internal_response":0,"time_to_resolve":0,"is_test":false,"declared":"2026-07-09T20:46:38.508134+00:00","declared_by":{"data":{"type":"users","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","attributes":{"uuid":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","email":"team-intg-tools-libs-spam@datadoghq.com","name":"CI + Account","icon":"https://secure.gravatar.com/avatar/b7c189b5b4c2c429d7c1e0bc3749330e?s=48&d=retro"}}},"declared_by_uuid":null,"fields":{"teams":{"type":"autocomplete","value":null},"severity":{"type":"dropdown","value":"UNKNOWN"},"state":{"type":"dropdown","value":"active"},"detection_method":{"type":"dropdown","value":"unknown"},"root_cause":{"type":"textbox","value":null},"summary":{"type":"textbox","value":null},"services":{"type":"autocomplete","value":null},"slug":{"type":"textbox","value":"IR-364278"}},"field_analytics":null,"severity":"UNKNOWN","state":"active","non_datadog_creator":null,"visibility":"organization","case_id":null},"relationships":{"created_by_user":{"data":{"type":"users","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"}},"last_modified_by_user":{"data":{"type":"users","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"}},"commander_user":{"data":null},"declared_by_user":{"data":{"type":"users","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"}},"user_defined_fields":{"data":[{"type":"user_defined_field","id":"3cbe9e60-d794-532c-acc0-73641f782813"},{"type":"user_defined_field","id":"33457d2a-570c-5567-b4af-979a2a8f1164"},{"type":"user_defined_field","id":"d003693c-bee9-5420-8d46-859269c20914"},{"type":"user_defined_field","id":"1ddff6f6-cb1f-51a0-9d81-dc18ef52cc9d"},{"type":"user_defined_field","id":"6bc9d32b-c2cd-591e-9b7a-74c886a5ddcf"},{"type":"user_defined_field","id":"95c53547-2ba3-5d8a-9c3b-cf245bc0c629"},{"type":"user_defined_field","id":"39044b03-cee4-555f-b1e0-3eb3aa759a86"},{"type":"user_defined_field","id":"2b9f1063-b915-4c7a-8bbd-fc3940245529"}]},"integrations":{"data":[]},"attachments":{"data":[]},"responders":{"data":[]},"impacts":{"data":[]}}}} + + ' + headers: + Content-Type: + - application/json + status: + code: 201 + message: Created +- recorded_at: Thu, 09 Jul 2026 20:46:38 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"document_url":"https://docs.example.com/postmortem-test-update_postmortem_for_an_incident_returns_ok_response-1783629998","title":"Postmortem + for Test-Update_postmortem_for_an_incident_returns_OK_response-1783629998"},"type":"incident_postmortems"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/incidents/c22705d8-525c-52bd-89bc-c7b33823c592/postmortem + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"d37b1ea1-eeae-4fc9-93d0-41e64d9df187","type":"incident_postmortems","attributes":{"created":"2026-07-09T20:46:38.961153Z","document_id":"","document_type":"","document_url":"https://docs.example.com/postmortem-test-update_postmortem_for_an_incident_returns_ok_response-1783629998","modified":"2026-07-09T20:46:38.961153Z","status":"draft","title":"Postmortem + for Test-Update_postmortem_for_an_incident_returns_OK_response-1783629998"},"relationships":{"incident":{"data":{"id":"c22705d8-525c-52bd-89bc-c7b33823c592","type":"incidents"}},"last_modified_by_user":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}},"postmortem_owner_responder":{"data":null},"postmortem_owner_user":{"data":null}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Thu, 09 Jul 2026 20:46:38 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"status":"in_review"},"id":"d37b1ea1-eeae-4fc9-93d0-41e64d9df187","type":"incident_postmortems"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/incidents/c22705d8-525c-52bd-89bc-c7b33823c592/postmortem + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"d37b1ea1-eeae-4fc9-93d0-41e64d9df187","type":"incident_postmortems","attributes":{"created":"2026-07-09T20:46:38.961153Z","document_id":"","document_type":"","document_url":"https://docs.example.com/postmortem-test-update_postmortem_for_an_incident_returns_ok_response-1783629998","modified":"2026-07-09T20:46:43.136363Z","status":"in_review","title":"Postmortem + for Test-Update_postmortem_for_an_incident_returns_OK_response-1783629998"},"relationships":{"incident":{"data":{"id":"c22705d8-525c-52bd-89bc-c7b33823c592","type":"incidents"}},"last_modified_by_user":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}},"postmortem_owner_responder":{"data":null},"postmortem_owner_user":{"data":null}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Thu, 09 Jul 2026 20:46:38 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/incidents/c22705d8-525c-52bd-89bc-c7b33823c592/postmortem + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +- recorded_at: Thu, 09 Jul 2026 20:46:38 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/incidents/c22705d8-525c-52bd-89bc-c7b33823c592 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/examples/v2/incidents/CreateIncidentPostmortem.rb b/examples/v2/incidents/CreateIncidentPostmortem.rb new file mode 100644 index 000000000000..f7e953b15eaf --- /dev/null +++ b/examples/v2/incidents/CreateIncidentPostmortem.rb @@ -0,0 +1,21 @@ +# Create postmortem for an incident returns "CREATED" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.create_incident_postmortem".to_sym] = true +end +api_instance = DatadogAPIClient::V2::IncidentsAPI.new + +# there is a valid "incident" in the system +INCIDENT_DATA_ID = ENV["INCIDENT_DATA_ID"] + +body = DatadogAPIClient::V2::IncidentPostmortemCreateRequest.new({ + data: DatadogAPIClient::V2::IncidentPostmortemCreateData.new({ + attributes: DatadogAPIClient::V2::IncidentPostmortemCreateAttributes.new({ + document_url: "https://app.datadoghq.com/notebook/123", + title: "Postmortem for IR-123", + }), + type: DatadogAPIClient::V2::IncidentPostmortemType::INCIDENT_POSTMORTEMS, + }), +}) +p api_instance.create_incident_postmortem(INCIDENT_DATA_ID, body) diff --git a/examples/v2/incidents/DeleteIncidentPostmortem.rb b/examples/v2/incidents/DeleteIncidentPostmortem.rb new file mode 100644 index 000000000000..bc71a5f0f387 --- /dev/null +++ b/examples/v2/incidents/DeleteIncidentPostmortem.rb @@ -0,0 +1,11 @@ +# Delete postmortem for an incident returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.delete_incident_postmortem".to_sym] = true +end +api_instance = DatadogAPIClient::V2::IncidentsAPI.new + +# there is a valid "postmortem" in the system +POSTMORTEM_DATA_RELATIONSHIPS_INCIDENT_DATA_ID = ENV["POSTMORTEM_DATA_RELATIONSHIPS_INCIDENT_DATA_ID"] +api_instance.delete_incident_postmortem(POSTMORTEM_DATA_RELATIONSHIPS_INCIDENT_DATA_ID) diff --git a/examples/v2/incidents/GetIncidentPostmortem.rb b/examples/v2/incidents/GetIncidentPostmortem.rb new file mode 100644 index 000000000000..48e8f0215552 --- /dev/null +++ b/examples/v2/incidents/GetIncidentPostmortem.rb @@ -0,0 +1,11 @@ +# Get postmortem for an incident returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_incident_postmortem".to_sym] = true +end +api_instance = DatadogAPIClient::V2::IncidentsAPI.new + +# there is a valid "postmortem" in the system +POSTMORTEM_DATA_RELATIONSHIPS_INCIDENT_DATA_ID = ENV["POSTMORTEM_DATA_RELATIONSHIPS_INCIDENT_DATA_ID"] +p api_instance.get_incident_postmortem(POSTMORTEM_DATA_RELATIONSHIPS_INCIDENT_DATA_ID) diff --git a/examples/v2/incidents/UpdateIncidentPostmortem.rb b/examples/v2/incidents/UpdateIncidentPostmortem.rb new file mode 100644 index 000000000000..023a7b2a3a1b --- /dev/null +++ b/examples/v2/incidents/UpdateIncidentPostmortem.rb @@ -0,0 +1,22 @@ +# Update postmortem for an incident returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.update_incident_postmortem".to_sym] = true +end +api_instance = DatadogAPIClient::V2::IncidentsAPI.new + +# there is a valid "postmortem" in the system +POSTMORTEM_DATA_ID = ENV["POSTMORTEM_DATA_ID"] +POSTMORTEM_DATA_RELATIONSHIPS_INCIDENT_DATA_ID = ENV["POSTMORTEM_DATA_RELATIONSHIPS_INCIDENT_DATA_ID"] + +body = DatadogAPIClient::V2::IncidentPostmortemUpdateRequest.new({ + data: DatadogAPIClient::V2::IncidentPostmortemUpdateData.new({ + attributes: DatadogAPIClient::V2::IncidentPostmortemUpdateAttributes.new({ + status: DatadogAPIClient::V2::PostmortemStatus::IN_REVIEW, + }), + id: POSTMORTEM_DATA_ID, + type: DatadogAPIClient::V2::IncidentPostmortemType::INCIDENT_POSTMORTEMS, + }), +}) +p api_instance.update_incident_postmortem(POSTMORTEM_DATA_RELATIONSHIPS_INCIDENT_DATA_ID, body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index f4cb633ab3a6..d69ba4aecae2 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -3610,6 +3610,23 @@ "incident_id" => "String", "impact_id" => "String", }, + "v2.DeleteIncidentPostmortem" => { + "incident_id" => "String", + }, + "v2.GetIncidentPostmortem" => { + "incident_id" => "String", + "include" => "String", + }, + "v2.UpdateIncidentPostmortem" => { + "incident_id" => "String", + "include" => "String", + "body" => "IncidentPostmortemUpdateRequest", + }, + "v2.CreateIncidentPostmortem" => { + "incident_id" => "String", + "include" => "String", + "body" => "IncidentPostmortemCreateRequest", + }, "v2.ListIncidentIntegrations" => { "incident_id" => "String", }, diff --git a/features/v2/given.json b/features/v2/given.json index 0f9de6d48a2f..d4b1c0129957 100644 --- a/features/v2/given.json +++ b/features/v2/given.json @@ -602,6 +602,22 @@ "key": "incident_impact", "tag": "Incidents" }, + { + "parameters": [ + { + "name": "incident_id", + "source": "incident.data.id" + }, + { + "name": "body", + "value": "{\n \"data\": {\n \"type\": \"incident_postmortems\",\n \"attributes\": {\n \"title\": \"Postmortem for {{ unique }}\",\n \"document_url\": \"https://docs.example.com/postmortem-{{ unique_lower }}\"\n }\n }\n}" + } + ], + "step": "there is a valid \"postmortem\" in the system", + "key": "postmortem", + "tag": "Incidents", + "operationId": "CreateIncidentPostmortem" + }, { "parameters": [ { diff --git a/features/v2/incidents.feature b/features/v2/incidents.feature index 646ec88d8798..f06b7f6c8397 100644 --- a/features/v2/incidents.feature +++ b/features/v2/incidents.feature @@ -314,6 +314,45 @@ Feature: Incidents When the request is sent Then the response status is 201 Created + @generated @skip @team:DataDog/incident-app + Scenario: Create postmortem for an incident returns "Bad Request" response + Given operation "CreateIncidentPostmortem" enabled + And new "CreateIncidentPostmortem" request + And request contains "incident_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"document_url": "https://app.datadoghq.com/notebook/123", "title": "Postmortem for IR-123"}, "type": "incident_postmortems"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/incident-app + Scenario: Create postmortem for an incident returns "CREATED" response + Given operation "CreateIncidentPostmortem" enabled + And there is a valid "incident" in the system + And new "CreateIncidentPostmortem" request + And request contains "incident_id" parameter from "incident.data.id" + And body with value {"data": {"attributes": {"document_url": "https://app.datadoghq.com/notebook/123", "title": "Postmortem for IR-123"}, "type": "incident_postmortems"}} + When the request is sent + Then the response status is 201 CREATED + And the response "data.type" is equal to "incident_postmortems" + And the response "data.relationships.incident.data.id" has the same value as "incident.data.id" + + @generated @skip @team:DataDog/incident-app + Scenario: Create postmortem for an incident returns "Conflict" response + Given operation "CreateIncidentPostmortem" enabled + And new "CreateIncidentPostmortem" request + And request contains "incident_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"document_url": "https://app.datadoghq.com/notebook/123", "title": "Postmortem for IR-123"}, "type": "incident_postmortems"}} + When the request is sent + Then the response status is 409 Conflict + + @generated @skip @team:DataDog/incident-app + Scenario: Create postmortem for an incident returns "Not Found" response + Given operation "CreateIncidentPostmortem" enabled + And new "CreateIncidentPostmortem" request + And request contains "incident_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"document_url": "https://app.datadoghq.com/notebook/123", "title": "Postmortem for IR-123"}, "type": "incident_postmortems"}} + When the request is sent + Then the response status is 404 Not Found + @generated @skip @team:DataDog/incident-app Scenario: Create postmortem template returns "Bad Request" response Given operation "CreateIncidentPostmortemTemplate" enabled @@ -601,6 +640,32 @@ Feature: Incidents When the request is sent Then the response status is 204 No Content + @generated @skip @team:DataDog/incident-app + Scenario: Delete postmortem for an incident returns "Bad Request" response + Given operation "DeleteIncidentPostmortem" enabled + And new "DeleteIncidentPostmortem" request + And request contains "incident_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/incident-app + Scenario: Delete postmortem for an incident returns "Not Found" response + Given operation "DeleteIncidentPostmortem" enabled + And new "DeleteIncidentPostmortem" request + And request contains "incident_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/incident-app + Scenario: Delete postmortem for an incident returns "OK" response + Given operation "DeleteIncidentPostmortem" enabled + And there is a valid "incident" in the system + And there is a valid "postmortem" in the system + And new "DeleteIncidentPostmortem" request + And request contains "incident_id" parameter from "postmortem.data.relationships.incident.data.id" + When the request is sent + Then the response status is 204 OK + @generated @skip @team:DataDog/incident-app Scenario: Delete postmortem template returns "Bad Request" response Given operation "DeleteIncidentPostmortemTemplate" enabled @@ -929,6 +994,33 @@ Feature: Incidents When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/incident-app + Scenario: Get postmortem for an incident returns "Bad Request" response + Given operation "GetIncidentPostmortem" enabled + And new "GetIncidentPostmortem" request + And request contains "incident_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/incident-app + Scenario: Get postmortem for an incident returns "Not Found" response + Given operation "GetIncidentPostmortem" enabled + And new "GetIncidentPostmortem" request + And request contains "incident_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/incident-app + Scenario: Get postmortem for an incident returns "OK" response + Given operation "GetIncidentPostmortem" enabled + And there is a valid "incident" in the system + And there is a valid "postmortem" in the system + And new "GetIncidentPostmortem" request + And request contains "incident_id" parameter from "postmortem.data.relationships.incident.data.id" + When the request is sent + Then the response status is 200 OK + And the response "data.attributes.title" has the same value as "postmortem.data.attributes.title" + @generated @skip @team:DataDog/incident-app Scenario: Get postmortem template returns "Bad Request" response Given operation "GetIncidentPostmortemTemplate" enabled @@ -1480,6 +1572,36 @@ Feature: Incidents And the response "data.attributes.name" has the same value as "unique" And the response "data.attributes.category" is equal to "update" + @generated @skip @team:DataDog/incident-app + Scenario: Update postmortem for an incident returns "Bad Request" response + Given operation "UpdateIncidentPostmortem" enabled + And new "UpdateIncidentPostmortem" request + And request contains "incident_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"status": "draft"}, "id": "00000000-0000-abcd-1000-000000000000", "type": "incident_postmortems"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/incident-app + Scenario: Update postmortem for an incident returns "Not Found" response + Given operation "UpdateIncidentPostmortem" enabled + And new "UpdateIncidentPostmortem" request + And request contains "incident_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"status": "draft"}, "id": "00000000-0000-abcd-1000-000000000000", "type": "incident_postmortems"}} + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/incident-app + Scenario: Update postmortem for an incident returns "OK" response + Given operation "UpdateIncidentPostmortem" enabled + And there is a valid "incident" in the system + And there is a valid "postmortem" in the system + And new "UpdateIncidentPostmortem" request + And request contains "incident_id" parameter from "postmortem.data.relationships.incident.data.id" + And body with value {"data": {"attributes": {"status": "in_review"}, "id": "{{ postmortem.data.id }}", "type": "incident_postmortems"}} + When the request is sent + Then the response status is 200 OK + And the response "data.attributes.status" is equal to "in_review" + @generated @skip @team:DataDog/incident-app Scenario: Update postmortem template returns "Bad Request" response Given operation "UpdateIncidentPostmortemTemplate" enabled diff --git a/features/v2/undo.json b/features/v2/undo.json index 1eaba52ee9bf..d9d1f7b28d3f 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -3218,6 +3218,37 @@ "type": "idempotent" } }, + "DeleteIncidentPostmortem": { + "tag": "Incidents", + "undo": { + "type": "idempotent" + } + }, + "GetIncidentPostmortem": { + "tag": "Incidents", + "undo": { + "type": "safe" + } + }, + "UpdateIncidentPostmortem": { + "tag": "Incidents", + "undo": { + "type": "idempotent" + } + }, + "CreateIncidentPostmortem": { + "tag": "Incidents", + "undo": { + "operationId": "DeleteIncidentPostmortem", + "parameters": [ + { + "name": "incident_id", + "source": "data.relationships.incident.data.id" + } + ], + "type": "unsafe" + } + }, "ListIncidentIntegrations": { "tag": "Incidents", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index 5b2130e9913c..e9600c8e2530 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -507,6 +507,7 @@ def initialize "v2.create_incident_integration": false, "v2.create_incident_notification_rule": false, "v2.create_incident_notification_template": false, + "v2.create_incident_postmortem": false, "v2.create_incident_postmortem_attachment": false, "v2.create_incident_postmortem_template": false, "v2.create_incident_todo": false, @@ -518,6 +519,7 @@ def initialize "v2.delete_incident_integration": false, "v2.delete_incident_notification_rule": false, "v2.delete_incident_notification_template": false, + "v2.delete_incident_postmortem": false, "v2.delete_incident_postmortem_template": false, "v2.delete_incident_todo": false, "v2.delete_incident_type": false, @@ -527,6 +529,7 @@ def initialize "v2.get_incident_integration": false, "v2.get_incident_notification_rule": false, "v2.get_incident_notification_template": false, + "v2.get_incident_postmortem": false, "v2.get_incident_postmortem_template": false, "v2.get_incident_todo": false, "v2.get_incident_type": false, @@ -550,6 +553,7 @@ def initialize "v2.update_incident_integration": false, "v2.update_incident_notification_rule": false, "v2.update_incident_notification_template": false, + "v2.update_incident_postmortem": false, "v2.update_incident_postmortem_template": false, "v2.update_incident_todo": false, "v2.update_incident_type": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index bb489f2e6b16..5edc8978139d 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -3797,7 +3797,18 @@ def overrides "v2.incident_notification_template_type" => "IncidentNotificationTemplateType", "v2.incident_notification_template_update_attributes" => "IncidentNotificationTemplateUpdateAttributes", "v2.incident_notification_template_update_data" => "IncidentNotificationTemplateUpdateData", + "v2.incident_postmortem_attributes" => "IncidentPostmortemAttributes", + "v2.incident_postmortem_create_attributes" => "IncidentPostmortemCreateAttributes", + "v2.incident_postmortem_create_data" => "IncidentPostmortemCreateData", + "v2.incident_postmortem_create_request" => "IncidentPostmortemCreateRequest", + "v2.incident_postmortem_data" => "IncidentPostmortemData", + "v2.incident_postmortem_included" => "IncidentPostmortemIncluded", + "v2.incident_postmortem_relationships" => "IncidentPostmortemRelationships", + "v2.incident_postmortem_response" => "IncidentPostmortemResponse", "v2.incident_postmortem_type" => "IncidentPostmortemType", + "v2.incident_postmortem_update_attributes" => "IncidentPostmortemUpdateAttributes", + "v2.incident_postmortem_update_data" => "IncidentPostmortemUpdateData", + "v2.incident_postmortem_update_request" => "IncidentPostmortemUpdateRequest", "v2.incident_related_object" => "IncidentRelatedObject", "v2.incident_relationship_data" => "IncidentRelationshipData", "v2.incident_resource_type" => "IncidentResourceType", @@ -4945,6 +4956,7 @@ def overrides "v2.notion_integration" => "NotionIntegration", "v2.notion_integration_type" => "NotionIntegrationType", "v2.notion_integration_update" => "NotionIntegrationUpdate", + "v2.nullable_relationship_to_incident_responder_data" => "NullableRelationshipToIncidentResponderData", "v2.nullable_relationship_to_user" => "NullableRelationshipToUser", "v2.nullable_relationship_to_user_data" => "NullableRelationshipToUserData", "v2.nullable_user_relationship" => "NullableUserRelationship", @@ -5654,6 +5666,7 @@ def overrides "v2.postmortem_cell_attributes" => "PostmortemCellAttributes", "v2.postmortem_cell_definition" => "PostmortemCellDefinition", "v2.postmortem_cell_type" => "PostmortemCellType", + "v2.postmortem_status" => "PostmortemStatus", "v2.postmortem_template_attributes_request" => "PostmortemTemplateAttributesRequest", "v2.postmortem_template_attributes_response" => "PostmortemTemplateAttributesResponse", "v2.postmortem_template_data_request" => "PostmortemTemplateDataRequest", @@ -5835,6 +5848,7 @@ def overrides "v2.relationship_to_incident_postmortem" => "RelationshipToIncidentPostmortem", "v2.relationship_to_incident_postmortem_data" => "RelationshipToIncidentPostmortemData", "v2.relationship_to_incident_request" => "RelationshipToIncidentRequest", + "v2.relationship_to_incident_responder" => "RelationshipToIncidentResponder", "v2.relationship_to_incident_responder_data" => "RelationshipToIncidentResponderData", "v2.relationship_to_incident_responders" => "RelationshipToIncidentResponders", "v2.relationship_to_incident_type" => "RelationshipToIncidentType", diff --git a/lib/datadog_api_client/v2/api/incidents_api.rb b/lib/datadog_api_client/v2/api/incidents_api.rb index e5ea4e02b73e..7b582485b879 100644 --- a/lib/datadog_api_client/v2/api/incidents_api.rb +++ b/lib/datadog_api_client/v2/api/incidents_api.rb @@ -549,6 +549,89 @@ def create_incident_notification_template_with_http_info(body, opts = {}) return data, status_code, headers end + # Create postmortem for an incident. + # + # @see #create_incident_postmortem_with_http_info + def create_incident_postmortem(incident_id, body, opts = {}) + data, _status_code, _headers = create_incident_postmortem_with_http_info(incident_id, body, opts) + data + end + + # Create postmortem for an incident. + # + # Create a postmortem for an incident by linking a title and document URL + # (for example, a Datadog notebook, Confluence page, or Google Doc). + # + # Only one postmortem is allowed per incident. + # + # @param incident_id [String] The UUID of the incident. + # @param body [IncidentPostmortemCreateRequest] Postmortem creation payload. + # @param opts [Hash] the optional parameters + # @option opts [String] :include Resources to include in the response. Supported values: `last_modified_by_user`, `postmortem_owner_user`, `postmortem_owner_responder`, `incident`. + # @return [Array<(IncidentPostmortemResponse, Integer, Hash)>] IncidentPostmortemResponse data, response status code and response headers + def create_incident_postmortem_with_http_info(incident_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_incident_postmortem".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_incident_postmortem") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_incident_postmortem")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IncidentsAPI.create_incident_postmortem ...' + end + # verify the required parameter 'incident_id' is set + if @api_client.config.client_side_validation && incident_id.nil? + fail ArgumentError, "Missing the required parameter 'incident_id' when calling IncidentsAPI.create_incident_postmortem" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling IncidentsAPI.create_incident_postmortem" + end + # resource path + local_var_path = '/api/v2/incidents/{incident_id}/postmortem'.sub('{incident_id}', CGI.escape(incident_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'IncidentPostmortemResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :create_incident_postmortem, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: IncidentsAPI#create_incident_postmortem\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Create postmortem attachment. # # @see #create_incident_postmortem_attachment_with_http_info @@ -1432,6 +1515,77 @@ def delete_incident_notification_template_with_http_info(id, opts = {}) return data, status_code, headers end + # Delete postmortem for an incident. + # + # @see #delete_incident_postmortem_with_http_info + def delete_incident_postmortem(incident_id, opts = {}) + delete_incident_postmortem_with_http_info(incident_id, opts) + nil + end + + # Delete postmortem for an incident. + # + # Delete the postmortem attached to an incident. + # + # @param incident_id [String] The UUID of the incident. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_incident_postmortem_with_http_info(incident_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_incident_postmortem".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_incident_postmortem") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_incident_postmortem")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IncidentsAPI.delete_incident_postmortem ...' + end + # verify the required parameter 'incident_id' is set + if @api_client.config.client_side_validation && incident_id.nil? + fail ArgumentError, "Missing the required parameter 'incident_id' when calling IncidentsAPI.delete_incident_postmortem" + end + # resource path + local_var_path = '/api/v2/incidents/{incident_id}/postmortem'.sub('{incident_id}', CGI.escape(incident_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :delete_incident_postmortem, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: IncidentsAPI#delete_incident_postmortem\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Delete postmortem template. # # @see #delete_incident_postmortem_template_with_http_info @@ -2082,6 +2236,79 @@ def get_incident_notification_template_with_http_info(id, opts = {}) return data, status_code, headers end + # Get postmortem for an incident. + # + # @see #get_incident_postmortem_with_http_info + def get_incident_postmortem(incident_id, opts = {}) + data, _status_code, _headers = get_incident_postmortem_with_http_info(incident_id, opts) + data + end + + # Get postmortem for an incident. + # + # Get the postmortem attached to an incident. + # + # @param incident_id [String] The UUID of the incident. + # @param opts [Hash] the optional parameters + # @option opts [String] :include Resources to include in the response. Supported values: `last_modified_by_user`, `postmortem_owner_user`, `postmortem_owner_responder`, `incident`. + # @return [Array<(IncidentPostmortemResponse, Integer, Hash)>] IncidentPostmortemResponse data, response status code and response headers + def get_incident_postmortem_with_http_info(incident_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_incident_postmortem".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_incident_postmortem") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_incident_postmortem")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IncidentsAPI.get_incident_postmortem ...' + end + # verify the required parameter 'incident_id' is set + if @api_client.config.client_side_validation && incident_id.nil? + fail ArgumentError, "Missing the required parameter 'incident_id' when calling IncidentsAPI.get_incident_postmortem" + end + # resource path + local_var_path = '/api/v2/incidents/{incident_id}/postmortem'.sub('{incident_id}', CGI.escape(incident_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'IncidentPostmortemResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :get_incident_postmortem, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: IncidentsAPI#get_incident_postmortem\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Get postmortem template. # # @see #get_incident_postmortem_template_with_http_info @@ -3914,6 +4141,86 @@ def update_incident_notification_template_with_http_info(id, body, opts = {}) return data, status_code, headers end + # Update postmortem for an incident. + # + # @see #update_incident_postmortem_with_http_info + def update_incident_postmortem(incident_id, body, opts = {}) + data, _status_code, _headers = update_incident_postmortem_with_http_info(incident_id, body, opts) + data + end + + # Update postmortem for an incident. + # + # Update the postmortem attached to an incident, for example to change its status. + # + # @param incident_id [String] The UUID of the incident. + # @param body [IncidentPostmortemUpdateRequest] Postmortem update payload. + # @param opts [Hash] the optional parameters + # @option opts [String] :include Resources to include in the response. Supported values: `last_modified_by_user`, `postmortem_owner_user`, `postmortem_owner_responder`, `incident`. + # @return [Array<(IncidentPostmortemResponse, Integer, Hash)>] IncidentPostmortemResponse data, response status code and response headers + def update_incident_postmortem_with_http_info(incident_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.update_incident_postmortem".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_incident_postmortem") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_incident_postmortem")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IncidentsAPI.update_incident_postmortem ...' + end + # verify the required parameter 'incident_id' is set + if @api_client.config.client_side_validation && incident_id.nil? + fail ArgumentError, "Missing the required parameter 'incident_id' when calling IncidentsAPI.update_incident_postmortem" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling IncidentsAPI.update_incident_postmortem" + end + # resource path + local_var_path = '/api/v2/incidents/{incident_id}/postmortem'.sub('{incident_id}', CGI.escape(incident_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'IncidentPostmortemResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :update_incident_postmortem, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: IncidentsAPI#update_incident_postmortem\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Update postmortem template. # # @see #update_incident_postmortem_template_with_http_info diff --git a/lib/datadog_api_client/v2/models/incident_postmortem_attributes.rb b/lib/datadog_api_client/v2/models/incident_postmortem_attributes.rb new file mode 100644 index 000000000000..dac6acef507a --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_postmortem_attributes.rb @@ -0,0 +1,249 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The postmortem's attributes. + class IncidentPostmortemAttributes + include BaseGenericModel + + # Timestamp when the postmortem was created. + attr_reader :created + + # The identifier of the postmortem document within its host platform. + attr_reader :document_id + + # The type of document backing the postmortem (for example, `datadog_notebooks`, `confluence`, or `google_docs`). Can be empty if the document type is unknown. + attr_reader :document_type + + # The URL of the postmortem document. + attr_reader :document_url + + # Timestamp when the postmortem was last modified. + attr_reader :modified + + # The status of the postmortem. + attr_reader :status + + # The title of the postmortem. + attr_reader :title + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'created' => :'created', + :'document_id' => :'document_id', + :'document_type' => :'document_type', + :'document_url' => :'document_url', + :'modified' => :'modified', + :'status' => :'status', + :'title' => :'title' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'created' => :'Time', + :'document_id' => :'String', + :'document_type' => :'String', + :'document_url' => :'String', + :'modified' => :'Time', + :'status' => :'PostmortemStatus', + :'title' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentPostmortemAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'created') + self.created = attributes[:'created'] + end + + if attributes.key?(:'document_id') + self.document_id = attributes[:'document_id'] + end + + if attributes.key?(:'document_type') + self.document_type = attributes[:'document_type'] + end + + if attributes.key?(:'document_url') + self.document_url = attributes[:'document_url'] + end + + if attributes.key?(:'modified') + self.modified = attributes[:'modified'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'title') + self.title = attributes[:'title'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @created.nil? + return false if @document_id.nil? + return false if @document_type.nil? + return false if @document_url.nil? + return false if @modified.nil? + return false if @status.nil? + return false if @title.nil? + true + end + + # Custom attribute writer method with validation + # @param created [Object] Object to be assigned + # @!visibility private + def created=(created) + if created.nil? + fail ArgumentError, 'invalid value for "created", created cannot be nil.' + end + @created = created + end + + # Custom attribute writer method with validation + # @param document_id [Object] Object to be assigned + # @!visibility private + def document_id=(document_id) + if document_id.nil? + fail ArgumentError, 'invalid value for "document_id", document_id cannot be nil.' + end + @document_id = document_id + end + + # Custom attribute writer method with validation + # @param document_type [Object] Object to be assigned + # @!visibility private + def document_type=(document_type) + if document_type.nil? + fail ArgumentError, 'invalid value for "document_type", document_type cannot be nil.' + end + @document_type = document_type + end + + # Custom attribute writer method with validation + # @param document_url [Object] Object to be assigned + # @!visibility private + def document_url=(document_url) + if document_url.nil? + fail ArgumentError, 'invalid value for "document_url", document_url cannot be nil.' + end + @document_url = document_url + end + + # Custom attribute writer method with validation + # @param modified [Object] Object to be assigned + # @!visibility private + def modified=(modified) + if modified.nil? + fail ArgumentError, 'invalid value for "modified", modified cannot be nil.' + end + @modified = modified + end + + # Custom attribute writer method with validation + # @param status [Object] Object to be assigned + # @!visibility private + def status=(status) + if status.nil? + fail ArgumentError, 'invalid value for "status", status cannot be nil.' + end + @status = status + end + + # Custom attribute writer method with validation + # @param title [Object] Object to be assigned + # @!visibility private + def title=(title) + if title.nil? + fail ArgumentError, 'invalid value for "title", title cannot be nil.' + end + @title = title + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + created == o.created && + document_id == o.document_id && + document_type == o.document_type && + document_url == o.document_url && + modified == o.modified && + status == o.status && + title == o.title && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [created, document_id, document_type, document_url, modified, status, title, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_postmortem_create_attributes.rb b/lib/datadog_api_client/v2/models/incident_postmortem_create_attributes.rb new file mode 100644 index 000000000000..8108e34685f9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_postmortem_create_attributes.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The postmortem's attributes for a creation request. + class IncidentPostmortemCreateAttributes + include BaseGenericModel + + # The URL of the postmortem document (for example, a Datadog notebook, Confluence page, or Google Doc). + attr_reader :document_url + + # The title of the postmortem. + attr_reader :title + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'document_url' => :'document_url', + :'title' => :'title' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'document_url' => :'String', + :'title' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentPostmortemCreateAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'document_url') + self.document_url = attributes[:'document_url'] + end + + if attributes.key?(:'title') + self.title = attributes[:'title'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @document_url.nil? + return false if @title.nil? + true + end + + # Custom attribute writer method with validation + # @param document_url [Object] Object to be assigned + # @!visibility private + def document_url=(document_url) + if document_url.nil? + fail ArgumentError, 'invalid value for "document_url", document_url cannot be nil.' + end + @document_url = document_url + end + + # Custom attribute writer method with validation + # @param title [Object] Object to be assigned + # @!visibility private + def title=(title) + if title.nil? + fail ArgumentError, 'invalid value for "title", title cannot be nil.' + end + @title = title + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + document_url == o.document_url && + title == o.title && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [document_url, title, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_postmortem_create_data.rb b/lib/datadog_api_client/v2/models/incident_postmortem_create_data.rb new file mode 100644 index 000000000000..ff9c6b1bc989 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_postmortem_create_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The postmortem resource for a creation request. + class IncidentPostmortemCreateData + include BaseGenericModel + + # The postmortem's attributes for a creation request. + attr_reader :attributes + + # Incident postmortem resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'IncidentPostmortemCreateAttributes', + :'type' => :'IncidentPostmortemType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentPostmortemCreateData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_postmortem_create_request.rb b/lib/datadog_api_client/v2/models/incident_postmortem_create_request.rb new file mode 100644 index 000000000000..94cc5a40bd4a --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_postmortem_create_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request to create a postmortem for an incident. + class IncidentPostmortemCreateRequest + include BaseGenericModel + + # The postmortem resource for a creation request. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'IncidentPostmortemCreateData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentPostmortemCreateRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_postmortem_data.rb b/lib/datadog_api_client/v2/models/incident_postmortem_data.rb new file mode 100644 index 000000000000..06097a6cf392 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_postmortem_data.rb @@ -0,0 +1,186 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The postmortem resource. + class IncidentPostmortemData + include BaseGenericModel + + # The postmortem's attributes. + attr_reader :attributes + + # The UUID of the postmortem. + attr_reader :id + + # The postmortem's relationships. + attr_reader :relationships + + # Incident postmortem resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'relationships' => :'relationships', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'IncidentPostmortemAttributes', + :'id' => :'String', + :'relationships' => :'IncidentPostmortemRelationships', + :'type' => :'IncidentPostmortemType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentPostmortemData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'relationships') + self.relationships = attributes[:'relationships'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @relationships.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param relationships [Object] Object to be assigned + # @!visibility private + def relationships=(relationships) + if relationships.nil? + fail ArgumentError, 'invalid value for "relationships", relationships cannot be nil.' + end + @relationships = relationships + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + relationships == o.relationships && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, relationships, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_postmortem_included.rb b/lib/datadog_api_client/v2/models/incident_postmortem_included.rb new file mode 100644 index 000000000000..4a23633c1322 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_postmortem_included.rb @@ -0,0 +1,63 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # An object related to a postmortem that is included in the response. + module IncidentPostmortemIncluded + class << self + include BaseOneOfModel + include BaseOneOfModelNoDiscriminator + + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'IncidentUserData', + :'IncidentResponseData' + ] + end + # Builds the object + # @param data [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass, data) + next if typed_data.respond_to?(:_unparsed) && typed_data._unparsed + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + if openapi_one_of.include?(:AnyType) + data + else + self._unparsed = true + DatadogAPIClient::UnparsedObject.new(data) + end + end + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_postmortem_relationships.rb b/lib/datadog_api_client/v2/models/incident_postmortem_relationships.rb new file mode 100644 index 000000000000..162ff7f11c4e --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_postmortem_relationships.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The postmortem's relationships. + class IncidentPostmortemRelationships + include BaseGenericModel + + # Relationship to incident. + attr_accessor :incident + + # Relationship to user. + attr_accessor :last_modified_by_user + + # A relationship reference for a single incident responder. + attr_accessor :postmortem_owner_responder + + # Relationship to user. + attr_accessor :postmortem_owner_user + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'incident' => :'incident', + :'last_modified_by_user' => :'last_modified_by_user', + :'postmortem_owner_responder' => :'postmortem_owner_responder', + :'postmortem_owner_user' => :'postmortem_owner_user' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'incident' => :'RelationshipToIncident', + :'last_modified_by_user' => :'RelationshipToUser', + :'postmortem_owner_responder' => :'RelationshipToIncidentResponder', + :'postmortem_owner_user' => :'NullableRelationshipToUser' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'postmortem_owner_responder', + :'postmortem_owner_user', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentPostmortemRelationships` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'incident') + self.incident = attributes[:'incident'] + end + + if attributes.key?(:'last_modified_by_user') + self.last_modified_by_user = attributes[:'last_modified_by_user'] + end + + if attributes.key?(:'postmortem_owner_responder') + self.postmortem_owner_responder = attributes[:'postmortem_owner_responder'] + end + + if attributes.key?(:'postmortem_owner_user') + self.postmortem_owner_user = attributes[:'postmortem_owner_user'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + incident == o.incident && + last_modified_by_user == o.last_modified_by_user && + postmortem_owner_responder == o.postmortem_owner_responder && + postmortem_owner_user == o.postmortem_owner_user && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [incident, last_modified_by_user, postmortem_owner_responder, postmortem_owner_user, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_postmortem_response.rb b/lib/datadog_api_client/v2/models/incident_postmortem_response.rb new file mode 100644 index 000000000000..ff3a3c564b90 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_postmortem_response.rb @@ -0,0 +1,135 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response with a single incident postmortem. + class IncidentPostmortemResponse + include BaseGenericModel + + # The postmortem resource. + attr_reader :data + + # Related objects included in the response. + attr_accessor :included + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'included' => :'included' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'IncidentPostmortemData', + :'included' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentPostmortemResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + + if attributes.key?(:'included') + if (value = attributes[:'included']).is_a?(Array) + self.included = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + included == o.included && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, included, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_postmortem_update_attributes.rb b/lib/datadog_api_client/v2/models/incident_postmortem_update_attributes.rb new file mode 100644 index 000000000000..2d5b2af00ff6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_postmortem_update_attributes.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The postmortem's attributes for an update request. + class IncidentPostmortemUpdateAttributes + include BaseGenericModel + + # The status of the postmortem. + attr_accessor :status + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'status' => :'status' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'status' => :'PostmortemStatus' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentPostmortemUpdateAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + status == o.status && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [status, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_postmortem_update_data.rb b/lib/datadog_api_client/v2/models/incident_postmortem_update_data.rb new file mode 100644 index 000000000000..8cc1a045f689 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_postmortem_update_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The postmortem resource for an update request. + class IncidentPostmortemUpdateData + include BaseGenericModel + + # The postmortem's attributes for an update request. + attr_reader :attributes + + # The UUID of the postmortem. + attr_reader :id + + # Incident postmortem resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'IncidentPostmortemUpdateAttributes', + :'id' => :'String', + :'type' => :'IncidentPostmortemType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentPostmortemUpdateData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_postmortem_update_request.rb b/lib/datadog_api_client/v2/models/incident_postmortem_update_request.rb new file mode 100644 index 000000000000..6fadab318918 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_postmortem_update_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request to update the postmortem attached to an incident. + class IncidentPostmortemUpdateRequest + include BaseGenericModel + + # The postmortem resource for an update request. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'IncidentPostmortemUpdateData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentPostmortemUpdateRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/nullable_relationship_to_incident_responder_data.rb b/lib/datadog_api_client/v2/models/nullable_relationship_to_incident_responder_data.rb new file mode 100644 index 000000000000..ab75fc04a24b --- /dev/null +++ b/lib/datadog_api_client/v2/models/nullable_relationship_to_incident_responder_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Relationship to impact object. + class NullableRelationshipToIncidentResponderData + include BaseGenericModel + + # A unique identifier that represents the responder. + attr_reader :id + + # The incident responders type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'String', + :'type' => :'IncidentRespondersType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::NullableRelationshipToIncidentResponderData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/postmortem_status.rb b/lib/datadog_api_client/v2/models/postmortem_status.rb new file mode 100644 index 000000000000..0bd5e69e2c68 --- /dev/null +++ b/lib/datadog_api_client/v2/models/postmortem_status.rb @@ -0,0 +1,28 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The status of the postmortem. + class PostmortemStatus + include BaseEnumModel + + DRAFT = "draft".freeze + IN_REVIEW = "in_review".freeze + COMPLETED = "completed".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/relationship_to_incident_responder.rb b/lib/datadog_api_client/v2/models/relationship_to_incident_responder.rb new file mode 100644 index 000000000000..4029b828aaff --- /dev/null +++ b/lib/datadog_api_client/v2/models/relationship_to_incident_responder.rb @@ -0,0 +1,113 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A relationship reference for a single incident responder. + class RelationshipToIncidentResponder + include BaseGenericModel + + # Relationship to impact object. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'NullableRelationshipToIncidentResponderData' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'data', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RelationshipToIncidentResponder` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end