From daeaf3cd5f98faa1f795e9e3de8f5225dd0b880d Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Mon, 19 Jan 2026 08:42:06 +0000 Subject: [PATCH] Regenerate client from commit 904d2dd of spec repo --- .generator/schemas/v2/openapi.yaml | 117 +++++++++ .../CreateIncidentPostmortemAttachment.java | 64 +++++ .../com/datadog/api/client/ApiClient.java | 1 + .../api/client/v2/api/IncidentsApi.java | 183 ++++++++++++++ .../v2/model/PostmortemAttachmentRequest.java | 147 +++++++++++ ...PostmortemAttachmentRequestAttributes.java | 237 ++++++++++++++++++ .../PostmortemAttachmentRequestData.java | 184 ++++++++++++++ .../api/client/v2/model/PostmortemCell.java | 196 +++++++++++++++ .../v2/model/PostmortemCellAttributes.java | 136 ++++++++++ .../v2/model/PostmortemCellDefinition.java | 135 ++++++++++ .../client/v2/model/PostmortemCellType.java | 53 ++++ .../api/client/v2/api/incidents.feature | 18 ++ .../com/datadog/api/client/v2/api/undo.json | 8 + 13 files changed, 1479 insertions(+) create mode 100644 examples/v2/incidents/CreateIncidentPostmortemAttachment.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/PostmortemAttachmentRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/PostmortemAttachmentRequestAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/PostmortemAttachmentRequestData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/PostmortemCell.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/PostmortemCellAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/PostmortemCellDefinition.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/PostmortemCellType.java diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index f11972d91d0..3abfaf3ebf6 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -41880,6 +41880,83 @@ components: type: string x-enum-varnames: - PERMISSIONS + PostmortemAttachmentRequest: + properties: + data: + $ref: '#/components/schemas/PostmortemAttachmentRequestData' + required: + - data + type: object + PostmortemAttachmentRequestAttributes: + description: Postmortem attachment attributes + properties: + cells: + description: The cells of the postmortem + items: + $ref: '#/components/schemas/PostmortemCell' + type: array + content: + description: The content of the postmortem + example: '# Incident Report - IR-123 + + [...]' + type: string + postmortem_template_id: + description: The ID of the postmortem template + example: 93645509-874e-45c4-adfa-623bfeaead89-123 + type: string + title: + description: The title of the postmortem + example: Postmortem-IR-123 + type: string + type: object + PostmortemAttachmentRequestData: + description: Postmortem attachment data + properties: + attributes: + $ref: '#/components/schemas/PostmortemAttachmentRequestAttributes' + type: + $ref: '#/components/schemas/IncidentAttachmentType' + required: + - type + - attributes + type: object + PostmortemCell: + description: A cell in the postmortem + properties: + attributes: + $ref: '#/components/schemas/PostmortemCellAttributes' + id: + description: The unique identifier of the cell + example: cell-1 + type: string + type: + $ref: '#/components/schemas/PostmortemCellType' + type: object + PostmortemCellAttributes: + description: Attributes of a postmortem cell + properties: + definition: + $ref: '#/components/schemas/PostmortemCellDefinition' + type: object + PostmortemCellDefinition: + description: Definition of a postmortem cell + properties: + content: + description: The content of the cell in markdown format + example: '## Incident Summary + + This incident was caused by...' + type: string + type: object + PostmortemCellType: + description: The postmortem cell resource type. + enum: + - markdown + example: markdown + type: string + x-enum-varnames: + - MARKDOWN Powerpack: description: Powerpacks are templated groups of dashboard widgets you can save from an existing dashboard and turn into reusable packs in the widget tray. @@ -71685,6 +71762,46 @@ paths: - incident_write x-unstable: '**Note**: This endpoint is in Preview. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/incidents/{incident_id}/attachments/postmortems: + post: + description: Create a postmortem attachment for an incident. + operationId: CreateIncidentPostmortemAttachment + parameters: + - description: The ID of the incident + in: path + name: incident_id + required: true + schema: + example: 00000000-0000-0000-0000-000000000000 + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PostmortemAttachmentRequest' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/Attachment' + description: Created + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Create postmortem attachment + tags: + - Incidents + x-unstable: '**Note**: This endpoint is in public beta and it''s subject to + change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/incidents/{incident_id}/attachments/{attachment_id}: delete: diff --git a/examples/v2/incidents/CreateIncidentPostmortemAttachment.java b/examples/v2/incidents/CreateIncidentPostmortemAttachment.java new file mode 100644 index 00000000000..7dd39baebd9 --- /dev/null +++ b/examples/v2/incidents/CreateIncidentPostmortemAttachment.java @@ -0,0 +1,64 @@ +// Create postmortem attachment returns "Created" response + +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.Attachment; +import com.datadog.api.client.v2.model.IncidentAttachmentType; +import com.datadog.api.client.v2.model.PostmortemAttachmentRequest; +import com.datadog.api.client.v2.model.PostmortemAttachmentRequestAttributes; +import com.datadog.api.client.v2.model.PostmortemAttachmentRequestData; +import com.datadog.api.client.v2.model.PostmortemCell; +import com.datadog.api.client.v2.model.PostmortemCellAttributes; +import com.datadog.api.client.v2.model.PostmortemCellDefinition; +import com.datadog.api.client.v2.model.PostmortemCellType; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.createIncidentPostmortemAttachment", true); + IncidentsApi apiInstance = new IncidentsApi(defaultClient); + + PostmortemAttachmentRequest body = + new PostmortemAttachmentRequest() + .data( + new PostmortemAttachmentRequestData() + .attributes( + new PostmortemAttachmentRequestAttributes() + .cells( + Collections.singletonList( + new PostmortemCell() + .attributes( + new PostmortemCellAttributes() + .definition( + new PostmortemCellDefinition() + .content( + """ +## Incident Summary +This incident was caused by... +"""))) + .id("cell-1") + .type(PostmortemCellType.MARKDOWN))) + .content(""" +# Incident Report - IR-123 +[...] +""") + .postmortemTemplateId("93645509-874e-45c4-adfa-623bfeaead89-123") + .title("Postmortem-IR-123")) + .type(IncidentAttachmentType.INCIDENT_ATTACHMENTS)); + + try { + Attachment result = + apiInstance.createIncidentPostmortemAttachment( + "00000000-0000-0000-0000-000000000000", body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling IncidentsApi#createIncidentPostmortemAttachment"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/datadog/api/client/ApiClient.java b/src/main/java/com/datadog/api/client/ApiClient.java index 013c656b24d..fef72371100 100644 --- a/src/main/java/com/datadog/api/client/ApiClient.java +++ b/src/main/java/com/datadog/api/client/ApiClient.java @@ -820,6 +820,7 @@ public class ApiClient { put("v2.createIncidentIntegration", false); put("v2.createIncidentNotificationRule", false); put("v2.createIncidentNotificationTemplate", false); + put("v2.createIncidentPostmortemAttachment", false); put("v2.createIncidentTodo", false); put("v2.createIncidentType", false); put("v2.deleteIncident", false); 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 11dbbcfb272..846e12a65dd 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 @@ -41,6 +41,7 @@ import com.datadog.api.client.v2.model.IncidentsResponse; import com.datadog.api.client.v2.model.PatchAttachmentRequest; import com.datadog.api.client.v2.model.PatchIncidentNotificationTemplateRequest; +import com.datadog.api.client.v2.model.PostmortemAttachmentRequest; import com.datadog.api.client.v2.model.PutIncidentNotificationRuleRequest; import jakarta.ws.rs.client.Invocation; import jakarta.ws.rs.core.GenericType; @@ -1219,6 +1220,188 @@ public ApiResponse createIncidentNotificationTempl new GenericType() {}); } + /** + * Create postmortem attachment. + * + *

See {@link #createIncidentPostmortemAttachmentWithHttpInfo}. + * + * @param incidentId The ID of the incident (required) + * @param body (required) + * @return Attachment + * @throws ApiException if fails to make API call + */ + public Attachment createIncidentPostmortemAttachment( + String incidentId, PostmortemAttachmentRequest body) throws ApiException { + return createIncidentPostmortemAttachmentWithHttpInfo(incidentId, body).getData(); + } + + /** + * Create postmortem attachment. + * + *

See {@link #createIncidentPostmortemAttachmentWithHttpInfoAsync}. + * + * @param incidentId The ID of the incident (required) + * @param body (required) + * @return CompletableFuture<Attachment> + */ + public CompletableFuture createIncidentPostmortemAttachmentAsync( + String incidentId, PostmortemAttachmentRequest body) { + return createIncidentPostmortemAttachmentWithHttpInfoAsync(incidentId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Create a postmortem attachment for an incident. + * + * @param incidentId The ID of the incident (required) + * @param body (required) + * @return ApiResponse<Attachment> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
201 Created -
400 Bad Request -
429 Too many requests -
+ */ + public ApiResponse createIncidentPostmortemAttachmentWithHttpInfo( + String incidentId, PostmortemAttachmentRequest body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "createIncidentPostmortemAttachment"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'incidentId' is set + if (incidentId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'incidentId' when calling" + + " createIncidentPostmortemAttachment"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, + "Missing the required parameter 'body' when calling createIncidentPostmortemAttachment"); + } + // create path and map variables + String localVarPath = + "/api/v2/incidents/{incident_id}/attachments/postmortems" + .replaceAll( + "\\{" + "incident_id" + "\\}", apiClient.escapeString(incidentId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.IncidentsApi.createIncidentPostmortemAttachment", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Create postmortem attachment. + * + *

See {@link #createIncidentPostmortemAttachmentWithHttpInfo}. + * + * @param incidentId The ID of the incident (required) + * @param body (required) + * @return CompletableFuture<ApiResponse<Attachment>> + */ + public CompletableFuture> + createIncidentPostmortemAttachmentWithHttpInfoAsync( + String incidentId, PostmortemAttachmentRequest body) { + // Check if unstable operation is enabled + String operationId = "createIncidentPostmortemAttachment"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = body; + + // verify the required parameter 'incidentId' is set + if (incidentId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'incidentId' when calling" + + " createIncidentPostmortemAttachment")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'body' when calling" + + " createIncidentPostmortemAttachment")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/incidents/{incident_id}/attachments/postmortems" + .replaceAll( + "\\{" + "incident_id" + "\\}", apiClient.escapeString(incidentId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.IncidentsApi.createIncidentPostmortemAttachment", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + /** * Create an incident todo. * diff --git a/src/main/java/com/datadog/api/client/v2/model/PostmortemAttachmentRequest.java b/src/main/java/com/datadog/api/client/v2/model/PostmortemAttachmentRequest.java new file mode 100644 index 00000000000..c5f60ab55ba --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/PostmortemAttachmentRequest.java @@ -0,0 +1,147 @@ +/* + * 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; + +/** */ +@JsonPropertyOrder({PostmortemAttachmentRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class PostmortemAttachmentRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private PostmortemAttachmentRequestData data; + + public PostmortemAttachmentRequest() {} + + @JsonCreator + public PostmortemAttachmentRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + PostmortemAttachmentRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public PostmortemAttachmentRequest data(PostmortemAttachmentRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Postmortem attachment data + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public PostmortemAttachmentRequestData getData() { + return data; + } + + public void setData(PostmortemAttachmentRequestData data) { + this.data = data; + } + + /** + * 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 PostmortemAttachmentRequest + */ + @JsonAnySetter + public PostmortemAttachmentRequest 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 PostmortemAttachmentRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PostmortemAttachmentRequest postmortemAttachmentRequest = (PostmortemAttachmentRequest) o; + return Objects.equals(this.data, postmortemAttachmentRequest.data) + && Objects.equals( + this.additionalProperties, postmortemAttachmentRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PostmortemAttachmentRequest {\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/PostmortemAttachmentRequestAttributes.java b/src/main/java/com/datadog/api/client/v2/model/PostmortemAttachmentRequestAttributes.java new file mode 100644 index 00000000000..3d2fca801e0 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/PostmortemAttachmentRequestAttributes.java @@ -0,0 +1,237 @@ +/* + * 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.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Postmortem attachment attributes */ +@JsonPropertyOrder({ + PostmortemAttachmentRequestAttributes.JSON_PROPERTY_CELLS, + PostmortemAttachmentRequestAttributes.JSON_PROPERTY_CONTENT, + PostmortemAttachmentRequestAttributes.JSON_PROPERTY_POSTMORTEM_TEMPLATE_ID, + PostmortemAttachmentRequestAttributes.JSON_PROPERTY_TITLE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class PostmortemAttachmentRequestAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CELLS = "cells"; + private List cells = null; + + public static final String JSON_PROPERTY_CONTENT = "content"; + private String content; + + public static final String JSON_PROPERTY_POSTMORTEM_TEMPLATE_ID = "postmortem_template_id"; + private String postmortemTemplateId; + + public static final String JSON_PROPERTY_TITLE = "title"; + private String title; + + public PostmortemAttachmentRequestAttributes cells(List cells) { + this.cells = cells; + for (PostmortemCell item : cells) { + this.unparsed |= item.unparsed; + } + return this; + } + + public PostmortemAttachmentRequestAttributes addCellsItem(PostmortemCell cellsItem) { + if (this.cells == null) { + this.cells = new ArrayList<>(); + } + this.cells.add(cellsItem); + this.unparsed |= cellsItem.unparsed; + return this; + } + + /** + * The cells of the postmortem + * + * @return cells + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CELLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCells() { + return cells; + } + + public void setCells(List cells) { + this.cells = cells; + } + + public PostmortemAttachmentRequestAttributes content(String content) { + this.content = content; + return this; + } + + /** + * The content of the postmortem + * + * @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 PostmortemAttachmentRequestAttributes postmortemTemplateId(String postmortemTemplateId) { + this.postmortemTemplateId = postmortemTemplateId; + return this; + } + + /** + * The ID of the postmortem template + * + * @return postmortemTemplateId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_POSTMORTEM_TEMPLATE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPostmortemTemplateId() { + return postmortemTemplateId; + } + + public void setPostmortemTemplateId(String postmortemTemplateId) { + this.postmortemTemplateId = postmortemTemplateId; + } + + public PostmortemAttachmentRequestAttributes title(String title) { + this.title = title; + return this; + } + + /** + * The title of the postmortem + * + * @return title + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + /** + * 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 PostmortemAttachmentRequestAttributes + */ + @JsonAnySetter + public PostmortemAttachmentRequestAttributes 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 PostmortemAttachmentRequestAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PostmortemAttachmentRequestAttributes postmortemAttachmentRequestAttributes = + (PostmortemAttachmentRequestAttributes) o; + return Objects.equals(this.cells, postmortemAttachmentRequestAttributes.cells) + && Objects.equals(this.content, postmortemAttachmentRequestAttributes.content) + && Objects.equals( + this.postmortemTemplateId, postmortemAttachmentRequestAttributes.postmortemTemplateId) + && Objects.equals(this.title, postmortemAttachmentRequestAttributes.title) + && Objects.equals( + this.additionalProperties, postmortemAttachmentRequestAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(cells, content, postmortemTemplateId, title, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PostmortemAttachmentRequestAttributes {\n"); + sb.append(" cells: ").append(toIndentedString(cells)).append("\n"); + sb.append(" content: ").append(toIndentedString(content)).append("\n"); + sb.append(" postmortemTemplateId: ") + .append(toIndentedString(postmortemTemplateId)) + .append("\n"); + sb.append(" title: ").append(toIndentedString(title)).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/PostmortemAttachmentRequestData.java b/src/main/java/com/datadog/api/client/v2/model/PostmortemAttachmentRequestData.java new file mode 100644 index 00000000000..a7bbc5b3125 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/PostmortemAttachmentRequestData.java @@ -0,0 +1,184 @@ +/* + * 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; + +/** Postmortem attachment data */ +@JsonPropertyOrder({ + PostmortemAttachmentRequestData.JSON_PROPERTY_ATTRIBUTES, + PostmortemAttachmentRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class PostmortemAttachmentRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private PostmortemAttachmentRequestAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private IncidentAttachmentType type = IncidentAttachmentType.INCIDENT_ATTACHMENTS; + + public PostmortemAttachmentRequestData() {} + + @JsonCreator + public PostmortemAttachmentRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + PostmortemAttachmentRequestAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) IncidentAttachmentType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public PostmortemAttachmentRequestData attributes( + PostmortemAttachmentRequestAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Postmortem attachment attributes + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public PostmortemAttachmentRequestAttributes getAttributes() { + return attributes; + } + + public void setAttributes(PostmortemAttachmentRequestAttributes attributes) { + this.attributes = attributes; + } + + public PostmortemAttachmentRequestData type(IncidentAttachmentType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The incident attachment resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IncidentAttachmentType getType() { + return type; + } + + public void setType(IncidentAttachmentType type) { + if (!type.isValid()) { + this.unparsed = true; + } + 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 PostmortemAttachmentRequestData + */ + @JsonAnySetter + public PostmortemAttachmentRequestData 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 PostmortemAttachmentRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PostmortemAttachmentRequestData postmortemAttachmentRequestData = + (PostmortemAttachmentRequestData) o; + return Objects.equals(this.attributes, postmortemAttachmentRequestData.attributes) + && Objects.equals(this.type, postmortemAttachmentRequestData.type) + && Objects.equals( + this.additionalProperties, postmortemAttachmentRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PostmortemAttachmentRequestData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).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/PostmortemCell.java b/src/main/java/com/datadog/api/client/v2/model/PostmortemCell.java new file mode 100644 index 00000000000..9a39d37f55a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/PostmortemCell.java @@ -0,0 +1,196 @@ +/* + * 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; + +/** A cell in the postmortem */ +@JsonPropertyOrder({ + PostmortemCell.JSON_PROPERTY_ATTRIBUTES, + PostmortemCell.JSON_PROPERTY_ID, + PostmortemCell.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class PostmortemCell { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private PostmortemCellAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private PostmortemCellType type; + + public PostmortemCell attributes(PostmortemCellAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of a postmortem cell + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PostmortemCellAttributes getAttributes() { + return attributes; + } + + public void setAttributes(PostmortemCellAttributes attributes) { + this.attributes = attributes; + } + + public PostmortemCell id(String id) { + this.id = id; + return this; + } + + /** + * The unique identifier of the cell + * + * @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 PostmortemCell type(PostmortemCellType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The postmortem cell resource type. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PostmortemCellType getType() { + return type; + } + + public void setType(PostmortemCellType type) { + if (!type.isValid()) { + this.unparsed = true; + } + 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 PostmortemCell + */ + @JsonAnySetter + public PostmortemCell 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 PostmortemCell object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PostmortemCell postmortemCell = (PostmortemCell) o; + return Objects.equals(this.attributes, postmortemCell.attributes) + && Objects.equals(this.id, postmortemCell.id) + && Objects.equals(this.type, postmortemCell.type) + && Objects.equals(this.additionalProperties, postmortemCell.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PostmortemCell {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\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/PostmortemCellAttributes.java b/src/main/java/com/datadog/api/client/v2/model/PostmortemCellAttributes.java new file mode 100644 index 00000000000..9c9789938e7 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/PostmortemCellAttributes.java @@ -0,0 +1,136 @@ +/* + * 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; + +/** Attributes of a postmortem cell */ +@JsonPropertyOrder({PostmortemCellAttributes.JSON_PROPERTY_DEFINITION}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class PostmortemCellAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DEFINITION = "definition"; + private PostmortemCellDefinition definition; + + public PostmortemCellAttributes definition(PostmortemCellDefinition definition) { + this.definition = definition; + this.unparsed |= definition.unparsed; + return this; + } + + /** + * Definition of a postmortem cell + * + * @return definition + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DEFINITION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PostmortemCellDefinition getDefinition() { + return definition; + } + + public void setDefinition(PostmortemCellDefinition definition) { + this.definition = definition; + } + + /** + * 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 PostmortemCellAttributes + */ + @JsonAnySetter + public PostmortemCellAttributes 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 PostmortemCellAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PostmortemCellAttributes postmortemCellAttributes = (PostmortemCellAttributes) o; + return Objects.equals(this.definition, postmortemCellAttributes.definition) + && Objects.equals(this.additionalProperties, postmortemCellAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(definition, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PostmortemCellAttributes {\n"); + sb.append(" definition: ").append(toIndentedString(definition)).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/PostmortemCellDefinition.java b/src/main/java/com/datadog/api/client/v2/model/PostmortemCellDefinition.java new file mode 100644 index 00000000000..4f7e842109b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/PostmortemCellDefinition.java @@ -0,0 +1,135 @@ +/* + * 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; + +/** Definition of a postmortem cell */ +@JsonPropertyOrder({PostmortemCellDefinition.JSON_PROPERTY_CONTENT}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class PostmortemCellDefinition { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CONTENT = "content"; + private String content; + + public PostmortemCellDefinition content(String content) { + this.content = content; + return this; + } + + /** + * The content of the cell in markdown format + * + * @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; + } + + /** + * 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 PostmortemCellDefinition + */ + @JsonAnySetter + public PostmortemCellDefinition 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 PostmortemCellDefinition object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PostmortemCellDefinition postmortemCellDefinition = (PostmortemCellDefinition) o; + return Objects.equals(this.content, postmortemCellDefinition.content) + && Objects.equals(this.additionalProperties, postmortemCellDefinition.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(content, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PostmortemCellDefinition {\n"); + sb.append(" content: ").append(toIndentedString(content)).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/PostmortemCellType.java b/src/main/java/com/datadog/api/client/v2/model/PostmortemCellType.java new file mode 100644 index 00000000000..080f4ddf584 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/PostmortemCellType.java @@ -0,0 +1,53 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +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 postmortem cell resource type. */ +@JsonSerialize(using = PostmortemCellType.PostmortemCellTypeSerializer.class) +public class PostmortemCellType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("markdown")); + + public static final PostmortemCellType MARKDOWN = new PostmortemCellType("markdown"); + + PostmortemCellType(String value) { + super(value, allowedValues); + } + + public static class PostmortemCellTypeSerializer extends StdSerializer { + public PostmortemCellTypeSerializer(Class t) { + super(t); + } + + public PostmortemCellTypeSerializer() { + this(null); + } + + @Override + public void serialize(PostmortemCellType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static PostmortemCellType fromValue(String value) { + return new PostmortemCellType(value); + } +} 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 a101f5f4af4..23e5882fa75 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 @@ -253,6 +253,24 @@ Feature: Incidents When the request is sent Then the response status is 404 Not Found + @generated @skip @team:DataDog/incident-app + Scenario: Create postmortem attachment returns "Bad Request" response + Given operation "CreateIncidentPostmortemAttachment" enabled + And new "CreateIncidentPostmortemAttachment" request + And request contains "incident_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"cells": [{"attributes": {"definition": {"content": "## Incident Summary\nThis incident was caused by..."}}, "id": "cell-1", "type": "markdown"}], "content": "# Incident Report - IR-123\n[...]", "postmortem_template_id": "93645509-874e-45c4-adfa-623bfeaead89-123", "title": "Postmortem-IR-123"}, "type": "incident_attachments"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/incident-app + Scenario: Create postmortem attachment returns "Created" response + Given operation "CreateIncidentPostmortemAttachment" enabled + And new "CreateIncidentPostmortemAttachment" request + And request contains "incident_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"cells": [{"attributes": {"definition": {"content": "## Incident Summary\nThis incident was caused by..."}}, "id": "cell-1", "type": "markdown"}], "content": "# Incident Report - IR-123\n[...]", "postmortem_template_id": "93645509-874e-45c4-adfa-623bfeaead89-123", "title": "Postmortem-IR-123"}, "type": "incident_attachments"}} + When the request is sent + Then the response status is 201 Created + @generated @skip @team:Datadog/incident-app Scenario: Delete a notification template returns "Bad Request" response Given operation "DeleteIncidentNotificationTemplate" enabled 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 421fd893373..59046d30f0b 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 @@ -1734,6 +1734,14 @@ "type": "unsafe" } }, + "CreateIncidentPostmortemAttachment": { + "tag": "Incidents", + "undo": { + "operationId": "TODO", + "parameters": [], + "type": "unsafe" + } + }, "DeleteIncidentAttachment": { "tag": "Incidents", "undo": {