diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 840ac4eef97..a6ffdea0135 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -44962,6 +44962,92 @@ components: type: string x-enum-varnames: - MARKDOWN + PostmortemTemplateAttributesRequest: + properties: + name: + description: The name of the template + example: Standard Postmortem Template + type: string + required: + - name + type: object + PostmortemTemplateAttributesResponse: + properties: + createdAt: + description: When the template was created + example: '2026-01-13T17:15:53.208340Z' + format: date-time + type: string + modifiedAt: + 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 + example: Standard Postmortem Template + type: string + required: + - name + - createdAt + - modifiedAt + type: object + PostmortemTemplateDataRequest: + properties: + attributes: + $ref: '#/components/schemas/PostmortemTemplateAttributesRequest' + type: + $ref: '#/components/schemas/PostmortemTemplateType' + required: + - type + - attributes + type: object + PostmortemTemplateDataResponse: + properties: + attributes: + $ref: '#/components/schemas/PostmortemTemplateAttributesResponse' + id: + description: The ID of the template + example: template-456 + type: string + type: + $ref: '#/components/schemas/PostmortemTemplateType' + required: + - id + - type + - attributes + type: object + PostmortemTemplateRequest: + properties: + data: + $ref: '#/components/schemas/PostmortemTemplateDataRequest' + required: + - data + type: object + PostmortemTemplateResponse: + properties: + data: + $ref: '#/components/schemas/PostmortemTemplateDataResponse' + required: + - data + type: object + PostmortemTemplateType: + description: Postmortem template resource type + enum: + - postmortem_template + example: postmortem_template + type: string + x-enum-varnames: + - POSTMORTEM_TEMPLATE + PostmortemTemplatesResponse: + properties: + data: + items: + $ref: '#/components/schemas/PostmortemTemplateDataResponse' + type: array + required: + - data + type: object 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. @@ -77414,6 +77500,184 @@ paths: - incident_notification_settings_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/config/postmortem-templates: + get: + description: Retrieve a list of all postmortem templates for incidents. + operationId: ListIncidentPostmortemTemplates + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PostmortemTemplatesResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: List postmortem templates + tags: + - Incidents + x-unstable: '**Note**: This endpoint is in preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + post: + description: Create a new postmortem template for incidents. + operationId: CreateIncidentPostmortemTemplate + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PostmortemTemplateRequest' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/PostmortemTemplateResponse' + description: Created + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Create postmortem template + tags: + - Incidents + x-unstable: '**Note**: This endpoint is in preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/incidents/config/postmortem-templates/{template_id}: + delete: + 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 + responses: + '204': + description: No Content + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Delete postmortem template + tags: + - Incidents + x-unstable: '**Note**: This endpoint is in preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + get: + 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 + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PostmortemTemplateResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Get postmortem template + tags: + - Incidents + x-unstable: '**Note**: This endpoint is in preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + patch: + description: Update an existing 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 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PostmortemTemplateRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PostmortemTemplateResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Update postmortem template + tags: + - Incidents + x-unstable: '**Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/incidents/config/types: get: diff --git a/examples/v2/incidents/CreateIncidentPostmortemTemplate.java b/examples/v2/incidents/CreateIncidentPostmortemTemplate.java new file mode 100644 index 00000000000..57948e0fead --- /dev/null +++ b/examples/v2/incidents/CreateIncidentPostmortemTemplate.java @@ -0,0 +1,38 @@ +// Create postmortem template 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.PostmortemTemplateAttributesRequest; +import com.datadog.api.client.v2.model.PostmortemTemplateDataRequest; +import com.datadog.api.client.v2.model.PostmortemTemplateRequest; +import com.datadog.api.client.v2.model.PostmortemTemplateResponse; +import com.datadog.api.client.v2.model.PostmortemTemplateType; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.createIncidentPostmortemTemplate", true); + IncidentsApi apiInstance = new IncidentsApi(defaultClient); + + PostmortemTemplateRequest body = + new PostmortemTemplateRequest() + .data( + new PostmortemTemplateDataRequest() + .attributes( + new PostmortemTemplateAttributesRequest() + .name("Standard Postmortem Template")) + .type(PostmortemTemplateType.POSTMORTEM_TEMPLATE)); + + try { + PostmortemTemplateResponse result = apiInstance.createIncidentPostmortemTemplate(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling IncidentsApi#createIncidentPostmortemTemplate"); + 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/examples/v2/incidents/DeleteIncidentPostmortemTemplate.java b/examples/v2/incidents/DeleteIncidentPostmortemTemplate.java new file mode 100644 index 00000000000..614b204a0f6 --- /dev/null +++ b/examples/v2/incidents/DeleteIncidentPostmortemTemplate.java @@ -0,0 +1,23 @@ +// Delete postmortem template returns "No Content" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.IncidentsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.deleteIncidentPostmortemTemplate", true); + IncidentsApi apiInstance = new IncidentsApi(defaultClient); + + try { + apiInstance.deleteIncidentPostmortemTemplate("template-456"); + } catch (ApiException e) { + System.err.println("Exception when calling IncidentsApi#deleteIncidentPostmortemTemplate"); + 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/examples/v2/incidents/GetIncidentPostmortemTemplate.java b/examples/v2/incidents/GetIncidentPostmortemTemplate.java new file mode 100644 index 00000000000..064ac958977 --- /dev/null +++ b/examples/v2/incidents/GetIncidentPostmortemTemplate.java @@ -0,0 +1,25 @@ +// Get postmortem template returns "OK" 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.PostmortemTemplateResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.getIncidentPostmortemTemplate", true); + IncidentsApi apiInstance = new IncidentsApi(defaultClient); + + try { + PostmortemTemplateResponse result = apiInstance.getIncidentPostmortemTemplate("template-456"); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling IncidentsApi#getIncidentPostmortemTemplate"); + 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/examples/v2/incidents/ListIncidentPostmortemTemplates.java b/examples/v2/incidents/ListIncidentPostmortemTemplates.java new file mode 100644 index 00000000000..deacaa15c81 --- /dev/null +++ b/examples/v2/incidents/ListIncidentPostmortemTemplates.java @@ -0,0 +1,25 @@ +// List postmortem templates returns "OK" 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.PostmortemTemplatesResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.listIncidentPostmortemTemplates", true); + IncidentsApi apiInstance = new IncidentsApi(defaultClient); + + try { + PostmortemTemplatesResponse result = apiInstance.listIncidentPostmortemTemplates(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling IncidentsApi#listIncidentPostmortemTemplates"); + 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/examples/v2/incidents/UpdateIncidentPostmortemTemplate.java b/examples/v2/incidents/UpdateIncidentPostmortemTemplate.java new file mode 100644 index 00000000000..56641805786 --- /dev/null +++ b/examples/v2/incidents/UpdateIncidentPostmortemTemplate.java @@ -0,0 +1,39 @@ +// Update postmortem template returns "OK" 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.PostmortemTemplateAttributesRequest; +import com.datadog.api.client.v2.model.PostmortemTemplateDataRequest; +import com.datadog.api.client.v2.model.PostmortemTemplateRequest; +import com.datadog.api.client.v2.model.PostmortemTemplateResponse; +import com.datadog.api.client.v2.model.PostmortemTemplateType; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.updateIncidentPostmortemTemplate", true); + IncidentsApi apiInstance = new IncidentsApi(defaultClient); + + PostmortemTemplateRequest body = + new PostmortemTemplateRequest() + .data( + new PostmortemTemplateDataRequest() + .attributes( + new PostmortemTemplateAttributesRequest() + .name("Standard Postmortem Template")) + .type(PostmortemTemplateType.POSTMORTEM_TEMPLATE)); + + try { + PostmortemTemplateResponse result = + apiInstance.updateIncidentPostmortemTemplate("template-456", body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling IncidentsApi#updateIncidentPostmortemTemplate"); + 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 fcadf72e1e8..4ae08286497 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.createIncidentNotificationRule", false); put("v2.createIncidentNotificationTemplate", false); put("v2.createIncidentPostmortemAttachment", false); + put("v2.createIncidentPostmortemTemplate", false); put("v2.createIncidentTodo", false); put("v2.createIncidentType", false); put("v2.deleteGlobalIncidentHandle", false); @@ -828,6 +829,7 @@ public class ApiClient { put("v2.deleteIncidentIntegration", false); put("v2.deleteIncidentNotificationRule", false); put("v2.deleteIncidentNotificationTemplate", false); + put("v2.deleteIncidentPostmortemTemplate", false); put("v2.deleteIncidentTodo", false); put("v2.deleteIncidentType", false); put("v2.getGlobalIncidentSettings", false); @@ -835,6 +837,7 @@ public class ApiClient { put("v2.getIncidentIntegration", false); put("v2.getIncidentNotificationRule", false); put("v2.getIncidentNotificationTemplate", false); + put("v2.getIncidentPostmortemTemplate", false); put("v2.getIncidentTodo", false); put("v2.getIncidentType", false); put("v2.listGlobalIncidentHandles", false); @@ -842,6 +845,7 @@ public class ApiClient { put("v2.listIncidentIntegrations", false); put("v2.listIncidentNotificationRules", false); put("v2.listIncidentNotificationTemplates", false); + put("v2.listIncidentPostmortemTemplates", false); put("v2.listIncidents", false); put("v2.listIncidentTodos", false); put("v2.listIncidentTypes", false); @@ -853,6 +857,7 @@ public class ApiClient { put("v2.updateIncidentIntegration", false); put("v2.updateIncidentNotificationRule", false); put("v2.updateIncidentNotificationTemplate", false); + put("v2.updateIncidentPostmortemTemplate", false); put("v2.updateIncidentTodo", false); put("v2.updateIncidentType", false); put("v2.createJiraIssueTemplate", 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 75952e5c7cc..d449d0f493f 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 @@ -47,6 +47,9 @@ 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.PostmortemTemplateRequest; +import com.datadog.api.client.v2.model.PostmortemTemplateResponse; +import com.datadog.api.client.v2.model.PostmortemTemplatesResponse; import com.datadog.api.client.v2.model.PutIncidentNotificationRuleRequest; import jakarta.ws.rs.client.Invocation; import jakarta.ws.rs.core.GenericType; @@ -1623,6 +1626,159 @@ public ApiResponse createIncidentPostmortemAttachmentWithHttpInfo( new GenericType() {}); } + /** + * Create postmortem template. + * + *

See {@link #createIncidentPostmortemTemplateWithHttpInfo}. + * + * @param body (required) + * @return PostmortemTemplateResponse + * @throws ApiException if fails to make API call + */ + public PostmortemTemplateResponse createIncidentPostmortemTemplate(PostmortemTemplateRequest body) + throws ApiException { + return createIncidentPostmortemTemplateWithHttpInfo(body).getData(); + } + + /** + * Create postmortem template. + * + *

See {@link #createIncidentPostmortemTemplateWithHttpInfoAsync}. + * + * @param body (required) + * @return CompletableFuture<PostmortemTemplateResponse> + */ + public CompletableFuture createIncidentPostmortemTemplateAsync( + PostmortemTemplateRequest body) { + return createIncidentPostmortemTemplateWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Create a new postmortem template for incidents. + * + * @param body (required) + * @return ApiResponse<PostmortemTemplateResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
201 Created -
400 Bad Request -
403 Forbidden -
429 Too many requests -
+ */ + public ApiResponse createIncidentPostmortemTemplateWithHttpInfo( + PostmortemTemplateRequest body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "createIncidentPostmortemTemplate"; + 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 'body' is set + if (body == null) { + throw new ApiException( + 400, + "Missing the required parameter 'body' when calling createIncidentPostmortemTemplate"); + } + // create path and map variables + String localVarPath = "/api/v2/incidents/config/postmortem-templates"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.IncidentsApi.createIncidentPostmortemTemplate", + 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 template. + * + *

See {@link #createIncidentPostmortemTemplateWithHttpInfo}. + * + * @param body (required) + * @return CompletableFuture<ApiResponse<PostmortemTemplateResponse>> + */ + public CompletableFuture> + createIncidentPostmortemTemplateWithHttpInfoAsync(PostmortemTemplateRequest body) { + // Check if unstable operation is enabled + String operationId = "createIncidentPostmortemTemplate"; + 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 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'body' when calling" + + " createIncidentPostmortemTemplate")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/incidents/config/postmortem-templates"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.IncidentsApi.createIncidentPostmortemTemplate", + 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. * @@ -3194,6 +3350,163 @@ public CompletableFuture> deleteIncidentNotificationTemplateWi null); } + /** + * Delete postmortem template. + * + *

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

See {@link #deleteIncidentPostmortemTemplateWithHttpInfoAsync}. + * + * @param templateId The ID of the postmortem template (required) + * @return CompletableFuture + */ + public CompletableFuture deleteIncidentPostmortemTemplateAsync(String templateId) { + return deleteIncidentPostmortemTemplateWithHttpInfoAsync(templateId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Delete a postmortem template. + * + * @param templateId The ID of the postmortem template (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
204 No Content -
400 Bad Request -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse deleteIncidentPostmortemTemplateWithHttpInfo(String templateId) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "deleteIncidentPostmortemTemplate"; + 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 = null; + + // verify the required parameter 'templateId' is set + if (templateId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'templateId' when calling" + + " deleteIncidentPostmortemTemplate"); + } + // create path and map variables + String localVarPath = + "/api/v2/incidents/config/postmortem-templates/{template_id}" + .replaceAll( + "\\{" + "template_id" + "\\}", apiClient.escapeString(templateId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.IncidentsApi.deleteIncidentPostmortemTemplate", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Delete postmortem template. + * + *

See {@link #deleteIncidentPostmortemTemplateWithHttpInfo}. + * + * @param templateId The ID of the postmortem template (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> deleteIncidentPostmortemTemplateWithHttpInfoAsync( + String templateId) { + // Check if unstable operation is enabled + String operationId = "deleteIncidentPostmortemTemplate"; + 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 = null; + + // verify the required parameter 'templateId' is set + if (templateId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'templateId' when calling" + + " deleteIncidentPostmortemTemplate")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/incidents/config/postmortem-templates/{template_id}" + .replaceAll( + "\\{" + "template_id" + "\\}", apiClient.escapeString(templateId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.IncidentsApi.deleteIncidentPostmortemTemplate", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + /** * Delete an incident todo. * @@ -4460,41 +4773,200 @@ public ApiResponse getIncidentNotificationTemplate } Object localVarPostBody = null; - // verify the required parameter 'id' is set - if (id == null) { - CompletableFuture> result = - new CompletableFuture<>(); + // verify the required parameter 'id' is set + if (id == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'id' when calling getIncidentNotificationTemplate")); + return result; + } + String include = parameters.include; + // create path and map variables + String localVarPath = + "/api/v2/incidents/config/notification-templates/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "include", include)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.IncidentsApi.getIncidentNotificationTemplate", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get postmortem template. + * + *

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

See {@link #getIncidentPostmortemTemplateWithHttpInfoAsync}. + * + * @param templateId The ID of the postmortem template (required) + * @return CompletableFuture<PostmortemTemplateResponse> + */ + public CompletableFuture getIncidentPostmortemTemplateAsync( + String templateId) { + return getIncidentPostmortemTemplateWithHttpInfoAsync(templateId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Retrieve details of a specific postmortem template. + * + * @param templateId The ID of the postmortem template (required) + * @return ApiResponse<PostmortemTemplateResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse getIncidentPostmortemTemplateWithHttpInfo( + String templateId) throws ApiException { + // Check if unstable operation is enabled + String operationId = "getIncidentPostmortemTemplate"; + 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 = null; + + // verify the required parameter 'templateId' is set + if (templateId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'templateId' when calling getIncidentPostmortemTemplate"); + } + // create path and map variables + String localVarPath = + "/api/v2/incidents/config/postmortem-templates/{template_id}" + .replaceAll( + "\\{" + "template_id" + "\\}", apiClient.escapeString(templateId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.IncidentsApi.getIncidentPostmortemTemplate", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get postmortem template. + * + *

See {@link #getIncidentPostmortemTemplateWithHttpInfo}. + * + * @param templateId The ID of the postmortem template (required) + * @return CompletableFuture<ApiResponse<PostmortemTemplateResponse>> + */ + public CompletableFuture> + getIncidentPostmortemTemplateWithHttpInfoAsync(String templateId) { + // Check if unstable operation is enabled + String operationId = "getIncidentPostmortemTemplate"; + 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 = null; + + // verify the required parameter 'templateId' is set + if (templateId == null) { + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, - "Missing the required parameter 'id' when calling getIncidentNotificationTemplate")); + "Missing the required parameter 'templateId' when calling" + + " getIncidentPostmortemTemplate")); return result; } - String include = parameters.include; // create path and map variables String localVarPath = - "/api/v2/incidents/config/notification-templates/{id}" - .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + "/api/v2/incidents/config/postmortem-templates/{template_id}" + .replaceAll( + "\\{" + "template_id" + "\\}", apiClient.escapeString(templateId.toString())); - List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "include", include)); - Invocation.Builder builder; try { builder = apiClient.createBuilder( - "v2.IncidentsApi.getIncidentNotificationTemplate", + "v2.IncidentsApi.getIncidentPostmortemTemplate", localVarPath, - localVarQueryParams, + new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + new String[] {"apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { - CompletableFuture> result = - new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -4506,7 +4978,7 @@ public ApiResponse getIncidentNotificationTemplate localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** @@ -6051,6 +6523,136 @@ public IncidentNotificationTemplateArray listIncidentNotificationTemplates( new GenericType() {}); } + /** + * List postmortem templates. + * + *

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

See {@link #listIncidentPostmortemTemplatesWithHttpInfoAsync}. + * + * @return CompletableFuture<PostmortemTemplatesResponse> + */ + public CompletableFuture listIncidentPostmortemTemplatesAsync() { + return listIncidentPostmortemTemplatesWithHttpInfoAsync() + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Retrieve a list of all postmortem templates for incidents. + * + * @return ApiResponse<PostmortemTemplatesResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
429 Too many requests -
+ */ + public ApiResponse listIncidentPostmortemTemplatesWithHttpInfo() + throws ApiException { + // Check if unstable operation is enabled + String operationId = "listIncidentPostmortemTemplates"; + 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 = null; + // create path and map variables + String localVarPath = "/api/v2/incidents/config/postmortem-templates"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.IncidentsApi.listIncidentPostmortemTemplates", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * List postmortem templates. + * + *

See {@link #listIncidentPostmortemTemplatesWithHttpInfo}. + * + * @return CompletableFuture<ApiResponse<PostmortemTemplatesResponse>> + */ + public CompletableFuture> + listIncidentPostmortemTemplatesWithHttpInfoAsync() { + // Check if unstable operation is enabled + String operationId = "listIncidentPostmortemTemplates"; + 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 = null; + // create path and map variables + String localVarPath = "/api/v2/incidents/config/postmortem-templates"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.IncidentsApi.listIncidentPostmortemTemplates", + 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( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + /** Manage optional parameters to listIncidents. */ public static class ListIncidentsOptionalParameters { private List include; @@ -8644,6 +9246,189 @@ public ApiResponse updateIncidentNotificationTempl new GenericType() {}); } + /** + * Update postmortem template. + * + *

See {@link #updateIncidentPostmortemTemplateWithHttpInfo}. + * + * @param templateId The ID of the postmortem template (required) + * @param body (required) + * @return PostmortemTemplateResponse + * @throws ApiException if fails to make API call + */ + public PostmortemTemplateResponse updateIncidentPostmortemTemplate( + String templateId, PostmortemTemplateRequest body) throws ApiException { + return updateIncidentPostmortemTemplateWithHttpInfo(templateId, body).getData(); + } + + /** + * Update postmortem template. + * + *

See {@link #updateIncidentPostmortemTemplateWithHttpInfoAsync}. + * + * @param templateId The ID of the postmortem template (required) + * @param body (required) + * @return CompletableFuture<PostmortemTemplateResponse> + */ + public CompletableFuture updateIncidentPostmortemTemplateAsync( + String templateId, PostmortemTemplateRequest body) { + return updateIncidentPostmortemTemplateWithHttpInfoAsync(templateId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Update an existing postmortem template. + * + * @param templateId The ID of the postmortem template (required) + * @param body (required) + * @return ApiResponse<PostmortemTemplateResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse updateIncidentPostmortemTemplateWithHttpInfo( + String templateId, PostmortemTemplateRequest body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "updateIncidentPostmortemTemplate"; + 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 'templateId' is set + if (templateId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'templateId' when calling" + + " updateIncidentPostmortemTemplate"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, + "Missing the required parameter 'body' when calling updateIncidentPostmortemTemplate"); + } + // create path and map variables + String localVarPath = + "/api/v2/incidents/config/postmortem-templates/{template_id}" + .replaceAll( + "\\{" + "template_id" + "\\}", apiClient.escapeString(templateId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.IncidentsApi.updateIncidentPostmortemTemplate", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update postmortem template. + * + *

See {@link #updateIncidentPostmortemTemplateWithHttpInfo}. + * + * @param templateId The ID of the postmortem template (required) + * @param body (required) + * @return CompletableFuture<ApiResponse<PostmortemTemplateResponse>> + */ + public CompletableFuture> + updateIncidentPostmortemTemplateWithHttpInfoAsync( + String templateId, PostmortemTemplateRequest body) { + // Check if unstable operation is enabled + String operationId = "updateIncidentPostmortemTemplate"; + 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 'templateId' is set + if (templateId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'templateId' when calling" + + " updateIncidentPostmortemTemplate")); + 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" + + " updateIncidentPostmortemTemplate")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/incidents/config/postmortem-templates/{template_id}" + .replaceAll( + "\\{" + "template_id" + "\\}", apiClient.escapeString(templateId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.IncidentsApi.updateIncidentPostmortemTemplate", + 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( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + /** * Update an incident todo. * 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 new file mode 100644 index 00000000000..f8219b44225 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/PostmortemTemplateAttributesRequest.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.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({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_NAME = "name"; + private String name; + + public PostmortemTemplateAttributesRequest() {} + + @JsonCreator + public PostmortemTemplateAttributesRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name) { + this.name = name; + } + + public PostmortemTemplateAttributesRequest name(String name) { + this.name = name; + return this; + } + + /** + * The name of the template + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + /** + * 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 PostmortemTemplateAttributesRequest + */ + @JsonAnySetter + public PostmortemTemplateAttributesRequest 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 PostmortemTemplateAttributesRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PostmortemTemplateAttributesRequest postmortemTemplateAttributesRequest = + (PostmortemTemplateAttributesRequest) o; + return Objects.equals(this.name, postmortemTemplateAttributesRequest.name) + && Objects.equals( + this.additionalProperties, postmortemTemplateAttributesRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PostmortemTemplateAttributesRequest {\n"); + sb.append(" name: ").append(toIndentedString(name)).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/PostmortemTemplateAttributesResponse.java b/src/main/java/com/datadog/api/client/v2/model/PostmortemTemplateAttributesResponse.java new file mode 100644 index 00000000000..0ffbe2ebaf1 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/PostmortemTemplateAttributesResponse.java @@ -0,0 +1,204 @@ +/* + * 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.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** */ +@JsonPropertyOrder({ + PostmortemTemplateAttributesResponse.JSON_PROPERTY_CREATED_AT, + PostmortemTemplateAttributesResponse.JSON_PROPERTY_MODIFIED_AT, + PostmortemTemplateAttributesResponse.JSON_PROPERTY_NAME +}) +@jakarta.annotation.Generated( + 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_CREATED_AT = "createdAt"; + private OffsetDateTime createdAt; + + public static final String JSON_PROPERTY_MODIFIED_AT = "modifiedAt"; + private OffsetDateTime modifiedAt; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public PostmortemTemplateAttributesResponse() {} + + @JsonCreator + public PostmortemTemplateAttributesResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_CREATED_AT) OffsetDateTime createdAt, + @JsonProperty(required = true, value = JSON_PROPERTY_MODIFIED_AT) OffsetDateTime modifiedAt, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name) { + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.name = name; + } + + public PostmortemTemplateAttributesResponse createdAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * When the template was created + * + * @return createdAt + */ + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + public PostmortemTemplateAttributesResponse modifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + /** + * When the template was last modified + * + * @return modifiedAt + */ + @JsonProperty(JSON_PROPERTY_MODIFIED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getModifiedAt() { + return modifiedAt; + } + + public void setModifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = modifiedAt; + } + + public PostmortemTemplateAttributesResponse name(String name) { + this.name = name; + return this; + } + + /** + * The name of the template + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + /** + * 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 PostmortemTemplateAttributesResponse + */ + @JsonAnySetter + public PostmortemTemplateAttributesResponse 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 PostmortemTemplateAttributesResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PostmortemTemplateAttributesResponse postmortemTemplateAttributesResponse = + (PostmortemTemplateAttributesResponse) o; + return Objects.equals(this.createdAt, postmortemTemplateAttributesResponse.createdAt) + && Objects.equals(this.modifiedAt, postmortemTemplateAttributesResponse.modifiedAt) + && Objects.equals(this.name, postmortemTemplateAttributesResponse.name) + && Objects.equals( + this.additionalProperties, postmortemTemplateAttributesResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(createdAt, modifiedAt, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PostmortemTemplateAttributesResponse {\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" modifiedAt: ").append(toIndentedString(modifiedAt)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).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 new file mode 100644 index 00000000000..0cc472653d7 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/PostmortemTemplateDataRequest.java @@ -0,0 +1,182 @@ +/* + * 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({ + PostmortemTemplateDataRequest.JSON_PROPERTY_ATTRIBUTES, + PostmortemTemplateDataRequest.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class PostmortemTemplateDataRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private PostmortemTemplateAttributesRequest attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private PostmortemTemplateType type; + + public PostmortemTemplateDataRequest() {} + + @JsonCreator + public PostmortemTemplateDataRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + PostmortemTemplateAttributesRequest attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) PostmortemTemplateType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public PostmortemTemplateDataRequest attributes(PostmortemTemplateAttributesRequest attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Getattributes + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public PostmortemTemplateAttributesRequest getAttributes() { + return attributes; + } + + public void setAttributes(PostmortemTemplateAttributesRequest attributes) { + this.attributes = attributes; + } + + public PostmortemTemplateDataRequest type(PostmortemTemplateType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Postmortem template resource type + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public PostmortemTemplateType getType() { + return type; + } + + public void setType(PostmortemTemplateType 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 PostmortemTemplateDataRequest + */ + @JsonAnySetter + public PostmortemTemplateDataRequest 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 PostmortemTemplateDataRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PostmortemTemplateDataRequest postmortemTemplateDataRequest = (PostmortemTemplateDataRequest) o; + return Objects.equals(this.attributes, postmortemTemplateDataRequest.attributes) + && Objects.equals(this.type, postmortemTemplateDataRequest.type) + && Objects.equals( + this.additionalProperties, postmortemTemplateDataRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PostmortemTemplateDataRequest {\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/PostmortemTemplateDataResponse.java b/src/main/java/com/datadog/api/client/v2/model/PostmortemTemplateDataResponse.java new file mode 100644 index 00000000000..42ebf856166 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/PostmortemTemplateDataResponse.java @@ -0,0 +1,212 @@ +/* + * 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({ + PostmortemTemplateDataResponse.JSON_PROPERTY_ATTRIBUTES, + PostmortemTemplateDataResponse.JSON_PROPERTY_ID, + PostmortemTemplateDataResponse.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class PostmortemTemplateDataResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private PostmortemTemplateAttributesResponse attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private PostmortemTemplateType type; + + public PostmortemTemplateDataResponse() {} + + @JsonCreator + public PostmortemTemplateDataResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + PostmortemTemplateAttributesResponse attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) PostmortemTemplateType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public PostmortemTemplateDataResponse attributes( + PostmortemTemplateAttributesResponse attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Getattributes + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public PostmortemTemplateAttributesResponse getAttributes() { + return attributes; + } + + public void setAttributes(PostmortemTemplateAttributesResponse attributes) { + this.attributes = attributes; + } + + public PostmortemTemplateDataResponse id(String id) { + this.id = id; + return this; + } + + /** + * The ID of the template + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public PostmortemTemplateDataResponse type(PostmortemTemplateType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Postmortem template resource type + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public PostmortemTemplateType getType() { + return type; + } + + public void setType(PostmortemTemplateType 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 PostmortemTemplateDataResponse + */ + @JsonAnySetter + public PostmortemTemplateDataResponse 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 PostmortemTemplateDataResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PostmortemTemplateDataResponse postmortemTemplateDataResponse = + (PostmortemTemplateDataResponse) o; + return Objects.equals(this.attributes, postmortemTemplateDataResponse.attributes) + && Objects.equals(this.id, postmortemTemplateDataResponse.id) + && Objects.equals(this.type, postmortemTemplateDataResponse.type) + && Objects.equals( + this.additionalProperties, postmortemTemplateDataResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PostmortemTemplateDataResponse {\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/PostmortemTemplateRequest.java b/src/main/java/com/datadog/api/client/v2/model/PostmortemTemplateRequest.java new file mode 100644 index 00000000000..29e21d728f9 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/PostmortemTemplateRequest.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({PostmortemTemplateRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class PostmortemTemplateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private PostmortemTemplateDataRequest data; + + public PostmortemTemplateRequest() {} + + @JsonCreator + public PostmortemTemplateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + PostmortemTemplateDataRequest data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public PostmortemTemplateRequest data(PostmortemTemplateDataRequest data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Getdata + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public PostmortemTemplateDataRequest getData() { + return data; + } + + public void setData(PostmortemTemplateDataRequest 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 PostmortemTemplateRequest + */ + @JsonAnySetter + public PostmortemTemplateRequest 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 PostmortemTemplateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PostmortemTemplateRequest postmortemTemplateRequest = (PostmortemTemplateRequest) o; + return Objects.equals(this.data, postmortemTemplateRequest.data) + && Objects.equals( + this.additionalProperties, postmortemTemplateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PostmortemTemplateRequest {\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/PostmortemTemplateResponse.java b/src/main/java/com/datadog/api/client/v2/model/PostmortemTemplateResponse.java new file mode 100644 index 00000000000..2e70075ffc1 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/PostmortemTemplateResponse.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({PostmortemTemplateResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class PostmortemTemplateResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private PostmortemTemplateDataResponse data; + + public PostmortemTemplateResponse() {} + + @JsonCreator + public PostmortemTemplateResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + PostmortemTemplateDataResponse data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public PostmortemTemplateResponse data(PostmortemTemplateDataResponse data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Getdata + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public PostmortemTemplateDataResponse getData() { + return data; + } + + public void setData(PostmortemTemplateDataResponse 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 PostmortemTemplateResponse + */ + @JsonAnySetter + public PostmortemTemplateResponse 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 PostmortemTemplateResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PostmortemTemplateResponse postmortemTemplateResponse = (PostmortemTemplateResponse) o; + return Objects.equals(this.data, postmortemTemplateResponse.data) + && Objects.equals( + this.additionalProperties, postmortemTemplateResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PostmortemTemplateResponse {\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/PostmortemTemplateType.java b/src/main/java/com/datadog/api/client/v2/model/PostmortemTemplateType.java new file mode 100644 index 00000000000..509e81022dd --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/PostmortemTemplateType.java @@ -0,0 +1,57 @@ +/* + * 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; + +/** 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")); + + public static final PostmortemTemplateType POSTMORTEM_TEMPLATE = + new PostmortemTemplateType("postmortem_template"); + + PostmortemTemplateType(String value) { + super(value, allowedValues); + } + + public static class PostmortemTemplateTypeSerializer + extends StdSerializer { + public PostmortemTemplateTypeSerializer(Class t) { + super(t); + } + + public PostmortemTemplateTypeSerializer() { + this(null); + } + + @Override + public void serialize( + PostmortemTemplateType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static PostmortemTemplateType fromValue(String value) { + return new PostmortemTemplateType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/PostmortemTemplatesResponse.java b/src/main/java/com/datadog/api/client/v2/model/PostmortemTemplatesResponse.java new file mode 100644 index 00000000000..a6307658347 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/PostmortemTemplatesResponse.java @@ -0,0 +1,156 @@ +/* + * 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.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** */ +@JsonPropertyOrder({PostmortemTemplatesResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class PostmortemTemplatesResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public PostmortemTemplatesResponse() {} + + @JsonCreator + public PostmortemTemplatesResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + List data) { + this.data = data; + } + + public PostmortemTemplatesResponse data(List data) { + this.data = data; + for (PostmortemTemplateDataResponse item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public PostmortemTemplatesResponse addDataItem(PostmortemTemplateDataResponse dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * Getdata + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List 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 PostmortemTemplatesResponse + */ + @JsonAnySetter + public PostmortemTemplatesResponse 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 PostmortemTemplatesResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PostmortemTemplatesResponse postmortemTemplatesResponse = (PostmortemTemplatesResponse) o; + return Objects.equals(this.data, postmortemTemplatesResponse.data) + && Objects.equals( + this.additionalProperties, postmortemTemplatesResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PostmortemTemplatesResponse {\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/test/resources/com/datadog/api/client/v2/api/incidents.feature b/src/test/resources/com/datadog/api/client/v2/api/incidents.feature index db706355841..a683c2cac14 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 @@ -290,6 +290,22 @@ Feature: Incidents When the request is sent Then the response status is 201 Created + @generated @skip @team:DataDog/incident-app + 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"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/incident-app + 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"}} + 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 @@ -537,6 +553,30 @@ Feature: Incidents When the request is sent Then the response status is 204 No Content + @generated @skip @team:DataDog/incident-app + Scenario: Delete postmortem template returns "Bad Request" response + Given operation "DeleteIncidentPostmortemTemplate" enabled + And new "DeleteIncidentPostmortemTemplate" request + And request contains "template_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/incident-app + Scenario: Delete postmortem template returns "No Content" response + Given operation "DeleteIncidentPostmortemTemplate" enabled + And new "DeleteIncidentPostmortemTemplate" request + And request contains "template_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/incident-app + Scenario: Delete postmortem template returns "Not Found" response + Given operation "DeleteIncidentPostmortemTemplate" enabled + And new "DeleteIncidentPostmortemTemplate" request + And request contains "template_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + @generated @skip @team:DataDog/incident-app Scenario: Get a list of an incident's integration metadata returns "Bad Request" response Given operation "ListIncidentIntegrations" enabled @@ -811,6 +851,30 @@ Feature: Incidents When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/incident-app + Scenario: Get postmortem template returns "Bad Request" response + Given operation "GetIncidentPostmortemTemplate" enabled + And new "GetIncidentPostmortemTemplate" request + And request contains "template_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/incident-app + Scenario: Get postmortem template returns "Not Found" response + Given operation "GetIncidentPostmortemTemplate" enabled + And new "GetIncidentPostmortemTemplate" request + And request contains "template_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/incident-app + Scenario: Get postmortem template returns "OK" response + Given operation "GetIncidentPostmortemTemplate" enabled + And new "GetIncidentPostmortemTemplate" request + And request contains "template_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/incident-app Scenario: Get the details of an incident returns "Bad Request" response Given operation "GetIncident" enabled @@ -940,6 +1004,20 @@ Feature: Incidents Then the response status is 200 OK And the response "data" has length 0 + @generated @skip @team:DataDog/incident-app + Scenario: List postmortem templates returns "Bad Request" response + Given operation "ListIncidentPostmortemTemplates" enabled + And new "ListIncidentPostmortemTemplates" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/incident-app + Scenario: List postmortem templates returns "OK" response + Given operation "ListIncidentPostmortemTemplates" enabled + And new "ListIncidentPostmortemTemplates" request + When the request is sent + Then the response status is 200 OK + @team:DataDog/incident-app Scenario: Remove commander from an incident returns "OK" response Given operation "UpdateIncident" enabled @@ -1270,3 +1348,30 @@ Feature: Incidents And the response "data.id" has the same value as "notification_template.data.id" And the response "data.attributes.name" has the same value as "unique" And the response "data.attributes.category" is equal to "update" + + @generated @skip @team:DataDog/incident-app + Scenario: Update postmortem template returns "Bad Request" response + 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"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/incident-app + Scenario: Update postmortem template returns "Not Found" response + 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"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/incident-app + Scenario: Update postmortem template returns "OK" response + 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"}} + 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 41fa31182a8..303edc6b994 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 @@ -1761,6 +1761,43 @@ "type": "idempotent" } }, + "ListIncidentPostmortemTemplates": { + "tag": "Incidents", + "undo": { + "type": "safe" + } + }, + "CreateIncidentPostmortemTemplate": { + "tag": "Incidents", + "undo": { + "operationId": "DeleteIncidentPostmortemTemplate", + "parameters": [ + { + "name": "template_id", + "source": "" + } + ], + "type": "unsafe" + } + }, + "DeleteIncidentPostmortemTemplate": { + "tag": "Incidents", + "undo": { + "type": "idempotent" + } + }, + "GetIncidentPostmortemTemplate": { + "tag": "Incidents", + "undo": { + "type": "safe" + } + }, + "UpdateIncidentPostmortemTemplate": { + "tag": "Incidents", + "undo": { + "type": "idempotent" + } + }, "ListIncidentTypes": { "tag": "Incidents", "undo": {