From c8ded5a5b4a69b1531cfc65e240af384510ffb42 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Wed, 22 Jul 2026 14:29:57 +0000 Subject: [PATCH 1/2] Regenerate client from commit bc75a62 of spec repo --- .generator/schemas/v2/openapi.yaml | 274 +++++++++++++++--- .../api/client/v2/api/incidents.feature | 10 +- .../com/datadog/api/client/v2/api/undo.json | 2 +- 3 files changed, 245 insertions(+), 41 deletions(-) diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 90e1196820e..0417cfefc3f 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -1448,6 +1448,31 @@ components: required: false schema: $ref: "#/components/schemas/OrgGroupPolicySortOption" + PostmortemTemplateFilterIncidentTypeParameter: + description: Filter postmortem templates by the associated incident type ID. + in: query + name: filter[incident-type] + required: false + schema: + format: uuid + type: string + PostmortemTemplateIdParameter: + description: The ID of the postmortem template. + example: 00000000-0000-0000-0000-000000000000 + in: path + name: template_id + required: true + schema: + type: string + PostmortemTemplateSortParameter: + description: The attribute to sort results by. Prefix with `-` for descending order. + in: query + name: sort + required: false + schema: + default: created_at + example: "-created_at" + type: string ProductName: description: Name of the product to be deleted, either `logs` or `rum`. in: path @@ -20811,6 +20836,26 @@ components: type: string x-enum-varnames: - SCHEDULE_TARGET + ConfluencePostmortemSettings: + description: Settings for a postmortem template stored in Confluence. Required when `location` is `confluence`. + properties: + account_id: + description: The ID of the Confluence integration account. + example: "123456" + type: string + parent_id: + description: The ID of the parent Confluence page under which postmortems are created. + example: "345678" + nullable: true + type: string + space_id: + description: The ID of the Confluence space where postmortems are created. + example: "789012" + type: string + required: + - account_id + - space_id + type: object ConfluentAccountCreateRequest: description: Payload schema when adding a Confluent account. properties: @@ -43223,6 +43268,21 @@ components: required: - attributes type: object + GoogleDocsPostmortemSettings: + description: Settings for a postmortem template stored in Google Docs. Required when `location` is `google_docs`. + properties: + account_id: + description: The ID of the Google Drive integration account. + example: "123456" + type: string + parent_folder_id: + description: The ID of the Google Drive folder where postmortems are created. + example: "789012" + type: string + required: + - account_id + - parent_folder_id + type: object GoogleMeetConfigurationReference: description: A reference to a Google Meet Configuration resource. nullable: true @@ -77094,8 +77154,24 @@ components: PostmortemTemplateAttributesRequest: description: Attributes for creating or updating a postmortem template. properties: + confluence_postmortem_settings: + $ref: "#/components/schemas/ConfluencePostmortemSettings" + content: + description: The templated content of the postmortem, supporting Markdown and incident template variables. + example: "# Overview\n\n# What Happened\n\n# Timeline\n\n# Action Items" + type: string + google_docs_postmortem_settings: + $ref: "#/components/schemas/GoogleDocsPostmortemSettings" + is_default: + description: When set, marks this template as a default. The effective default for an incident type is the template with the most recent `is_default` timestamp. Set to `null` to unset. + example: "2024-01-01T00:00:00+00:00" + format: date-time + nullable: true + type: string + location: + $ref: "#/components/schemas/PostmortemTemplateLocation" name: - description: The name of the template + description: The name of the template. example: "Standard Postmortem Template" type: string required: @@ -77104,30 +77180,61 @@ components: PostmortemTemplateAttributesResponse: description: Attributes of a postmortem template returned in a response. properties: + confluence_postmortem_settings: + $ref: "#/components/schemas/ConfluencePostmortemSettings" + content: + description: The templated content of the postmortem, supporting Markdown and incident template variables. + example: "# Overview\n\n# What Happened\n\n# Timeline\n\n# Action Items" + type: string createdAt: - description: When the template was created + description: When the template was created. example: "2026-01-13T17:15:53.208340Z" format: date-time type: string + google_docs_postmortem_settings: + $ref: "#/components/schemas/GoogleDocsPostmortemSettings" + is_default: + description: When set, marks this template as a default. The effective default for an incident type is the template with the most recent `is_default` timestamp. + example: "2024-01-01T00:00:00+00:00" + format: date-time + nullable: true + type: string + location: + $ref: "#/components/schemas/PostmortemTemplateLocation" modifiedAt: - description: When the template was last modified + description: When the template was last modified. example: "2026-01-13T17:15:53.208340Z" format: date-time type: string name: - description: The name of the template + description: The name of the template. example: "Standard Postmortem Template" type: string required: - name + - content + - is_default + - location - createdAt - modifiedAt type: object + PostmortemTemplateCreateRelationships: + description: Relationships for a postmortem template. `incident_type` is required when creating a template and is immutable afterwards. + properties: + incident_type: + $ref: "#/components/schemas/PostmortemTemplateIncidentTypeRelationship" + type: object PostmortemTemplateDataRequest: description: Data object for creating or updating a postmortem template. properties: attributes: $ref: "#/components/schemas/PostmortemTemplateAttributesRequest" + id: + description: The ID of the template. Required when updating. + example: 00000000-0000-0000-0000-000000000000 + type: string + relationships: + $ref: "#/components/schemas/PostmortemTemplateCreateRelationships" type: $ref: "#/components/schemas/PostmortemTemplateType" required: @@ -77140,9 +77247,11 @@ components: attributes: $ref: "#/components/schemas/PostmortemTemplateAttributesResponse" id: - description: The ID of the template - example: "template-456" + description: The ID of the template. + example: 00000000-0000-0000-0000-000000000000 type: string + relationships: + $ref: "#/components/schemas/PostmortemTemplateResponseRelationships" type: $ref: "#/components/schemas/PostmortemTemplateType" required: @@ -77150,6 +77259,43 @@ components: - type - attributes type: object + PostmortemTemplateIncidentTypeRelationship: + description: Relationship to the incident type this template belongs to. + properties: + data: + $ref: "#/components/schemas/PostmortemTemplateIncidentTypeRelationshipData" + required: + - data + type: object + PostmortemTemplateIncidentTypeRelationshipData: + description: Incident type relationship data. + properties: + id: + description: The incident type identifier. + example: 00000000-0000-0000-0000-000000000009 + format: uuid + type: string + type: + description: The incident type resource type. + example: incident_types + type: string + required: + - id + - type + type: object + PostmortemTemplateLocation: + default: datadog_notebooks + description: The location where the postmortem is created and stored. + enum: + - datadog_notebooks + - confluence + - google_docs + example: datadog_notebooks + type: string + x-enum-varnames: + - DATADOG_NOTEBOOKS + - CONFLUENCE + - GOOGLE_DOCS PostmortemTemplateRequest: description: Request body for creating or updating a postmortem template. properties: @@ -77166,14 +77312,48 @@ components: required: - data type: object + PostmortemTemplateResponseRelationships: + description: Relationships of a postmortem template returned in a response. + properties: + incident_type: + $ref: "#/components/schemas/PostmortemTemplateIncidentTypeRelationship" + last_modified_by_user: + $ref: "#/components/schemas/PostmortemTemplateUserRelationship" + type: object PostmortemTemplateType: - description: Postmortem template resource type + description: Postmortem template resource type. enum: + - postmortem_templates - postmortem_template - example: postmortem_template + example: postmortem_templates type: string x-enum-varnames: + - POSTMORTEM_TEMPLATES - POSTMORTEM_TEMPLATE + PostmortemTemplateUserRelationship: + description: Relationship to a user. + properties: + data: + $ref: "#/components/schemas/PostmortemTemplateUserRelationshipData" + required: + - data + type: object + PostmortemTemplateUserRelationshipData: + description: User relationship data. + properties: + id: + description: The user identifier. + example: 00000000-0000-0000-0000-000000000000 + format: uuid + type: string + type: + description: The user resource type. + example: users + type: string + required: + - id + - type + type: object PostmortemTemplatesResponse: description: Response containing a list of postmortem templates. properties: @@ -141993,6 +142173,9 @@ paths: get: description: Retrieve a list of all postmortem templates for incidents. operationId: ListIncidentPostmortemTemplates + parameters: + - $ref: "#/components/parameters/PostmortemTemplateFilterIncidentTypeParameter" + - $ref: "#/components/parameters/PostmortemTemplateSortParameter" responses: "200": content: @@ -142002,11 +142185,19 @@ paths: value: data: - attributes: + content: "# Overview\n\n# What Happened\n\n# Timeline\n\n# Action Items" createdAt: "2024-01-01T00:00:00+00:00" + is_default: "2024-01-01T00:00:00+00:00" + location: datadog_notebooks modifiedAt: "2024-01-01T00:00:00+00:00" name: Standard Postmortem Template id: 00000000-0000-0000-0000-000000000001 - type: postmortem_template + relationships: + incident_type: + data: + id: 00000000-0000-0000-0000-000000000009 + type: incident_types + type: postmortem_templates schema: $ref: "#/components/schemas/PostmortemTemplatesResponse" description: OK @@ -142035,8 +142226,14 @@ paths: value: data: attributes: + content: "# Overview\n\n# What Happened\n\n# Timeline\n\n# Action Items" name: Standard Postmortem Template - type: postmortem_template + relationships: + incident_type: + data: + id: 00000000-0000-0000-0000-000000000009 + type: incident_types + type: postmortem_templates schema: $ref: "#/components/schemas/PostmortemTemplateRequest" required: true @@ -142049,11 +142246,19 @@ paths: value: data: attributes: + content: "# Overview\n\n# What Happened\n\n# Timeline\n\n# Action Items" createdAt: "2024-01-01T00:00:00+00:00" + is_default: + location: datadog_notebooks modifiedAt: "2024-01-01T00:00:00+00:00" name: Standard Postmortem Template id: 00000000-0000-0000-0000-000000000002 - type: postmortem_template + relationships: + incident_type: + data: + id: 00000000-0000-0000-0000-000000000009 + type: incident_types + type: postmortem_templates schema: $ref: "#/components/schemas/PostmortemTemplateResponse" description: Created @@ -142082,13 +142287,7 @@ paths: description: Delete a postmortem template. operationId: DeleteIncidentPostmortemTemplate parameters: - - description: The ID of the postmortem template - in: path - name: template_id - required: true - schema: - example: "template-456" - type: string + - $ref: "#/components/parameters/PostmortemTemplateIdParameter" responses: "204": description: No Content @@ -142116,13 +142315,7 @@ paths: description: Retrieve details of a specific postmortem template. operationId: GetIncidentPostmortemTemplate parameters: - - description: The ID of the postmortem template - in: path - name: template_id - required: true - schema: - example: "template-456" - type: string + - $ref: "#/components/parameters/PostmortemTemplateIdParameter" responses: "200": content: @@ -142132,11 +142325,19 @@ paths: value: data: attributes: + content: "# Overview\n\n# What Happened\n\n# Timeline\n\n# Action Items" createdAt: "2024-01-01T00:00:00+00:00" + is_default: + location: datadog_notebooks modifiedAt: "2024-01-01T00:00:00+00:00" name: Standard Postmortem Template id: 00000000-0000-0000-0000-000000000003 - type: postmortem_template + relationships: + incident_type: + data: + id: 00000000-0000-0000-0000-000000000009 + type: incident_types + type: postmortem_templates schema: $ref: "#/components/schemas/PostmortemTemplateResponse" description: OK @@ -142164,13 +142365,7 @@ paths: description: Update an existing postmortem template. operationId: UpdateIncidentPostmortemTemplate parameters: - - description: The ID of the postmortem template - in: path - name: template_id - required: true - schema: - example: "template-456" - type: string + - $ref: "#/components/parameters/PostmortemTemplateIdParameter" requestBody: content: application/json: @@ -142180,7 +142375,8 @@ paths: data: attributes: name: Standard Postmortem Template - type: postmortem_template + id: 00000000-0000-0000-0000-000000000004 + type: postmortem_templates schema: $ref: "#/components/schemas/PostmortemTemplateRequest" required: true @@ -142193,11 +142389,19 @@ paths: value: data: attributes: + content: "# Overview\n\n# What Happened\n\n# Timeline\n\n# Action Items" createdAt: "2024-01-01T00:00:00+00:00" + is_default: + location: datadog_notebooks modifiedAt: "2024-01-01T00:00:00+00:00" name: Standard Postmortem Template id: 00000000-0000-0000-0000-000000000004 - type: postmortem_template + relationships: + incident_type: + data: + id: 00000000-0000-0000-0000-000000000009 + type: incident_types + type: postmortem_templates schema: $ref: "#/components/schemas/PostmortemTemplateResponse" description: OK diff --git a/src/test/resources/com/datadog/api/client/v2/api/incidents.feature b/src/test/resources/com/datadog/api/client/v2/api/incidents.feature index 1b993a1ff29..feea0deb36c 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/incidents.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/incidents.feature @@ -334,7 +334,7 @@ Feature: Incidents Scenario: Create postmortem template returns "Bad Request" response Given operation "CreateIncidentPostmortemTemplate" enabled And new "CreateIncidentPostmortemTemplate" request - And body with value {"data": {"attributes": {"name": "Standard Postmortem Template"}, "type": "postmortem_template"}} + And body with value {"data": {"attributes": {"confluence_postmortem_settings": {"account_id": "123456", "parent_id": "345678", "space_id": "789012"}, "content": "# Overview\n\n# What Happened\n\n# Timeline\n\n# Action Items", "google_docs_postmortem_settings": {"account_id": "123456", "parent_folder_id": "789012"}, "is_default": "2024-01-01T00:00:00+00:00", "location": "datadog_notebooks", "name": "Standard Postmortem Template"}, "id": "00000000-0000-0000-0000-000000000000", "relationships": {"incident_type": {"data": {"id": "00000000-0000-0000-0000-000000000009", "type": "incident_types"}}}, "type": "postmortem_templates"}} When the request is sent Then the response status is 400 Bad Request @@ -342,7 +342,7 @@ Feature: Incidents Scenario: Create postmortem template returns "Created" response Given operation "CreateIncidentPostmortemTemplate" enabled And new "CreateIncidentPostmortemTemplate" request - And body with value {"data": {"attributes": {"name": "Standard Postmortem Template"}, "type": "postmortem_template"}} + And body with value {"data": {"attributes": {"confluence_postmortem_settings": {"account_id": "123456", "parent_id": "345678", "space_id": "789012"}, "content": "# Overview\n\n# What Happened\n\n# Timeline\n\n# Action Items", "google_docs_postmortem_settings": {"account_id": "123456", "parent_folder_id": "789012"}, "is_default": "2024-01-01T00:00:00+00:00", "location": "datadog_notebooks", "name": "Standard Postmortem Template"}, "id": "00000000-0000-0000-0000-000000000000", "relationships": {"incident_type": {"data": {"id": "00000000-0000-0000-0000-000000000009", "type": "incident_types"}}}, "type": "postmortem_templates"}} When the request is sent Then the response status is 201 Created @@ -1590,7 +1590,7 @@ Feature: Incidents Given operation "UpdateIncidentPostmortemTemplate" enabled And new "UpdateIncidentPostmortemTemplate" request And request contains "template_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"name": "Standard Postmortem Template"}, "type": "postmortem_template"}} + And body with value {"data": {"attributes": {"confluence_postmortem_settings": {"account_id": "123456", "parent_id": "345678", "space_id": "789012"}, "content": "# Overview\n\n# What Happened\n\n# Timeline\n\n# Action Items", "google_docs_postmortem_settings": {"account_id": "123456", "parent_folder_id": "789012"}, "is_default": "2024-01-01T00:00:00+00:00", "location": "datadog_notebooks", "name": "Standard Postmortem Template"}, "id": "00000000-0000-0000-0000-000000000000", "relationships": {"incident_type": {"data": {"id": "00000000-0000-0000-0000-000000000009", "type": "incident_types"}}}, "type": "postmortem_templates"}} When the request is sent Then the response status is 400 Bad Request @@ -1599,7 +1599,7 @@ Feature: Incidents Given operation "UpdateIncidentPostmortemTemplate" enabled And new "UpdateIncidentPostmortemTemplate" request And request contains "template_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"name": "Standard Postmortem Template"}, "type": "postmortem_template"}} + And body with value {"data": {"attributes": {"confluence_postmortem_settings": {"account_id": "123456", "parent_id": "345678", "space_id": "789012"}, "content": "# Overview\n\n# What Happened\n\n# Timeline\n\n# Action Items", "google_docs_postmortem_settings": {"account_id": "123456", "parent_folder_id": "789012"}, "is_default": "2024-01-01T00:00:00+00:00", "location": "datadog_notebooks", "name": "Standard Postmortem Template"}, "id": "00000000-0000-0000-0000-000000000000", "relationships": {"incident_type": {"data": {"id": "00000000-0000-0000-0000-000000000009", "type": "incident_types"}}}, "type": "postmortem_templates"}} When the request is sent Then the response status is 404 Not Found @@ -1608,6 +1608,6 @@ Feature: Incidents Given operation "UpdateIncidentPostmortemTemplate" enabled And new "UpdateIncidentPostmortemTemplate" request And request contains "template_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"name": "Standard Postmortem Template"}, "type": "postmortem_template"}} + And body with value {"data": {"attributes": {"confluence_postmortem_settings": {"account_id": "123456", "parent_id": "345678", "space_id": "789012"}, "content": "# Overview\n\n# What Happened\n\n# Timeline\n\n# Action Items", "google_docs_postmortem_settings": {"account_id": "123456", "parent_folder_id": "789012"}, "is_default": "2024-01-01T00:00:00+00:00", "location": "datadog_notebooks", "name": "Standard Postmortem Template"}, "id": "00000000-0000-0000-0000-000000000000", "relationships": {"incident_type": {"data": {"id": "00000000-0000-0000-0000-000000000009", "type": "incident_types"}}}, "type": "postmortem_templates"}} When the request is sent Then the response status is 200 OK diff --git a/src/test/resources/com/datadog/api/client/v2/api/undo.json b/src/test/resources/com/datadog/api/client/v2/api/undo.json index e72767d8e0d..4a8555e43ae 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/undo.json +++ b/src/test/resources/com/datadog/api/client/v2/api/undo.json @@ -3029,7 +3029,7 @@ "parameters": [ { "name": "template_id", - "source": "" + "source": "data.id" } ], "type": "unsafe" From 88b45e42c527b669b1c61ad917fbe391dce3d746 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Wed, 22 Jul 2026 14:33:27 +0000 Subject: [PATCH 2/2] pre-commit fixes --- .../CreateIncidentPostmortemTemplate.java | 42 +++- .../DeleteIncidentPostmortemTemplate.java | 2 +- .../GetIncidentPostmortemTemplate.java | 3 +- .../UpdateIncidentPostmortemTemplate.java | 45 +++- .../api/client/v2/api/IncidentsApi.java | 120 ++++++++-- .../model/ConfluencePostmortemSettings.java | 215 ++++++++++++++++++ .../model/GoogleDocsPostmortemSettings.java | 178 +++++++++++++++ .../PostmortemTemplateAttributesRequest.java | 194 +++++++++++++++- .../PostmortemTemplateAttributesResponse.java | 191 +++++++++++++++- ...PostmortemTemplateCreateRelationships.java | 145 ++++++++++++ .../model/PostmortemTemplateDataRequest.java | 64 +++++- .../model/PostmortemTemplateDataResponse.java | 38 +++- ...ortemTemplateIncidentTypeRelationship.java | 154 +++++++++++++ ...mTemplateIncidentTypeRelationshipData.java | 178 +++++++++++++++ .../v2/model/PostmortemTemplateLocation.java | 61 +++++ ...stmortemTemplateResponseRelationships.java | 178 +++++++++++++++ .../v2/model/PostmortemTemplateType.java | 6 +- .../PostmortemTemplateUserRelationship.java | 151 ++++++++++++ ...ostmortemTemplateUserRelationshipData.java | 176 ++++++++++++++ 19 files changed, 2101 insertions(+), 40 deletions(-) create mode 100644 src/main/java/com/datadog/api/client/v2/model/ConfluencePostmortemSettings.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GoogleDocsPostmortemSettings.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/PostmortemTemplateCreateRelationships.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/PostmortemTemplateIncidentTypeRelationship.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/PostmortemTemplateIncidentTypeRelationshipData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/PostmortemTemplateLocation.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/PostmortemTemplateResponseRelationships.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/PostmortemTemplateUserRelationship.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/PostmortemTemplateUserRelationshipData.java diff --git a/examples/v2/incidents/CreateIncidentPostmortemTemplate.java b/examples/v2/incidents/CreateIncidentPostmortemTemplate.java index 57948e0fead..48d52257dfd 100644 --- a/examples/v2/incidents/CreateIncidentPostmortemTemplate.java +++ b/examples/v2/incidents/CreateIncidentPostmortemTemplate.java @@ -3,11 +3,19 @@ import com.datadog.api.client.ApiClient; import com.datadog.api.client.ApiException; import com.datadog.api.client.v2.api.IncidentsApi; +import com.datadog.api.client.v2.model.ConfluencePostmortemSettings; +import com.datadog.api.client.v2.model.GoogleDocsPostmortemSettings; import com.datadog.api.client.v2.model.PostmortemTemplateAttributesRequest; +import com.datadog.api.client.v2.model.PostmortemTemplateCreateRelationships; import com.datadog.api.client.v2.model.PostmortemTemplateDataRequest; +import com.datadog.api.client.v2.model.PostmortemTemplateIncidentTypeRelationship; +import com.datadog.api.client.v2.model.PostmortemTemplateIncidentTypeRelationshipData; +import com.datadog.api.client.v2.model.PostmortemTemplateLocation; import com.datadog.api.client.v2.model.PostmortemTemplateRequest; import com.datadog.api.client.v2.model.PostmortemTemplateResponse; import com.datadog.api.client.v2.model.PostmortemTemplateType; +import java.time.OffsetDateTime; +import java.util.UUID; public class Example { public static void main(String[] args) { @@ -21,8 +29,40 @@ public static void main(String[] args) { new PostmortemTemplateDataRequest() .attributes( new PostmortemTemplateAttributesRequest() + .confluencePostmortemSettings( + new ConfluencePostmortemSettings() + .accountId("123456") + .parentId("345678") + .spaceId("789012")) + .content( + """ +# Overview + +# What Happened + +# Timeline + +# Action Items +""") + .googleDocsPostmortemSettings( + new GoogleDocsPostmortemSettings() + .accountId("123456") + .parentFolderId("789012")) + .isDefault(OffsetDateTime.parse("2024-01-01T00:00:00+00:00")) + .location(PostmortemTemplateLocation.DATADOG_NOTEBOOKS) .name("Standard Postmortem Template")) - .type(PostmortemTemplateType.POSTMORTEM_TEMPLATE)); + .id("00000000-0000-0000-0000-000000000000") + .relationships( + new PostmortemTemplateCreateRelationships() + .incidentType( + new PostmortemTemplateIncidentTypeRelationship() + .data( + new PostmortemTemplateIncidentTypeRelationshipData() + .id( + UUID.fromString( + "00000000-0000-0000-0000-000000000009")) + .type("incident_types")))) + .type(PostmortemTemplateType.POSTMORTEM_TEMPLATES)); try { PostmortemTemplateResponse result = apiInstance.createIncidentPostmortemTemplate(body); diff --git a/examples/v2/incidents/DeleteIncidentPostmortemTemplate.java b/examples/v2/incidents/DeleteIncidentPostmortemTemplate.java index 614b204a0f6..af551a35d4a 100644 --- a/examples/v2/incidents/DeleteIncidentPostmortemTemplate.java +++ b/examples/v2/incidents/DeleteIncidentPostmortemTemplate.java @@ -11,7 +11,7 @@ public static void main(String[] args) { IncidentsApi apiInstance = new IncidentsApi(defaultClient); try { - apiInstance.deleteIncidentPostmortemTemplate("template-456"); + apiInstance.deleteIncidentPostmortemTemplate("00000000-0000-0000-0000-000000000000"); } catch (ApiException e) { System.err.println("Exception when calling IncidentsApi#deleteIncidentPostmortemTemplate"); System.err.println("Status code: " + e.getCode()); diff --git a/examples/v2/incidents/GetIncidentPostmortemTemplate.java b/examples/v2/incidents/GetIncidentPostmortemTemplate.java index 064ac958977..03b7c2bd327 100644 --- a/examples/v2/incidents/GetIncidentPostmortemTemplate.java +++ b/examples/v2/incidents/GetIncidentPostmortemTemplate.java @@ -12,7 +12,8 @@ public static void main(String[] args) { IncidentsApi apiInstance = new IncidentsApi(defaultClient); try { - PostmortemTemplateResponse result = apiInstance.getIncidentPostmortemTemplate("template-456"); + PostmortemTemplateResponse result = + apiInstance.getIncidentPostmortemTemplate("00000000-0000-0000-0000-000000000000"); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling IncidentsApi#getIncidentPostmortemTemplate"); diff --git a/examples/v2/incidents/UpdateIncidentPostmortemTemplate.java b/examples/v2/incidents/UpdateIncidentPostmortemTemplate.java index 56641805786..d7d0f5e91be 100644 --- a/examples/v2/incidents/UpdateIncidentPostmortemTemplate.java +++ b/examples/v2/incidents/UpdateIncidentPostmortemTemplate.java @@ -3,11 +3,19 @@ import com.datadog.api.client.ApiClient; import com.datadog.api.client.ApiException; import com.datadog.api.client.v2.api.IncidentsApi; +import com.datadog.api.client.v2.model.ConfluencePostmortemSettings; +import com.datadog.api.client.v2.model.GoogleDocsPostmortemSettings; import com.datadog.api.client.v2.model.PostmortemTemplateAttributesRequest; +import com.datadog.api.client.v2.model.PostmortemTemplateCreateRelationships; import com.datadog.api.client.v2.model.PostmortemTemplateDataRequest; +import com.datadog.api.client.v2.model.PostmortemTemplateIncidentTypeRelationship; +import com.datadog.api.client.v2.model.PostmortemTemplateIncidentTypeRelationshipData; +import com.datadog.api.client.v2.model.PostmortemTemplateLocation; import com.datadog.api.client.v2.model.PostmortemTemplateRequest; import com.datadog.api.client.v2.model.PostmortemTemplateResponse; import com.datadog.api.client.v2.model.PostmortemTemplateType; +import java.time.OffsetDateTime; +import java.util.UUID; public class Example { public static void main(String[] args) { @@ -21,12 +29,45 @@ public static void main(String[] args) { new PostmortemTemplateDataRequest() .attributes( new PostmortemTemplateAttributesRequest() + .confluencePostmortemSettings( + new ConfluencePostmortemSettings() + .accountId("123456") + .parentId("345678") + .spaceId("789012")) + .content( + """ +# Overview + +# What Happened + +# Timeline + +# Action Items +""") + .googleDocsPostmortemSettings( + new GoogleDocsPostmortemSettings() + .accountId("123456") + .parentFolderId("789012")) + .isDefault(OffsetDateTime.parse("2024-01-01T00:00:00+00:00")) + .location(PostmortemTemplateLocation.DATADOG_NOTEBOOKS) .name("Standard Postmortem Template")) - .type(PostmortemTemplateType.POSTMORTEM_TEMPLATE)); + .id("00000000-0000-0000-0000-000000000000") + .relationships( + new PostmortemTemplateCreateRelationships() + .incidentType( + new PostmortemTemplateIncidentTypeRelationship() + .data( + new PostmortemTemplateIncidentTypeRelationshipData() + .id( + UUID.fromString( + "00000000-0000-0000-0000-000000000009")) + .type("incident_types")))) + .type(PostmortemTemplateType.POSTMORTEM_TEMPLATES)); try { PostmortemTemplateResponse result = - apiInstance.updateIncidentPostmortemTemplate("template-456", body); + apiInstance.updateIncidentPostmortemTemplate( + "00000000-0000-0000-0000-000000000000", body); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling IncidentsApi#updateIncidentPostmortemTemplate"); diff --git a/src/main/java/com/datadog/api/client/v2/api/IncidentsApi.java b/src/main/java/com/datadog/api/client/v2/api/IncidentsApi.java index 1abe2b4359d..5336e0147de 100644 --- a/src/main/java/com/datadog/api/client/v2/api/IncidentsApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/IncidentsApi.java @@ -3820,7 +3820,7 @@ public CompletableFuture> deleteIncidentNotificationTemplateWi * *

See {@link #deleteIncidentPostmortemTemplateWithHttpInfo}. * - * @param templateId The ID of the postmortem template (required) + * @param templateId The ID of the postmortem template. (required) * @throws ApiException if fails to make API call */ public void deleteIncidentPostmortemTemplate(String templateId) throws ApiException { @@ -3832,7 +3832,7 @@ public void deleteIncidentPostmortemTemplate(String templateId) throws ApiExcept * *

See {@link #deleteIncidentPostmortemTemplateWithHttpInfoAsync}. * - * @param templateId The ID of the postmortem template (required) + * @param templateId The ID of the postmortem template. (required) * @return CompletableFuture */ public CompletableFuture deleteIncidentPostmortemTemplateAsync(String templateId) { @@ -3846,7 +3846,7 @@ public CompletableFuture deleteIncidentPostmortemTemplateAsync(String temp /** * Delete a postmortem template. * - * @param templateId The ID of the postmortem template (required) + * @param templateId The ID of the postmortem template. (required) * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details @@ -3910,7 +3910,7 @@ public ApiResponse deleteIncidentPostmortemTemplateWithHttpInfo(String tem * *

See {@link #deleteIncidentPostmortemTemplateWithHttpInfo}. * - * @param templateId The ID of the postmortem template (required) + * @param templateId The ID of the postmortem template. (required) * @return CompletableFuture<ApiResponse<Void>> */ public CompletableFuture> deleteIncidentPostmortemTemplateWithHttpInfoAsync( @@ -5602,7 +5602,7 @@ public ApiResponse getIncidentNotificationTemplate * *

See {@link #getIncidentPostmortemTemplateWithHttpInfo}. * - * @param templateId The ID of the postmortem template (required) + * @param templateId The ID of the postmortem template. (required) * @return PostmortemTemplateResponse * @throws ApiException if fails to make API call */ @@ -5616,7 +5616,7 @@ public PostmortemTemplateResponse getIncidentPostmortemTemplate(String templateI * *

See {@link #getIncidentPostmortemTemplateWithHttpInfoAsync}. * - * @param templateId The ID of the postmortem template (required) + * @param templateId The ID of the postmortem template. (required) * @return CompletableFuture<PostmortemTemplateResponse> */ public CompletableFuture getIncidentPostmortemTemplateAsync( @@ -5631,7 +5631,7 @@ public CompletableFuture getIncidentPostmortemTempla /** * Retrieve details of a specific postmortem template. * - * @param templateId The ID of the postmortem template (required) + * @param templateId The ID of the postmortem template. (required) * @return ApiResponse<PostmortemTemplateResponse> * @throws ApiException if fails to make API call * @http.response.details @@ -5694,7 +5694,7 @@ public ApiResponse getIncidentPostmortemTemplateWith * *

See {@link #getIncidentPostmortemTemplateWithHttpInfo}. * - * @param templateId The ID of the postmortem template (required) + * @param templateId The ID of the postmortem template. (required) * @return CompletableFuture<ApiResponse<PostmortemTemplateResponse>> */ public CompletableFuture> @@ -7957,6 +7957,37 @@ public IncidentNotificationTemplateArray listIncidentNotificationTemplates( new GenericType() {}); } + /** Manage optional parameters to listIncidentPostmortemTemplates. */ + public static class ListIncidentPostmortemTemplatesOptionalParameters { + private UUID filterIncidentType; + private String sort; + + /** + * Set filterIncidentType. + * + * @param filterIncidentType Filter postmortem templates by the associated incident type ID. + * (optional) + * @return ListIncidentPostmortemTemplatesOptionalParameters + */ + public ListIncidentPostmortemTemplatesOptionalParameters filterIncidentType( + UUID filterIncidentType) { + this.filterIncidentType = filterIncidentType; + return this; + } + + /** + * Set sort. + * + * @param sort The attribute to sort results by. Prefix with - for descending + * order. (optional, default to "created_at") + * @return ListIncidentPostmortemTemplatesOptionalParameters + */ + public ListIncidentPostmortemTemplatesOptionalParameters sort(String sort) { + this.sort = sort; + return this; + } + } + /** * List postmortem templates. * @@ -7966,7 +7997,9 @@ public IncidentNotificationTemplateArray listIncidentNotificationTemplates( * @throws ApiException if fails to make API call */ public PostmortemTemplatesResponse listIncidentPostmortemTemplates() throws ApiException { - return listIncidentPostmortemTemplatesWithHttpInfo().getData(); + return listIncidentPostmortemTemplatesWithHttpInfo( + new ListIncidentPostmortemTemplatesOptionalParameters()) + .getData(); } /** @@ -7977,7 +8010,39 @@ public PostmortemTemplatesResponse listIncidentPostmortemTemplates() throws ApiE * @return CompletableFuture<PostmortemTemplatesResponse> */ public CompletableFuture listIncidentPostmortemTemplatesAsync() { - return listIncidentPostmortemTemplatesWithHttpInfoAsync() + return listIncidentPostmortemTemplatesWithHttpInfoAsync( + new ListIncidentPostmortemTemplatesOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List postmortem templates. + * + *

See {@link #listIncidentPostmortemTemplatesWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return PostmortemTemplatesResponse + * @throws ApiException if fails to make API call + */ + public PostmortemTemplatesResponse listIncidentPostmortemTemplates( + ListIncidentPostmortemTemplatesOptionalParameters parameters) throws ApiException { + return listIncidentPostmortemTemplatesWithHttpInfo(parameters).getData(); + } + + /** + * List postmortem templates. + * + *

See {@link #listIncidentPostmortemTemplatesWithHttpInfoAsync}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<PostmortemTemplatesResponse> + */ + public CompletableFuture listIncidentPostmortemTemplatesAsync( + ListIncidentPostmortemTemplatesOptionalParameters parameters) { + return listIncidentPostmortemTemplatesWithHttpInfoAsync(parameters) .thenApply( response -> { return response.getData(); @@ -7987,6 +8052,7 @@ public CompletableFuture listIncidentPostmortemTemp /** * Retrieve a list of all postmortem templates for incidents. * + * @param parameters Optional parameters for the request. * @return ApiResponse<PostmortemTemplatesResponse> * @throws ApiException if fails to make API call * @http.response.details @@ -7998,8 +8064,8 @@ public CompletableFuture listIncidentPostmortemTemp * 429 Too many requests - * */ - public ApiResponse listIncidentPostmortemTemplatesWithHttpInfo() - throws ApiException { + public ApiResponse listIncidentPostmortemTemplatesWithHttpInfo( + ListIncidentPostmortemTemplatesOptionalParameters parameters) throws ApiException { // Check if unstable operation is enabled String operationId = "listIncidentPostmortemTemplates"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { @@ -8008,16 +8074,23 @@ public ApiResponse listIncidentPostmortemTemplatesW throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); } Object localVarPostBody = null; + UUID filterIncidentType = parameters.filterIncidentType; + String sort = parameters.sort; // create path and map variables String localVarPath = "/api/v2/incidents/config/postmortem-templates"; + List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[incident-type]", filterIncidentType)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort)); + Invocation.Builder builder = apiClient.createBuilder( "v2.IncidentsApi.listIncidentPostmortemTemplates", localVarPath, - new ArrayList(), + localVarQueryParams, localVarHeaderParams, new HashMap(), new String[] {"application/json"}, @@ -8038,10 +8111,12 @@ public ApiResponse listIncidentPostmortemTemplatesW * *

See {@link #listIncidentPostmortemTemplatesWithHttpInfo}. * + * @param parameters Optional parameters for the request. * @return CompletableFuture<ApiResponse<PostmortemTemplatesResponse>> */ public CompletableFuture> - listIncidentPostmortemTemplatesWithHttpInfoAsync() { + listIncidentPostmortemTemplatesWithHttpInfoAsync( + ListIncidentPostmortemTemplatesOptionalParameters parameters) { // Check if unstable operation is enabled String operationId = "listIncidentPostmortemTemplates"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { @@ -8054,18 +8129,25 @@ public ApiResponse listIncidentPostmortemTemplatesW return result; } Object localVarPostBody = null; + UUID filterIncidentType = parameters.filterIncidentType; + String sort = parameters.sort; // create path and map variables String localVarPath = "/api/v2/incidents/config/postmortem-templates"; + List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[incident-type]", filterIncidentType)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort)); + Invocation.Builder builder; try { builder = apiClient.createBuilder( "v2.IncidentsApi.listIncidentPostmortemTemplates", localVarPath, - new ArrayList(), + localVarQueryParams, localVarHeaderParams, new HashMap(), new String[] {"application/json"}, @@ -11166,7 +11248,7 @@ public ApiResponse updateIncidentNotificationTempl * *

See {@link #updateIncidentPostmortemTemplateWithHttpInfo}. * - * @param templateId The ID of the postmortem template (required) + * @param templateId The ID of the postmortem template. (required) * @param body (required) * @return PostmortemTemplateResponse * @throws ApiException if fails to make API call @@ -11181,7 +11263,7 @@ public PostmortemTemplateResponse updateIncidentPostmortemTemplate( * *

See {@link #updateIncidentPostmortemTemplateWithHttpInfoAsync}. * - * @param templateId The ID of the postmortem template (required) + * @param templateId The ID of the postmortem template. (required) * @param body (required) * @return CompletableFuture<PostmortemTemplateResponse> */ @@ -11197,7 +11279,7 @@ public CompletableFuture updateIncidentPostmortemTem /** * Update an existing postmortem template. * - * @param templateId The ID of the postmortem template (required) + * @param templateId The ID of the postmortem template. (required) * @param body (required) * @return ApiResponse<PostmortemTemplateResponse> * @throws ApiException if fails to make API call @@ -11269,7 +11351,7 @@ public ApiResponse updateIncidentPostmortemTemplateW * *

See {@link #updateIncidentPostmortemTemplateWithHttpInfo}. * - * @param templateId The ID of the postmortem template (required) + * @param templateId The ID of the postmortem template. (required) * @param body (required) * @return CompletableFuture<ApiResponse<PostmortemTemplateResponse>> */ diff --git a/src/main/java/com/datadog/api/client/v2/model/ConfluencePostmortemSettings.java b/src/main/java/com/datadog/api/client/v2/model/ConfluencePostmortemSettings.java new file mode 100644 index 00000000000..f85c4c8b039 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ConfluencePostmortemSettings.java @@ -0,0 +1,215 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * Settings for a postmortem template stored in Confluence. Required when location is + * confluence. + */ +@JsonPropertyOrder({ + ConfluencePostmortemSettings.JSON_PROPERTY_ACCOUNT_ID, + ConfluencePostmortemSettings.JSON_PROPERTY_PARENT_ID, + ConfluencePostmortemSettings.JSON_PROPERTY_SPACE_ID +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ConfluencePostmortemSettings { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; + private String accountId; + + public static final String JSON_PROPERTY_PARENT_ID = "parent_id"; + private JsonNullable parentId = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_SPACE_ID = "space_id"; + private String spaceId; + + public ConfluencePostmortemSettings() {} + + @JsonCreator + public ConfluencePostmortemSettings( + @JsonProperty(required = true, value = JSON_PROPERTY_ACCOUNT_ID) String accountId, + @JsonProperty(required = true, value = JSON_PROPERTY_SPACE_ID) String spaceId) { + this.accountId = accountId; + this.spaceId = spaceId; + } + + public ConfluencePostmortemSettings accountId(String accountId) { + this.accountId = accountId; + return this; + } + + /** + * The ID of the Confluence integration account. + * + * @return accountId + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getAccountId() { + return accountId; + } + + public void setAccountId(String accountId) { + this.accountId = accountId; + } + + public ConfluencePostmortemSettings parentId(String parentId) { + this.parentId = JsonNullable.of(parentId); + return this; + } + + /** + * The ID of the parent Confluence page under which postmortems are created. + * + * @return parentId + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getParentId() { + return parentId.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_PARENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getParentId_JsonNullable() { + return parentId; + } + + @JsonProperty(JSON_PROPERTY_PARENT_ID) + public void setParentId_JsonNullable(JsonNullable parentId) { + this.parentId = parentId; + } + + public void setParentId(String parentId) { + this.parentId = JsonNullable.of(parentId); + } + + public ConfluencePostmortemSettings spaceId(String spaceId) { + this.spaceId = spaceId; + return this; + } + + /** + * The ID of the Confluence space where postmortems are created. + * + * @return spaceId + */ + @JsonProperty(JSON_PROPERTY_SPACE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getSpaceId() { + return spaceId; + } + + public void setSpaceId(String spaceId) { + this.spaceId = spaceId; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ConfluencePostmortemSettings + */ + @JsonAnySetter + public ConfluencePostmortemSettings putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ConfluencePostmortemSettings object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConfluencePostmortemSettings confluencePostmortemSettings = (ConfluencePostmortemSettings) o; + return Objects.equals(this.accountId, confluencePostmortemSettings.accountId) + && Objects.equals(this.parentId, confluencePostmortemSettings.parentId) + && Objects.equals(this.spaceId, confluencePostmortemSettings.spaceId) + && Objects.equals( + this.additionalProperties, confluencePostmortemSettings.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(accountId, parentId, spaceId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConfluencePostmortemSettings {\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append(" parentId: ").append(toIndentedString(parentId)).append("\n"); + sb.append(" spaceId: ").append(toIndentedString(spaceId)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GoogleDocsPostmortemSettings.java b/src/main/java/com/datadog/api/client/v2/model/GoogleDocsPostmortemSettings.java new file mode 100644 index 00000000000..c6eeb89e586 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GoogleDocsPostmortemSettings.java @@ -0,0 +1,178 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * Settings for a postmortem template stored in Google Docs. Required when location is + * google_docs. + */ +@JsonPropertyOrder({ + GoogleDocsPostmortemSettings.JSON_PROPERTY_ACCOUNT_ID, + GoogleDocsPostmortemSettings.JSON_PROPERTY_PARENT_FOLDER_ID +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GoogleDocsPostmortemSettings { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; + private String accountId; + + public static final String JSON_PROPERTY_PARENT_FOLDER_ID = "parent_folder_id"; + private String parentFolderId; + + public GoogleDocsPostmortemSettings() {} + + @JsonCreator + public GoogleDocsPostmortemSettings( + @JsonProperty(required = true, value = JSON_PROPERTY_ACCOUNT_ID) String accountId, + @JsonProperty(required = true, value = JSON_PROPERTY_PARENT_FOLDER_ID) + String parentFolderId) { + this.accountId = accountId; + this.parentFolderId = parentFolderId; + } + + public GoogleDocsPostmortemSettings accountId(String accountId) { + this.accountId = accountId; + return this; + } + + /** + * The ID of the Google Drive integration account. + * + * @return accountId + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getAccountId() { + return accountId; + } + + public void setAccountId(String accountId) { + this.accountId = accountId; + } + + public GoogleDocsPostmortemSettings parentFolderId(String parentFolderId) { + this.parentFolderId = parentFolderId; + return this; + } + + /** + * The ID of the Google Drive folder where postmortems are created. + * + * @return parentFolderId + */ + @JsonProperty(JSON_PROPERTY_PARENT_FOLDER_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getParentFolderId() { + return parentFolderId; + } + + public void setParentFolderId(String parentFolderId) { + this.parentFolderId = parentFolderId; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return GoogleDocsPostmortemSettings + */ + @JsonAnySetter + public GoogleDocsPostmortemSettings putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this GoogleDocsPostmortemSettings object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GoogleDocsPostmortemSettings googleDocsPostmortemSettings = (GoogleDocsPostmortemSettings) o; + return Objects.equals(this.accountId, googleDocsPostmortemSettings.accountId) + && Objects.equals(this.parentFolderId, googleDocsPostmortemSettings.parentFolderId) + && Objects.equals( + this.additionalProperties, googleDocsPostmortemSettings.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(accountId, parentFolderId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GoogleDocsPostmortemSettings {\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append(" parentFolderId: ").append(toIndentedString(parentFolderId)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/PostmortemTemplateAttributesRequest.java b/src/main/java/com/datadog/api/client/v2/model/PostmortemTemplateAttributesRequest.java index 2837f299729..0878ffb747e 100644 --- a/src/main/java/com/datadog/api/client/v2/model/PostmortemTemplateAttributesRequest.java +++ b/src/main/java/com/datadog/api/client/v2/model/PostmortemTemplateAttributesRequest.java @@ -13,16 +13,42 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; /** Attributes for creating or updating a postmortem template. */ -@JsonPropertyOrder({PostmortemTemplateAttributesRequest.JSON_PROPERTY_NAME}) +@JsonPropertyOrder({ + PostmortemTemplateAttributesRequest.JSON_PROPERTY_CONFLUENCE_POSTMORTEM_SETTINGS, + PostmortemTemplateAttributesRequest.JSON_PROPERTY_CONTENT, + PostmortemTemplateAttributesRequest.JSON_PROPERTY_GOOGLE_DOCS_POSTMORTEM_SETTINGS, + PostmortemTemplateAttributesRequest.JSON_PROPERTY_IS_DEFAULT, + PostmortemTemplateAttributesRequest.JSON_PROPERTY_LOCATION, + PostmortemTemplateAttributesRequest.JSON_PROPERTY_NAME +}) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") public class PostmortemTemplateAttributesRequest { @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CONFLUENCE_POSTMORTEM_SETTINGS = + "confluence_postmortem_settings"; + private ConfluencePostmortemSettings confluencePostmortemSettings; + + public static final String JSON_PROPERTY_CONTENT = "content"; + private String content; + + public static final String JSON_PROPERTY_GOOGLE_DOCS_POSTMORTEM_SETTINGS = + "google_docs_postmortem_settings"; + private GoogleDocsPostmortemSettings googleDocsPostmortemSettings; + + public static final String JSON_PROPERTY_IS_DEFAULT = "is_default"; + private JsonNullable isDefault = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_LOCATION = "location"; + private PostmortemTemplateLocation location = PostmortemTemplateLocation.DATADOG_NOTEBOOKS; + public static final String JSON_PROPERTY_NAME = "name"; private String name; @@ -34,13 +60,148 @@ public PostmortemTemplateAttributesRequest( this.name = name; } + public PostmortemTemplateAttributesRequest confluencePostmortemSettings( + ConfluencePostmortemSettings confluencePostmortemSettings) { + this.confluencePostmortemSettings = confluencePostmortemSettings; + this.unparsed |= confluencePostmortemSettings.unparsed; + return this; + } + + /** + * Settings for a postmortem template stored in Confluence. Required when location is + * confluence. + * + * @return confluencePostmortemSettings + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONFLUENCE_POSTMORTEM_SETTINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ConfluencePostmortemSettings getConfluencePostmortemSettings() { + return confluencePostmortemSettings; + } + + public void setConfluencePostmortemSettings( + ConfluencePostmortemSettings confluencePostmortemSettings) { + this.confluencePostmortemSettings = confluencePostmortemSettings; + if (confluencePostmortemSettings != null) { + this.unparsed |= confluencePostmortemSettings.unparsed; + } + } + + public PostmortemTemplateAttributesRequest content(String content) { + this.content = content; + return this; + } + + /** + * The templated content of the postmortem, supporting Markdown and incident template variables. + * + * @return content + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + public PostmortemTemplateAttributesRequest googleDocsPostmortemSettings( + GoogleDocsPostmortemSettings googleDocsPostmortemSettings) { + this.googleDocsPostmortemSettings = googleDocsPostmortemSettings; + this.unparsed |= googleDocsPostmortemSettings.unparsed; + return this; + } + + /** + * Settings for a postmortem template stored in Google Docs. Required when location + * is google_docs. + * + * @return googleDocsPostmortemSettings + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GOOGLE_DOCS_POSTMORTEM_SETTINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public GoogleDocsPostmortemSettings getGoogleDocsPostmortemSettings() { + return googleDocsPostmortemSettings; + } + + public void setGoogleDocsPostmortemSettings( + GoogleDocsPostmortemSettings googleDocsPostmortemSettings) { + this.googleDocsPostmortemSettings = googleDocsPostmortemSettings; + if (googleDocsPostmortemSettings != null) { + this.unparsed |= googleDocsPostmortemSettings.unparsed; + } + } + + public PostmortemTemplateAttributesRequest isDefault(OffsetDateTime isDefault) { + this.isDefault = JsonNullable.of(isDefault); + return this; + } + + /** + * When set, marks this template as a default. The effective default for an incident type is the + * template with the most recent is_default timestamp. Set to null to + * unset. + * + * @return isDefault + */ + @jakarta.annotation.Nullable + @JsonIgnore + public OffsetDateTime getIsDefault() { + return isDefault.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_IS_DEFAULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getIsDefault_JsonNullable() { + return isDefault; + } + + @JsonProperty(JSON_PROPERTY_IS_DEFAULT) + public void setIsDefault_JsonNullable(JsonNullable isDefault) { + this.isDefault = isDefault; + } + + public void setIsDefault(OffsetDateTime isDefault) { + this.isDefault = JsonNullable.of(isDefault); + } + + public PostmortemTemplateAttributesRequest location(PostmortemTemplateLocation location) { + this.location = location; + this.unparsed |= !location.isValid(); + return this; + } + + /** + * The location where the postmortem is created and stored. + * + * @return location + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LOCATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PostmortemTemplateLocation getLocation() { + return location; + } + + public void setLocation(PostmortemTemplateLocation location) { + if (!location.isValid()) { + this.unparsed = true; + } + this.location = location; + } + public PostmortemTemplateAttributesRequest name(String name) { this.name = name; return this; } /** - * The name of the template + * The name of the template. * * @return name */ @@ -111,20 +272,45 @@ public boolean equals(Object o) { } PostmortemTemplateAttributesRequest postmortemTemplateAttributesRequest = (PostmortemTemplateAttributesRequest) o; - return Objects.equals(this.name, postmortemTemplateAttributesRequest.name) + return Objects.equals( + this.confluencePostmortemSettings, + postmortemTemplateAttributesRequest.confluencePostmortemSettings) + && Objects.equals(this.content, postmortemTemplateAttributesRequest.content) + && Objects.equals( + this.googleDocsPostmortemSettings, + postmortemTemplateAttributesRequest.googleDocsPostmortemSettings) + && Objects.equals(this.isDefault, postmortemTemplateAttributesRequest.isDefault) + && Objects.equals(this.location, postmortemTemplateAttributesRequest.location) + && Objects.equals(this.name, postmortemTemplateAttributesRequest.name) && Objects.equals( this.additionalProperties, postmortemTemplateAttributesRequest.additionalProperties); } @Override public int hashCode() { - return Objects.hash(name, additionalProperties); + return Objects.hash( + confluencePostmortemSettings, + content, + googleDocsPostmortemSettings, + isDefault, + location, + name, + additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class PostmortemTemplateAttributesRequest {\n"); + sb.append(" confluencePostmortemSettings: ") + .append(toIndentedString(confluencePostmortemSettings)) + .append("\n"); + sb.append(" content: ").append(toIndentedString(content)).append("\n"); + sb.append(" googleDocsPostmortemSettings: ") + .append(toIndentedString(googleDocsPostmortemSettings)) + .append("\n"); + sb.append(" isDefault: ").append(toIndentedString(isDefault)).append("\n"); + sb.append(" location: ").append(toIndentedString(location)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) diff --git a/src/main/java/com/datadog/api/client/v2/model/PostmortemTemplateAttributesResponse.java b/src/main/java/com/datadog/api/client/v2/model/PostmortemTemplateAttributesResponse.java index d114c8d403e..a7051156c48 100644 --- a/src/main/java/com/datadog/api/client/v2/model/PostmortemTemplateAttributesResponse.java +++ b/src/main/java/com/datadog/api/client/v2/model/PostmortemTemplateAttributesResponse.java @@ -20,7 +20,12 @@ /** Attributes of a postmortem template returned in a response. */ @JsonPropertyOrder({ + PostmortemTemplateAttributesResponse.JSON_PROPERTY_CONFLUENCE_POSTMORTEM_SETTINGS, + PostmortemTemplateAttributesResponse.JSON_PROPERTY_CONTENT, PostmortemTemplateAttributesResponse.JSON_PROPERTY_CREATED_AT, + PostmortemTemplateAttributesResponse.JSON_PROPERTY_GOOGLE_DOCS_POSTMORTEM_SETTINGS, + PostmortemTemplateAttributesResponse.JSON_PROPERTY_IS_DEFAULT, + PostmortemTemplateAttributesResponse.JSON_PROPERTY_LOCATION, PostmortemTemplateAttributesResponse.JSON_PROPERTY_MODIFIED_AT, PostmortemTemplateAttributesResponse.JSON_PROPERTY_NAME }) @@ -28,9 +33,26 @@ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") public class PostmortemTemplateAttributesResponse { @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CONFLUENCE_POSTMORTEM_SETTINGS = + "confluence_postmortem_settings"; + private ConfluencePostmortemSettings confluencePostmortemSettings; + + public static final String JSON_PROPERTY_CONTENT = "content"; + private String content; + public static final String JSON_PROPERTY_CREATED_AT = "createdAt"; private OffsetDateTime createdAt; + public static final String JSON_PROPERTY_GOOGLE_DOCS_POSTMORTEM_SETTINGS = + "google_docs_postmortem_settings"; + private GoogleDocsPostmortemSettings googleDocsPostmortemSettings; + + public static final String JSON_PROPERTY_IS_DEFAULT = "is_default"; + private OffsetDateTime isDefault; + + public static final String JSON_PROPERTY_LOCATION = "location"; + private PostmortemTemplateLocation location = PostmortemTemplateLocation.DATADOG_NOTEBOOKS; + public static final String JSON_PROPERTY_MODIFIED_AT = "modifiedAt"; private OffsetDateTime modifiedAt; @@ -41,21 +63,78 @@ public PostmortemTemplateAttributesResponse() {} @JsonCreator public PostmortemTemplateAttributesResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_CONTENT) String content, @JsonProperty(required = true, value = JSON_PROPERTY_CREATED_AT) OffsetDateTime createdAt, + @JsonProperty(required = true, value = JSON_PROPERTY_IS_DEFAULT) OffsetDateTime isDefault, + @JsonProperty(required = true, value = JSON_PROPERTY_LOCATION) + PostmortemTemplateLocation location, @JsonProperty(required = true, value = JSON_PROPERTY_MODIFIED_AT) OffsetDateTime modifiedAt, @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name) { + this.content = content; this.createdAt = createdAt; + this.isDefault = isDefault; + if (isDefault != null) {} + this.location = location; + this.unparsed |= !location.isValid(); this.modifiedAt = modifiedAt; this.name = name; } + public PostmortemTemplateAttributesResponse confluencePostmortemSettings( + ConfluencePostmortemSettings confluencePostmortemSettings) { + this.confluencePostmortemSettings = confluencePostmortemSettings; + this.unparsed |= confluencePostmortemSettings.unparsed; + return this; + } + + /** + * Settings for a postmortem template stored in Confluence. Required when location is + * confluence. + * + * @return confluencePostmortemSettings + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONFLUENCE_POSTMORTEM_SETTINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ConfluencePostmortemSettings getConfluencePostmortemSettings() { + return confluencePostmortemSettings; + } + + public void setConfluencePostmortemSettings( + ConfluencePostmortemSettings confluencePostmortemSettings) { + this.confluencePostmortemSettings = confluencePostmortemSettings; + if (confluencePostmortemSettings != null) { + this.unparsed |= confluencePostmortemSettings.unparsed; + } + } + + public PostmortemTemplateAttributesResponse content(String content) { + this.content = content; + return this; + } + + /** + * The templated content of the postmortem, supporting Markdown and incident template variables. + * + * @return content + */ + @JsonProperty(JSON_PROPERTY_CONTENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + public PostmortemTemplateAttributesResponse createdAt(OffsetDateTime createdAt) { this.createdAt = createdAt; return this; } /** - * When the template was created + * When the template was created. * * @return createdAt */ @@ -69,13 +148,88 @@ public void setCreatedAt(OffsetDateTime createdAt) { this.createdAt = createdAt; } + public PostmortemTemplateAttributesResponse googleDocsPostmortemSettings( + GoogleDocsPostmortemSettings googleDocsPostmortemSettings) { + this.googleDocsPostmortemSettings = googleDocsPostmortemSettings; + this.unparsed |= googleDocsPostmortemSettings.unparsed; + return this; + } + + /** + * Settings for a postmortem template stored in Google Docs. Required when location + * is google_docs. + * + * @return googleDocsPostmortemSettings + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GOOGLE_DOCS_POSTMORTEM_SETTINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public GoogleDocsPostmortemSettings getGoogleDocsPostmortemSettings() { + return googleDocsPostmortemSettings; + } + + public void setGoogleDocsPostmortemSettings( + GoogleDocsPostmortemSettings googleDocsPostmortemSettings) { + this.googleDocsPostmortemSettings = googleDocsPostmortemSettings; + if (googleDocsPostmortemSettings != null) { + this.unparsed |= googleDocsPostmortemSettings.unparsed; + } + } + + public PostmortemTemplateAttributesResponse isDefault(OffsetDateTime isDefault) { + this.isDefault = isDefault; + if (isDefault != null) {} + return this; + } + + /** + * When set, marks this template as a default. The effective default for an incident type is the + * template with the most recent is_default timestamp. + * + * @return isDefault + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_DEFAULT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getIsDefault() { + return isDefault; + } + + public void setIsDefault(OffsetDateTime isDefault) { + this.isDefault = isDefault; + } + + public PostmortemTemplateAttributesResponse location(PostmortemTemplateLocation location) { + this.location = location; + this.unparsed |= !location.isValid(); + return this; + } + + /** + * The location where the postmortem is created and stored. + * + * @return location + */ + @JsonProperty(JSON_PROPERTY_LOCATION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public PostmortemTemplateLocation getLocation() { + return location; + } + + public void setLocation(PostmortemTemplateLocation location) { + if (!location.isValid()) { + this.unparsed = true; + } + this.location = location; + } + public PostmortemTemplateAttributesResponse modifiedAt(OffsetDateTime modifiedAt) { this.modifiedAt = modifiedAt; return this; } /** - * When the template was last modified + * When the template was last modified. * * @return modifiedAt */ @@ -95,7 +249,7 @@ public PostmortemTemplateAttributesResponse name(String name) { } /** - * The name of the template + * The name of the template. * * @return name */ @@ -166,7 +320,16 @@ public boolean equals(Object o) { } PostmortemTemplateAttributesResponse postmortemTemplateAttributesResponse = (PostmortemTemplateAttributesResponse) o; - return Objects.equals(this.createdAt, postmortemTemplateAttributesResponse.createdAt) + return Objects.equals( + this.confluencePostmortemSettings, + postmortemTemplateAttributesResponse.confluencePostmortemSettings) + && Objects.equals(this.content, postmortemTemplateAttributesResponse.content) + && Objects.equals(this.createdAt, postmortemTemplateAttributesResponse.createdAt) + && Objects.equals( + this.googleDocsPostmortemSettings, + postmortemTemplateAttributesResponse.googleDocsPostmortemSettings) + && Objects.equals(this.isDefault, postmortemTemplateAttributesResponse.isDefault) + && Objects.equals(this.location, postmortemTemplateAttributesResponse.location) && Objects.equals(this.modifiedAt, postmortemTemplateAttributesResponse.modifiedAt) && Objects.equals(this.name, postmortemTemplateAttributesResponse.name) && Objects.equals( @@ -175,14 +338,32 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(createdAt, modifiedAt, name, additionalProperties); + return Objects.hash( + confluencePostmortemSettings, + content, + createdAt, + googleDocsPostmortemSettings, + isDefault, + location, + modifiedAt, + name, + additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class PostmortemTemplateAttributesResponse {\n"); + sb.append(" confluencePostmortemSettings: ") + .append(toIndentedString(confluencePostmortemSettings)) + .append("\n"); + sb.append(" content: ").append(toIndentedString(content)).append("\n"); sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" googleDocsPostmortemSettings: ") + .append(toIndentedString(googleDocsPostmortemSettings)) + .append("\n"); + sb.append(" isDefault: ").append(toIndentedString(isDefault)).append("\n"); + sb.append(" location: ").append(toIndentedString(location)).append("\n"); sb.append(" modifiedAt: ").append(toIndentedString(modifiedAt)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" additionalProperties: ") diff --git a/src/main/java/com/datadog/api/client/v2/model/PostmortemTemplateCreateRelationships.java b/src/main/java/com/datadog/api/client/v2/model/PostmortemTemplateCreateRelationships.java new file mode 100644 index 00000000000..ec1e553fac7 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/PostmortemTemplateCreateRelationships.java @@ -0,0 +1,145 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * Relationships for a postmortem template. incident_type is required when creating a + * template and is immutable afterwards. + */ +@JsonPropertyOrder({PostmortemTemplateCreateRelationships.JSON_PROPERTY_INCIDENT_TYPE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class PostmortemTemplateCreateRelationships { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_INCIDENT_TYPE = "incident_type"; + private PostmortemTemplateIncidentTypeRelationship incidentType; + + public PostmortemTemplateCreateRelationships incidentType( + PostmortemTemplateIncidentTypeRelationship incidentType) { + this.incidentType = incidentType; + this.unparsed |= incidentType.unparsed; + return this; + } + + /** + * Relationship to the incident type this template belongs to. + * + * @return incidentType + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INCIDENT_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PostmortemTemplateIncidentTypeRelationship getIncidentType() { + return incidentType; + } + + public void setIncidentType(PostmortemTemplateIncidentTypeRelationship incidentType) { + this.incidentType = incidentType; + if (incidentType != null) { + this.unparsed |= incidentType.unparsed; + } + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return PostmortemTemplateCreateRelationships + */ + @JsonAnySetter + public PostmortemTemplateCreateRelationships putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this PostmortemTemplateCreateRelationships object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PostmortemTemplateCreateRelationships postmortemTemplateCreateRelationships = + (PostmortemTemplateCreateRelationships) o; + return Objects.equals(this.incidentType, postmortemTemplateCreateRelationships.incidentType) + && Objects.equals( + this.additionalProperties, postmortemTemplateCreateRelationships.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(incidentType, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PostmortemTemplateCreateRelationships {\n"); + sb.append(" incidentType: ").append(toIndentedString(incidentType)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/PostmortemTemplateDataRequest.java b/src/main/java/com/datadog/api/client/v2/model/PostmortemTemplateDataRequest.java index 56494369935..d20c51a0cba 100644 --- a/src/main/java/com/datadog/api/client/v2/model/PostmortemTemplateDataRequest.java +++ b/src/main/java/com/datadog/api/client/v2/model/PostmortemTemplateDataRequest.java @@ -20,6 +20,8 @@ /** Data object for creating or updating a postmortem template. */ @JsonPropertyOrder({ PostmortemTemplateDataRequest.JSON_PROPERTY_ATTRIBUTES, + PostmortemTemplateDataRequest.JSON_PROPERTY_ID, + PostmortemTemplateDataRequest.JSON_PROPERTY_RELATIONSHIPS, PostmortemTemplateDataRequest.JSON_PROPERTY_TYPE }) @jakarta.annotation.Generated( @@ -29,6 +31,12 @@ public class PostmortemTemplateDataRequest { public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; private PostmortemTemplateAttributesRequest attributes; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private PostmortemTemplateCreateRelationships relationships; + public static final String JSON_PROPERTY_TYPE = "type"; private PostmortemTemplateType type; @@ -69,6 +77,54 @@ public void setAttributes(PostmortemTemplateAttributesRequest attributes) { } } + public PostmortemTemplateDataRequest id(String id) { + this.id = id; + return this; + } + + /** + * The ID of the template. Required when updating. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public PostmortemTemplateDataRequest relationships( + PostmortemTemplateCreateRelationships relationships) { + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + return this; + } + + /** + * Relationships for a postmortem template. incident_type is required when creating a + * template and is immutable afterwards. + * + * @return relationships + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PostmortemTemplateCreateRelationships getRelationships() { + return relationships; + } + + public void setRelationships(PostmortemTemplateCreateRelationships relationships) { + this.relationships = relationships; + if (relationships != null) { + this.unparsed |= relationships.unparsed; + } + } + public PostmortemTemplateDataRequest type(PostmortemTemplateType type) { this.type = type; this.unparsed |= !type.isValid(); @@ -76,7 +132,7 @@ public PostmortemTemplateDataRequest type(PostmortemTemplateType type) { } /** - * Postmortem template resource type + * Postmortem template resource type. * * @return type */ @@ -150,6 +206,8 @@ public boolean equals(Object o) { } PostmortemTemplateDataRequest postmortemTemplateDataRequest = (PostmortemTemplateDataRequest) o; return Objects.equals(this.attributes, postmortemTemplateDataRequest.attributes) + && Objects.equals(this.id, postmortemTemplateDataRequest.id) + && Objects.equals(this.relationships, postmortemTemplateDataRequest.relationships) && Objects.equals(this.type, postmortemTemplateDataRequest.type) && Objects.equals( this.additionalProperties, postmortemTemplateDataRequest.additionalProperties); @@ -157,7 +215,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(attributes, type, additionalProperties); + return Objects.hash(attributes, id, relationships, type, additionalProperties); } @Override @@ -165,6 +223,8 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class PostmortemTemplateDataRequest {\n"); sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" relationships: ").append(toIndentedString(relationships)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) diff --git a/src/main/java/com/datadog/api/client/v2/model/PostmortemTemplateDataResponse.java b/src/main/java/com/datadog/api/client/v2/model/PostmortemTemplateDataResponse.java index 25740a4e7df..c81a4472a90 100644 --- a/src/main/java/com/datadog/api/client/v2/model/PostmortemTemplateDataResponse.java +++ b/src/main/java/com/datadog/api/client/v2/model/PostmortemTemplateDataResponse.java @@ -21,6 +21,7 @@ @JsonPropertyOrder({ PostmortemTemplateDataResponse.JSON_PROPERTY_ATTRIBUTES, PostmortemTemplateDataResponse.JSON_PROPERTY_ID, + PostmortemTemplateDataResponse.JSON_PROPERTY_RELATIONSHIPS, PostmortemTemplateDataResponse.JSON_PROPERTY_TYPE }) @jakarta.annotation.Generated( @@ -33,6 +34,9 @@ public class PostmortemTemplateDataResponse { public static final String JSON_PROPERTY_ID = "id"; private String id; + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private PostmortemTemplateResponseRelationships relationships; + public static final String JSON_PROPERTY_TYPE = "type"; private PostmortemTemplateType type; @@ -82,7 +86,7 @@ public PostmortemTemplateDataResponse id(String id) { } /** - * The ID of the template + * The ID of the template. * * @return id */ @@ -96,6 +100,32 @@ public void setId(String id) { this.id = id; } + public PostmortemTemplateDataResponse relationships( + PostmortemTemplateResponseRelationships relationships) { + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + return this; + } + + /** + * Relationships of a postmortem template returned in a response. + * + * @return relationships + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PostmortemTemplateResponseRelationships getRelationships() { + return relationships; + } + + public void setRelationships(PostmortemTemplateResponseRelationships relationships) { + this.relationships = relationships; + if (relationships != null) { + this.unparsed |= relationships.unparsed; + } + } + public PostmortemTemplateDataResponse type(PostmortemTemplateType type) { this.type = type; this.unparsed |= !type.isValid(); @@ -103,7 +133,7 @@ public PostmortemTemplateDataResponse type(PostmortemTemplateType type) { } /** - * Postmortem template resource type + * Postmortem template resource type. * * @return type */ @@ -179,6 +209,7 @@ public boolean equals(Object o) { (PostmortemTemplateDataResponse) o; return Objects.equals(this.attributes, postmortemTemplateDataResponse.attributes) && Objects.equals(this.id, postmortemTemplateDataResponse.id) + && Objects.equals(this.relationships, postmortemTemplateDataResponse.relationships) && Objects.equals(this.type, postmortemTemplateDataResponse.type) && Objects.equals( this.additionalProperties, postmortemTemplateDataResponse.additionalProperties); @@ -186,7 +217,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(attributes, id, type, additionalProperties); + return Objects.hash(attributes, id, relationships, type, additionalProperties); } @Override @@ -195,6 +226,7 @@ public String toString() { sb.append("class PostmortemTemplateDataResponse {\n"); sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" relationships: ").append(toIndentedString(relationships)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) diff --git a/src/main/java/com/datadog/api/client/v2/model/PostmortemTemplateIncidentTypeRelationship.java b/src/main/java/com/datadog/api/client/v2/model/PostmortemTemplateIncidentTypeRelationship.java new file mode 100644 index 00000000000..ea15a647379 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/PostmortemTemplateIncidentTypeRelationship.java @@ -0,0 +1,154 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Relationship to the incident type this template belongs to. */ +@JsonPropertyOrder({PostmortemTemplateIncidentTypeRelationship.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class PostmortemTemplateIncidentTypeRelationship { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private PostmortemTemplateIncidentTypeRelationshipData data; + + public PostmortemTemplateIncidentTypeRelationship() {} + + @JsonCreator + public PostmortemTemplateIncidentTypeRelationship( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + PostmortemTemplateIncidentTypeRelationshipData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public PostmortemTemplateIncidentTypeRelationship data( + PostmortemTemplateIncidentTypeRelationshipData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Incident type relationship data. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public PostmortemTemplateIncidentTypeRelationshipData getData() { + return data; + } + + public void setData(PostmortemTemplateIncidentTypeRelationshipData data) { + this.data = data; + if (data != null) { + this.unparsed |= data.unparsed; + } + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return PostmortemTemplateIncidentTypeRelationship + */ + @JsonAnySetter + public PostmortemTemplateIncidentTypeRelationship putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this PostmortemTemplateIncidentTypeRelationship object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PostmortemTemplateIncidentTypeRelationship postmortemTemplateIncidentTypeRelationship = + (PostmortemTemplateIncidentTypeRelationship) o; + return Objects.equals(this.data, postmortemTemplateIncidentTypeRelationship.data) + && Objects.equals( + this.additionalProperties, + postmortemTemplateIncidentTypeRelationship.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PostmortemTemplateIncidentTypeRelationship {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/PostmortemTemplateIncidentTypeRelationshipData.java b/src/main/java/com/datadog/api/client/v2/model/PostmortemTemplateIncidentTypeRelationshipData.java new file mode 100644 index 00000000000..57ed80187f4 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/PostmortemTemplateIncidentTypeRelationshipData.java @@ -0,0 +1,178 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.UUID; + +/** Incident type relationship data. */ +@JsonPropertyOrder({ + PostmortemTemplateIncidentTypeRelationshipData.JSON_PROPERTY_ID, + PostmortemTemplateIncidentTypeRelationshipData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class PostmortemTemplateIncidentTypeRelationshipData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private UUID id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public PostmortemTemplateIncidentTypeRelationshipData() {} + + @JsonCreator + public PostmortemTemplateIncidentTypeRelationshipData( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) UUID id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) String type) { + this.id = id; + this.type = type; + } + + public PostmortemTemplateIncidentTypeRelationshipData id(UUID id) { + this.id = id; + return this; + } + + /** + * The incident type identifier. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UUID getId() { + return id; + } + + public void setId(UUID id) { + this.id = id; + } + + public PostmortemTemplateIncidentTypeRelationshipData type(String type) { + this.type = type; + return this; + } + + /** + * The incident type resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return PostmortemTemplateIncidentTypeRelationshipData + */ + @JsonAnySetter + public PostmortemTemplateIncidentTypeRelationshipData putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this PostmortemTemplateIncidentTypeRelationshipData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PostmortemTemplateIncidentTypeRelationshipData postmortemTemplateIncidentTypeRelationshipData = + (PostmortemTemplateIncidentTypeRelationshipData) o; + return Objects.equals(this.id, postmortemTemplateIncidentTypeRelationshipData.id) + && Objects.equals(this.type, postmortemTemplateIncidentTypeRelationshipData.type) + && Objects.equals( + this.additionalProperties, + postmortemTemplateIncidentTypeRelationshipData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PostmortemTemplateIncidentTypeRelationshipData {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/PostmortemTemplateLocation.java b/src/main/java/com/datadog/api/client/v2/model/PostmortemTemplateLocation.java new file mode 100644 index 00000000000..49c5115bd01 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/PostmortemTemplateLocation.java @@ -0,0 +1,61 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The location where the postmortem is created and stored. */ +@JsonSerialize(using = PostmortemTemplateLocation.PostmortemTemplateLocationSerializer.class) +public class PostmortemTemplateLocation extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("datadog_notebooks", "confluence", "google_docs")); + + public static final PostmortemTemplateLocation DATADOG_NOTEBOOKS = + new PostmortemTemplateLocation("datadog_notebooks"); + public static final PostmortemTemplateLocation CONFLUENCE = + new PostmortemTemplateLocation("confluence"); + public static final PostmortemTemplateLocation GOOGLE_DOCS = + new PostmortemTemplateLocation("google_docs"); + + PostmortemTemplateLocation(String value) { + super(value, allowedValues); + } + + public static class PostmortemTemplateLocationSerializer + extends StdSerializer { + public PostmortemTemplateLocationSerializer(Class t) { + super(t); + } + + public PostmortemTemplateLocationSerializer() { + this(null); + } + + @Override + public void serialize( + PostmortemTemplateLocation value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static PostmortemTemplateLocation fromValue(String value) { + return new PostmortemTemplateLocation(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/PostmortemTemplateResponseRelationships.java b/src/main/java/com/datadog/api/client/v2/model/PostmortemTemplateResponseRelationships.java new file mode 100644 index 00000000000..4988be7c2e7 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/PostmortemTemplateResponseRelationships.java @@ -0,0 +1,178 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Relationships of a postmortem template returned in a response. */ +@JsonPropertyOrder({ + PostmortemTemplateResponseRelationships.JSON_PROPERTY_INCIDENT_TYPE, + PostmortemTemplateResponseRelationships.JSON_PROPERTY_LAST_MODIFIED_BY_USER +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class PostmortemTemplateResponseRelationships { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_INCIDENT_TYPE = "incident_type"; + private PostmortemTemplateIncidentTypeRelationship incidentType; + + public static final String JSON_PROPERTY_LAST_MODIFIED_BY_USER = "last_modified_by_user"; + private PostmortemTemplateUserRelationship lastModifiedByUser; + + public PostmortemTemplateResponseRelationships incidentType( + PostmortemTemplateIncidentTypeRelationship incidentType) { + this.incidentType = incidentType; + this.unparsed |= incidentType.unparsed; + return this; + } + + /** + * Relationship to the incident type this template belongs to. + * + * @return incidentType + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INCIDENT_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PostmortemTemplateIncidentTypeRelationship getIncidentType() { + return incidentType; + } + + public void setIncidentType(PostmortemTemplateIncidentTypeRelationship incidentType) { + this.incidentType = incidentType; + if (incidentType != null) { + this.unparsed |= incidentType.unparsed; + } + } + + public PostmortemTemplateResponseRelationships lastModifiedByUser( + PostmortemTemplateUserRelationship lastModifiedByUser) { + this.lastModifiedByUser = lastModifiedByUser; + this.unparsed |= lastModifiedByUser.unparsed; + return this; + } + + /** + * Relationship to a user. + * + * @return lastModifiedByUser + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LAST_MODIFIED_BY_USER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PostmortemTemplateUserRelationship getLastModifiedByUser() { + return lastModifiedByUser; + } + + public void setLastModifiedByUser(PostmortemTemplateUserRelationship lastModifiedByUser) { + this.lastModifiedByUser = lastModifiedByUser; + if (lastModifiedByUser != null) { + this.unparsed |= lastModifiedByUser.unparsed; + } + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return PostmortemTemplateResponseRelationships + */ + @JsonAnySetter + public PostmortemTemplateResponseRelationships putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this PostmortemTemplateResponseRelationships object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PostmortemTemplateResponseRelationships postmortemTemplateResponseRelationships = + (PostmortemTemplateResponseRelationships) o; + return Objects.equals(this.incidentType, postmortemTemplateResponseRelationships.incidentType) + && Objects.equals( + this.lastModifiedByUser, postmortemTemplateResponseRelationships.lastModifiedByUser) + && Objects.equals( + this.additionalProperties, + postmortemTemplateResponseRelationships.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(incidentType, lastModifiedByUser, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PostmortemTemplateResponseRelationships {\n"); + sb.append(" incidentType: ").append(toIndentedString(incidentType)).append("\n"); + sb.append(" lastModifiedByUser: ").append(toIndentedString(lastModifiedByUser)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/PostmortemTemplateType.java b/src/main/java/com/datadog/api/client/v2/model/PostmortemTemplateType.java index 509e81022dd..af9126fa184 100644 --- a/src/main/java/com/datadog/api/client/v2/model/PostmortemTemplateType.java +++ b/src/main/java/com/datadog/api/client/v2/model/PostmortemTemplateType.java @@ -18,13 +18,15 @@ import java.util.HashSet; import java.util.Set; -/** Postmortem template resource type */ +/** Postmortem template resource type. */ @JsonSerialize(using = PostmortemTemplateType.PostmortemTemplateTypeSerializer.class) public class PostmortemTemplateType extends ModelEnum { private static final Set allowedValues = - new HashSet(Arrays.asList("postmortem_template")); + new HashSet(Arrays.asList("postmortem_templates", "postmortem_template")); + public static final PostmortemTemplateType POSTMORTEM_TEMPLATES = + new PostmortemTemplateType("postmortem_templates"); public static final PostmortemTemplateType POSTMORTEM_TEMPLATE = new PostmortemTemplateType("postmortem_template"); diff --git a/src/main/java/com/datadog/api/client/v2/model/PostmortemTemplateUserRelationship.java b/src/main/java/com/datadog/api/client/v2/model/PostmortemTemplateUserRelationship.java new file mode 100644 index 00000000000..549f812d32a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/PostmortemTemplateUserRelationship.java @@ -0,0 +1,151 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Relationship to a user. */ +@JsonPropertyOrder({PostmortemTemplateUserRelationship.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class PostmortemTemplateUserRelationship { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private PostmortemTemplateUserRelationshipData data; + + public PostmortemTemplateUserRelationship() {} + + @JsonCreator + public PostmortemTemplateUserRelationship( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + PostmortemTemplateUserRelationshipData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public PostmortemTemplateUserRelationship data(PostmortemTemplateUserRelationshipData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * User relationship data. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public PostmortemTemplateUserRelationshipData getData() { + return data; + } + + public void setData(PostmortemTemplateUserRelationshipData data) { + this.data = data; + if (data != null) { + this.unparsed |= data.unparsed; + } + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return PostmortemTemplateUserRelationship + */ + @JsonAnySetter + public PostmortemTemplateUserRelationship putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this PostmortemTemplateUserRelationship object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PostmortemTemplateUserRelationship postmortemTemplateUserRelationship = + (PostmortemTemplateUserRelationship) o; + return Objects.equals(this.data, postmortemTemplateUserRelationship.data) + && Objects.equals( + this.additionalProperties, postmortemTemplateUserRelationship.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PostmortemTemplateUserRelationship {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/PostmortemTemplateUserRelationshipData.java b/src/main/java/com/datadog/api/client/v2/model/PostmortemTemplateUserRelationshipData.java new file mode 100644 index 00000000000..760f7f690d0 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/PostmortemTemplateUserRelationshipData.java @@ -0,0 +1,176 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.UUID; + +/** User relationship data. */ +@JsonPropertyOrder({ + PostmortemTemplateUserRelationshipData.JSON_PROPERTY_ID, + PostmortemTemplateUserRelationshipData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class PostmortemTemplateUserRelationshipData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private UUID id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public PostmortemTemplateUserRelationshipData() {} + + @JsonCreator + public PostmortemTemplateUserRelationshipData( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) UUID id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) String type) { + this.id = id; + this.type = type; + } + + public PostmortemTemplateUserRelationshipData id(UUID id) { + this.id = id; + return this; + } + + /** + * The user identifier. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UUID getId() { + return id; + } + + public void setId(UUID id) { + this.id = id; + } + + public PostmortemTemplateUserRelationshipData type(String type) { + this.type = type; + return this; + } + + /** + * The user resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return PostmortemTemplateUserRelationshipData + */ + @JsonAnySetter + public PostmortemTemplateUserRelationshipData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this PostmortemTemplateUserRelationshipData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PostmortemTemplateUserRelationshipData postmortemTemplateUserRelationshipData = + (PostmortemTemplateUserRelationshipData) o; + return Objects.equals(this.id, postmortemTemplateUserRelationshipData.id) + && Objects.equals(this.type, postmortemTemplateUserRelationshipData.type) + && Objects.equals( + this.additionalProperties, postmortemTemplateUserRelationshipData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PostmortemTemplateUserRelationshipData {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +}