From 729745d6df8b6e7edb6a57323fc432718eae04a4 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Fri, 6 Feb 2026 10:17:56 +0000 Subject: [PATCH] Regenerate client from commit f1b97e5 of spec repo --- .generator/schemas/v2/openapi.yaml | 472 +++++++ .../CreateIncidentTimestampOverride.java | 44 + .../DeleteIncidentTimestampOverride.java | 26 + .../ListIncidentTimestampOverrides.java | 28 + .../UpdateIncidentTimestampOverride.java | 44 + .../com/datadog/api/client/ApiClient.java | 4 + .../api/client/v2/api/IncidentsApi.java | 1134 ++++++++++++++++- .../IncidentTimestampOverrideAttributes.java | 306 +++++ ...dentTimestampOverrideCreateAttributes.java | 186 +++ .../IncidentTimestampOverrideCreateData.java | 186 +++ ...ncidentTimestampOverrideCreateRequest.java | 148 +++ .../model/IncidentTimestampOverrideData.java | 245 ++++ ...identTimestampOverridePatchAttributes.java | 149 +++ .../IncidentTimestampOverridePatchData.java | 186 +++ ...IncidentTimestampOverridePatchRequest.java | 148 +++ ...ncidentTimestampOverrideRelationships.java | 184 +++ .../IncidentTimestampOverrideResponse.java | 191 +++ .../IncidentTimestampOverridesResponse.java | 198 +++ .../IncidentsTimestampOverridesType.java | 58 + .../TimestampOverrideUserRelationship.java | 148 +++ ...TimestampOverrideUserRelationshipData.java | 176 +++ .../api/client/v2/model/TimestampType.java | 57 + .../api/client/v2/model/UserIncluded.java | 205 +++ .../v2/model/UserIncludedAttributes.java | 258 ++++ .../api/client/v2/api/incidents.feature | 91 ++ .../com/datadog/api/client/v2/api/undo.json | 24 + 26 files changed, 4834 insertions(+), 62 deletions(-) create mode 100644 examples/v2/incidents/CreateIncidentTimestampOverride.java create mode 100644 examples/v2/incidents/DeleteIncidentTimestampOverride.java create mode 100644 examples/v2/incidents/ListIncidentTimestampOverrides.java create mode 100644 examples/v2/incidents/UpdateIncidentTimestampOverride.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IncidentTimestampOverrideAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IncidentTimestampOverrideCreateAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IncidentTimestampOverrideCreateData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IncidentTimestampOverrideCreateRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IncidentTimestampOverrideData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IncidentTimestampOverridePatchAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IncidentTimestampOverridePatchData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IncidentTimestampOverridePatchRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IncidentTimestampOverrideRelationships.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IncidentTimestampOverrideResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IncidentTimestampOverridesResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IncidentsTimestampOverridesType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TimestampOverrideUserRelationship.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TimestampOverrideUserRelationshipData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TimestampType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/UserIncluded.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/UserIncludedAttributes.java diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index e301432aca7..1fbbc433026 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -494,6 +494,15 @@ components: items: $ref: '#/components/schemas/GetIssueIncludeQueryParameterItem' type: array + IncidentID: + description: The UUID of the incident. + in: path + name: incident_id + required: true + schema: + example: 9cecfde8-e35d-4387-8985-9b30dcb9cb1c + format: uuid + type: string IncidentIDPathParameter: description: The UUID of the incident. in: path @@ -660,6 +669,14 @@ components: schema: example: ExampleTeamName type: string + IncidentTimestampOverrideInclude: + description: Specifies which types of related objects are included in the response. + in: query + name: include + required: false + schema: + example: created_by_user,last_modified_by_user + type: string IncidentTodoIDPathParameter: description: The UUID of the incident todo. in: path @@ -689,6 +706,15 @@ components: required: false schema: $ref: '#/components/schemas/IncludeType' + IncludeDeleted: + description: Specifies whether to include deleted timestamp overrides in the + response. + in: query + name: include-deleted + required: false + schema: + example: false + type: boolean InstanceId: description: The ID of the workflow instance. in: path @@ -1152,6 +1178,15 @@ components: required: true schema: type: string + TimestampOverrideID: + description: The UUID of the timestamp override. + in: path + name: timestamp_override_id + required: true + schema: + example: 6f48a86f-9a39-4bcf-a76b-9a1b20188995 + format: uuid + type: string ToTimestamp: description: The ending timestamp for the SLO status query in epoch seconds. in: query @@ -30334,6 +30369,168 @@ components: nullable: false type: string type: object + IncidentTimestampOverrideAttributes: + description: Attributes of an incident timestamp override. + properties: + created_at: + description: Timestamp of when the override was created. + example: '2026-01-13T17:15:55.379155748Z' + format: date-time + type: string + deleted_at: + description: Timestamp of when the override was deleted (soft delete). + example: null + format: date-time + nullable: true + type: string + incident_id: + description: The UUID of the incident. + example: 9cecfde8-e35d-4387-8985-9b30dcb9cb1c + format: uuid + type: string + modified_at: + description: Timestamp of when the override was last modified. + example: '2026-01-13T17:15:55.379155834Z' + format: date-time + type: string + timestamp_type: + $ref: '#/components/schemas/TimestampType' + timestamp_value: + description: The timestamp value for the override. + example: '2024-12-29T10:00:00Z' + format: date-time + type: string + required: + - incident_id + - timestamp_type + - timestamp_value + - created_at + - modified_at + - deleted_at + type: object + IncidentTimestampOverrideCreateAttributes: + description: Attributes for creating an incident timestamp override. + properties: + timestamp_type: + $ref: '#/components/schemas/TimestampType' + timestamp_value: + description: The timestamp value for the override. + example: '2024-12-29T10:00:00Z' + format: date-time + type: string + required: + - timestamp_type + - timestamp_value + type: object + IncidentTimestampOverrideCreateData: + description: Data for creating an incident timestamp override. + properties: + attributes: + $ref: '#/components/schemas/IncidentTimestampOverrideCreateAttributes' + type: + $ref: '#/components/schemas/IncidentsTimestampOverridesType' + required: + - type + - attributes + type: object + IncidentTimestampOverrideCreateRequest: + description: Request to create an incident timestamp override. + properties: + data: + $ref: '#/components/schemas/IncidentTimestampOverrideCreateData' + required: + - data + type: object + IncidentTimestampOverrideData: + description: Data for a single incident timestamp override. + properties: + attributes: + $ref: '#/components/schemas/IncidentTimestampOverrideAttributes' + id: + description: The UUID of the timestamp override. + example: 35301c93-75c0-4ec4-a889-28e1dfc092a9 + format: uuid + type: string + relationships: + $ref: '#/components/schemas/IncidentTimestampOverrideRelationships' + type: + $ref: '#/components/schemas/IncidentsTimestampOverridesType' + required: + - id + - type + - attributes + - relationships + type: object + IncidentTimestampOverridePatchAttributes: + description: Attributes for patching an incident timestamp override. + properties: + timestamp_value: + description: The timestamp value for the override. + example: '2024-12-29T11:00:00Z' + format: date-time + type: string + required: + - timestamp_value + type: object + IncidentTimestampOverridePatchData: + description: Data for patching an incident timestamp override. + properties: + attributes: + $ref: '#/components/schemas/IncidentTimestampOverridePatchAttributes' + type: + $ref: '#/components/schemas/IncidentsTimestampOverridesType' + required: + - type + - attributes + type: object + IncidentTimestampOverridePatchRequest: + description: Request to patch an incident timestamp override. + properties: + data: + $ref: '#/components/schemas/IncidentTimestampOverridePatchData' + required: + - data + type: object + IncidentTimestampOverrideRelationships: + description: Relationships for incident timestamp override. + properties: + created_by_user: + $ref: '#/components/schemas/TimestampOverrideUserRelationship' + last_modified_by_user: + $ref: '#/components/schemas/TimestampOverrideUserRelationship' + required: + - created_by_user + - last_modified_by_user + type: object + IncidentTimestampOverrideResponse: + description: Response containing a single incident timestamp override. + properties: + data: + $ref: '#/components/schemas/IncidentTimestampOverrideData' + included: + description: Included related resources. + items: + $ref: '#/components/schemas/UserIncluded' + type: array + required: + - data + type: object + IncidentTimestampOverridesResponse: + description: Response containing a list of incident timestamp overrides. + properties: + data: + description: Array of incident timestamp overrides. + items: + $ref: '#/components/schemas/IncidentTimestampOverrideData' + type: array + included: + description: Included related resources. + items: + $ref: '#/components/schemas/UserIncluded' + type: array + required: + - data + type: object IncidentTodoAnonymousAssignee: description: Anonymous assignee entity. properties: @@ -30994,6 +31191,15 @@ components: required: - data type: object + IncidentsTimestampOverridesType: + default: incidents_timestamp_overrides + description: The JSON:API type for timestamp overrides. + enum: + - incidents_timestamp_overrides + example: incidents_timestamp_overrides + type: string + x-enum-varnames: + - INCIDENTS_TIMESTAMP_OVERRIDES IncludeType: description: Supported include types. enum: @@ -64053,6 +64259,44 @@ components: items: $ref: '#/components/schemas/TimeseriesResponseValues' type: array + TimestampOverrideUserRelationship: + description: Relationship to a user. + properties: + data: + $ref: '#/components/schemas/TimestampOverrideUserRelationshipData' + required: + - data + type: object + TimestampOverrideUserRelationshipData: + description: User relationship data. + properties: + id: + description: The UUID of the user. + example: 8ec982dd-cd99-41c6-992a-c47fc9168cad + format: uuid + type: string + type: + description: The type of the related resource. + example: users + type: string + required: + - id + - type + type: object + TimestampType: + description: The type of timestamp being overridden. + enum: + - created + - detected + - resolved + - declared + example: created + type: string + x-enum-varnames: + - CREATED + - DETECTED + - RESOLVED + - DECLARED TokenName: description: Name for tokens. example: MyTokenName @@ -65792,6 +66036,56 @@ components: required: - data type: object + UserIncluded: + description: Included user data. + properties: + attributes: + $ref: '#/components/schemas/UserIncludedAttributes' + id: + description: The UUID of the user. + example: 8ec982dd-cd99-41c6-992a-c47fc9168cad + format: uuid + type: string + type: + description: The type of the included resource. + example: users + type: string + required: + - id + - type + - attributes + type: object + UserIncludedAttributes: + description: Attributes of an included user. + properties: + email: + description: The email address of the user. + example: fake1@email.com + type: string + handle: + description: The handle of the user. + example: fakeUserHandle1 + type: string + icon: + description: The icon URL for the user. + example: http://a.com/some-icon-1.jpg + type: string + name: + description: The name of the user. + example: fakeUserName1 + type: string + uuid: + description: The UUID of the user. + example: 8ec982dd-cd99-41c6-992a-c47fc9168cad + format: uuid + type: string + required: + - email + - handle + - icon + - name + - uuid + type: object UserInvitationData: description: Object to create a user invitation. properties: @@ -79659,6 +79953,184 @@ paths: - incident_write x-unstable: '**Note**: This endpoint is in public beta. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/incidents/{incident_id}/timestamp-overrides: + get: + description: Get all timestamp overrides for a specific incident. + operationId: ListIncidentTimestampOverrides + parameters: + - $ref: '#/components/parameters/IncidentID' + - $ref: '#/components/parameters/IncidentTimestampOverrideInclude' + - $ref: '#/components/parameters/IncludeDeleted' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/IncidentTimestampOverridesResponse' + description: OK + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_read + summary: List timestamp overrides for an incident + tags: + - Incidents + x-unstable: '**Note**: This endpoint is in preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + post: + description: Create a new timestamp override for a specific incident. + operationId: CreateIncidentTimestampOverride + parameters: + - $ref: '#/components/parameters/IncidentID' + - $ref: '#/components/parameters/IncidentTimestampOverrideInclude' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/IncidentTimestampOverrideCreateRequest' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/IncidentTimestampOverrideResponse' + description: Created + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_write + summary: Create a timestamp override for an incident + tags: + - Incidents + x-codegen-request-body-name: body + x-unstable: '**Note**: This endpoint is in preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/incidents/{incident_id}/timestamp-overrides/{timestamp_override_id}: + delete: + description: Delete an existing timestamp override for a specific incident. + operationId: DeleteIncidentTimestampOverride + parameters: + - $ref: '#/components/parameters/IncidentID' + - $ref: '#/components/parameters/TimestampOverrideID' + responses: + '204': + description: No Content + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_write + summary: Delete a timestamp override for an incident + tags: + - Incidents + x-unstable: '**Note**: This endpoint is in preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + patch: + description: Update an existing timestamp override for a specific incident. + operationId: UpdateIncidentTimestampOverride + parameters: + - $ref: '#/components/parameters/IncidentID' + - $ref: '#/components/parameters/TimestampOverrideID' + - $ref: '#/components/parameters/IncidentTimestampOverrideInclude' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/IncidentTimestampOverridePatchRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/IncidentTimestampOverrideResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_write + summary: Update a timestamp override for an incident + tags: + - Incidents + x-codegen-request-body-name: body + x-unstable: '**Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/integration/aws/accounts: get: diff --git a/examples/v2/incidents/CreateIncidentTimestampOverride.java b/examples/v2/incidents/CreateIncidentTimestampOverride.java new file mode 100644 index 00000000000..e6da85d1f72 --- /dev/null +++ b/examples/v2/incidents/CreateIncidentTimestampOverride.java @@ -0,0 +1,44 @@ +// Create a timestamp override for an incident 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.IncidentTimestampOverrideCreateAttributes; +import com.datadog.api.client.v2.model.IncidentTimestampOverrideCreateData; +import com.datadog.api.client.v2.model.IncidentTimestampOverrideCreateRequest; +import com.datadog.api.client.v2.model.IncidentTimestampOverrideResponse; +import com.datadog.api.client.v2.model.IncidentsTimestampOverridesType; +import com.datadog.api.client.v2.model.TimestampType; +import java.time.OffsetDateTime; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.createIncidentTimestampOverride", true); + IncidentsApi apiInstance = new IncidentsApi(defaultClient); + + IncidentTimestampOverrideCreateRequest body = + new IncidentTimestampOverrideCreateRequest() + .data( + new IncidentTimestampOverrideCreateData() + .attributes( + new IncidentTimestampOverrideCreateAttributes() + .timestampType(TimestampType.CREATED) + .timestampValue(OffsetDateTime.parse("2024-12-29T10:00:00Z"))) + .type(IncidentsTimestampOverridesType.INCIDENTS_TIMESTAMP_OVERRIDES)); + + try { + IncidentTimestampOverrideResponse result = + apiInstance.createIncidentTimestampOverride( + UUID.fromString("9cecfde8-e35d-4387-8985-9b30dcb9cb1c"), body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling IncidentsApi#createIncidentTimestampOverride"); + 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/DeleteIncidentTimestampOverride.java b/examples/v2/incidents/DeleteIncidentTimestampOverride.java new file mode 100644 index 00000000000..afe7a1bc841 --- /dev/null +++ b/examples/v2/incidents/DeleteIncidentTimestampOverride.java @@ -0,0 +1,26 @@ +// Delete a timestamp override for an incident returns "No Content" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.IncidentsApi; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.deleteIncidentTimestampOverride", true); + IncidentsApi apiInstance = new IncidentsApi(defaultClient); + + try { + apiInstance.deleteIncidentTimestampOverride( + UUID.fromString("9cecfde8-e35d-4387-8985-9b30dcb9cb1c"), + UUID.fromString("6f48a86f-9a39-4bcf-a76b-9a1b20188995")); + } catch (ApiException e) { + System.err.println("Exception when calling IncidentsApi#deleteIncidentTimestampOverride"); + 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/ListIncidentTimestampOverrides.java b/examples/v2/incidents/ListIncidentTimestampOverrides.java new file mode 100644 index 00000000000..ec5e4994768 --- /dev/null +++ b/examples/v2/incidents/ListIncidentTimestampOverrides.java @@ -0,0 +1,28 @@ +// List timestamp overrides for an incident 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.IncidentTimestampOverridesResponse; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.listIncidentTimestampOverrides", true); + IncidentsApi apiInstance = new IncidentsApi(defaultClient); + + try { + IncidentTimestampOverridesResponse result = + apiInstance.listIncidentTimestampOverrides( + UUID.fromString("9cecfde8-e35d-4387-8985-9b30dcb9cb1c")); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling IncidentsApi#listIncidentTimestampOverrides"); + 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/UpdateIncidentTimestampOverride.java b/examples/v2/incidents/UpdateIncidentTimestampOverride.java new file mode 100644 index 00000000000..7e30293fe97 --- /dev/null +++ b/examples/v2/incidents/UpdateIncidentTimestampOverride.java @@ -0,0 +1,44 @@ +// Update a timestamp override for an incident 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.IncidentTimestampOverridePatchAttributes; +import com.datadog.api.client.v2.model.IncidentTimestampOverridePatchData; +import com.datadog.api.client.v2.model.IncidentTimestampOverridePatchRequest; +import com.datadog.api.client.v2.model.IncidentTimestampOverrideResponse; +import com.datadog.api.client.v2.model.IncidentsTimestampOverridesType; +import java.time.OffsetDateTime; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.updateIncidentTimestampOverride", true); + IncidentsApi apiInstance = new IncidentsApi(defaultClient); + + IncidentTimestampOverridePatchRequest body = + new IncidentTimestampOverridePatchRequest() + .data( + new IncidentTimestampOverridePatchData() + .attributes( + new IncidentTimestampOverridePatchAttributes() + .timestampValue(OffsetDateTime.parse("2024-12-29T11:00:00Z"))) + .type(IncidentsTimestampOverridesType.INCIDENTS_TIMESTAMP_OVERRIDES)); + + try { + IncidentTimestampOverrideResponse result = + apiInstance.updateIncidentTimestampOverride( + UUID.fromString("9cecfde8-e35d-4387-8985-9b30dcb9cb1c"), + UUID.fromString("6f48a86f-9a39-4bcf-a76b-9a1b20188995"), + body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling IncidentsApi#updateIncidentTimestampOverride"); + 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 e1945840a66..7e02dc290ee 100644 --- a/src/main/java/com/datadog/api/client/ApiClient.java +++ b/src/main/java/com/datadog/api/client/ApiClient.java @@ -824,6 +824,7 @@ public class ApiClient { put("v2.createIncidentNotificationTemplate", false); put("v2.createIncidentPostmortemAttachment", false); put("v2.createIncidentPostmortemTemplate", false); + put("v2.createIncidentTimestampOverride", false); put("v2.createIncidentTodo", false); put("v2.createIncidentType", false); put("v2.deleteGlobalIncidentHandle", false); @@ -833,6 +834,7 @@ public class ApiClient { put("v2.deleteIncidentNotificationRule", false); put("v2.deleteIncidentNotificationTemplate", false); put("v2.deleteIncidentPostmortemTemplate", false); + put("v2.deleteIncidentTimestampOverride", false); put("v2.deleteIncidentTodo", false); put("v2.deleteIncidentType", false); put("v2.getGlobalIncidentSettings", false); @@ -850,6 +852,7 @@ public class ApiClient { put("v2.listIncidentNotificationTemplates", false); put("v2.listIncidentPostmortemTemplates", false); put("v2.listIncidents", false); + put("v2.listIncidentTimestampOverrides", false); put("v2.listIncidentTodos", false); put("v2.listIncidentTypes", false); put("v2.searchIncidents", false); @@ -861,6 +864,7 @@ public class ApiClient { put("v2.updateIncidentNotificationRule", false); put("v2.updateIncidentNotificationTemplate", false); put("v2.updateIncidentPostmortemTemplate", false); + put("v2.updateIncidentTimestampOverride", 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 438ca455ab8..a84cd5c0055 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 @@ -34,6 +34,10 @@ import com.datadog.api.client.v2.model.IncidentSearchResponse; import com.datadog.api.client.v2.model.IncidentSearchResponseIncidentsData; import com.datadog.api.client.v2.model.IncidentSearchSortOrder; +import com.datadog.api.client.v2.model.IncidentTimestampOverrideCreateRequest; +import com.datadog.api.client.v2.model.IncidentTimestampOverridePatchRequest; +import com.datadog.api.client.v2.model.IncidentTimestampOverrideResponse; +import com.datadog.api.client.v2.model.IncidentTimestampOverridesResponse; import com.datadog.api.client.v2.model.IncidentTodoCreateRequest; import com.datadog.api.client.v2.model.IncidentTodoListResponse; import com.datadog.api.client.v2.model.IncidentTodoPatchRequest; @@ -1783,6 +1787,269 @@ public ApiResponse createIncidentPostmortemTemplateW new GenericType() {}); } + /** Manage optional parameters to createIncidentTimestampOverride. */ + public static class CreateIncidentTimestampOverrideOptionalParameters { + private String include; + + /** + * Set include. + * + * @param include Specifies which types of related objects are included in the response. + * (optional) + * @return CreateIncidentTimestampOverrideOptionalParameters + */ + public CreateIncidentTimestampOverrideOptionalParameters include(String include) { + this.include = include; + return this; + } + } + + /** + * Create a timestamp override for an incident. + * + *

See {@link #createIncidentTimestampOverrideWithHttpInfo}. + * + * @param incidentId The UUID of the incident. (required) + * @param body (required) + * @return IncidentTimestampOverrideResponse + * @throws ApiException if fails to make API call + */ + public IncidentTimestampOverrideResponse createIncidentTimestampOverride( + UUID incidentId, IncidentTimestampOverrideCreateRequest body) throws ApiException { + return createIncidentTimestampOverrideWithHttpInfo( + incidentId, body, new CreateIncidentTimestampOverrideOptionalParameters()) + .getData(); + } + + /** + * Create a timestamp override for an incident. + * + *

See {@link #createIncidentTimestampOverrideWithHttpInfoAsync}. + * + * @param incidentId The UUID of the incident. (required) + * @param body (required) + * @return CompletableFuture<IncidentTimestampOverrideResponse> + */ + public CompletableFuture createIncidentTimestampOverrideAsync( + UUID incidentId, IncidentTimestampOverrideCreateRequest body) { + return createIncidentTimestampOverrideWithHttpInfoAsync( + incidentId, body, new CreateIncidentTimestampOverrideOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Create a timestamp override for an incident. + * + *

See {@link #createIncidentTimestampOverrideWithHttpInfo}. + * + * @param incidentId The UUID of the incident. (required) + * @param body (required) + * @param parameters Optional parameters for the request. + * @return IncidentTimestampOverrideResponse + * @throws ApiException if fails to make API call + */ + public IncidentTimestampOverrideResponse createIncidentTimestampOverride( + UUID incidentId, + IncidentTimestampOverrideCreateRequest body, + CreateIncidentTimestampOverrideOptionalParameters parameters) + throws ApiException { + return createIncidentTimestampOverrideWithHttpInfo(incidentId, body, parameters).getData(); + } + + /** + * Create a timestamp override for an incident. + * + *

See {@link #createIncidentTimestampOverrideWithHttpInfoAsync}. + * + * @param incidentId The UUID of the incident. (required) + * @param body (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<IncidentTimestampOverrideResponse> + */ + public CompletableFuture createIncidentTimestampOverrideAsync( + UUID incidentId, + IncidentTimestampOverrideCreateRequest body, + CreateIncidentTimestampOverrideOptionalParameters parameters) { + return createIncidentTimestampOverrideWithHttpInfoAsync(incidentId, body, parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Create a new timestamp override for a specific incident. + * + * @param incidentId The UUID of the incident. (required) + * @param body (required) + * @param parameters Optional parameters for the request. + * @return ApiResponse<IncidentTimestampOverrideResponse> + * @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 -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse createIncidentTimestampOverrideWithHttpInfo( + UUID incidentId, + IncidentTimestampOverrideCreateRequest body, + CreateIncidentTimestampOverrideOptionalParameters parameters) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "createIncidentTimestampOverride"; + 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" + + " createIncidentTimestampOverride"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, + "Missing the required parameter 'body' when calling createIncidentTimestampOverride"); + } + String include = parameters.include; + // create path and map variables + String localVarPath = + "/api/v2/incidents/{incident_id}/timestamp-overrides" + .replaceAll( + "\\{" + "incident_id" + "\\}", apiClient.escapeString(incidentId.toString())); + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "include", include)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.IncidentsApi.createIncidentTimestampOverride", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Create a timestamp override for an incident. + * + *

See {@link #createIncidentTimestampOverrideWithHttpInfo}. + * + * @param incidentId The UUID of the incident. (required) + * @param body (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<IncidentTimestampOverrideResponse>> + */ + public CompletableFuture> + createIncidentTimestampOverrideWithHttpInfoAsync( + UUID incidentId, + IncidentTimestampOverrideCreateRequest body, + CreateIncidentTimestampOverrideOptionalParameters parameters) { + // Check if unstable operation is enabled + String operationId = "createIncidentTimestampOverride"; + 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" + + " createIncidentTimestampOverride")); + 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" + + " createIncidentTimestampOverride")); + return result; + } + String include = parameters.include; + // create path and map variables + String localVarPath = + "/api/v2/incidents/{incident_id}/timestamp-overrides" + .replaceAll( + "\\{" + "incident_id" + "\\}", apiClient.escapeString(incidentId.toString())); + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "include", include)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.IncidentsApi.createIncidentTimestampOverride", + 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( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + /** * Create an incident todo. * @@ -3337,7 +3604,164 @@ public CompletableFuture> deleteIncidentNotificationTemplateWi localVarHeaderParams, new HashMap(), new String[] {"*/*"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } 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 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); @@ -3355,27 +3779,31 @@ public CompletableFuture> deleteIncidentNotificationTemplateWi } /** - * Delete postmortem template. + * Delete a timestamp override for an incident. * - *

See {@link #deleteIncidentPostmortemTemplateWithHttpInfo}. + *

See {@link #deleteIncidentTimestampOverrideWithHttpInfo}. * - * @param templateId The ID of the postmortem template (required) + * @param incidentId The UUID of the incident. (required) + * @param timestampOverrideId The UUID of the timestamp override. (required) * @throws ApiException if fails to make API call */ - public void deleteIncidentPostmortemTemplate(String templateId) throws ApiException { - deleteIncidentPostmortemTemplateWithHttpInfo(templateId); + public void deleteIncidentTimestampOverride(UUID incidentId, UUID timestampOverrideId) + throws ApiException { + deleteIncidentTimestampOverrideWithHttpInfo(incidentId, timestampOverrideId); } /** - * Delete postmortem template. + * Delete a timestamp override for an incident. * - *

See {@link #deleteIncidentPostmortemTemplateWithHttpInfoAsync}. + *

See {@link #deleteIncidentTimestampOverrideWithHttpInfoAsync}. * - * @param templateId The ID of the postmortem template (required) + * @param incidentId The UUID of the incident. (required) + * @param timestampOverrideId The UUID of the timestamp override. (required) * @return CompletableFuture */ - public CompletableFuture deleteIncidentPostmortemTemplateAsync(String templateId) { - return deleteIncidentPostmortemTemplateWithHttpInfoAsync(templateId) + public CompletableFuture deleteIncidentTimestampOverrideAsync( + UUID incidentId, UUID timestampOverrideId) { + return deleteIncidentTimestampOverrideWithHttpInfoAsync(incidentId, timestampOverrideId) .thenApply( response -> { return response.getData(); @@ -3383,9 +3811,10 @@ public CompletableFuture deleteIncidentPostmortemTemplateAsync(String temp } /** - * Delete a postmortem template. + * Delete an existing timestamp override for a specific incident. * - * @param templateId The ID of the postmortem template (required) + * @param incidentId The UUID of the incident. (required) + * @param timestampOverrideId The UUID of the timestamp override. (required) * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details @@ -3393,15 +3822,15 @@ public CompletableFuture deleteIncidentPostmortemTemplateAsync(String temp * Response details * Status Code Description Response Headers * 204 No Content - - * 400 Bad Request - + * 403 Forbidden - * 404 Not Found - * 429 Too many requests - * */ - public ApiResponse deleteIncidentPostmortemTemplateWithHttpInfo(String templateId) - throws ApiException { + public ApiResponse deleteIncidentTimestampOverrideWithHttpInfo( + UUID incidentId, UUID timestampOverrideId) throws ApiException { // Check if unstable operation is enabled - String operationId = "deleteIncidentPostmortemTemplate"; + String operationId = "deleteIncidentTimestampOverride"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { @@ -3409,30 +3838,41 @@ public ApiResponse deleteIncidentPostmortemTemplateWithHttpInfo(String tem } Object localVarPostBody = null; - // verify the required parameter 'templateId' is set - if (templateId == null) { + // verify the required parameter 'incidentId' is set + if (incidentId == null) { throw new ApiException( 400, - "Missing the required parameter 'templateId' when calling" - + " deleteIncidentPostmortemTemplate"); + "Missing the required parameter 'incidentId' when calling" + + " deleteIncidentTimestampOverride"); + } + + // verify the required parameter 'timestampOverrideId' is set + if (timestampOverrideId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'timestampOverrideId' when calling" + + " deleteIncidentTimestampOverride"); } // create path and map variables String localVarPath = - "/api/v2/incidents/config/postmortem-templates/{template_id}" + "/api/v2/incidents/{incident_id}/timestamp-overrides/{timestamp_override_id}" .replaceAll( - "\\{" + "template_id" + "\\}", apiClient.escapeString(templateId.toString())); + "\\{" + "incident_id" + "\\}", apiClient.escapeString(incidentId.toString())) + .replaceAll( + "\\{" + "timestamp_override_id" + "\\}", + apiClient.escapeString(timestampOverrideId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.IncidentsApi.deleteIncidentPostmortemTemplate", + "v2.IncidentsApi.deleteIncidentTimestampOverride", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"*/*"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); return apiClient.invokeAPI( "DELETE", builder, @@ -3445,17 +3885,18 @@ public ApiResponse deleteIncidentPostmortemTemplateWithHttpInfo(String tem } /** - * Delete postmortem template. + * Delete a timestamp override for an incident. * - *

See {@link #deleteIncidentPostmortemTemplateWithHttpInfo}. + *

See {@link #deleteIncidentTimestampOverrideWithHttpInfo}. * - * @param templateId The ID of the postmortem template (required) + * @param incidentId The UUID of the incident. (required) + * @param timestampOverrideId The UUID of the timestamp override. (required) * @return CompletableFuture<ApiResponse<Void>> */ - public CompletableFuture> deleteIncidentPostmortemTemplateWithHttpInfoAsync( - String templateId) { + public CompletableFuture> deleteIncidentTimestampOverrideWithHttpInfoAsync( + UUID incidentId, UUID timestampOverrideId) { // Check if unstable operation is enabled - String operationId = "deleteIncidentPostmortemTemplate"; + String operationId = "deleteIncidentTimestampOverride"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { @@ -3466,21 +3907,35 @@ public CompletableFuture> deleteIncidentPostmortemTemplateWith } Object localVarPostBody = null; - // verify the required parameter 'templateId' is set - if (templateId == null) { + // verify the required parameter 'incidentId' is set + if (incidentId == null) { CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, - "Missing the required parameter 'templateId' when calling" - + " deleteIncidentPostmortemTemplate")); + "Missing the required parameter 'incidentId' when calling" + + " deleteIncidentTimestampOverride")); + return result; + } + + // verify the required parameter 'timestampOverrideId' is set + if (timestampOverrideId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'timestampOverrideId' when calling" + + " deleteIncidentTimestampOverride")); return result; } // create path and map variables String localVarPath = - "/api/v2/incidents/config/postmortem-templates/{template_id}" + "/api/v2/incidents/{incident_id}/timestamp-overrides/{timestamp_override_id}" .replaceAll( - "\\{" + "template_id" + "\\}", apiClient.escapeString(templateId.toString())); + "\\{" + "incident_id" + "\\}", apiClient.escapeString(incidentId.toString())) + .replaceAll( + "\\{" + "timestamp_override_id" + "\\}", + apiClient.escapeString(timestampOverrideId.toString())); Map localVarHeaderParams = new HashMap(); @@ -3488,13 +3943,13 @@ public CompletableFuture> deleteIncidentPostmortemTemplateWith try { builder = apiClient.createBuilder( - "v2.IncidentsApi.deleteIncidentPostmortemTemplate", + "v2.IncidentsApi.deleteIncidentTimestampOverride", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"*/*"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); @@ -6842,18 +7297,247 @@ public ApiResponse listIncidentsWithHttpInfo( Long pageSize = parameters.pageSize; Long pageOffset = parameters.pageOffset; // create path and map variables - String localVarPath = "/api/v2/incidents"; + String localVarPath = "/api/v2/incidents"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "include", include)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[offset]", pageOffset)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.IncidentsApi.listIncidents", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get a list of incidents. + * + *

See {@link #listIncidentsWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<IncidentsResponse>> + */ + public CompletableFuture> listIncidentsWithHttpInfoAsync( + ListIncidentsOptionalParameters parameters) { + // Check if unstable operation is enabled + String operationId = "listIncidents"; + 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; + List include = parameters.include; + Long pageSize = parameters.pageSize; + Long pageOffset = parameters.pageOffset; + // create path and map variables + String localVarPath = "/api/v2/incidents"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "include", include)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[offset]", pageOffset)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.IncidentsApi.listIncidents", + 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() {}); + } + + /** Manage optional parameters to listIncidentTimestampOverrides. */ + public static class ListIncidentTimestampOverridesOptionalParameters { + private String include; + private Boolean includeDeleted; + + /** + * Set include. + * + * @param include Specifies which types of related objects are included in the response. + * (optional) + * @return ListIncidentTimestampOverridesOptionalParameters + */ + public ListIncidentTimestampOverridesOptionalParameters include(String include) { + this.include = include; + return this; + } + + /** + * Set includeDeleted. + * + * @param includeDeleted Specifies whether to include deleted timestamp overrides in the + * response. (optional) + * @return ListIncidentTimestampOverridesOptionalParameters + */ + public ListIncidentTimestampOverridesOptionalParameters includeDeleted(Boolean includeDeleted) { + this.includeDeleted = includeDeleted; + return this; + } + } + + /** + * List timestamp overrides for an incident. + * + *

See {@link #listIncidentTimestampOverridesWithHttpInfo}. + * + * @param incidentId The UUID of the incident. (required) + * @return IncidentTimestampOverridesResponse + * @throws ApiException if fails to make API call + */ + public IncidentTimestampOverridesResponse listIncidentTimestampOverrides(UUID incidentId) + throws ApiException { + return listIncidentTimestampOverridesWithHttpInfo( + incidentId, new ListIncidentTimestampOverridesOptionalParameters()) + .getData(); + } + + /** + * List timestamp overrides for an incident. + * + *

See {@link #listIncidentTimestampOverridesWithHttpInfoAsync}. + * + * @param incidentId The UUID of the incident. (required) + * @return CompletableFuture<IncidentTimestampOverridesResponse> + */ + public CompletableFuture listIncidentTimestampOverridesAsync( + UUID incidentId) { + return listIncidentTimestampOverridesWithHttpInfoAsync( + incidentId, new ListIncidentTimestampOverridesOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List timestamp overrides for an incident. + * + *

See {@link #listIncidentTimestampOverridesWithHttpInfo}. + * + * @param incidentId The UUID of the incident. (required) + * @param parameters Optional parameters for the request. + * @return IncidentTimestampOverridesResponse + * @throws ApiException if fails to make API call + */ + public IncidentTimestampOverridesResponse listIncidentTimestampOverrides( + UUID incidentId, ListIncidentTimestampOverridesOptionalParameters parameters) + throws ApiException { + return listIncidentTimestampOverridesWithHttpInfo(incidentId, parameters).getData(); + } + + /** + * List timestamp overrides for an incident. + * + *

See {@link #listIncidentTimestampOverridesWithHttpInfoAsync}. + * + * @param incidentId The UUID of the incident. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<IncidentTimestampOverridesResponse> + */ + public CompletableFuture listIncidentTimestampOverridesAsync( + UUID incidentId, ListIncidentTimestampOverridesOptionalParameters parameters) { + return listIncidentTimestampOverridesWithHttpInfoAsync(incidentId, parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get all timestamp overrides for a specific incident. + * + * @param incidentId The UUID of the incident. (required) + * @param parameters Optional parameters for the request. + * @return ApiResponse<IncidentTimestampOverridesResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse listIncidentTimestampOverridesWithHttpInfo( + UUID incidentId, ListIncidentTimestampOverridesOptionalParameters parameters) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "listIncidentTimestampOverrides"; + 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 'incidentId' is set + if (incidentId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'incidentId' when calling" + + " listIncidentTimestampOverrides"); + } + String include = parameters.include; + Boolean includeDeleted = parameters.includeDeleted; + // create path and map variables + String localVarPath = + "/api/v2/incidents/{incident_id}/timestamp-overrides" + .replaceAll( + "\\{" + "incident_id" + "\\}", apiClient.escapeString(incidentId.toString())); List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "include", include)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[offset]", pageOffset)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "include", include)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "include-deleted", includeDeleted)); Invocation.Builder builder = apiClient.createBuilder( - "v2.IncidentsApi.listIncidents", + "v2.IncidentsApi.listIncidentTimestampOverrides", localVarPath, localVarQueryParams, localVarHeaderParams, @@ -6868,48 +7552,64 @@ public ApiResponse listIncidentsWithHttpInfo( localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get a list of incidents. + * List timestamp overrides for an incident. * - *

See {@link #listIncidentsWithHttpInfo}. + *

See {@link #listIncidentTimestampOverridesWithHttpInfo}. * + * @param incidentId The UUID of the incident. (required) * @param parameters Optional parameters for the request. - * @return CompletableFuture<ApiResponse<IncidentsResponse>> + * @return CompletableFuture<ApiResponse<IncidentTimestampOverridesResponse>> */ - public CompletableFuture> listIncidentsWithHttpInfoAsync( - ListIncidentsOptionalParameters parameters) { + public CompletableFuture> + listIncidentTimestampOverridesWithHttpInfoAsync( + UUID incidentId, ListIncidentTimestampOverridesOptionalParameters parameters) { // Check if unstable operation is enabled - String operationId = "listIncidents"; + String operationId = "listIncidentTimestampOverrides"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally( new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); return result; } Object localVarPostBody = null; - List include = parameters.include; - Long pageSize = parameters.pageSize; - Long pageOffset = parameters.pageOffset; + + // 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" + + " listIncidentTimestampOverrides")); + return result; + } + String include = parameters.include; + Boolean includeDeleted = parameters.includeDeleted; // create path and map variables - String localVarPath = "/api/v2/incidents"; + String localVarPath = + "/api/v2/incidents/{incident_id}/timestamp-overrides" + .replaceAll( + "\\{" + "incident_id" + "\\}", apiClient.escapeString(incidentId.toString())); List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "include", include)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[offset]", pageOffset)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "include", include)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "include-deleted", includeDeleted)); Invocation.Builder builder; try { builder = apiClient.createBuilder( - "v2.IncidentsApi.listIncidents", + "v2.IncidentsApi.listIncidentTimestampOverrides", localVarPath, localVarQueryParams, localVarHeaderParams, @@ -6917,7 +7617,8 @@ public CompletableFuture> listIncidentsWithHttpIn new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -6929,7 +7630,7 @@ public CompletableFuture> listIncidentsWithHttpIn localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** @@ -9433,6 +10134,315 @@ public ApiResponse updateIncidentPostmortemTemplateW new GenericType() {}); } + /** Manage optional parameters to updateIncidentTimestampOverride. */ + public static class UpdateIncidentTimestampOverrideOptionalParameters { + private String include; + + /** + * Set include. + * + * @param include Specifies which types of related objects are included in the response. + * (optional) + * @return UpdateIncidentTimestampOverrideOptionalParameters + */ + public UpdateIncidentTimestampOverrideOptionalParameters include(String include) { + this.include = include; + return this; + } + } + + /** + * Update a timestamp override for an incident. + * + *

See {@link #updateIncidentTimestampOverrideWithHttpInfo}. + * + * @param incidentId The UUID of the incident. (required) + * @param timestampOverrideId The UUID of the timestamp override. (required) + * @param body (required) + * @return IncidentTimestampOverrideResponse + * @throws ApiException if fails to make API call + */ + public IncidentTimestampOverrideResponse updateIncidentTimestampOverride( + UUID incidentId, UUID timestampOverrideId, IncidentTimestampOverridePatchRequest body) + throws ApiException { + return updateIncidentTimestampOverrideWithHttpInfo( + incidentId, + timestampOverrideId, + body, + new UpdateIncidentTimestampOverrideOptionalParameters()) + .getData(); + } + + /** + * Update a timestamp override for an incident. + * + *

See {@link #updateIncidentTimestampOverrideWithHttpInfoAsync}. + * + * @param incidentId The UUID of the incident. (required) + * @param timestampOverrideId The UUID of the timestamp override. (required) + * @param body (required) + * @return CompletableFuture<IncidentTimestampOverrideResponse> + */ + public CompletableFuture updateIncidentTimestampOverrideAsync( + UUID incidentId, UUID timestampOverrideId, IncidentTimestampOverridePatchRequest body) { + return updateIncidentTimestampOverrideWithHttpInfoAsync( + incidentId, + timestampOverrideId, + body, + new UpdateIncidentTimestampOverrideOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Update a timestamp override for an incident. + * + *

See {@link #updateIncidentTimestampOverrideWithHttpInfo}. + * + * @param incidentId The UUID of the incident. (required) + * @param timestampOverrideId The UUID of the timestamp override. (required) + * @param body (required) + * @param parameters Optional parameters for the request. + * @return IncidentTimestampOverrideResponse + * @throws ApiException if fails to make API call + */ + public IncidentTimestampOverrideResponse updateIncidentTimestampOverride( + UUID incidentId, + UUID timestampOverrideId, + IncidentTimestampOverridePatchRequest body, + UpdateIncidentTimestampOverrideOptionalParameters parameters) + throws ApiException { + return updateIncidentTimestampOverrideWithHttpInfo( + incidentId, timestampOverrideId, body, parameters) + .getData(); + } + + /** + * Update a timestamp override for an incident. + * + *

See {@link #updateIncidentTimestampOverrideWithHttpInfoAsync}. + * + * @param incidentId The UUID of the incident. (required) + * @param timestampOverrideId The UUID of the timestamp override. (required) + * @param body (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<IncidentTimestampOverrideResponse> + */ + public CompletableFuture updateIncidentTimestampOverrideAsync( + UUID incidentId, + UUID timestampOverrideId, + IncidentTimestampOverridePatchRequest body, + UpdateIncidentTimestampOverrideOptionalParameters parameters) { + return updateIncidentTimestampOverrideWithHttpInfoAsync( + incidentId, timestampOverrideId, body, parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Update an existing timestamp override for a specific incident. + * + * @param incidentId The UUID of the incident. (required) + * @param timestampOverrideId The UUID of the timestamp override. (required) + * @param body (required) + * @param parameters Optional parameters for the request. + * @return ApiResponse<IncidentTimestampOverrideResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse updateIncidentTimestampOverrideWithHttpInfo( + UUID incidentId, + UUID timestampOverrideId, + IncidentTimestampOverridePatchRequest body, + UpdateIncidentTimestampOverrideOptionalParameters parameters) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "updateIncidentTimestampOverride"; + 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" + + " updateIncidentTimestampOverride"); + } + + // verify the required parameter 'timestampOverrideId' is set + if (timestampOverrideId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'timestampOverrideId' when calling" + + " updateIncidentTimestampOverride"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, + "Missing the required parameter 'body' when calling updateIncidentTimestampOverride"); + } + String include = parameters.include; + // create path and map variables + String localVarPath = + "/api/v2/incidents/{incident_id}/timestamp-overrides/{timestamp_override_id}" + .replaceAll( + "\\{" + "incident_id" + "\\}", apiClient.escapeString(incidentId.toString())) + .replaceAll( + "\\{" + "timestamp_override_id" + "\\}", + apiClient.escapeString(timestampOverrideId.toString())); + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "include", include)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.IncidentsApi.updateIncidentTimestampOverride", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update a timestamp override for an incident. + * + *

See {@link #updateIncidentTimestampOverrideWithHttpInfo}. + * + * @param incidentId The UUID of the incident. (required) + * @param timestampOverrideId The UUID of the timestamp override. (required) + * @param body (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<IncidentTimestampOverrideResponse>> + */ + public CompletableFuture> + updateIncidentTimestampOverrideWithHttpInfoAsync( + UUID incidentId, + UUID timestampOverrideId, + IncidentTimestampOverridePatchRequest body, + UpdateIncidentTimestampOverrideOptionalParameters parameters) { + // Check if unstable operation is enabled + String operationId = "updateIncidentTimestampOverride"; + 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" + + " updateIncidentTimestampOverride")); + return result; + } + + // verify the required parameter 'timestampOverrideId' is set + if (timestampOverrideId == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'timestampOverrideId' when calling" + + " updateIncidentTimestampOverride")); + 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" + + " updateIncidentTimestampOverride")); + return result; + } + String include = parameters.include; + // create path and map variables + String localVarPath = + "/api/v2/incidents/{incident_id}/timestamp-overrides/{timestamp_override_id}" + .replaceAll( + "\\{" + "incident_id" + "\\}", apiClient.escapeString(incidentId.toString())) + .replaceAll( + "\\{" + "timestamp_override_id" + "\\}", + apiClient.escapeString(timestampOverrideId.toString())); + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "include", include)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.IncidentsApi.updateIncidentTimestampOverride", + 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( + "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/IncidentTimestampOverrideAttributes.java b/src/main/java/com/datadog/api/client/v2/model/IncidentTimestampOverrideAttributes.java new file mode 100644 index 00000000000..4317f30266d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentTimestampOverrideAttributes.java @@ -0,0 +1,306 @@ +/* + * 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; +import java.util.UUID; + +/** Attributes of an incident timestamp override. */ +@JsonPropertyOrder({ + IncidentTimestampOverrideAttributes.JSON_PROPERTY_CREATED_AT, + IncidentTimestampOverrideAttributes.JSON_PROPERTY_DELETED_AT, + IncidentTimestampOverrideAttributes.JSON_PROPERTY_INCIDENT_ID, + IncidentTimestampOverrideAttributes.JSON_PROPERTY_MODIFIED_AT, + IncidentTimestampOverrideAttributes.JSON_PROPERTY_TIMESTAMP_TYPE, + IncidentTimestampOverrideAttributes.JSON_PROPERTY_TIMESTAMP_VALUE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IncidentTimestampOverrideAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + private OffsetDateTime createdAt; + + public static final String JSON_PROPERTY_DELETED_AT = "deleted_at"; + private OffsetDateTime deletedAt; + + public static final String JSON_PROPERTY_INCIDENT_ID = "incident_id"; + private UUID incidentId; + + public static final String JSON_PROPERTY_MODIFIED_AT = "modified_at"; + private OffsetDateTime modifiedAt; + + public static final String JSON_PROPERTY_TIMESTAMP_TYPE = "timestamp_type"; + private TimestampType timestampType; + + public static final String JSON_PROPERTY_TIMESTAMP_VALUE = "timestamp_value"; + private OffsetDateTime timestampValue; + + public IncidentTimestampOverrideAttributes() {} + + @JsonCreator + public IncidentTimestampOverrideAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_CREATED_AT) OffsetDateTime createdAt, + @JsonProperty(required = true, value = JSON_PROPERTY_DELETED_AT) OffsetDateTime deletedAt, + @JsonProperty(required = true, value = JSON_PROPERTY_INCIDENT_ID) UUID incidentId, + @JsonProperty(required = true, value = JSON_PROPERTY_MODIFIED_AT) OffsetDateTime modifiedAt, + @JsonProperty(required = true, value = JSON_PROPERTY_TIMESTAMP_TYPE) + TimestampType timestampType, + @JsonProperty(required = true, value = JSON_PROPERTY_TIMESTAMP_VALUE) + OffsetDateTime timestampValue) { + this.createdAt = createdAt; + this.deletedAt = deletedAt; + if (deletedAt != null) {} + this.incidentId = incidentId; + this.modifiedAt = modifiedAt; + this.timestampType = timestampType; + this.unparsed |= !timestampType.isValid(); + this.timestampValue = timestampValue; + } + + public IncidentTimestampOverrideAttributes createdAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Timestamp of when the override 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 IncidentTimestampOverrideAttributes deletedAt(OffsetDateTime deletedAt) { + this.deletedAt = deletedAt; + if (deletedAt != null) {} + return this; + } + + /** + * Timestamp of when the override was deleted (soft delete). + * + * @return deletedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DELETED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getDeletedAt() { + return deletedAt; + } + + public void setDeletedAt(OffsetDateTime deletedAt) { + this.deletedAt = deletedAt; + } + + public IncidentTimestampOverrideAttributes incidentId(UUID incidentId) { + this.incidentId = incidentId; + return this; + } + + /** + * The UUID of the incident. + * + * @return incidentId + */ + @JsonProperty(JSON_PROPERTY_INCIDENT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UUID getIncidentId() { + return incidentId; + } + + public void setIncidentId(UUID incidentId) { + this.incidentId = incidentId; + } + + public IncidentTimestampOverrideAttributes modifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + /** + * Timestamp of when the override 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 IncidentTimestampOverrideAttributes timestampType(TimestampType timestampType) { + this.timestampType = timestampType; + this.unparsed |= !timestampType.isValid(); + return this; + } + + /** + * The type of timestamp being overridden. + * + * @return timestampType + */ + @JsonProperty(JSON_PROPERTY_TIMESTAMP_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TimestampType getTimestampType() { + return timestampType; + } + + public void setTimestampType(TimestampType timestampType) { + if (!timestampType.isValid()) { + this.unparsed = true; + } + this.timestampType = timestampType; + } + + public IncidentTimestampOverrideAttributes timestampValue(OffsetDateTime timestampValue) { + this.timestampValue = timestampValue; + return this; + } + + /** + * The timestamp value for the override. + * + * @return timestampValue + */ + @JsonProperty(JSON_PROPERTY_TIMESTAMP_VALUE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getTimestampValue() { + return timestampValue; + } + + public void setTimestampValue(OffsetDateTime timestampValue) { + this.timestampValue = timestampValue; + } + + /** + * 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 IncidentTimestampOverrideAttributes + */ + @JsonAnySetter + public IncidentTimestampOverrideAttributes 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 IncidentTimestampOverrideAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IncidentTimestampOverrideAttributes incidentTimestampOverrideAttributes = + (IncidentTimestampOverrideAttributes) o; + return Objects.equals(this.createdAt, incidentTimestampOverrideAttributes.createdAt) + && Objects.equals(this.deletedAt, incidentTimestampOverrideAttributes.deletedAt) + && Objects.equals(this.incidentId, incidentTimestampOverrideAttributes.incidentId) + && Objects.equals(this.modifiedAt, incidentTimestampOverrideAttributes.modifiedAt) + && Objects.equals(this.timestampType, incidentTimestampOverrideAttributes.timestampType) + && Objects.equals(this.timestampValue, incidentTimestampOverrideAttributes.timestampValue) + && Objects.equals( + this.additionalProperties, incidentTimestampOverrideAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + createdAt, + deletedAt, + incidentId, + modifiedAt, + timestampType, + timestampValue, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IncidentTimestampOverrideAttributes {\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" deletedAt: ").append(toIndentedString(deletedAt)).append("\n"); + sb.append(" incidentId: ").append(toIndentedString(incidentId)).append("\n"); + sb.append(" modifiedAt: ").append(toIndentedString(modifiedAt)).append("\n"); + sb.append(" timestampType: ").append(toIndentedString(timestampType)).append("\n"); + sb.append(" timestampValue: ").append(toIndentedString(timestampValue)).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/IncidentTimestampOverrideCreateAttributes.java b/src/main/java/com/datadog/api/client/v2/model/IncidentTimestampOverrideCreateAttributes.java new file mode 100644 index 00000000000..9189d709627 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentTimestampOverrideCreateAttributes.java @@ -0,0 +1,186 @@ +/* + * 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; + +/** Attributes for creating an incident timestamp override. */ +@JsonPropertyOrder({ + IncidentTimestampOverrideCreateAttributes.JSON_PROPERTY_TIMESTAMP_TYPE, + IncidentTimestampOverrideCreateAttributes.JSON_PROPERTY_TIMESTAMP_VALUE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IncidentTimestampOverrideCreateAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_TIMESTAMP_TYPE = "timestamp_type"; + private TimestampType timestampType; + + public static final String JSON_PROPERTY_TIMESTAMP_VALUE = "timestamp_value"; + private OffsetDateTime timestampValue; + + public IncidentTimestampOverrideCreateAttributes() {} + + @JsonCreator + public IncidentTimestampOverrideCreateAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_TIMESTAMP_TYPE) + TimestampType timestampType, + @JsonProperty(required = true, value = JSON_PROPERTY_TIMESTAMP_VALUE) + OffsetDateTime timestampValue) { + this.timestampType = timestampType; + this.unparsed |= !timestampType.isValid(); + this.timestampValue = timestampValue; + } + + public IncidentTimestampOverrideCreateAttributes timestampType(TimestampType timestampType) { + this.timestampType = timestampType; + this.unparsed |= !timestampType.isValid(); + return this; + } + + /** + * The type of timestamp being overridden. + * + * @return timestampType + */ + @JsonProperty(JSON_PROPERTY_TIMESTAMP_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TimestampType getTimestampType() { + return timestampType; + } + + public void setTimestampType(TimestampType timestampType) { + if (!timestampType.isValid()) { + this.unparsed = true; + } + this.timestampType = timestampType; + } + + public IncidentTimestampOverrideCreateAttributes timestampValue(OffsetDateTime timestampValue) { + this.timestampValue = timestampValue; + return this; + } + + /** + * The timestamp value for the override. + * + * @return timestampValue + */ + @JsonProperty(JSON_PROPERTY_TIMESTAMP_VALUE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getTimestampValue() { + return timestampValue; + } + + public void setTimestampValue(OffsetDateTime timestampValue) { + this.timestampValue = timestampValue; + } + + /** + * 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 IncidentTimestampOverrideCreateAttributes + */ + @JsonAnySetter + public IncidentTimestampOverrideCreateAttributes 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 IncidentTimestampOverrideCreateAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IncidentTimestampOverrideCreateAttributes incidentTimestampOverrideCreateAttributes = + (IncidentTimestampOverrideCreateAttributes) o; + return Objects.equals( + this.timestampType, incidentTimestampOverrideCreateAttributes.timestampType) + && Objects.equals( + this.timestampValue, incidentTimestampOverrideCreateAttributes.timestampValue) + && Objects.equals( + this.additionalProperties, + incidentTimestampOverrideCreateAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(timestampType, timestampValue, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IncidentTimestampOverrideCreateAttributes {\n"); + sb.append(" timestampType: ").append(toIndentedString(timestampType)).append("\n"); + sb.append(" timestampValue: ").append(toIndentedString(timestampValue)).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/IncidentTimestampOverrideCreateData.java b/src/main/java/com/datadog/api/client/v2/model/IncidentTimestampOverrideCreateData.java new file mode 100644 index 00000000000..29c37e4ba26 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentTimestampOverrideCreateData.java @@ -0,0 +1,186 @@ +/* + * 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; + +/** Data for creating an incident timestamp override. */ +@JsonPropertyOrder({ + IncidentTimestampOverrideCreateData.JSON_PROPERTY_ATTRIBUTES, + IncidentTimestampOverrideCreateData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IncidentTimestampOverrideCreateData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private IncidentTimestampOverrideCreateAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private IncidentsTimestampOverridesType type = + IncidentsTimestampOverridesType.INCIDENTS_TIMESTAMP_OVERRIDES; + + public IncidentTimestampOverrideCreateData() {} + + @JsonCreator + public IncidentTimestampOverrideCreateData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + IncidentTimestampOverrideCreateAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + IncidentsTimestampOverridesType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public IncidentTimestampOverrideCreateData attributes( + IncidentTimestampOverrideCreateAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for creating an incident timestamp override. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IncidentTimestampOverrideCreateAttributes getAttributes() { + return attributes; + } + + public void setAttributes(IncidentTimestampOverrideCreateAttributes attributes) { + this.attributes = attributes; + } + + public IncidentTimestampOverrideCreateData type(IncidentsTimestampOverridesType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The JSON:API type for timestamp overrides. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IncidentsTimestampOverridesType getType() { + return type; + } + + public void setType(IncidentsTimestampOverridesType 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 IncidentTimestampOverrideCreateData + */ + @JsonAnySetter + public IncidentTimestampOverrideCreateData 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 IncidentTimestampOverrideCreateData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IncidentTimestampOverrideCreateData incidentTimestampOverrideCreateData = + (IncidentTimestampOverrideCreateData) o; + return Objects.equals(this.attributes, incidentTimestampOverrideCreateData.attributes) + && Objects.equals(this.type, incidentTimestampOverrideCreateData.type) + && Objects.equals( + this.additionalProperties, incidentTimestampOverrideCreateData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IncidentTimestampOverrideCreateData {\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/IncidentTimestampOverrideCreateRequest.java b/src/main/java/com/datadog/api/client/v2/model/IncidentTimestampOverrideCreateRequest.java new file mode 100644 index 00000000000..76d3910a4dc --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentTimestampOverrideCreateRequest.java @@ -0,0 +1,148 @@ +/* + * 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; + +/** Request to create an incident timestamp override. */ +@JsonPropertyOrder({IncidentTimestampOverrideCreateRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IncidentTimestampOverrideCreateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private IncidentTimestampOverrideCreateData data; + + public IncidentTimestampOverrideCreateRequest() {} + + @JsonCreator + public IncidentTimestampOverrideCreateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + IncidentTimestampOverrideCreateData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public IncidentTimestampOverrideCreateRequest data(IncidentTimestampOverrideCreateData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data for creating an incident timestamp override. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IncidentTimestampOverrideCreateData getData() { + return data; + } + + public void setData(IncidentTimestampOverrideCreateData 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 IncidentTimestampOverrideCreateRequest + */ + @JsonAnySetter + public IncidentTimestampOverrideCreateRequest 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 IncidentTimestampOverrideCreateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IncidentTimestampOverrideCreateRequest incidentTimestampOverrideCreateRequest = + (IncidentTimestampOverrideCreateRequest) o; + return Objects.equals(this.data, incidentTimestampOverrideCreateRequest.data) + && Objects.equals( + this.additionalProperties, incidentTimestampOverrideCreateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IncidentTimestampOverrideCreateRequest {\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/IncidentTimestampOverrideData.java b/src/main/java/com/datadog/api/client/v2/model/IncidentTimestampOverrideData.java new file mode 100644 index 00000000000..dbbe91f478e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentTimestampOverrideData.java @@ -0,0 +1,245 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.UUID; + +/** Data for a single incident timestamp override. */ +@JsonPropertyOrder({ + IncidentTimestampOverrideData.JSON_PROPERTY_ATTRIBUTES, + IncidentTimestampOverrideData.JSON_PROPERTY_ID, + IncidentTimestampOverrideData.JSON_PROPERTY_RELATIONSHIPS, + IncidentTimestampOverrideData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IncidentTimestampOverrideData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private IncidentTimestampOverrideAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private UUID id; + + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private IncidentTimestampOverrideRelationships relationships; + + public static final String JSON_PROPERTY_TYPE = "type"; + private IncidentsTimestampOverridesType type = + IncidentsTimestampOverridesType.INCIDENTS_TIMESTAMP_OVERRIDES; + + public IncidentTimestampOverrideData() {} + + @JsonCreator + public IncidentTimestampOverrideData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + IncidentTimestampOverrideAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) UUID id, + @JsonProperty(required = true, value = JSON_PROPERTY_RELATIONSHIPS) + IncidentTimestampOverrideRelationships relationships, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + IncidentsTimestampOverridesType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public IncidentTimestampOverrideData attributes(IncidentTimestampOverrideAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of an incident timestamp override. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IncidentTimestampOverrideAttributes getAttributes() { + return attributes; + } + + public void setAttributes(IncidentTimestampOverrideAttributes attributes) { + this.attributes = attributes; + } + + public IncidentTimestampOverrideData id(UUID id) { + this.id = id; + return this; + } + + /** + * The UUID of the timestamp override. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UUID getId() { + return id; + } + + public void setId(UUID id) { + this.id = id; + } + + public IncidentTimestampOverrideData relationships( + IncidentTimestampOverrideRelationships relationships) { + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + return this; + } + + /** + * Relationships for incident timestamp override. + * + * @return relationships + */ + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IncidentTimestampOverrideRelationships getRelationships() { + return relationships; + } + + public void setRelationships(IncidentTimestampOverrideRelationships relationships) { + this.relationships = relationships; + } + + public IncidentTimestampOverrideData type(IncidentsTimestampOverridesType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The JSON:API type for timestamp overrides. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IncidentsTimestampOverridesType getType() { + return type; + } + + public void setType(IncidentsTimestampOverridesType 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 IncidentTimestampOverrideData + */ + @JsonAnySetter + public IncidentTimestampOverrideData 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 IncidentTimestampOverrideData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IncidentTimestampOverrideData incidentTimestampOverrideData = (IncidentTimestampOverrideData) o; + return Objects.equals(this.attributes, incidentTimestampOverrideData.attributes) + && Objects.equals(this.id, incidentTimestampOverrideData.id) + && Objects.equals(this.relationships, incidentTimestampOverrideData.relationships) + && Objects.equals(this.type, incidentTimestampOverrideData.type) + && Objects.equals( + this.additionalProperties, incidentTimestampOverrideData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, relationships, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IncidentTimestampOverrideData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" relationships: ").append(toIndentedString(relationships)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .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/IncidentTimestampOverridePatchAttributes.java b/src/main/java/com/datadog/api/client/v2/model/IncidentTimestampOverridePatchAttributes.java new file mode 100644 index 00000000000..c65a4a1c4fc --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentTimestampOverridePatchAttributes.java @@ -0,0 +1,149 @@ +/* + * 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; + +/** Attributes for patching an incident timestamp override. */ +@JsonPropertyOrder({IncidentTimestampOverridePatchAttributes.JSON_PROPERTY_TIMESTAMP_VALUE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IncidentTimestampOverridePatchAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_TIMESTAMP_VALUE = "timestamp_value"; + private OffsetDateTime timestampValue; + + public IncidentTimestampOverridePatchAttributes() {} + + @JsonCreator + public IncidentTimestampOverridePatchAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_TIMESTAMP_VALUE) + OffsetDateTime timestampValue) { + this.timestampValue = timestampValue; + } + + public IncidentTimestampOverridePatchAttributes timestampValue(OffsetDateTime timestampValue) { + this.timestampValue = timestampValue; + return this; + } + + /** + * The timestamp value for the override. + * + * @return timestampValue + */ + @JsonProperty(JSON_PROPERTY_TIMESTAMP_VALUE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getTimestampValue() { + return timestampValue; + } + + public void setTimestampValue(OffsetDateTime timestampValue) { + this.timestampValue = timestampValue; + } + + /** + * 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 IncidentTimestampOverridePatchAttributes + */ + @JsonAnySetter + public IncidentTimestampOverridePatchAttributes 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 IncidentTimestampOverridePatchAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IncidentTimestampOverridePatchAttributes incidentTimestampOverridePatchAttributes = + (IncidentTimestampOverridePatchAttributes) o; + return Objects.equals( + this.timestampValue, incidentTimestampOverridePatchAttributes.timestampValue) + && Objects.equals( + this.additionalProperties, + incidentTimestampOverridePatchAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(timestampValue, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IncidentTimestampOverridePatchAttributes {\n"); + sb.append(" timestampValue: ").append(toIndentedString(timestampValue)).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/IncidentTimestampOverridePatchData.java b/src/main/java/com/datadog/api/client/v2/model/IncidentTimestampOverridePatchData.java new file mode 100644 index 00000000000..2ff14d04f37 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentTimestampOverridePatchData.java @@ -0,0 +1,186 @@ +/* + * 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; + +/** Data for patching an incident timestamp override. */ +@JsonPropertyOrder({ + IncidentTimestampOverridePatchData.JSON_PROPERTY_ATTRIBUTES, + IncidentTimestampOverridePatchData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IncidentTimestampOverridePatchData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private IncidentTimestampOverridePatchAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private IncidentsTimestampOverridesType type = + IncidentsTimestampOverridesType.INCIDENTS_TIMESTAMP_OVERRIDES; + + public IncidentTimestampOverridePatchData() {} + + @JsonCreator + public IncidentTimestampOverridePatchData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + IncidentTimestampOverridePatchAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + IncidentsTimestampOverridesType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public IncidentTimestampOverridePatchData attributes( + IncidentTimestampOverridePatchAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for patching an incident timestamp override. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IncidentTimestampOverridePatchAttributes getAttributes() { + return attributes; + } + + public void setAttributes(IncidentTimestampOverridePatchAttributes attributes) { + this.attributes = attributes; + } + + public IncidentTimestampOverridePatchData type(IncidentsTimestampOverridesType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The JSON:API type for timestamp overrides. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IncidentsTimestampOverridesType getType() { + return type; + } + + public void setType(IncidentsTimestampOverridesType 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 IncidentTimestampOverridePatchData + */ + @JsonAnySetter + public IncidentTimestampOverridePatchData 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 IncidentTimestampOverridePatchData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IncidentTimestampOverridePatchData incidentTimestampOverridePatchData = + (IncidentTimestampOverridePatchData) o; + return Objects.equals(this.attributes, incidentTimestampOverridePatchData.attributes) + && Objects.equals(this.type, incidentTimestampOverridePatchData.type) + && Objects.equals( + this.additionalProperties, incidentTimestampOverridePatchData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IncidentTimestampOverridePatchData {\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/IncidentTimestampOverridePatchRequest.java b/src/main/java/com/datadog/api/client/v2/model/IncidentTimestampOverridePatchRequest.java new file mode 100644 index 00000000000..0de1eae4ce1 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentTimestampOverridePatchRequest.java @@ -0,0 +1,148 @@ +/* + * 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; + +/** Request to patch an incident timestamp override. */ +@JsonPropertyOrder({IncidentTimestampOverridePatchRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IncidentTimestampOverridePatchRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private IncidentTimestampOverridePatchData data; + + public IncidentTimestampOverridePatchRequest() {} + + @JsonCreator + public IncidentTimestampOverridePatchRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + IncidentTimestampOverridePatchData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public IncidentTimestampOverridePatchRequest data(IncidentTimestampOverridePatchData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data for patching an incident timestamp override. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IncidentTimestampOverridePatchData getData() { + return data; + } + + public void setData(IncidentTimestampOverridePatchData 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 IncidentTimestampOverridePatchRequest + */ + @JsonAnySetter + public IncidentTimestampOverridePatchRequest 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 IncidentTimestampOverridePatchRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IncidentTimestampOverridePatchRequest incidentTimestampOverridePatchRequest = + (IncidentTimestampOverridePatchRequest) o; + return Objects.equals(this.data, incidentTimestampOverridePatchRequest.data) + && Objects.equals( + this.additionalProperties, incidentTimestampOverridePatchRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IncidentTimestampOverridePatchRequest {\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/IncidentTimestampOverrideRelationships.java b/src/main/java/com/datadog/api/client/v2/model/IncidentTimestampOverrideRelationships.java new file mode 100644 index 00000000000..3a904a9ede6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentTimestampOverrideRelationships.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; + +/** Relationships for incident timestamp override. */ +@JsonPropertyOrder({ + IncidentTimestampOverrideRelationships.JSON_PROPERTY_CREATED_BY_USER, + IncidentTimestampOverrideRelationships.JSON_PROPERTY_LAST_MODIFIED_BY_USER +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IncidentTimestampOverrideRelationships { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CREATED_BY_USER = "created_by_user"; + private TimestampOverrideUserRelationship createdByUser; + + public static final String JSON_PROPERTY_LAST_MODIFIED_BY_USER = "last_modified_by_user"; + private TimestampOverrideUserRelationship lastModifiedByUser; + + public IncidentTimestampOverrideRelationships() {} + + @JsonCreator + public IncidentTimestampOverrideRelationships( + @JsonProperty(required = true, value = JSON_PROPERTY_CREATED_BY_USER) + TimestampOverrideUserRelationship createdByUser, + @JsonProperty(required = true, value = JSON_PROPERTY_LAST_MODIFIED_BY_USER) + TimestampOverrideUserRelationship lastModifiedByUser) { + this.createdByUser = createdByUser; + this.unparsed |= createdByUser.unparsed; + this.lastModifiedByUser = lastModifiedByUser; + this.unparsed |= lastModifiedByUser.unparsed; + } + + public IncidentTimestampOverrideRelationships createdByUser( + TimestampOverrideUserRelationship createdByUser) { + this.createdByUser = createdByUser; + this.unparsed |= createdByUser.unparsed; + return this; + } + + /** + * Relationship to a user. + * + * @return createdByUser + */ + @JsonProperty(JSON_PROPERTY_CREATED_BY_USER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TimestampOverrideUserRelationship getCreatedByUser() { + return createdByUser; + } + + public void setCreatedByUser(TimestampOverrideUserRelationship createdByUser) { + this.createdByUser = createdByUser; + } + + public IncidentTimestampOverrideRelationships lastModifiedByUser( + TimestampOverrideUserRelationship lastModifiedByUser) { + this.lastModifiedByUser = lastModifiedByUser; + this.unparsed |= lastModifiedByUser.unparsed; + return this; + } + + /** + * Relationship to a user. + * + * @return lastModifiedByUser + */ + @JsonProperty(JSON_PROPERTY_LAST_MODIFIED_BY_USER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TimestampOverrideUserRelationship getLastModifiedByUser() { + return lastModifiedByUser; + } + + public void setLastModifiedByUser(TimestampOverrideUserRelationship lastModifiedByUser) { + this.lastModifiedByUser = lastModifiedByUser; + } + + /** + * 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 IncidentTimestampOverrideRelationships + */ + @JsonAnySetter + public IncidentTimestampOverrideRelationships 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 IncidentTimestampOverrideRelationships object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IncidentTimestampOverrideRelationships incidentTimestampOverrideRelationships = + (IncidentTimestampOverrideRelationships) o; + return Objects.equals(this.createdByUser, incidentTimestampOverrideRelationships.createdByUser) + && Objects.equals( + this.lastModifiedByUser, incidentTimestampOverrideRelationships.lastModifiedByUser) + && Objects.equals( + this.additionalProperties, incidentTimestampOverrideRelationships.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(createdByUser, lastModifiedByUser, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IncidentTimestampOverrideRelationships {\n"); + sb.append(" createdByUser: ").append(toIndentedString(createdByUser)).append("\n"); + sb.append(" lastModifiedByUser: ").append(toIndentedString(lastModifiedByUser)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IncidentTimestampOverrideResponse.java b/src/main/java/com/datadog/api/client/v2/model/IncidentTimestampOverrideResponse.java new file mode 100644 index 00000000000..daf6c2ac8d2 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentTimestampOverrideResponse.java @@ -0,0 +1,191 @@ +/* + * 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; + +/** Response containing a single incident timestamp override. */ +@JsonPropertyOrder({ + IncidentTimestampOverrideResponse.JSON_PROPERTY_DATA, + IncidentTimestampOverrideResponse.JSON_PROPERTY_INCLUDED +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IncidentTimestampOverrideResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private IncidentTimestampOverrideData data; + + public static final String JSON_PROPERTY_INCLUDED = "included"; + private List included = null; + + public IncidentTimestampOverrideResponse() {} + + @JsonCreator + public IncidentTimestampOverrideResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + IncidentTimestampOverrideData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public IncidentTimestampOverrideResponse data(IncidentTimestampOverrideData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data for a single incident timestamp override. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IncidentTimestampOverrideData getData() { + return data; + } + + public void setData(IncidentTimestampOverrideData data) { + this.data = data; + } + + public IncidentTimestampOverrideResponse included(List included) { + this.included = included; + for (UserIncluded item : included) { + this.unparsed |= item.unparsed; + } + return this; + } + + public IncidentTimestampOverrideResponse addIncludedItem(UserIncluded includedItem) { + if (this.included == null) { + this.included = new ArrayList<>(); + } + this.included.add(includedItem); + this.unparsed |= includedItem.unparsed; + return this; + } + + /** + * Included related resources. + * + * @return included + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INCLUDED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getIncluded() { + return included; + } + + public void setIncluded(List included) { + this.included = included; + } + + /** + * 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 IncidentTimestampOverrideResponse + */ + @JsonAnySetter + public IncidentTimestampOverrideResponse 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 IncidentTimestampOverrideResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IncidentTimestampOverrideResponse incidentTimestampOverrideResponse = + (IncidentTimestampOverrideResponse) o; + return Objects.equals(this.data, incidentTimestampOverrideResponse.data) + && Objects.equals(this.included, incidentTimestampOverrideResponse.included) + && Objects.equals( + this.additionalProperties, incidentTimestampOverrideResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, included, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IncidentTimestampOverrideResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" included: ").append(toIndentedString(included)).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/IncidentTimestampOverridesResponse.java b/src/main/java/com/datadog/api/client/v2/model/IncidentTimestampOverridesResponse.java new file mode 100644 index 00000000000..dfe03543652 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentTimestampOverridesResponse.java @@ -0,0 +1,198 @@ +/* + * 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; + +/** Response containing a list of incident timestamp overrides. */ +@JsonPropertyOrder({ + IncidentTimestampOverridesResponse.JSON_PROPERTY_DATA, + IncidentTimestampOverridesResponse.JSON_PROPERTY_INCLUDED +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IncidentTimestampOverridesResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public static final String JSON_PROPERTY_INCLUDED = "included"; + private List included = null; + + public IncidentTimestampOverridesResponse() {} + + @JsonCreator + public IncidentTimestampOverridesResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + List data) { + this.data = data; + } + + public IncidentTimestampOverridesResponse data(List data) { + this.data = data; + for (IncidentTimestampOverrideData item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public IncidentTimestampOverridesResponse addDataItem(IncidentTimestampOverrideData dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * Array of incident timestamp overrides. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public IncidentTimestampOverridesResponse included(List included) { + this.included = included; + for (UserIncluded item : included) { + this.unparsed |= item.unparsed; + } + return this; + } + + public IncidentTimestampOverridesResponse addIncludedItem(UserIncluded includedItem) { + if (this.included == null) { + this.included = new ArrayList<>(); + } + this.included.add(includedItem); + this.unparsed |= includedItem.unparsed; + return this; + } + + /** + * Included related resources. + * + * @return included + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INCLUDED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getIncluded() { + return included; + } + + public void setIncluded(List included) { + this.included = included; + } + + /** + * 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 IncidentTimestampOverridesResponse + */ + @JsonAnySetter + public IncidentTimestampOverridesResponse 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 IncidentTimestampOverridesResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IncidentTimestampOverridesResponse incidentTimestampOverridesResponse = + (IncidentTimestampOverridesResponse) o; + return Objects.equals(this.data, incidentTimestampOverridesResponse.data) + && Objects.equals(this.included, incidentTimestampOverridesResponse.included) + && Objects.equals( + this.additionalProperties, incidentTimestampOverridesResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, included, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IncidentTimestampOverridesResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" included: ").append(toIndentedString(included)).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/IncidentsTimestampOverridesType.java b/src/main/java/com/datadog/api/client/v2/model/IncidentsTimestampOverridesType.java new file mode 100644 index 00000000000..4117b0298bb --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentsTimestampOverridesType.java @@ -0,0 +1,58 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +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 JSON:API type for timestamp overrides. */ +@JsonSerialize( + using = IncidentsTimestampOverridesType.IncidentsTimestampOverridesTypeSerializer.class) +public class IncidentsTimestampOverridesType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("incidents_timestamp_overrides")); + + public static final IncidentsTimestampOverridesType INCIDENTS_TIMESTAMP_OVERRIDES = + new IncidentsTimestampOverridesType("incidents_timestamp_overrides"); + + IncidentsTimestampOverridesType(String value) { + super(value, allowedValues); + } + + public static class IncidentsTimestampOverridesTypeSerializer + extends StdSerializer { + public IncidentsTimestampOverridesTypeSerializer(Class t) { + super(t); + } + + public IncidentsTimestampOverridesTypeSerializer() { + this(null); + } + + @Override + public void serialize( + IncidentsTimestampOverridesType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static IncidentsTimestampOverridesType fromValue(String value) { + return new IncidentsTimestampOverridesType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TimestampOverrideUserRelationship.java b/src/main/java/com/datadog/api/client/v2/model/TimestampOverrideUserRelationship.java new file mode 100644 index 00000000000..1deb55efa03 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TimestampOverrideUserRelationship.java @@ -0,0 +1,148 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Relationship to a user. */ +@JsonPropertyOrder({TimestampOverrideUserRelationship.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TimestampOverrideUserRelationship { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private TimestampOverrideUserRelationshipData data; + + public TimestampOverrideUserRelationship() {} + + @JsonCreator + public TimestampOverrideUserRelationship( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + TimestampOverrideUserRelationshipData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public TimestampOverrideUserRelationship data(TimestampOverrideUserRelationshipData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * User relationship data. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TimestampOverrideUserRelationshipData getData() { + return data; + } + + public void setData(TimestampOverrideUserRelationshipData 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 TimestampOverrideUserRelationship + */ + @JsonAnySetter + public TimestampOverrideUserRelationship 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 TimestampOverrideUserRelationship object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TimestampOverrideUserRelationship timestampOverrideUserRelationship = + (TimestampOverrideUserRelationship) o; + return Objects.equals(this.data, timestampOverrideUserRelationship.data) + && Objects.equals( + this.additionalProperties, timestampOverrideUserRelationship.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TimestampOverrideUserRelationship {\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/TimestampOverrideUserRelationshipData.java b/src/main/java/com/datadog/api/client/v2/model/TimestampOverrideUserRelationshipData.java new file mode 100644 index 00000000000..0a5c8351d98 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TimestampOverrideUserRelationshipData.java @@ -0,0 +1,176 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.UUID; + +/** User relationship data. */ +@JsonPropertyOrder({ + TimestampOverrideUserRelationshipData.JSON_PROPERTY_ID, + TimestampOverrideUserRelationshipData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TimestampOverrideUserRelationshipData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private UUID id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public TimestampOverrideUserRelationshipData() {} + + @JsonCreator + public TimestampOverrideUserRelationshipData( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) UUID id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) String type) { + this.id = id; + this.type = type; + } + + public TimestampOverrideUserRelationshipData id(UUID id) { + this.id = id; + return this; + } + + /** + * The UUID of the user. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UUID getId() { + return id; + } + + public void setId(UUID id) { + this.id = id; + } + + public TimestampOverrideUserRelationshipData type(String type) { + this.type = type; + return this; + } + + /** + * The type of the related resource. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TimestampOverrideUserRelationshipData + */ + @JsonAnySetter + public TimestampOverrideUserRelationshipData 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 TimestampOverrideUserRelationshipData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TimestampOverrideUserRelationshipData timestampOverrideUserRelationshipData = + (TimestampOverrideUserRelationshipData) o; + return Objects.equals(this.id, timestampOverrideUserRelationshipData.id) + && Objects.equals(this.type, timestampOverrideUserRelationshipData.type) + && Objects.equals( + this.additionalProperties, timestampOverrideUserRelationshipData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TimestampOverrideUserRelationshipData {\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/TimestampType.java b/src/main/java/com/datadog/api/client/v2/model/TimestampType.java new file mode 100644 index 00000000000..f1fd3ae2a71 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TimestampType.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; + +/** The type of timestamp being overridden. */ +@JsonSerialize(using = TimestampType.TimestampTypeSerializer.class) +public class TimestampType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("created", "detected", "resolved", "declared")); + + public static final TimestampType CREATED = new TimestampType("created"); + public static final TimestampType DETECTED = new TimestampType("detected"); + public static final TimestampType RESOLVED = new TimestampType("resolved"); + public static final TimestampType DECLARED = new TimestampType("declared"); + + TimestampType(String value) { + super(value, allowedValues); + } + + public static class TimestampTypeSerializer extends StdSerializer { + public TimestampTypeSerializer(Class t) { + super(t); + } + + public TimestampTypeSerializer() { + this(null); + } + + @Override + public void serialize(TimestampType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static TimestampType fromValue(String value) { + return new TimestampType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/UserIncluded.java b/src/main/java/com/datadog/api/client/v2/model/UserIncluded.java new file mode 100644 index 00000000000..32b3d83d279 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UserIncluded.java @@ -0,0 +1,205 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.UUID; + +/** Included user data. */ +@JsonPropertyOrder({ + UserIncluded.JSON_PROPERTY_ATTRIBUTES, + UserIncluded.JSON_PROPERTY_ID, + UserIncluded.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UserIncluded { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private UserIncludedAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private UUID id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public UserIncluded() {} + + @JsonCreator + public UserIncluded( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + UserIncludedAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) UUID id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) String type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + } + + public UserIncluded attributes(UserIncludedAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of an included user. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UserIncludedAttributes getAttributes() { + return attributes; + } + + public void setAttributes(UserIncludedAttributes attributes) { + this.attributes = attributes; + } + + public UserIncluded id(UUID id) { + this.id = id; + return this; + } + + /** + * The UUID of the user. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UUID getId() { + return id; + } + + public void setId(UUID id) { + this.id = id; + } + + public UserIncluded type(String type) { + this.type = type; + return this; + } + + /** + * The type of the included resource. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return UserIncluded + */ + @JsonAnySetter + public UserIncluded 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 UserIncluded object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserIncluded userIncluded = (UserIncluded) o; + return Objects.equals(this.attributes, userIncluded.attributes) + && Objects.equals(this.id, userIncluded.id) + && Objects.equals(this.type, userIncluded.type) + && Objects.equals(this.additionalProperties, userIncluded.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserIncluded {\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/UserIncludedAttributes.java b/src/main/java/com/datadog/api/client/v2/model/UserIncludedAttributes.java new file mode 100644 index 00000000000..85ea12e4457 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UserIncludedAttributes.java @@ -0,0 +1,258 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.UUID; + +/** Attributes of an included user. */ +@JsonPropertyOrder({ + UserIncludedAttributes.JSON_PROPERTY_EMAIL, + UserIncludedAttributes.JSON_PROPERTY_HANDLE, + UserIncludedAttributes.JSON_PROPERTY_ICON, + UserIncludedAttributes.JSON_PROPERTY_NAME, + UserIncludedAttributes.JSON_PROPERTY_UUID +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UserIncludedAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public static final String JSON_PROPERTY_HANDLE = "handle"; + private String handle; + + public static final String JSON_PROPERTY_ICON = "icon"; + private String icon; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_UUID = "uuid"; + private UUID uuid; + + public UserIncludedAttributes() {} + + @JsonCreator + public UserIncludedAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_EMAIL) String email, + @JsonProperty(required = true, value = JSON_PROPERTY_HANDLE) String handle, + @JsonProperty(required = true, value = JSON_PROPERTY_ICON) String icon, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_UUID) UUID uuid) { + this.email = email; + this.handle = handle; + this.icon = icon; + this.name = name; + this.uuid = uuid; + } + + public UserIncludedAttributes email(String email) { + this.email = email; + return this; + } + + /** + * The email address of the user. + * + * @return email + */ + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public UserIncludedAttributes handle(String handle) { + this.handle = handle; + return this; + } + + /** + * The handle of the user. + * + * @return handle + */ + @JsonProperty(JSON_PROPERTY_HANDLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getHandle() { + return handle; + } + + public void setHandle(String handle) { + this.handle = handle; + } + + public UserIncludedAttributes icon(String icon) { + this.icon = icon; + return this; + } + + /** + * The icon URL for the user. + * + * @return icon + */ + @JsonProperty(JSON_PROPERTY_ICON) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getIcon() { + return icon; + } + + public void setIcon(String icon) { + this.icon = icon; + } + + public UserIncludedAttributes name(String name) { + this.name = name; + return this; + } + + /** + * The name of the user. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public UserIncludedAttributes uuid(UUID uuid) { + this.uuid = uuid; + return this; + } + + /** + * The UUID of the user. + * + * @return uuid + */ + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UUID getUuid() { + return uuid; + } + + public void setUuid(UUID uuid) { + this.uuid = uuid; + } + + /** + * 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 UserIncludedAttributes + */ + @JsonAnySetter + public UserIncludedAttributes 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 UserIncludedAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserIncludedAttributes userIncludedAttributes = (UserIncludedAttributes) o; + return Objects.equals(this.email, userIncludedAttributes.email) + && Objects.equals(this.handle, userIncludedAttributes.handle) + && Objects.equals(this.icon, userIncludedAttributes.icon) + && Objects.equals(this.name, userIncludedAttributes.name) + && Objects.equals(this.uuid, userIncludedAttributes.uuid) + && Objects.equals(this.additionalProperties, userIncludedAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(email, handle, icon, name, uuid, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserIncludedAttributes {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" handle: ").append(toIndentedString(handle)).append("\n"); + sb.append(" icon: ").append(toIndentedString(icon)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" uuid: ").append(toIndentedString(uuid)).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 a683c2cac14..e9062093145 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 @@ -21,6 +21,33 @@ Feature: Incidents When the request is sent Then the response status is 200 OK + @generated @skip @team:Datadog/incident-app + Scenario: Create a timestamp override for an incident returns "Bad Request" response + Given operation "CreateIncidentTimestampOverride" enabled + And new "CreateIncidentTimestampOverride" request + And request contains "incident_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"timestamp_type": "created", "timestamp_value": "2024-12-29T10:00:00Z"}, "type": "incidents_timestamp_overrides"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:Datadog/incident-app + Scenario: Create a timestamp override for an incident returns "Created" response + Given operation "CreateIncidentTimestampOverride" enabled + And new "CreateIncidentTimestampOverride" request + And request contains "incident_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"timestamp_type": "created", "timestamp_value": "2024-12-29T10:00:00Z"}, "type": "incidents_timestamp_overrides"}} + When the request is sent + Then the response status is 201 Created + + @generated @skip @team:Datadog/incident-app + Scenario: Create a timestamp override for an incident returns "Not Found" response + Given operation "CreateIncidentTimestampOverride" enabled + And new "CreateIncidentTimestampOverride" request + And request contains "incident_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"timestamp_type": "created", "timestamp_value": "2024-12-29T10:00:00Z"}, "type": "incidents_timestamp_overrides"}} + When the request is sent + Then the response status is 404 Not Found + @skip @team:DataDog/incident-app Scenario: Create an incident impact returns "Bad Request" response Given operation "CreateIncidentImpact" enabled @@ -330,6 +357,24 @@ Feature: Incidents When the request is sent Then the response status is 404 Not Found + @generated @skip @team:Datadog/incident-app + Scenario: Delete a timestamp override for an incident returns "No Content" response + Given operation "DeleteIncidentTimestampOverride" enabled + And new "DeleteIncidentTimestampOverride" request + And request contains "incident_id" parameter from "REPLACE.ME" + And request contains "timestamp_override_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:Datadog/incident-app + Scenario: Delete a timestamp override for an incident returns "Not Found" response + Given operation "DeleteIncidentTimestampOverride" enabled + And new "DeleteIncidentTimestampOverride" request + And request contains "incident_id" parameter from "REPLACE.ME" + And request contains "timestamp_override_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + @generated @skip @team:DataDog/incident-app Scenario: Delete an existing incident returns "Bad Request" response Given operation "DeleteIncident" enabled @@ -1018,6 +1063,22 @@ Feature: Incidents When the request is sent Then the response status is 200 OK + @generated @skip @team:Datadog/incident-app + Scenario: List timestamp overrides for an incident returns "Not Found" response + Given operation "ListIncidentTimestampOverrides" enabled + And new "ListIncidentTimestampOverrides" request + And request contains "incident_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:Datadog/incident-app + Scenario: List timestamp overrides for an incident returns "OK" response + Given operation "ListIncidentTimestampOverrides" enabled + And new "ListIncidentTimestampOverrides" request + And request contains "incident_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @team:DataDog/incident-app Scenario: Remove commander from an incident returns "OK" response Given operation "UpdateIncident" enabled @@ -1066,6 +1127,36 @@ Feature: Incidents Then the response status is 200 OK And the response has 3 items + @generated @skip @team:Datadog/incident-app + Scenario: Update a timestamp override for an incident returns "Bad Request" response + Given operation "UpdateIncidentTimestampOverride" enabled + And new "UpdateIncidentTimestampOverride" request + And request contains "incident_id" parameter from "REPLACE.ME" + And request contains "timestamp_override_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"timestamp_value": "2024-12-29T11:00:00Z"}, "type": "incidents_timestamp_overrides"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:Datadog/incident-app + Scenario: Update a timestamp override for an incident returns "Not Found" response + Given operation "UpdateIncidentTimestampOverride" enabled + And new "UpdateIncidentTimestampOverride" request + And request contains "incident_id" parameter from "REPLACE.ME" + And request contains "timestamp_override_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"timestamp_value": "2024-12-29T11:00:00Z"}, "type": "incidents_timestamp_overrides"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:Datadog/incident-app + Scenario: Update a timestamp override for an incident returns "OK" response + Given operation "UpdateIncidentTimestampOverride" enabled + And new "UpdateIncidentTimestampOverride" request + And request contains "incident_id" parameter from "REPLACE.ME" + And request contains "timestamp_override_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"timestamp_value": "2024-12-29T11:00:00Z"}, "type": "incidents_timestamp_overrides"}} + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/incident-app Scenario: Update an existing incident integration metadata returns "Bad Request" response Given operation "UpdateIncidentIntegration" enabled diff --git a/src/test/resources/com/datadog/api/client/v2/api/undo.json b/src/test/resources/com/datadog/api/client/v2/api/undo.json index c77dfee3356..8c4911b6c29 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 @@ -2013,6 +2013,30 @@ "type": "idempotent" } }, + "ListIncidentTimestampOverrides": { + "tag": "Incidents", + "undo": { + "type": "safe" + } + }, + "CreateIncidentTimestampOverride": { + "tag": "Incidents", + "undo": { + "type": "unsafe" + } + }, + "DeleteIncidentTimestampOverride": { + "tag": "Incidents", + "undo": { + "type": "idempotent" + } + }, + "UpdateIncidentTimestampOverride": { + "tag": "Incidents", + "undo": { + "type": "idempotent" + } + }, "ListAWSAccounts": { "tag": "AWS Integration", "undo": {