From 899ab52bb716f7d0e22a82ef3b42c35e04cb28f1 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Wed, 21 Jan 2026 10:41:04 +0000 Subject: [PATCH] Regenerate client from commit 0e32ffe of spec repo --- .generator/schemas/v2/openapi.yaml | 437 +++++ .../incidents/CreateGlobalIncidentHandle.java | 61 + .../incidents/DeleteGlobalIncidentHandle.java | 23 + .../incidents/GetGlobalIncidentSettings.java | 25 + .../incidents/ListGlobalIncidentHandles.java | 25 + .../incidents/UpdateGlobalIncidentHandle.java | 61 + .../UpdateGlobalIncidentSettings.java | 38 + .../com/datadog/api/client/ApiClient.java | 6 + .../api/client/v2/api/IncidentsApi.java | 1496 ++++++++++++++--- ...obalIncidentSettingsAttributesRequest.java | 141 ++ ...balIncidentSettingsAttributesResponse.java | 211 +++ .../GlobalIncidentSettingsDataRequest.java | 181 ++ .../GlobalIncidentSettingsDataResponse.java | 212 +++ .../model/GlobalIncidentSettingsRequest.java | 147 ++ .../model/GlobalIncidentSettingsResponse.java | 148 ++ .../v2/model/GlobalIncidentSettingsType.java | 57 + .../model/IncidentHandleAttributesFields.java | 147 ++ .../IncidentHandleAttributesRequest.java | 175 ++ .../IncidentHandleAttributesResponse.java | 235 +++ .../v2/model/IncidentHandleDataRequest.java | 249 +++ .../v2/model/IncidentHandleDataResponse.java | 250 +++ .../IncidentHandleIncludedItemResponse.java | 218 +++ .../v2/model/IncidentHandleRelationship.java | 147 ++ .../model/IncidentHandleRelationshipData.java | 175 ++ .../v2/model/IncidentHandleRelationships.java | 241 +++ .../IncidentHandleRelationshipsRequest.java | 179 ++ .../v2/model/IncidentHandleRequest.java | 145 ++ .../v2/model/IncidentHandleResponse.java | 188 +++ .../client/v2/model/IncidentHandleType.java | 55 + .../v2/model/IncidentHandlesResponse.java | 196 +++ .../api/client/v2/api/incidents.feature | 90 + .../com/datadog/api/client/v2/api/undo.json | 38 + 32 files changed, 5766 insertions(+), 231 deletions(-) create mode 100644 examples/v2/incidents/CreateGlobalIncidentHandle.java create mode 100644 examples/v2/incidents/DeleteGlobalIncidentHandle.java create mode 100644 examples/v2/incidents/GetGlobalIncidentSettings.java create mode 100644 examples/v2/incidents/ListGlobalIncidentHandles.java create mode 100644 examples/v2/incidents/UpdateGlobalIncidentHandle.java create mode 100644 examples/v2/incidents/UpdateGlobalIncidentSettings.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GlobalIncidentSettingsAttributesRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GlobalIncidentSettingsAttributesResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GlobalIncidentSettingsDataRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GlobalIncidentSettingsDataResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GlobalIncidentSettingsRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GlobalIncidentSettingsResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GlobalIncidentSettingsType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IncidentHandleAttributesFields.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IncidentHandleAttributesRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IncidentHandleAttributesResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IncidentHandleDataRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IncidentHandleDataResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IncidentHandleIncludedItemResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IncidentHandleRelationship.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IncidentHandleRelationshipData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IncidentHandleRelationships.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IncidentHandleRelationshipsRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IncidentHandleRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IncidentHandleResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IncidentHandleType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IncidentHandlesResponse.java diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 85a6c58a698..a7f88ae2284 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -25381,6 +25381,82 @@ components: required: - type type: object + GlobalIncidentSettingsAttributesRequest: + description: Global incident settings attributes + properties: + analytics_dashboard_id: + description: The analytics dashboard ID + example: abc-123-def + type: string + type: object + GlobalIncidentSettingsAttributesResponse: + description: Global incident settings attributes + properties: + analytics_dashboard_id: + description: The analytics dashboard ID + example: abc-123-def + type: string + created: + description: Timestamp when the settings were created + example: '2026-01-13T17:15:56.557278191Z' + format: date-time + type: string + modified: + description: Timestamp when the settings were last modified + example: '2026-01-13T17:15:56.557278191Z' + format: date-time + type: string + required: + - created + - modified + - analytics_dashboard_id + type: object + GlobalIncidentSettingsDataRequest: + properties: + attributes: + $ref: '#/components/schemas/GlobalIncidentSettingsAttributesRequest' + type: + $ref: '#/components/schemas/GlobalIncidentSettingsType' + required: + - type + type: object + GlobalIncidentSettingsDataResponse: + properties: + attributes: + $ref: '#/components/schemas/GlobalIncidentSettingsAttributesResponse' + id: + description: The unique identifier for the global incident settings + example: f8b9a915-ed85-48b4-9071-ceba567a3db5 + type: string + type: + $ref: '#/components/schemas/GlobalIncidentSettingsType' + required: + - id + - type + - attributes + type: object + GlobalIncidentSettingsRequest: + properties: + data: + $ref: '#/components/schemas/GlobalIncidentSettingsDataRequest' + required: + - data + type: object + GlobalIncidentSettingsResponse: + properties: + data: + $ref: '#/components/schemas/GlobalIncidentSettingsDataResponse' + required: + - data + type: object + GlobalIncidentSettingsType: + description: Global incident settings resource type + enum: + - incidents_global_settings + example: incidents_global_settings + type: string + x-enum-varnames: + - INCIDENTS_GLOBAL_SETTINGS GlobalVariableData: description: Synthetics global variable data. Wrapper around the global variable object. @@ -26244,6 +26320,183 @@ components: - TEXTARRAY - METRICTAG - AUTOCOMPLETE + IncidentHandleAttributesFields: + description: Dynamic fields associated with the handle + example: + severity: + - SEV-1 + properties: + severity: + description: Severity levels associated with the handle + items: + $ref: '#/components/schemas/IncidentHandleAttributesFieldsSeverity' + type: array + type: object + IncidentHandleAttributesFieldsSeverity: + example: SEV-1 + type: string + IncidentHandleAttributesRequest: + description: Incident handle attributes for requests + properties: + fields: + $ref: '#/components/schemas/IncidentHandleAttributesFields' + name: + description: The handle name + example: '@incident-sev-1' + type: string + required: + - name + type: object + IncidentHandleAttributesResponse: + description: Incident handle attributes for responses + properties: + created_at: + description: Timestamp when the handle was created + example: '2026-01-13T17:15:52.726905Z' + format: date-time + type: string + fields: + $ref: '#/components/schemas/IncidentHandleAttributesFields' + modified_at: + description: Timestamp when the handle was last modified + example: '2026-01-13T17:15:52.726905Z' + format: date-time + type: string + name: + description: The handle name + example: '@incident-sev-1' + type: string + required: + - name + - fields + - created_at + - modified_at + type: object + IncidentHandleDataRequest: + properties: + attributes: + $ref: '#/components/schemas/IncidentHandleAttributesRequest' + id: + description: The ID of the incident handle (required for PUT requests) + example: b2494081-cdf0-4205-b366-4e1dd4fdf0bf + type: string + relationships: + $ref: '#/components/schemas/IncidentHandleRelationshipsRequest' + type: + $ref: '#/components/schemas/IncidentHandleType' + required: + - type + - attributes + type: object + IncidentHandleDataResponse: + properties: + attributes: + $ref: '#/components/schemas/IncidentHandleAttributesResponse' + id: + description: The ID of the incident handle + example: 12ceee6d-a7c0-4407-bc54-30e54140d7f0 + type: string + relationships: + $ref: '#/components/schemas/IncidentHandleRelationships' + type: + $ref: '#/components/schemas/IncidentHandleType' + required: + - id + - type + - attributes + type: object + IncidentHandleIncludedItemResponse: + oneOf: + - $ref: '#/components/schemas/IncidentUserData' + IncidentHandleIncludedResponse: + description: Included related resources + items: + $ref: '#/components/schemas/IncidentHandleIncludedItemResponse' + type: array + IncidentHandleRelationship: + properties: + data: + $ref: '#/components/schemas/IncidentHandleRelationshipData' + required: + - data + type: object + IncidentHandleRelationshipData: + properties: + id: + description: The ID of the related resource + example: f7b538b1-ed7c-4e84-82de-fdf84a539d40 + type: string + type: + description: The type of the related resource + example: incident_types + type: string + required: + - id + - type + type: object + IncidentHandleRelationships: + nullable: true + properties: + commander_user: + $ref: '#/components/schemas/IncidentHandleRelationship' + created_by_user: + $ref: '#/components/schemas/IncidentHandleRelationship' + incident_type: + $ref: '#/components/schemas/IncidentHandleRelationship' + last_modified_by_user: + $ref: '#/components/schemas/IncidentHandleRelationship' + required: + - incident_type + - created_by_user + - last_modified_by_user + type: object + IncidentHandleRelationshipsRequest: + nullable: true + properties: + commander_user: + $ref: '#/components/schemas/IncidentHandleRelationship' + incident_type: + $ref: '#/components/schemas/IncidentHandleRelationship' + required: + - incident_type + type: object + IncidentHandleRequest: + properties: + data: + $ref: '#/components/schemas/IncidentHandleDataRequest' + required: + - data + type: object + IncidentHandleResponse: + properties: + data: + $ref: '#/components/schemas/IncidentHandleDataResponse' + included: + $ref: '#/components/schemas/IncidentHandleIncludedResponse' + required: + - data + type: object + IncidentHandleType: + description: Incident handle resource type + enum: + - incidents_handles + example: incidents_handles + type: string + x-enum-varnames: + - INCIDENTS_HANDLES + IncidentHandlesResponse: + properties: + data: + $ref: '#/components/schemas/IncidentHandlesResponseData' + included: + $ref: '#/components/schemas/IncidentHandleIncludedResponse' + required: + - data + type: object + IncidentHandlesResponseData: + items: + $ref: '#/components/schemas/IncidentHandleDataResponse' + type: array IncidentImpactAttributes: description: The incident impact's attributes. properties: @@ -71526,6 +71779,190 @@ 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/config/global/incident-handles: + delete: + description: Delete a global incident handle. + operationId: DeleteGlobalIncidentHandle + responses: + '204': + description: No Content + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Delete global incident handle + tags: + - Incidents + x-unstable: '**Note**: This endpoint is in public beta and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + get: + description: Retrieve a list of global incident handles. + operationId: ListGlobalIncidentHandles + parameters: + - description: Comma-separated list of related resources to include in the response + in: query + name: include + required: false + schema: + example: created_by_user,last_modified_by_user,commander_user,incident_type + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/IncidentHandlesResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: List global incident handles + tags: + - Incidents + x-unstable: '**Note**: This endpoint is in public beta and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + post: + description: Create a new global incident handle. + operationId: CreateGlobalIncidentHandle + parameters: + - description: Comma-separated list of related resources to include in the response + in: query + name: include + required: false + schema: + example: created_by_user,last_modified_by_user,commander_user,incident_type + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/IncidentHandleRequest' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/IncidentHandleResponse' + description: Created + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Create global incident handle + tags: + - Incidents + x-unstable: '**Note**: This endpoint is in public beta and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + put: + description: Update an existing global incident handle. + operationId: UpdateGlobalIncidentHandle + parameters: + - description: Comma-separated list of related resources to include in the response + in: query + name: include + required: false + schema: + example: created_by_user,last_modified_by_user,commander_user,incident_type + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/IncidentHandleRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/IncidentHandleResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Update global incident handle + tags: + - Incidents + x-unstable: '**Note**: This endpoint is in public beta and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/incidents/config/global/settings: + get: + description: Retrieve global incident settings for the organization. + operationId: GetGlobalIncidentSettings + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/GlobalIncidentSettingsResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Get global incident settings + tags: + - Incidents + x-unstable: '**Note**: This endpoint is in public beta and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + patch: + description: Update global incident settings for the organization. + operationId: UpdateGlobalIncidentSettings + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GlobalIncidentSettingsRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/GlobalIncidentSettingsResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Update global incident settings + tags: + - Incidents + x-unstable: '**Note**: This endpoint is in public beta and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/incidents/config/notification-rules: get: diff --git a/examples/v2/incidents/CreateGlobalIncidentHandle.java b/examples/v2/incidents/CreateGlobalIncidentHandle.java new file mode 100644 index 00000000000..8237bfb91b2 --- /dev/null +++ b/examples/v2/incidents/CreateGlobalIncidentHandle.java @@ -0,0 +1,61 @@ +// Create global incident handle 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.IncidentHandleAttributesFields; +import com.datadog.api.client.v2.model.IncidentHandleAttributesRequest; +import com.datadog.api.client.v2.model.IncidentHandleDataRequest; +import com.datadog.api.client.v2.model.IncidentHandleRelationship; +import com.datadog.api.client.v2.model.IncidentHandleRelationshipData; +import com.datadog.api.client.v2.model.IncidentHandleRelationshipsRequest; +import com.datadog.api.client.v2.model.IncidentHandleRequest; +import com.datadog.api.client.v2.model.IncidentHandleResponse; +import com.datadog.api.client.v2.model.IncidentHandleType; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.createGlobalIncidentHandle", true); + IncidentsApi apiInstance = new IncidentsApi(defaultClient); + + IncidentHandleRequest body = + new IncidentHandleRequest() + .data( + new IncidentHandleDataRequest() + .attributes( + new IncidentHandleAttributesRequest() + .fields( + new IncidentHandleAttributesFields() + .severity(Collections.singletonList("SEV-1"))) + .name("@incident-sev-1")) + .id("b2494081-cdf0-4205-b366-4e1dd4fdf0bf") + .relationships( + new IncidentHandleRelationshipsRequest() + .commanderUser( + new IncidentHandleRelationship() + .data( + new IncidentHandleRelationshipData() + .id("f7b538b1-ed7c-4e84-82de-fdf84a539d40") + .type("incident_types"))) + .incidentType( + new IncidentHandleRelationship() + .data( + new IncidentHandleRelationshipData() + .id("f7b538b1-ed7c-4e84-82de-fdf84a539d40") + .type("incident_types")))) + .type(IncidentHandleType.INCIDENTS_HANDLES)); + + try { + IncidentHandleResponse result = apiInstance.createGlobalIncidentHandle(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling IncidentsApi#createGlobalIncidentHandle"); + 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/DeleteGlobalIncidentHandle.java b/examples/v2/incidents/DeleteGlobalIncidentHandle.java new file mode 100644 index 00000000000..4d6abee39a6 --- /dev/null +++ b/examples/v2/incidents/DeleteGlobalIncidentHandle.java @@ -0,0 +1,23 @@ +// Delete global incident handle returns "No Content" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.IncidentsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.deleteGlobalIncidentHandle", true); + IncidentsApi apiInstance = new IncidentsApi(defaultClient); + + try { + apiInstance.deleteGlobalIncidentHandle(); + } catch (ApiException e) { + System.err.println("Exception when calling IncidentsApi#deleteGlobalIncidentHandle"); + 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/GetGlobalIncidentSettings.java b/examples/v2/incidents/GetGlobalIncidentSettings.java new file mode 100644 index 00000000000..a83357651c0 --- /dev/null +++ b/examples/v2/incidents/GetGlobalIncidentSettings.java @@ -0,0 +1,25 @@ +// Get global incident settings 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.GlobalIncidentSettingsResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.getGlobalIncidentSettings", true); + IncidentsApi apiInstance = new IncidentsApi(defaultClient); + + try { + GlobalIncidentSettingsResponse result = apiInstance.getGlobalIncidentSettings(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling IncidentsApi#getGlobalIncidentSettings"); + 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/ListGlobalIncidentHandles.java b/examples/v2/incidents/ListGlobalIncidentHandles.java new file mode 100644 index 00000000000..f35e63f5a53 --- /dev/null +++ b/examples/v2/incidents/ListGlobalIncidentHandles.java @@ -0,0 +1,25 @@ +// List global incident handles 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.IncidentHandlesResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.listGlobalIncidentHandles", true); + IncidentsApi apiInstance = new IncidentsApi(defaultClient); + + try { + IncidentHandlesResponse result = apiInstance.listGlobalIncidentHandles(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling IncidentsApi#listGlobalIncidentHandles"); + 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/UpdateGlobalIncidentHandle.java b/examples/v2/incidents/UpdateGlobalIncidentHandle.java new file mode 100644 index 00000000000..b13d0290300 --- /dev/null +++ b/examples/v2/incidents/UpdateGlobalIncidentHandle.java @@ -0,0 +1,61 @@ +// Update global incident handle 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.IncidentHandleAttributesFields; +import com.datadog.api.client.v2.model.IncidentHandleAttributesRequest; +import com.datadog.api.client.v2.model.IncidentHandleDataRequest; +import com.datadog.api.client.v2.model.IncidentHandleRelationship; +import com.datadog.api.client.v2.model.IncidentHandleRelationshipData; +import com.datadog.api.client.v2.model.IncidentHandleRelationshipsRequest; +import com.datadog.api.client.v2.model.IncidentHandleRequest; +import com.datadog.api.client.v2.model.IncidentHandleResponse; +import com.datadog.api.client.v2.model.IncidentHandleType; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.updateGlobalIncidentHandle", true); + IncidentsApi apiInstance = new IncidentsApi(defaultClient); + + IncidentHandleRequest body = + new IncidentHandleRequest() + .data( + new IncidentHandleDataRequest() + .attributes( + new IncidentHandleAttributesRequest() + .fields( + new IncidentHandleAttributesFields() + .severity(Collections.singletonList("SEV-1"))) + .name("@incident-sev-1")) + .id("b2494081-cdf0-4205-b366-4e1dd4fdf0bf") + .relationships( + new IncidentHandleRelationshipsRequest() + .commanderUser( + new IncidentHandleRelationship() + .data( + new IncidentHandleRelationshipData() + .id("f7b538b1-ed7c-4e84-82de-fdf84a539d40") + .type("incident_types"))) + .incidentType( + new IncidentHandleRelationship() + .data( + new IncidentHandleRelationshipData() + .id("f7b538b1-ed7c-4e84-82de-fdf84a539d40") + .type("incident_types")))) + .type(IncidentHandleType.INCIDENTS_HANDLES)); + + try { + IncidentHandleResponse result = apiInstance.updateGlobalIncidentHandle(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling IncidentsApi#updateGlobalIncidentHandle"); + 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/UpdateGlobalIncidentSettings.java b/examples/v2/incidents/UpdateGlobalIncidentSettings.java new file mode 100644 index 00000000000..4685b829465 --- /dev/null +++ b/examples/v2/incidents/UpdateGlobalIncidentSettings.java @@ -0,0 +1,38 @@ +// Update global incident settings 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.GlobalIncidentSettingsAttributesRequest; +import com.datadog.api.client.v2.model.GlobalIncidentSettingsDataRequest; +import com.datadog.api.client.v2.model.GlobalIncidentSettingsRequest; +import com.datadog.api.client.v2.model.GlobalIncidentSettingsResponse; +import com.datadog.api.client.v2.model.GlobalIncidentSettingsType; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.updateGlobalIncidentSettings", true); + IncidentsApi apiInstance = new IncidentsApi(defaultClient); + + GlobalIncidentSettingsRequest body = + new GlobalIncidentSettingsRequest() + .data( + new GlobalIncidentSettingsDataRequest() + .attributes( + new GlobalIncidentSettingsAttributesRequest() + .analyticsDashboardId("abc-123-def")) + .type(GlobalIncidentSettingsType.INCIDENTS_GLOBAL_SETTINGS)); + + try { + GlobalIncidentSettingsResponse result = apiInstance.updateGlobalIncidentSettings(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling IncidentsApi#updateGlobalIncidentSettings"); + 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 e2c4bb2bac2..a56e41784c9 100644 --- a/src/main/java/com/datadog/api/client/ApiClient.java +++ b/src/main/java/com/datadog/api/client/ApiClient.java @@ -815,6 +815,7 @@ public class ApiClient { put("v2.getDeploymentRule", false); put("v2.updateDeploymentGate", false); put("v2.updateDeploymentRule", false); + put("v2.createGlobalIncidentHandle", false); put("v2.createIncident", false); put("v2.createIncidentAttachment", false); put("v2.createIncidentIntegration", false); @@ -823,6 +824,7 @@ public class ApiClient { put("v2.createIncidentPostmortemAttachment", false); put("v2.createIncidentTodo", false); put("v2.createIncidentType", false); + put("v2.deleteGlobalIncidentHandle", false); put("v2.deleteIncident", false); put("v2.deleteIncidentAttachment", false); put("v2.deleteIncidentIntegration", false); @@ -830,12 +832,14 @@ public class ApiClient { put("v2.deleteIncidentNotificationTemplate", false); put("v2.deleteIncidentTodo", false); put("v2.deleteIncidentType", false); + put("v2.getGlobalIncidentSettings", false); put("v2.getIncident", false); put("v2.getIncidentIntegration", false); put("v2.getIncidentNotificationRule", false); put("v2.getIncidentNotificationTemplate", false); put("v2.getIncidentTodo", false); put("v2.getIncidentType", false); + put("v2.listGlobalIncidentHandles", false); put("v2.listIncidentAttachments", false); put("v2.listIncidentIntegrations", false); put("v2.listIncidentNotificationRules", false); @@ -844,6 +848,8 @@ public class ApiClient { put("v2.listIncidentTodos", false); put("v2.listIncidentTypes", false); put("v2.searchIncidents", false); + put("v2.updateGlobalIncidentHandle", false); + put("v2.updateGlobalIncidentSettings", false); put("v2.updateIncident", false); put("v2.updateIncidentAttachment", false); put("v2.updateIncidentIntegration", 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 846e12a65dd..d57afe8c7e9 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 @@ -10,7 +10,12 @@ import com.datadog.api.client.v2.model.CreateAttachmentRequest; import com.datadog.api.client.v2.model.CreateIncidentNotificationRuleRequest; import com.datadog.api.client.v2.model.CreateIncidentNotificationTemplateRequest; +import com.datadog.api.client.v2.model.GlobalIncidentSettingsRequest; +import com.datadog.api.client.v2.model.GlobalIncidentSettingsResponse; import com.datadog.api.client.v2.model.IncidentCreateRequest; +import com.datadog.api.client.v2.model.IncidentHandleRequest; +import com.datadog.api.client.v2.model.IncidentHandleResponse; +import com.datadog.api.client.v2.model.IncidentHandlesResponse; import com.datadog.api.client.v2.model.IncidentImpactCreateRequest; import com.datadog.api.client.v2.model.IncidentImpactRelatedObject; import com.datadog.api.client.v2.model.IncidentImpactResponse; @@ -84,6 +89,222 @@ public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; } + /** Manage optional parameters to createGlobalIncidentHandle. */ + public static class CreateGlobalIncidentHandleOptionalParameters { + private String include; + + /** + * Set include. + * + * @param include Comma-separated list of related resources to include in the response + * (optional) + * @return CreateGlobalIncidentHandleOptionalParameters + */ + public CreateGlobalIncidentHandleOptionalParameters include(String include) { + this.include = include; + return this; + } + } + + /** + * Create global incident handle. + * + *

See {@link #createGlobalIncidentHandleWithHttpInfo}. + * + * @param body (required) + * @return IncidentHandleResponse + * @throws ApiException if fails to make API call + */ + public IncidentHandleResponse createGlobalIncidentHandle(IncidentHandleRequest body) + throws ApiException { + return createGlobalIncidentHandleWithHttpInfo( + body, new CreateGlobalIncidentHandleOptionalParameters()) + .getData(); + } + + /** + * Create global incident handle. + * + *

See {@link #createGlobalIncidentHandleWithHttpInfoAsync}. + * + * @param body (required) + * @return CompletableFuture<IncidentHandleResponse> + */ + public CompletableFuture createGlobalIncidentHandleAsync( + IncidentHandleRequest body) { + return createGlobalIncidentHandleWithHttpInfoAsync( + body, new CreateGlobalIncidentHandleOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Create global incident handle. + * + *

See {@link #createGlobalIncidentHandleWithHttpInfo}. + * + * @param body (required) + * @param parameters Optional parameters for the request. + * @return IncidentHandleResponse + * @throws ApiException if fails to make API call + */ + public IncidentHandleResponse createGlobalIncidentHandle( + IncidentHandleRequest body, CreateGlobalIncidentHandleOptionalParameters parameters) + throws ApiException { + return createGlobalIncidentHandleWithHttpInfo(body, parameters).getData(); + } + + /** + * Create global incident handle. + * + *

See {@link #createGlobalIncidentHandleWithHttpInfoAsync}. + * + * @param body (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<IncidentHandleResponse> + */ + public CompletableFuture createGlobalIncidentHandleAsync( + IncidentHandleRequest body, CreateGlobalIncidentHandleOptionalParameters parameters) { + return createGlobalIncidentHandleWithHttpInfoAsync(body, parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Create a new global incident handle. + * + * @param body (required) + * @param parameters Optional parameters for the request. + * @return ApiResponse<IncidentHandleResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
201 Created -
400 Bad Request -
429 Too many requests -
+ */ + public ApiResponse createGlobalIncidentHandleWithHttpInfo( + IncidentHandleRequest body, CreateGlobalIncidentHandleOptionalParameters parameters) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "createGlobalIncidentHandle"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling createGlobalIncidentHandle"); + } + String include = parameters.include; + // create path and map variables + String localVarPath = "/api/v2/incidents/config/global/incident-handles"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "include", include)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.IncidentsApi.createGlobalIncidentHandle", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Create global incident handle. + * + *

See {@link #createGlobalIncidentHandleWithHttpInfo}. + * + * @param body (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<IncidentHandleResponse>> + */ + public CompletableFuture> + createGlobalIncidentHandleWithHttpInfoAsync( + IncidentHandleRequest body, CreateGlobalIncidentHandleOptionalParameters parameters) { + // Check if unstable operation is enabled + String operationId = "createGlobalIncidentHandle"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'body' when calling createGlobalIncidentHandle")); + return result; + } + String include = parameters.include; + // create path and map variables + String localVarPath = "/api/v2/incidents/config/global/incident-handles"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "include", include)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.IncidentsApi.createGlobalIncidentHandle", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + /** * Create an incident. * @@ -1732,27 +1953,25 @@ public CompletableFuture> createIncidentTypeWi } /** - * Delete an existing incident. + * Delete global incident handle. * - *

See {@link #deleteIncidentWithHttpInfo}. + *

See {@link #deleteGlobalIncidentHandleWithHttpInfo}. * - * @param incidentId The UUID of the incident. (required) * @throws ApiException if fails to make API call */ - public void deleteIncident(String incidentId) throws ApiException { - deleteIncidentWithHttpInfo(incidentId); + public void deleteGlobalIncidentHandle() throws ApiException { + deleteGlobalIncidentHandleWithHttpInfo(); } /** - * Delete an existing incident. + * Delete global incident handle. * - *

See {@link #deleteIncidentWithHttpInfoAsync}. + *

See {@link #deleteGlobalIncidentHandleWithHttpInfoAsync}. * - * @param incidentId The UUID of the incident. (required) * @return CompletableFuture */ - public CompletableFuture deleteIncidentAsync(String incidentId) { - return deleteIncidentWithHttpInfoAsync(incidentId) + public CompletableFuture deleteGlobalIncidentHandleAsync() { + return deleteGlobalIncidentHandleWithHttpInfoAsync() .thenApply( response -> { return response.getData(); @@ -1760,55 +1979,42 @@ public CompletableFuture deleteIncidentAsync(String incidentId) { } /** - * Deletes an existing incident from the users organization. + * Delete a global incident handle. * - * @param incidentId The UUID of the incident. (required) * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details * * * - * + * * - * - * - * * *
Response details
Status Code Description Response Headers
204 OK -
204 No Content -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse deleteIncidentWithHttpInfo(String incidentId) throws ApiException { + public ApiResponse deleteGlobalIncidentHandleWithHttpInfo() throws ApiException { // Check if unstable operation is enabled - String operationId = "deleteIncident"; + String operationId = "deleteGlobalIncidentHandle"; 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 deleteIncident"); - } // create path and map variables - String localVarPath = - "/api/v2/incidents/{incident_id}" - .replaceAll( - "\\{" + "incident_id" + "\\}", apiClient.escapeString(incidentId.toString())); + String localVarPath = "/api/v2/incidents/config/global/incident-handles"; Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.IncidentsApi.deleteIncident", + "v2.IncidentsApi.deleteGlobalIncidentHandle", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"*/*"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + new String[] {"apiKeyAuth", "appKeyAuth"}); return apiClient.invokeAPI( "DELETE", builder, @@ -1821,16 +2027,15 @@ public ApiResponse deleteIncidentWithHttpInfo(String incidentId) throws Ap } /** - * Delete an existing incident. + * Delete global incident handle. * - *

See {@link #deleteIncidentWithHttpInfo}. + *

See {@link #deleteGlobalIncidentHandleWithHttpInfo}. * - * @param incidentId The UUID of the incident. (required) * @return CompletableFuture<ApiResponse<Void>> */ - public CompletableFuture> deleteIncidentWithHttpInfoAsync(String incidentId) { + public CompletableFuture> deleteGlobalIncidentHandleWithHttpInfoAsync() { // Check if unstable operation is enabled - String operationId = "deleteIncident"; + String operationId = "deleteGlobalIncidentHandle"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { @@ -1840,20 +2045,8 @@ public CompletableFuture> deleteIncidentWithHttpInfoAsync(Stri return result; } Object localVarPostBody = null; - - // 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 deleteIncident")); - return result; - } // create path and map variables - String localVarPath = - "/api/v2/incidents/{incident_id}" - .replaceAll( - "\\{" + "incident_id" + "\\}", apiClient.escapeString(incidentId.toString())); + String localVarPath = "/api/v2/incidents/config/global/incident-handles"; Map localVarHeaderParams = new HashMap(); @@ -1861,13 +2054,13 @@ public CompletableFuture> deleteIncidentWithHttpInfoAsync(Stri try { builder = apiClient.createBuilder( - "v2.IncidentsApi.deleteIncident", + "v2.IncidentsApi.deleteGlobalIncidentHandle", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"*/*"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + new String[] {"apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); @@ -1885,30 +2078,27 @@ public CompletableFuture> deleteIncidentWithHttpInfoAsync(Stri } /** - * Delete incident attachment. + * Delete an existing incident. * - *

See {@link #deleteIncidentAttachmentWithHttpInfo}. + *

See {@link #deleteIncidentWithHttpInfo}. * * @param incidentId The UUID of the incident. (required) - * @param attachmentId The ID of the attachment. (required) * @throws ApiException if fails to make API call */ - public void deleteIncidentAttachment(String incidentId, Object attachmentId) throws ApiException { - deleteIncidentAttachmentWithHttpInfo(incidentId, attachmentId); + public void deleteIncident(String incidentId) throws ApiException { + deleteIncidentWithHttpInfo(incidentId); } /** - * Delete incident attachment. + * Delete an existing incident. * - *

See {@link #deleteIncidentAttachmentWithHttpInfoAsync}. + *

See {@link #deleteIncidentWithHttpInfoAsync}. * * @param incidentId The UUID of the incident. (required) - * @param attachmentId The ID of the attachment. (required) * @return CompletableFuture */ - public CompletableFuture deleteIncidentAttachmentAsync( - String incidentId, Object attachmentId) { - return deleteIncidentAttachmentWithHttpInfoAsync(incidentId, attachmentId) + public CompletableFuture deleteIncidentAsync(String incidentId) { + return deleteIncidentWithHttpInfoAsync(incidentId) .thenApply( response -> { return response.getData(); @@ -1916,25 +2106,26 @@ public CompletableFuture deleteIncidentAttachmentAsync( } /** + * Deletes an existing incident from the users organization. + * * @param incidentId The UUID of the incident. (required) - * @param attachmentId The ID of the attachment. (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 -
204 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse deleteIncidentAttachmentWithHttpInfo( - String incidentId, Object attachmentId) throws ApiException { + public ApiResponse deleteIncidentWithHttpInfo(String incidentId) throws ApiException { // Check if unstable operation is enabled - String operationId = "deleteIncidentAttachment"; + String operationId = "deleteIncident"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { @@ -1945,18 +2136,173 @@ public ApiResponse deleteIncidentAttachmentWithHttpInfo( // verify the required parameter 'incidentId' is set if (incidentId == null) { throw new ApiException( - 400, "Missing the required parameter 'incidentId' when calling deleteIncidentAttachment"); - } - - // verify the required parameter 'attachmentId' is set - if (attachmentId == null) { - throw new ApiException( - 400, - "Missing the required parameter 'attachmentId' when calling deleteIncidentAttachment"); + 400, "Missing the required parameter 'incidentId' when calling deleteIncident"); } // create path and map variables String localVarPath = - "/api/v2/incidents/{incident_id}/attachments/{attachment_id}" + "/api/v2/incidents/{incident_id}" + .replaceAll( + "\\{" + "incident_id" + "\\}", apiClient.escapeString(incidentId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.IncidentsApi.deleteIncident", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Delete an existing incident. + * + *

See {@link #deleteIncidentWithHttpInfo}. + * + * @param incidentId The UUID of the incident. (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> deleteIncidentWithHttpInfoAsync(String incidentId) { + // Check if unstable operation is enabled + String operationId = "deleteIncident"; + 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 'incidentId' is set + if (incidentId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'incidentId' when calling deleteIncident")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/incidents/{incident_id}" + .replaceAll( + "\\{" + "incident_id" + "\\}", apiClient.escapeString(incidentId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.IncidentsApi.deleteIncident", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + 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 incident attachment. + * + *

See {@link #deleteIncidentAttachmentWithHttpInfo}. + * + * @param incidentId The UUID of the incident. (required) + * @param attachmentId The ID of the attachment. (required) + * @throws ApiException if fails to make API call + */ + public void deleteIncidentAttachment(String incidentId, Object attachmentId) throws ApiException { + deleteIncidentAttachmentWithHttpInfo(incidentId, attachmentId); + } + + /** + * Delete incident attachment. + * + *

See {@link #deleteIncidentAttachmentWithHttpInfoAsync}. + * + * @param incidentId The UUID of the incident. (required) + * @param attachmentId The ID of the attachment. (required) + * @return CompletableFuture + */ + public CompletableFuture deleteIncidentAttachmentAsync( + String incidentId, Object attachmentId) { + return deleteIncidentAttachmentWithHttpInfoAsync(incidentId, attachmentId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * @param incidentId The UUID of the incident. (required) + * @param attachmentId The ID of the attachment. (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 -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse deleteIncidentAttachmentWithHttpInfo( + String incidentId, Object attachmentId) throws ApiException { + // Check if unstable operation is enabled + String operationId = "deleteIncidentAttachment"; + 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 deleteIncidentAttachment"); + } + + // verify the required parameter 'attachmentId' is set + if (attachmentId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'attachmentId' when calling deleteIncidentAttachment"); + } + // create path and map variables + String localVarPath = + "/api/v2/incidents/{incident_id}/attachments/{attachment_id}" .replaceAll( "\\{" + "incident_id" + "\\}", apiClient.escapeString(incidentId.toString())) .replaceAll( @@ -3182,79 +3528,27 @@ public CompletableFuture> deleteIncidentTypeWithHttpInfoAsync( null); } - /** Manage optional parameters to getIncident. */ - public static class GetIncidentOptionalParameters { - private List include; - - /** - * Set include. - * - * @param include Specifies which types of related objects should be included in the response. - * (optional) - * @return GetIncidentOptionalParameters - */ - public GetIncidentOptionalParameters include(List include) { - this.include = include; - return this; - } - } - - /** - * Get the details of an incident. - * - *

See {@link #getIncidentWithHttpInfo}. - * - * @param incidentId The UUID of the incident. (required) - * @return IncidentResponse - * @throws ApiException if fails to make API call - */ - public IncidentResponse getIncident(String incidentId) throws ApiException { - return getIncidentWithHttpInfo(incidentId, new GetIncidentOptionalParameters()).getData(); - } - - /** - * Get the details of an incident. - * - *

See {@link #getIncidentWithHttpInfoAsync}. - * - * @param incidentId The UUID of the incident. (required) - * @return CompletableFuture<IncidentResponse> - */ - public CompletableFuture getIncidentAsync(String incidentId) { - return getIncidentWithHttpInfoAsync(incidentId, new GetIncidentOptionalParameters()) - .thenApply( - response -> { - return response.getData(); - }); - } - /** - * Get the details of an incident. + * Get global incident settings. * - *

See {@link #getIncidentWithHttpInfo}. + *

See {@link #getGlobalIncidentSettingsWithHttpInfo}. * - * @param incidentId The UUID of the incident. (required) - * @param parameters Optional parameters for the request. - * @return IncidentResponse + * @return GlobalIncidentSettingsResponse * @throws ApiException if fails to make API call */ - public IncidentResponse getIncident(String incidentId, GetIncidentOptionalParameters parameters) - throws ApiException { - return getIncidentWithHttpInfo(incidentId, parameters).getData(); + public GlobalIncidentSettingsResponse getGlobalIncidentSettings() throws ApiException { + return getGlobalIncidentSettingsWithHttpInfo().getData(); } /** - * Get the details of an incident. + * Get global incident settings. * - *

See {@link #getIncidentWithHttpInfoAsync}. + *

See {@link #getGlobalIncidentSettingsWithHttpInfoAsync}. * - * @param incidentId The UUID of the incident. (required) - * @param parameters Optional parameters for the request. - * @return CompletableFuture<IncidentResponse> + * @return CompletableFuture<GlobalIncidentSettingsResponse> */ - public CompletableFuture getIncidentAsync( - String incidentId, GetIncidentOptionalParameters parameters) { - return getIncidentWithHttpInfoAsync(incidentId, parameters) + public CompletableFuture getGlobalIncidentSettingsAsync() { + return getGlobalIncidentSettingsWithHttpInfoAsync() .thenApply( response -> { return response.getData(); @@ -3262,11 +3556,9 @@ public CompletableFuture getIncidentAsync( } /** - * Get the details of an incident by incident_id. + * Retrieve global incident settings for the organization. * - * @param incidentId The UUID of the incident. (required) - * @param parameters Optional parameters for the request. - * @return ApiResponse<IncidentResponse> + * @return ApiResponse<GlobalIncidentSettingsResponse> * @throws ApiException if fails to make API call * @http.response.details * @@ -3274,49 +3566,33 @@ public CompletableFuture getIncidentAsync( * * * - * - * - * * *
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse getIncidentWithHttpInfo( - String incidentId, GetIncidentOptionalParameters parameters) throws ApiException { + public ApiResponse getGlobalIncidentSettingsWithHttpInfo() + throws ApiException { // Check if unstable operation is enabled - String operationId = "getIncident"; + String operationId = "getGlobalIncidentSettings"; 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 getIncident"); - } - List include = parameters.include; // create path and map variables - String localVarPath = - "/api/v2/incidents/{incident_id}" - .replaceAll( - "\\{" + "incident_id" + "\\}", apiClient.escapeString(incidentId.toString())); + String localVarPath = "/api/v2/incidents/config/global/settings"; - List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "include", include)); - Invocation.Builder builder = apiClient.createBuilder( - "v2.IncidentsApi.getIncident", + "v2.IncidentsApi.getGlobalIncidentSettings", localVarPath, - localVarQueryParams, + new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + new String[] {"apiKeyAuth", "appKeyAuth"}); return apiClient.invokeAPI( "GET", builder, @@ -3325,7 +3601,207 @@ public ApiResponse getIncidentWithHttpInfo( localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); + } + + /** + * Get global incident settings. + * + *

See {@link #getGlobalIncidentSettingsWithHttpInfo}. + * + * @return CompletableFuture<ApiResponse<GlobalIncidentSettingsResponse>> + */ + public CompletableFuture> + getGlobalIncidentSettingsWithHttpInfoAsync() { + // Check if unstable operation is enabled + String operationId = "getGlobalIncidentSettings"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/v2/incidents/config/global/settings"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.IncidentsApi.getGlobalIncidentSettings", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** Manage optional parameters to getIncident. */ + public static class GetIncidentOptionalParameters { + private List include; + + /** + * Set include. + * + * @param include Specifies which types of related objects should be included in the response. + * (optional) + * @return GetIncidentOptionalParameters + */ + public GetIncidentOptionalParameters include(List include) { + this.include = include; + return this; + } + } + + /** + * Get the details of an incident. + * + *

See {@link #getIncidentWithHttpInfo}. + * + * @param incidentId The UUID of the incident. (required) + * @return IncidentResponse + * @throws ApiException if fails to make API call + */ + public IncidentResponse getIncident(String incidentId) throws ApiException { + return getIncidentWithHttpInfo(incidentId, new GetIncidentOptionalParameters()).getData(); + } + + /** + * Get the details of an incident. + * + *

See {@link #getIncidentWithHttpInfoAsync}. + * + * @param incidentId The UUID of the incident. (required) + * @return CompletableFuture<IncidentResponse> + */ + public CompletableFuture getIncidentAsync(String incidentId) { + return getIncidentWithHttpInfoAsync(incidentId, new GetIncidentOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get the details of an incident. + * + *

See {@link #getIncidentWithHttpInfo}. + * + * @param incidentId The UUID of the incident. (required) + * @param parameters Optional parameters for the request. + * @return IncidentResponse + * @throws ApiException if fails to make API call + */ + public IncidentResponse getIncident(String incidentId, GetIncidentOptionalParameters parameters) + throws ApiException { + return getIncidentWithHttpInfo(incidentId, parameters).getData(); + } + + /** + * Get the details of an incident. + * + *

See {@link #getIncidentWithHttpInfoAsync}. + * + * @param incidentId The UUID of the incident. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<IncidentResponse> + */ + public CompletableFuture getIncidentAsync( + String incidentId, GetIncidentOptionalParameters parameters) { + return getIncidentWithHttpInfoAsync(incidentId, parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get the details of an incident by incident_id. + * + * @param incidentId The UUID of the incident. (required) + * @param parameters Optional parameters for the request. + * @return ApiResponse<IncidentResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse getIncidentWithHttpInfo( + String incidentId, GetIncidentOptionalParameters parameters) throws ApiException { + // Check if unstable operation is enabled + String operationId = "getIncident"; + 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 getIncident"); + } + List include = parameters.include; + // create path and map variables + String localVarPath = + "/api/v2/incidents/{incident_id}" + .replaceAll( + "\\{" + "incident_id" + "\\}", apiClient.escapeString(incidentId.toString())); + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "include", include)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.IncidentsApi.getIncident", + 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() {}); } /** @@ -4370,63 +4846,46 @@ public CompletableFuture> getIncidentTypeWithH new GenericType() {}); } - /** Manage optional parameters to listIncidentAttachments. */ - public static class ListIncidentAttachmentsOptionalParameters { - private String filterAttachmentType; + /** Manage optional parameters to listGlobalIncidentHandles. */ + public static class ListGlobalIncidentHandlesOptionalParameters { private String include; - /** - * Set filterAttachmentType. - * - * @param filterAttachmentType Filter attachments by type. Supported values are 1 ( - * postmortem) and 2 (link). (optional) - * @return ListIncidentAttachmentsOptionalParameters - */ - public ListIncidentAttachmentsOptionalParameters filterAttachmentType( - String filterAttachmentType) { - this.filterAttachmentType = filterAttachmentType; - return this; - } - /** * Set include. * - * @param include Resource to include in the response. Supported value: - * last_modified_by_user. (optional) - * @return ListIncidentAttachmentsOptionalParameters + * @param include Comma-separated list of related resources to include in the response + * (optional) + * @return ListGlobalIncidentHandlesOptionalParameters */ - public ListIncidentAttachmentsOptionalParameters include(String include) { + public ListGlobalIncidentHandlesOptionalParameters include(String include) { this.include = include; return this; } } /** - * List incident attachments. + * List global incident handles. * - *

See {@link #listIncidentAttachmentsWithHttpInfo}. + *

See {@link #listGlobalIncidentHandlesWithHttpInfo}. * - * @param incidentId The UUID of the incident. (required) - * @return AttachmentArray + * @return IncidentHandlesResponse * @throws ApiException if fails to make API call */ - public AttachmentArray listIncidentAttachments(String incidentId) throws ApiException { - return listIncidentAttachmentsWithHttpInfo( - incidentId, new ListIncidentAttachmentsOptionalParameters()) + public IncidentHandlesResponse listGlobalIncidentHandles() throws ApiException { + return listGlobalIncidentHandlesWithHttpInfo(new ListGlobalIncidentHandlesOptionalParameters()) .getData(); } /** - * List incident attachments. + * List global incident handles. * - *

See {@link #listIncidentAttachmentsWithHttpInfoAsync}. + *

See {@link #listGlobalIncidentHandlesWithHttpInfoAsync}. * - * @param incidentId The UUID of the incident. (required) - * @return CompletableFuture<AttachmentArray> + * @return CompletableFuture<IncidentHandlesResponse> */ - public CompletableFuture listIncidentAttachmentsAsync(String incidentId) { - return listIncidentAttachmentsWithHttpInfoAsync( - incidentId, new ListIncidentAttachmentsOptionalParameters()) + public CompletableFuture listGlobalIncidentHandlesAsync() { + return listGlobalIncidentHandlesWithHttpInfoAsync( + new ListGlobalIncidentHandlesOptionalParameters()) .thenApply( response -> { return response.getData(); @@ -4434,32 +4893,30 @@ incidentId, new ListIncidentAttachmentsOptionalParameters()) } /** - * List incident attachments. + * List global incident handles. * - *

See {@link #listIncidentAttachmentsWithHttpInfo}. + *

See {@link #listGlobalIncidentHandlesWithHttpInfo}. * - * @param incidentId The UUID of the incident. (required) * @param parameters Optional parameters for the request. - * @return AttachmentArray + * @return IncidentHandlesResponse * @throws ApiException if fails to make API call */ - public AttachmentArray listIncidentAttachments( - String incidentId, ListIncidentAttachmentsOptionalParameters parameters) throws ApiException { - return listIncidentAttachmentsWithHttpInfo(incidentId, parameters).getData(); + public IncidentHandlesResponse listGlobalIncidentHandles( + ListGlobalIncidentHandlesOptionalParameters parameters) throws ApiException { + return listGlobalIncidentHandlesWithHttpInfo(parameters).getData(); } /** - * List incident attachments. + * List global incident handles. * - *

See {@link #listIncidentAttachmentsWithHttpInfoAsync}. + *

See {@link #listGlobalIncidentHandlesWithHttpInfoAsync}. * - * @param incidentId The UUID of the incident. (required) * @param parameters Optional parameters for the request. - * @return CompletableFuture<AttachmentArray> + * @return CompletableFuture<IncidentHandlesResponse> */ - public CompletableFuture listIncidentAttachmentsAsync( - String incidentId, ListIncidentAttachmentsOptionalParameters parameters) { - return listIncidentAttachmentsWithHttpInfoAsync(incidentId, parameters) + public CompletableFuture listGlobalIncidentHandlesAsync( + ListGlobalIncidentHandlesOptionalParameters parameters) { + return listGlobalIncidentHandlesWithHttpInfoAsync(parameters) .thenApply( response -> { return response.getData(); @@ -4467,11 +4924,10 @@ public CompletableFuture listIncidentAttachmentsAsync( } /** - * List incident attachments. + * Retrieve a list of global incident handles. * - * @param incidentId The UUID of the incident. (required) * @param parameters Optional parameters for the request. - * @return ApiResponse<AttachmentArray> + * @return ApiResponse<IncidentHandlesResponse> * @throws ApiException if fails to make API call * @http.response.details * @@ -4482,34 +4938,243 @@ public CompletableFuture listIncidentAttachmentsAsync( * *
429 Too many requests -
*/ - public ApiResponse listIncidentAttachmentsWithHttpInfo( - String incidentId, ListIncidentAttachmentsOptionalParameters parameters) throws ApiException { + public ApiResponse listGlobalIncidentHandlesWithHttpInfo( + ListGlobalIncidentHandlesOptionalParameters parameters) throws ApiException { // Check if unstable operation is enabled - String operationId = "listIncidentAttachments"; + String operationId = "listGlobalIncidentHandles"; 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 listIncidentAttachments"); - } - String filterAttachmentType = parameters.filterAttachmentType; String include = parameters.include; // create path and map variables - String localVarPath = - "/api/v2/incidents/{incident_id}/attachments" - .replaceAll( - "\\{" + "incident_id" + "\\}", apiClient.escapeString(incidentId.toString())); + String localVarPath = "/api/v2/incidents/config/global/incident-handles"; List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll( + localVarQueryParams.addAll(apiClient.parameterToPairs("", "include", include)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.IncidentsApi.listGlobalIncidentHandles", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * List global incident handles. + * + *

See {@link #listGlobalIncidentHandlesWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<IncidentHandlesResponse>> + */ + public CompletableFuture> + listGlobalIncidentHandlesWithHttpInfoAsync( + ListGlobalIncidentHandlesOptionalParameters parameters) { + // Check if unstable operation is enabled + String operationId = "listGlobalIncidentHandles"; + 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; + String include = parameters.include; + // create path and map variables + String localVarPath = "/api/v2/incidents/config/global/incident-handles"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "include", include)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.IncidentsApi.listGlobalIncidentHandles", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** Manage optional parameters to listIncidentAttachments. */ + public static class ListIncidentAttachmentsOptionalParameters { + private String filterAttachmentType; + private String include; + + /** + * Set filterAttachmentType. + * + * @param filterAttachmentType Filter attachments by type. Supported values are 1 ( + * postmortem) and 2 (link). (optional) + * @return ListIncidentAttachmentsOptionalParameters + */ + public ListIncidentAttachmentsOptionalParameters filterAttachmentType( + String filterAttachmentType) { + this.filterAttachmentType = filterAttachmentType; + return this; + } + + /** + * Set include. + * + * @param include Resource to include in the response. Supported value: + * last_modified_by_user. (optional) + * @return ListIncidentAttachmentsOptionalParameters + */ + public ListIncidentAttachmentsOptionalParameters include(String include) { + this.include = include; + return this; + } + } + + /** + * List incident attachments. + * + *

See {@link #listIncidentAttachmentsWithHttpInfo}. + * + * @param incidentId The UUID of the incident. (required) + * @return AttachmentArray + * @throws ApiException if fails to make API call + */ + public AttachmentArray listIncidentAttachments(String incidentId) throws ApiException { + return listIncidentAttachmentsWithHttpInfo( + incidentId, new ListIncidentAttachmentsOptionalParameters()) + .getData(); + } + + /** + * List incident attachments. + * + *

See {@link #listIncidentAttachmentsWithHttpInfoAsync}. + * + * @param incidentId The UUID of the incident. (required) + * @return CompletableFuture<AttachmentArray> + */ + public CompletableFuture listIncidentAttachmentsAsync(String incidentId) { + return listIncidentAttachmentsWithHttpInfoAsync( + incidentId, new ListIncidentAttachmentsOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List incident attachments. + * + *

See {@link #listIncidentAttachmentsWithHttpInfo}. + * + * @param incidentId The UUID of the incident. (required) + * @param parameters Optional parameters for the request. + * @return AttachmentArray + * @throws ApiException if fails to make API call + */ + public AttachmentArray listIncidentAttachments( + String incidentId, ListIncidentAttachmentsOptionalParameters parameters) throws ApiException { + return listIncidentAttachmentsWithHttpInfo(incidentId, parameters).getData(); + } + + /** + * List incident attachments. + * + *

See {@link #listIncidentAttachmentsWithHttpInfoAsync}. + * + * @param incidentId The UUID of the incident. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<AttachmentArray> + */ + public CompletableFuture listIncidentAttachmentsAsync( + String incidentId, ListIncidentAttachmentsOptionalParameters parameters) { + return listIncidentAttachmentsWithHttpInfoAsync(incidentId, parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List incident attachments. + * + * @param incidentId The UUID of the incident. (required) + * @param parameters Optional parameters for the request. + * @return ApiResponse<AttachmentArray> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
429 Too many requests -
+ */ + public ApiResponse listIncidentAttachmentsWithHttpInfo( + String incidentId, ListIncidentAttachmentsOptionalParameters parameters) throws ApiException { + // Check if unstable operation is enabled + String operationId = "listIncidentAttachments"; + 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 listIncidentAttachments"); + } + String filterAttachmentType = parameters.filterAttachmentType; + String include = parameters.include; + // create path and map variables + String localVarPath = + "/api/v2/incidents/{incident_id}/attachments" + .replaceAll( + "\\{" + "incident_id" + "\\}", apiClient.escapeString(incidentId.toString())); + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll( apiClient.parameterToPairs("", "filter[attachment_type]", filterAttachmentType)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "include", include)); @@ -6347,6 +7012,375 @@ public CompletableFuture> searchIncidentsWit new GenericType() {}); } + /** Manage optional parameters to updateGlobalIncidentHandle. */ + public static class UpdateGlobalIncidentHandleOptionalParameters { + private String include; + + /** + * Set include. + * + * @param include Comma-separated list of related resources to include in the response + * (optional) + * @return UpdateGlobalIncidentHandleOptionalParameters + */ + public UpdateGlobalIncidentHandleOptionalParameters include(String include) { + this.include = include; + return this; + } + } + + /** + * Update global incident handle. + * + *

See {@link #updateGlobalIncidentHandleWithHttpInfo}. + * + * @param body (required) + * @return IncidentHandleResponse + * @throws ApiException if fails to make API call + */ + public IncidentHandleResponse updateGlobalIncidentHandle(IncidentHandleRequest body) + throws ApiException { + return updateGlobalIncidentHandleWithHttpInfo( + body, new UpdateGlobalIncidentHandleOptionalParameters()) + .getData(); + } + + /** + * Update global incident handle. + * + *

See {@link #updateGlobalIncidentHandleWithHttpInfoAsync}. + * + * @param body (required) + * @return CompletableFuture<IncidentHandleResponse> + */ + public CompletableFuture updateGlobalIncidentHandleAsync( + IncidentHandleRequest body) { + return updateGlobalIncidentHandleWithHttpInfoAsync( + body, new UpdateGlobalIncidentHandleOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Update global incident handle. + * + *

See {@link #updateGlobalIncidentHandleWithHttpInfo}. + * + * @param body (required) + * @param parameters Optional parameters for the request. + * @return IncidentHandleResponse + * @throws ApiException if fails to make API call + */ + public IncidentHandleResponse updateGlobalIncidentHandle( + IncidentHandleRequest body, UpdateGlobalIncidentHandleOptionalParameters parameters) + throws ApiException { + return updateGlobalIncidentHandleWithHttpInfo(body, parameters).getData(); + } + + /** + * Update global incident handle. + * + *

See {@link #updateGlobalIncidentHandleWithHttpInfoAsync}. + * + * @param body (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<IncidentHandleResponse> + */ + public CompletableFuture updateGlobalIncidentHandleAsync( + IncidentHandleRequest body, UpdateGlobalIncidentHandleOptionalParameters parameters) { + return updateGlobalIncidentHandleWithHttpInfoAsync(body, parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Update an existing global incident handle. + * + * @param body (required) + * @param parameters Optional parameters for the request. + * @return ApiResponse<IncidentHandleResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
429 Too many requests -
+ */ + public ApiResponse updateGlobalIncidentHandleWithHttpInfo( + IncidentHandleRequest body, UpdateGlobalIncidentHandleOptionalParameters parameters) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "updateGlobalIncidentHandle"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling updateGlobalIncidentHandle"); + } + String include = parameters.include; + // create path and map variables + String localVarPath = "/api/v2/incidents/config/global/incident-handles"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "include", include)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.IncidentsApi.updateGlobalIncidentHandle", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "PUT", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update global incident handle. + * + *

See {@link #updateGlobalIncidentHandleWithHttpInfo}. + * + * @param body (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<IncidentHandleResponse>> + */ + public CompletableFuture> + updateGlobalIncidentHandleWithHttpInfoAsync( + IncidentHandleRequest body, UpdateGlobalIncidentHandleOptionalParameters parameters) { + // Check if unstable operation is enabled + String operationId = "updateGlobalIncidentHandle"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'body' when calling updateGlobalIncidentHandle")); + return result; + } + String include = parameters.include; + // create path and map variables + String localVarPath = "/api/v2/incidents/config/global/incident-handles"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "include", include)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.IncidentsApi.updateGlobalIncidentHandle", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PUT", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update global incident settings. + * + *

See {@link #updateGlobalIncidentSettingsWithHttpInfo}. + * + * @param body (required) + * @return GlobalIncidentSettingsResponse + * @throws ApiException if fails to make API call + */ + public GlobalIncidentSettingsResponse updateGlobalIncidentSettings( + GlobalIncidentSettingsRequest body) throws ApiException { + return updateGlobalIncidentSettingsWithHttpInfo(body).getData(); + } + + /** + * Update global incident settings. + * + *

See {@link #updateGlobalIncidentSettingsWithHttpInfoAsync}. + * + * @param body (required) + * @return CompletableFuture<GlobalIncidentSettingsResponse> + */ + public CompletableFuture updateGlobalIncidentSettingsAsync( + GlobalIncidentSettingsRequest body) { + return updateGlobalIncidentSettingsWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Update global incident settings for the organization. + * + * @param body (required) + * @return ApiResponse<GlobalIncidentSettingsResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
429 Too many requests -
+ */ + public ApiResponse updateGlobalIncidentSettingsWithHttpInfo( + GlobalIncidentSettingsRequest body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "updateGlobalIncidentSettings"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling updateGlobalIncidentSettings"); + } + // create path and map variables + String localVarPath = "/api/v2/incidents/config/global/settings"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.IncidentsApi.updateGlobalIncidentSettings", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update global incident settings. + * + *

See {@link #updateGlobalIncidentSettingsWithHttpInfo}. + * + * @param body (required) + * @return CompletableFuture<ApiResponse<GlobalIncidentSettingsResponse>> + */ + public CompletableFuture> + updateGlobalIncidentSettingsWithHttpInfoAsync(GlobalIncidentSettingsRequest body) { + // Check if unstable operation is enabled + String operationId = "updateGlobalIncidentSettings"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'body' when calling updateGlobalIncidentSettings")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/incidents/config/global/settings"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.IncidentsApi.updateGlobalIncidentSettings", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + /** Manage optional parameters to updateIncident. */ public static class UpdateIncidentOptionalParameters { private List include; diff --git a/src/main/java/com/datadog/api/client/v2/model/GlobalIncidentSettingsAttributesRequest.java b/src/main/java/com/datadog/api/client/v2/model/GlobalIncidentSettingsAttributesRequest.java new file mode 100644 index 00000000000..1dc932ef2ad --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GlobalIncidentSettingsAttributesRequest.java @@ -0,0 +1,141 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Global incident settings attributes */ +@JsonPropertyOrder({GlobalIncidentSettingsAttributesRequest.JSON_PROPERTY_ANALYTICS_DASHBOARD_ID}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GlobalIncidentSettingsAttributesRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ANALYTICS_DASHBOARD_ID = "analytics_dashboard_id"; + private String analyticsDashboardId; + + public GlobalIncidentSettingsAttributesRequest analyticsDashboardId(String analyticsDashboardId) { + this.analyticsDashboardId = analyticsDashboardId; + return this; + } + + /** + * The analytics dashboard ID + * + * @return analyticsDashboardId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ANALYTICS_DASHBOARD_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAnalyticsDashboardId() { + return analyticsDashboardId; + } + + public void setAnalyticsDashboardId(String analyticsDashboardId) { + this.analyticsDashboardId = analyticsDashboardId; + } + + /** + * 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 GlobalIncidentSettingsAttributesRequest + */ + @JsonAnySetter + public GlobalIncidentSettingsAttributesRequest 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 GlobalIncidentSettingsAttributesRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GlobalIncidentSettingsAttributesRequest globalIncidentSettingsAttributesRequest = + (GlobalIncidentSettingsAttributesRequest) o; + return Objects.equals( + this.analyticsDashboardId, globalIncidentSettingsAttributesRequest.analyticsDashboardId) + && Objects.equals( + this.additionalProperties, + globalIncidentSettingsAttributesRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(analyticsDashboardId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GlobalIncidentSettingsAttributesRequest {\n"); + sb.append(" analyticsDashboardId: ") + .append(toIndentedString(analyticsDashboardId)) + .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/GlobalIncidentSettingsAttributesResponse.java b/src/main/java/com/datadog/api/client/v2/model/GlobalIncidentSettingsAttributesResponse.java new file mode 100644 index 00000000000..d6a87628ef6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GlobalIncidentSettingsAttributesResponse.java @@ -0,0 +1,211 @@ +/* + * 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; + +/** Global incident settings attributes */ +@JsonPropertyOrder({ + GlobalIncidentSettingsAttributesResponse.JSON_PROPERTY_ANALYTICS_DASHBOARD_ID, + GlobalIncidentSettingsAttributesResponse.JSON_PROPERTY_CREATED, + GlobalIncidentSettingsAttributesResponse.JSON_PROPERTY_MODIFIED +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GlobalIncidentSettingsAttributesResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ANALYTICS_DASHBOARD_ID = "analytics_dashboard_id"; + private String analyticsDashboardId; + + public static final String JSON_PROPERTY_CREATED = "created"; + private OffsetDateTime created; + + public static final String JSON_PROPERTY_MODIFIED = "modified"; + private OffsetDateTime modified; + + public GlobalIncidentSettingsAttributesResponse() {} + + @JsonCreator + public GlobalIncidentSettingsAttributesResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_ANALYTICS_DASHBOARD_ID) + String analyticsDashboardId, + @JsonProperty(required = true, value = JSON_PROPERTY_CREATED) OffsetDateTime created, + @JsonProperty(required = true, value = JSON_PROPERTY_MODIFIED) OffsetDateTime modified) { + this.analyticsDashboardId = analyticsDashboardId; + this.created = created; + this.modified = modified; + } + + public GlobalIncidentSettingsAttributesResponse analyticsDashboardId( + String analyticsDashboardId) { + this.analyticsDashboardId = analyticsDashboardId; + return this; + } + + /** + * The analytics dashboard ID + * + * @return analyticsDashboardId + */ + @JsonProperty(JSON_PROPERTY_ANALYTICS_DASHBOARD_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getAnalyticsDashboardId() { + return analyticsDashboardId; + } + + public void setAnalyticsDashboardId(String analyticsDashboardId) { + this.analyticsDashboardId = analyticsDashboardId; + } + + public GlobalIncidentSettingsAttributesResponse created(OffsetDateTime created) { + this.created = created; + return this; + } + + /** + * Timestamp when the settings were created + * + * @return created + */ + @JsonProperty(JSON_PROPERTY_CREATED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getCreated() { + return created; + } + + public void setCreated(OffsetDateTime created) { + this.created = created; + } + + public GlobalIncidentSettingsAttributesResponse modified(OffsetDateTime modified) { + this.modified = modified; + return this; + } + + /** + * Timestamp when the settings were last modified + * + * @return modified + */ + @JsonProperty(JSON_PROPERTY_MODIFIED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getModified() { + return modified; + } + + public void setModified(OffsetDateTime modified) { + this.modified = modified; + } + + /** + * 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 GlobalIncidentSettingsAttributesResponse + */ + @JsonAnySetter + public GlobalIncidentSettingsAttributesResponse 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 GlobalIncidentSettingsAttributesResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GlobalIncidentSettingsAttributesResponse globalIncidentSettingsAttributesResponse = + (GlobalIncidentSettingsAttributesResponse) o; + return Objects.equals( + this.analyticsDashboardId, + globalIncidentSettingsAttributesResponse.analyticsDashboardId) + && Objects.equals(this.created, globalIncidentSettingsAttributesResponse.created) + && Objects.equals(this.modified, globalIncidentSettingsAttributesResponse.modified) + && Objects.equals( + this.additionalProperties, + globalIncidentSettingsAttributesResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(analyticsDashboardId, created, modified, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GlobalIncidentSettingsAttributesResponse {\n"); + sb.append(" analyticsDashboardId: ") + .append(toIndentedString(analyticsDashboardId)) + .append("\n"); + sb.append(" created: ").append(toIndentedString(created)).append("\n"); + sb.append(" modified: ").append(toIndentedString(modified)).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/GlobalIncidentSettingsDataRequest.java b/src/main/java/com/datadog/api/client/v2/model/GlobalIncidentSettingsDataRequest.java new file mode 100644 index 00000000000..b136dcc6c39 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GlobalIncidentSettingsDataRequest.java @@ -0,0 +1,181 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** */ +@JsonPropertyOrder({ + GlobalIncidentSettingsDataRequest.JSON_PROPERTY_ATTRIBUTES, + GlobalIncidentSettingsDataRequest.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GlobalIncidentSettingsDataRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private GlobalIncidentSettingsAttributesRequest attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private GlobalIncidentSettingsType type; + + public GlobalIncidentSettingsDataRequest() {} + + @JsonCreator + public GlobalIncidentSettingsDataRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) GlobalIncidentSettingsType type) { + this.type = type; + this.unparsed |= !type.isValid(); + } + + public GlobalIncidentSettingsDataRequest attributes( + GlobalIncidentSettingsAttributesRequest attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Global incident settings attributes + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public GlobalIncidentSettingsAttributesRequest getAttributes() { + return attributes; + } + + public void setAttributes(GlobalIncidentSettingsAttributesRequest attributes) { + this.attributes = attributes; + } + + public GlobalIncidentSettingsDataRequest type(GlobalIncidentSettingsType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Global incident settings resource type + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GlobalIncidentSettingsType getType() { + return type; + } + + public void setType(GlobalIncidentSettingsType 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 GlobalIncidentSettingsDataRequest + */ + @JsonAnySetter + public GlobalIncidentSettingsDataRequest 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 GlobalIncidentSettingsDataRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GlobalIncidentSettingsDataRequest globalIncidentSettingsDataRequest = + (GlobalIncidentSettingsDataRequest) o; + return Objects.equals(this.attributes, globalIncidentSettingsDataRequest.attributes) + && Objects.equals(this.type, globalIncidentSettingsDataRequest.type) + && Objects.equals( + this.additionalProperties, globalIncidentSettingsDataRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GlobalIncidentSettingsDataRequest {\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/GlobalIncidentSettingsDataResponse.java b/src/main/java/com/datadog/api/client/v2/model/GlobalIncidentSettingsDataResponse.java new file mode 100644 index 00000000000..34c32fe2a87 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GlobalIncidentSettingsDataResponse.java @@ -0,0 +1,212 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** */ +@JsonPropertyOrder({ + GlobalIncidentSettingsDataResponse.JSON_PROPERTY_ATTRIBUTES, + GlobalIncidentSettingsDataResponse.JSON_PROPERTY_ID, + GlobalIncidentSettingsDataResponse.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GlobalIncidentSettingsDataResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private GlobalIncidentSettingsAttributesResponse attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private GlobalIncidentSettingsType type; + + public GlobalIncidentSettingsDataResponse() {} + + @JsonCreator + public GlobalIncidentSettingsDataResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + GlobalIncidentSettingsAttributesResponse attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) GlobalIncidentSettingsType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public GlobalIncidentSettingsDataResponse attributes( + GlobalIncidentSettingsAttributesResponse attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Global incident settings attributes + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GlobalIncidentSettingsAttributesResponse getAttributes() { + return attributes; + } + + public void setAttributes(GlobalIncidentSettingsAttributesResponse attributes) { + this.attributes = attributes; + } + + public GlobalIncidentSettingsDataResponse id(String id) { + this.id = id; + return this; + } + + /** + * The unique identifier for the global incident settings + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public GlobalIncidentSettingsDataResponse type(GlobalIncidentSettingsType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Global incident settings resource type + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GlobalIncidentSettingsType getType() { + return type; + } + + public void setType(GlobalIncidentSettingsType 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 GlobalIncidentSettingsDataResponse + */ + @JsonAnySetter + public GlobalIncidentSettingsDataResponse 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 GlobalIncidentSettingsDataResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GlobalIncidentSettingsDataResponse globalIncidentSettingsDataResponse = + (GlobalIncidentSettingsDataResponse) o; + return Objects.equals(this.attributes, globalIncidentSettingsDataResponse.attributes) + && Objects.equals(this.id, globalIncidentSettingsDataResponse.id) + && Objects.equals(this.type, globalIncidentSettingsDataResponse.type) + && Objects.equals( + this.additionalProperties, globalIncidentSettingsDataResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GlobalIncidentSettingsDataResponse {\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/GlobalIncidentSettingsRequest.java b/src/main/java/com/datadog/api/client/v2/model/GlobalIncidentSettingsRequest.java new file mode 100644 index 00000000000..7a1b00618fa --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GlobalIncidentSettingsRequest.java @@ -0,0 +1,147 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** */ +@JsonPropertyOrder({GlobalIncidentSettingsRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GlobalIncidentSettingsRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private GlobalIncidentSettingsDataRequest data; + + public GlobalIncidentSettingsRequest() {} + + @JsonCreator + public GlobalIncidentSettingsRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + GlobalIncidentSettingsDataRequest data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public GlobalIncidentSettingsRequest data(GlobalIncidentSettingsDataRequest data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Getdata + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GlobalIncidentSettingsDataRequest getData() { + return data; + } + + public void setData(GlobalIncidentSettingsDataRequest 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 GlobalIncidentSettingsRequest + */ + @JsonAnySetter + public GlobalIncidentSettingsRequest 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 GlobalIncidentSettingsRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GlobalIncidentSettingsRequest globalIncidentSettingsRequest = (GlobalIncidentSettingsRequest) o; + return Objects.equals(this.data, globalIncidentSettingsRequest.data) + && Objects.equals( + this.additionalProperties, globalIncidentSettingsRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GlobalIncidentSettingsRequest {\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/GlobalIncidentSettingsResponse.java b/src/main/java/com/datadog/api/client/v2/model/GlobalIncidentSettingsResponse.java new file mode 100644 index 00000000000..fa5890b5181 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GlobalIncidentSettingsResponse.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; + +/** */ +@JsonPropertyOrder({GlobalIncidentSettingsResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GlobalIncidentSettingsResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private GlobalIncidentSettingsDataResponse data; + + public GlobalIncidentSettingsResponse() {} + + @JsonCreator + public GlobalIncidentSettingsResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + GlobalIncidentSettingsDataResponse data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public GlobalIncidentSettingsResponse data(GlobalIncidentSettingsDataResponse data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Getdata + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GlobalIncidentSettingsDataResponse getData() { + return data; + } + + public void setData(GlobalIncidentSettingsDataResponse 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 GlobalIncidentSettingsResponse + */ + @JsonAnySetter + public GlobalIncidentSettingsResponse 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 GlobalIncidentSettingsResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GlobalIncidentSettingsResponse globalIncidentSettingsResponse = + (GlobalIncidentSettingsResponse) o; + return Objects.equals(this.data, globalIncidentSettingsResponse.data) + && Objects.equals( + this.additionalProperties, globalIncidentSettingsResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GlobalIncidentSettingsResponse {\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/GlobalIncidentSettingsType.java b/src/main/java/com/datadog/api/client/v2/model/GlobalIncidentSettingsType.java new file mode 100644 index 00000000000..738f149b948 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GlobalIncidentSettingsType.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; + +/** Global incident settings resource type */ +@JsonSerialize(using = GlobalIncidentSettingsType.GlobalIncidentSettingsTypeSerializer.class) +public class GlobalIncidentSettingsType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("incidents_global_settings")); + + public static final GlobalIncidentSettingsType INCIDENTS_GLOBAL_SETTINGS = + new GlobalIncidentSettingsType("incidents_global_settings"); + + GlobalIncidentSettingsType(String value) { + super(value, allowedValues); + } + + public static class GlobalIncidentSettingsTypeSerializer + extends StdSerializer { + public GlobalIncidentSettingsTypeSerializer(Class t) { + super(t); + } + + public GlobalIncidentSettingsTypeSerializer() { + this(null); + } + + @Override + public void serialize( + GlobalIncidentSettingsType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static GlobalIncidentSettingsType fromValue(String value) { + return new GlobalIncidentSettingsType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IncidentHandleAttributesFields.java b/src/main/java/com/datadog/api/client/v2/model/IncidentHandleAttributesFields.java new file mode 100644 index 00000000000..1ae1033a549 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentHandleAttributesFields.java @@ -0,0 +1,147 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.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; + +/** Dynamic fields associated with the handle */ +@JsonPropertyOrder({IncidentHandleAttributesFields.JSON_PROPERTY_SEVERITY}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IncidentHandleAttributesFields { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_SEVERITY = "severity"; + private List severity = null; + + public IncidentHandleAttributesFields severity(List severity) { + this.severity = severity; + return this; + } + + public IncidentHandleAttributesFields addSeverityItem(String severityItem) { + if (this.severity == null) { + this.severity = new ArrayList<>(); + } + this.severity.add(severityItem); + return this; + } + + /** + * Severity levels associated with the handle + * + * @return severity + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SEVERITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSeverity() { + return severity; + } + + public void setSeverity(List severity) { + this.severity = severity; + } + + /** + * 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 IncidentHandleAttributesFields + */ + @JsonAnySetter + public IncidentHandleAttributesFields 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 IncidentHandleAttributesFields object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IncidentHandleAttributesFields incidentHandleAttributesFields = + (IncidentHandleAttributesFields) o; + return Objects.equals(this.severity, incidentHandleAttributesFields.severity) + && Objects.equals( + this.additionalProperties, incidentHandleAttributesFields.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(severity, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IncidentHandleAttributesFields {\n"); + sb.append(" severity: ").append(toIndentedString(severity)).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/IncidentHandleAttributesRequest.java b/src/main/java/com/datadog/api/client/v2/model/IncidentHandleAttributesRequest.java new file mode 100644 index 00000000000..72589b5b5f6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentHandleAttributesRequest.java @@ -0,0 +1,175 @@ +/* + * 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; + +/** Incident handle attributes for requests */ +@JsonPropertyOrder({ + IncidentHandleAttributesRequest.JSON_PROPERTY_FIELDS, + IncidentHandleAttributesRequest.JSON_PROPERTY_NAME +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IncidentHandleAttributesRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FIELDS = "fields"; + private IncidentHandleAttributesFields fields; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public IncidentHandleAttributesRequest() {} + + @JsonCreator + public IncidentHandleAttributesRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name) { + this.name = name; + } + + public IncidentHandleAttributesRequest fields(IncidentHandleAttributesFields fields) { + this.fields = fields; + this.unparsed |= fields.unparsed; + return this; + } + + /** + * Dynamic fields associated with the handle + * + * @return fields + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IncidentHandleAttributesFields getFields() { + return fields; + } + + public void setFields(IncidentHandleAttributesFields fields) { + this.fields = fields; + } + + public IncidentHandleAttributesRequest name(String name) { + this.name = name; + return this; + } + + /** + * The handle name + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return IncidentHandleAttributesRequest + */ + @JsonAnySetter + public IncidentHandleAttributesRequest 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 IncidentHandleAttributesRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IncidentHandleAttributesRequest incidentHandleAttributesRequest = + (IncidentHandleAttributesRequest) o; + return Objects.equals(this.fields, incidentHandleAttributesRequest.fields) + && Objects.equals(this.name, incidentHandleAttributesRequest.name) + && Objects.equals( + this.additionalProperties, incidentHandleAttributesRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(fields, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IncidentHandleAttributesRequest {\n"); + sb.append(" fields: ").append(toIndentedString(fields)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IncidentHandleAttributesResponse.java b/src/main/java/com/datadog/api/client/v2/model/IncidentHandleAttributesResponse.java new file mode 100644 index 00000000000..f1262358880 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentHandleAttributesResponse.java @@ -0,0 +1,235 @@ +/* + * 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; + +/** Incident handle attributes for responses */ +@JsonPropertyOrder({ + IncidentHandleAttributesResponse.JSON_PROPERTY_CREATED_AT, + IncidentHandleAttributesResponse.JSON_PROPERTY_FIELDS, + IncidentHandleAttributesResponse.JSON_PROPERTY_MODIFIED_AT, + IncidentHandleAttributesResponse.JSON_PROPERTY_NAME +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IncidentHandleAttributesResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + private OffsetDateTime createdAt; + + public static final String JSON_PROPERTY_FIELDS = "fields"; + private IncidentHandleAttributesFields fields; + + public static final String JSON_PROPERTY_MODIFIED_AT = "modified_at"; + private OffsetDateTime modifiedAt; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public IncidentHandleAttributesResponse() {} + + @JsonCreator + public IncidentHandleAttributesResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_CREATED_AT) OffsetDateTime createdAt, + @JsonProperty(required = true, value = JSON_PROPERTY_FIELDS) + IncidentHandleAttributesFields fields, + @JsonProperty(required = true, value = JSON_PROPERTY_MODIFIED_AT) OffsetDateTime modifiedAt, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name) { + this.createdAt = createdAt; + this.fields = fields; + this.unparsed |= fields.unparsed; + this.modifiedAt = modifiedAt; + this.name = name; + } + + public IncidentHandleAttributesResponse createdAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Timestamp when the handle 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 IncidentHandleAttributesResponse fields(IncidentHandleAttributesFields fields) { + this.fields = fields; + this.unparsed |= fields.unparsed; + return this; + } + + /** + * Dynamic fields associated with the handle + * + * @return fields + */ + @JsonProperty(JSON_PROPERTY_FIELDS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IncidentHandleAttributesFields getFields() { + return fields; + } + + public void setFields(IncidentHandleAttributesFields fields) { + this.fields = fields; + } + + public IncidentHandleAttributesResponse modifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + /** + * Timestamp when the handle 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 IncidentHandleAttributesResponse name(String name) { + this.name = name; + return this; + } + + /** + * The handle name + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return IncidentHandleAttributesResponse + */ + @JsonAnySetter + public IncidentHandleAttributesResponse 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 IncidentHandleAttributesResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IncidentHandleAttributesResponse incidentHandleAttributesResponse = + (IncidentHandleAttributesResponse) o; + return Objects.equals(this.createdAt, incidentHandleAttributesResponse.createdAt) + && Objects.equals(this.fields, incidentHandleAttributesResponse.fields) + && Objects.equals(this.modifiedAt, incidentHandleAttributesResponse.modifiedAt) + && Objects.equals(this.name, incidentHandleAttributesResponse.name) + && Objects.equals( + this.additionalProperties, incidentHandleAttributesResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(createdAt, fields, modifiedAt, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IncidentHandleAttributesResponse {\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" fields: ").append(toIndentedString(fields)).append("\n"); + sb.append(" modifiedAt: ").append(toIndentedString(modifiedAt)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IncidentHandleDataRequest.java b/src/main/java/com/datadog/api/client/v2/model/IncidentHandleDataRequest.java new file mode 100644 index 00000000000..75a5dd3e5c4 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentHandleDataRequest.java @@ -0,0 +1,249 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; + +/** */ +@JsonPropertyOrder({ + IncidentHandleDataRequest.JSON_PROPERTY_ATTRIBUTES, + IncidentHandleDataRequest.JSON_PROPERTY_ID, + IncidentHandleDataRequest.JSON_PROPERTY_RELATIONSHIPS, + IncidentHandleDataRequest.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IncidentHandleDataRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private IncidentHandleAttributesRequest attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private JsonNullable relationships = + JsonNullable.undefined(); + + public static final String JSON_PROPERTY_TYPE = "type"; + private IncidentHandleType type; + + public IncidentHandleDataRequest() {} + + @JsonCreator + public IncidentHandleDataRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + IncidentHandleAttributesRequest attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) IncidentHandleType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public IncidentHandleDataRequest attributes(IncidentHandleAttributesRequest attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Incident handle attributes for requests + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IncidentHandleAttributesRequest getAttributes() { + return attributes; + } + + public void setAttributes(IncidentHandleAttributesRequest attributes) { + this.attributes = attributes; + } + + public IncidentHandleDataRequest id(String id) { + this.id = id; + return this; + } + + /** + * The ID of the incident handle (required for PUT requests) + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public IncidentHandleDataRequest relationships(IncidentHandleRelationshipsRequest relationships) { + this.relationships = JsonNullable.of(relationships); + return this; + } + + /** + * Getrelationships + * + * @return relationships + */ + @jakarta.annotation.Nullable + @JsonIgnore + public IncidentHandleRelationshipsRequest getRelationships() { + return relationships.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getRelationships_JsonNullable() { + return relationships; + } + + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + public void setRelationships_JsonNullable( + JsonNullable relationships) { + this.relationships = relationships; + } + + public void setRelationships(IncidentHandleRelationshipsRequest relationships) { + this.relationships = JsonNullable.of(relationships); + } + + public IncidentHandleDataRequest type(IncidentHandleType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Incident handle resource type + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IncidentHandleType getType() { + return type; + } + + public void setType(IncidentHandleType 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 IncidentHandleDataRequest + */ + @JsonAnySetter + public IncidentHandleDataRequest 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 IncidentHandleDataRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IncidentHandleDataRequest incidentHandleDataRequest = (IncidentHandleDataRequest) o; + return Objects.equals(this.attributes, incidentHandleDataRequest.attributes) + && Objects.equals(this.id, incidentHandleDataRequest.id) + && Objects.equals(this.relationships, incidentHandleDataRequest.relationships) + && Objects.equals(this.type, incidentHandleDataRequest.type) + && Objects.equals( + this.additionalProperties, incidentHandleDataRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, relationships, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IncidentHandleDataRequest {\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/IncidentHandleDataResponse.java b/src/main/java/com/datadog/api/client/v2/model/IncidentHandleDataResponse.java new file mode 100644 index 00000000000..bb50440f781 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentHandleDataResponse.java @@ -0,0 +1,250 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; + +/** */ +@JsonPropertyOrder({ + IncidentHandleDataResponse.JSON_PROPERTY_ATTRIBUTES, + IncidentHandleDataResponse.JSON_PROPERTY_ID, + IncidentHandleDataResponse.JSON_PROPERTY_RELATIONSHIPS, + IncidentHandleDataResponse.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IncidentHandleDataResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private IncidentHandleAttributesResponse attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private JsonNullable relationships = + JsonNullable.undefined(); + + public static final String JSON_PROPERTY_TYPE = "type"; + private IncidentHandleType type; + + public IncidentHandleDataResponse() {} + + @JsonCreator + public IncidentHandleDataResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + IncidentHandleAttributesResponse attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) IncidentHandleType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public IncidentHandleDataResponse attributes(IncidentHandleAttributesResponse attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Incident handle attributes for responses + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IncidentHandleAttributesResponse getAttributes() { + return attributes; + } + + public void setAttributes(IncidentHandleAttributesResponse attributes) { + this.attributes = attributes; + } + + public IncidentHandleDataResponse id(String id) { + this.id = id; + return this; + } + + /** + * The ID of the incident handle + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public IncidentHandleDataResponse relationships(IncidentHandleRelationships relationships) { + this.relationships = JsonNullable.of(relationships); + return this; + } + + /** + * Getrelationships + * + * @return relationships + */ + @jakarta.annotation.Nullable + @JsonIgnore + public IncidentHandleRelationships getRelationships() { + return relationships.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getRelationships_JsonNullable() { + return relationships; + } + + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + public void setRelationships_JsonNullable( + JsonNullable relationships) { + this.relationships = relationships; + } + + public void setRelationships(IncidentHandleRelationships relationships) { + this.relationships = JsonNullable.of(relationships); + } + + public IncidentHandleDataResponse type(IncidentHandleType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Incident handle resource type + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IncidentHandleType getType() { + return type; + } + + public void setType(IncidentHandleType 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 IncidentHandleDataResponse + */ + @JsonAnySetter + public IncidentHandleDataResponse 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 IncidentHandleDataResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IncidentHandleDataResponse incidentHandleDataResponse = (IncidentHandleDataResponse) o; + return Objects.equals(this.attributes, incidentHandleDataResponse.attributes) + && Objects.equals(this.id, incidentHandleDataResponse.id) + && Objects.equals(this.relationships, incidentHandleDataResponse.relationships) + && Objects.equals(this.type, incidentHandleDataResponse.type) + && Objects.equals( + this.additionalProperties, incidentHandleDataResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, relationships, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IncidentHandleDataResponse {\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/IncidentHandleIncludedItemResponse.java b/src/main/java/com/datadog/api/client/v2/model/IncidentHandleIncludedItemResponse.java new file mode 100644 index 00000000000..40d4044d575 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentHandleIncludedItemResponse.java @@ -0,0 +1,218 @@ +/* + * 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.AbstractOpenApiSchema; +import com.datadog.api.client.JSON; +import com.datadog.api.client.UnparsedObject; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.JsonToken; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.MapperFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import jakarta.ws.rs.core.GenericType; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; + +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +@JsonDeserialize( + using = IncidentHandleIncludedItemResponse.IncidentHandleIncludedItemResponseDeserializer.class) +@JsonSerialize( + using = IncidentHandleIncludedItemResponse.IncidentHandleIncludedItemResponseSerializer.class) +public class IncidentHandleIncludedItemResponse extends AbstractOpenApiSchema { + private static final Logger log = + Logger.getLogger(IncidentHandleIncludedItemResponse.class.getName()); + + @JsonIgnore public boolean unparsed = false; + + public static class IncidentHandleIncludedItemResponseSerializer + extends StdSerializer { + public IncidentHandleIncludedItemResponseSerializer( + Class t) { + super(t); + } + + public IncidentHandleIncludedItemResponseSerializer() { + this(null); + } + + @Override + public void serialize( + IncidentHandleIncludedItemResponse value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class IncidentHandleIncludedItemResponseDeserializer + extends StdDeserializer { + public IncidentHandleIncludedItemResponseDeserializer() { + this(IncidentHandleIncludedItemResponse.class); + } + + public IncidentHandleIncludedItemResponseDeserializer(Class vc) { + super(vc); + } + + @Override + public IncidentHandleIncludedItemResponse deserialize( + JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { + JsonNode tree = jp.readValueAsTree(); + Object deserialized = null; + Object tmp = null; + boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); + int match = 0; + JsonToken token = tree.traverse(jp.getCodec()).nextToken(); + // deserialize IncidentUserData + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (IncidentUserData.class.equals(Integer.class) + || IncidentUserData.class.equals(Long.class) + || IncidentUserData.class.equals(Float.class) + || IncidentUserData.class.equals(Double.class) + || IncidentUserData.class.equals(Boolean.class) + || IncidentUserData.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((IncidentUserData.class.equals(Integer.class) + || IncidentUserData.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((IncidentUserData.class.equals(Float.class) + || IncidentUserData.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (IncidentUserData.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (IncidentUserData.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(IncidentUserData.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((IncidentUserData) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'IncidentUserData'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'IncidentUserData'", e); + } + + IncidentHandleIncludedItemResponse ret = new IncidentHandleIncludedItemResponse(); + if (match == 1) { + ret.setActualInstance(deserialized); + } else { + Map res = + new ObjectMapper() + .readValue( + tree.traverse(jp.getCodec()).readValueAsTree().toString(), + new TypeReference>() {}); + ret.setActualInstance(new UnparsedObject(res)); + } + return ret; + } + + /** Handle deserialization of the 'null' value. */ + @Override + public IncidentHandleIncludedItemResponse getNullValue(DeserializationContext ctxt) + throws JsonMappingException { + throw new JsonMappingException( + ctxt.getParser(), "IncidentHandleIncludedItemResponse cannot be null"); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public IncidentHandleIncludedItemResponse() { + super("oneOf", Boolean.FALSE); + } + + public IncidentHandleIncludedItemResponse(IncidentUserData o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("IncidentUserData", new GenericType() {}); + JSON.registerDescendants( + IncidentHandleIncludedItemResponse.class, Collections.unmodifiableMap(schemas)); + } + + @Override + public Map getSchemas() { + return IncidentHandleIncludedItemResponse.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: IncidentUserData + * + *

It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be a + * composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf(IncidentUserData.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(UnparsedObject.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + throw new RuntimeException("Invalid instance type. Must be IncidentUserData"); + } + + /** + * Get the actual instance, which can be the following: IncidentUserData + * + * @return The actual instance (IncidentUserData) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `IncidentUserData`. If the actual instance is not + * `IncidentUserData`, the ClassCastException will be thrown. + * + * @return The actual instance of `IncidentUserData` + * @throws ClassCastException if the instance is not `IncidentUserData` + */ + public IncidentUserData getIncidentUserData() throws ClassCastException { + return (IncidentUserData) super.getActualInstance(); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IncidentHandleRelationship.java b/src/main/java/com/datadog/api/client/v2/model/IncidentHandleRelationship.java new file mode 100644 index 00000000000..7eb438086c3 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentHandleRelationship.java @@ -0,0 +1,147 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** */ +@JsonPropertyOrder({IncidentHandleRelationship.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IncidentHandleRelationship { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private IncidentHandleRelationshipData data; + + public IncidentHandleRelationship() {} + + @JsonCreator + public IncidentHandleRelationship( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + IncidentHandleRelationshipData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public IncidentHandleRelationship data(IncidentHandleRelationshipData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Getdata + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IncidentHandleRelationshipData getData() { + return data; + } + + public void setData(IncidentHandleRelationshipData 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 IncidentHandleRelationship + */ + @JsonAnySetter + public IncidentHandleRelationship 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 IncidentHandleRelationship object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IncidentHandleRelationship incidentHandleRelationship = (IncidentHandleRelationship) o; + return Objects.equals(this.data, incidentHandleRelationship.data) + && Objects.equals( + this.additionalProperties, incidentHandleRelationship.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IncidentHandleRelationship {\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/IncidentHandleRelationshipData.java b/src/main/java/com/datadog/api/client/v2/model/IncidentHandleRelationshipData.java new file mode 100644 index 00000000000..718a5185eea --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentHandleRelationshipData.java @@ -0,0 +1,175 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** */ +@JsonPropertyOrder({ + IncidentHandleRelationshipData.JSON_PROPERTY_ID, + IncidentHandleRelationshipData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IncidentHandleRelationshipData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public IncidentHandleRelationshipData() {} + + @JsonCreator + public IncidentHandleRelationshipData( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) String type) { + this.id = id; + this.type = type; + } + + public IncidentHandleRelationshipData id(String id) { + this.id = id; + return this; + } + + /** + * The ID of the related resource + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public IncidentHandleRelationshipData 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 IncidentHandleRelationshipData + */ + @JsonAnySetter + public IncidentHandleRelationshipData 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 IncidentHandleRelationshipData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IncidentHandleRelationshipData incidentHandleRelationshipData = + (IncidentHandleRelationshipData) o; + return Objects.equals(this.id, incidentHandleRelationshipData.id) + && Objects.equals(this.type, incidentHandleRelationshipData.type) + && Objects.equals( + this.additionalProperties, incidentHandleRelationshipData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IncidentHandleRelationshipData {\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/IncidentHandleRelationships.java b/src/main/java/com/datadog/api/client/v2/model/IncidentHandleRelationships.java new file mode 100644 index 00000000000..80d79ca8aa6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentHandleRelationships.java @@ -0,0 +1,241 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** */ +@JsonPropertyOrder({ + IncidentHandleRelationships.JSON_PROPERTY_COMMANDER_USER, + IncidentHandleRelationships.JSON_PROPERTY_CREATED_BY_USER, + IncidentHandleRelationships.JSON_PROPERTY_INCIDENT_TYPE, + IncidentHandleRelationships.JSON_PROPERTY_LAST_MODIFIED_BY_USER +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IncidentHandleRelationships { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_COMMANDER_USER = "commander_user"; + private IncidentHandleRelationship commanderUser; + + public static final String JSON_PROPERTY_CREATED_BY_USER = "created_by_user"; + private IncidentHandleRelationship createdByUser; + + public static final String JSON_PROPERTY_INCIDENT_TYPE = "incident_type"; + private IncidentHandleRelationship incidentType; + + public static final String JSON_PROPERTY_LAST_MODIFIED_BY_USER = "last_modified_by_user"; + private IncidentHandleRelationship lastModifiedByUser; + + public IncidentHandleRelationships() {} + + @JsonCreator + public IncidentHandleRelationships( + @JsonProperty(required = true, value = JSON_PROPERTY_CREATED_BY_USER) + IncidentHandleRelationship createdByUser, + @JsonProperty(required = true, value = JSON_PROPERTY_INCIDENT_TYPE) + IncidentHandleRelationship incidentType, + @JsonProperty(required = true, value = JSON_PROPERTY_LAST_MODIFIED_BY_USER) + IncidentHandleRelationship lastModifiedByUser) { + this.createdByUser = createdByUser; + this.unparsed |= createdByUser.unparsed; + this.incidentType = incidentType; + this.unparsed |= incidentType.unparsed; + this.lastModifiedByUser = lastModifiedByUser; + this.unparsed |= lastModifiedByUser.unparsed; + } + + public IncidentHandleRelationships commanderUser(IncidentHandleRelationship commanderUser) { + this.commanderUser = commanderUser; + this.unparsed |= commanderUser.unparsed; + return this; + } + + /** + * GetcommanderUser + * + * @return commanderUser + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COMMANDER_USER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IncidentHandleRelationship getCommanderUser() { + return commanderUser; + } + + public void setCommanderUser(IncidentHandleRelationship commanderUser) { + this.commanderUser = commanderUser; + } + + public IncidentHandleRelationships createdByUser(IncidentHandleRelationship createdByUser) { + this.createdByUser = createdByUser; + this.unparsed |= createdByUser.unparsed; + return this; + } + + /** + * GetcreatedByUser + * + * @return createdByUser + */ + @JsonProperty(JSON_PROPERTY_CREATED_BY_USER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IncidentHandleRelationship getCreatedByUser() { + return createdByUser; + } + + public void setCreatedByUser(IncidentHandleRelationship createdByUser) { + this.createdByUser = createdByUser; + } + + public IncidentHandleRelationships incidentType(IncidentHandleRelationship incidentType) { + this.incidentType = incidentType; + this.unparsed |= incidentType.unparsed; + return this; + } + + /** + * GetincidentType + * + * @return incidentType + */ + @JsonProperty(JSON_PROPERTY_INCIDENT_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IncidentHandleRelationship getIncidentType() { + return incidentType; + } + + public void setIncidentType(IncidentHandleRelationship incidentType) { + this.incidentType = incidentType; + } + + public IncidentHandleRelationships lastModifiedByUser( + IncidentHandleRelationship lastModifiedByUser) { + this.lastModifiedByUser = lastModifiedByUser; + this.unparsed |= lastModifiedByUser.unparsed; + return this; + } + + /** + * GetlastModifiedByUser + * + * @return lastModifiedByUser + */ + @JsonProperty(JSON_PROPERTY_LAST_MODIFIED_BY_USER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IncidentHandleRelationship getLastModifiedByUser() { + return lastModifiedByUser; + } + + public void setLastModifiedByUser(IncidentHandleRelationship 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 IncidentHandleRelationships + */ + @JsonAnySetter + public IncidentHandleRelationships 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 IncidentHandleRelationships object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IncidentHandleRelationships incidentHandleRelationships = (IncidentHandleRelationships) o; + return Objects.equals(this.commanderUser, incidentHandleRelationships.commanderUser) + && Objects.equals(this.createdByUser, incidentHandleRelationships.createdByUser) + && Objects.equals(this.incidentType, incidentHandleRelationships.incidentType) + && Objects.equals(this.lastModifiedByUser, incidentHandleRelationships.lastModifiedByUser) + && Objects.equals( + this.additionalProperties, incidentHandleRelationships.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + commanderUser, createdByUser, incidentType, lastModifiedByUser, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IncidentHandleRelationships {\n"); + sb.append(" commanderUser: ").append(toIndentedString(commanderUser)).append("\n"); + sb.append(" createdByUser: ").append(toIndentedString(createdByUser)).append("\n"); + sb.append(" incidentType: ").append(toIndentedString(incidentType)).append("\n"); + sb.append(" lastModifiedByUser: ").append(toIndentedString(lastModifiedByUser)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IncidentHandleRelationshipsRequest.java b/src/main/java/com/datadog/api/client/v2/model/IncidentHandleRelationshipsRequest.java new file mode 100644 index 00000000000..497eb5e2593 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentHandleRelationshipsRequest.java @@ -0,0 +1,179 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** */ +@JsonPropertyOrder({ + IncidentHandleRelationshipsRequest.JSON_PROPERTY_COMMANDER_USER, + IncidentHandleRelationshipsRequest.JSON_PROPERTY_INCIDENT_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IncidentHandleRelationshipsRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_COMMANDER_USER = "commander_user"; + private IncidentHandleRelationship commanderUser; + + public static final String JSON_PROPERTY_INCIDENT_TYPE = "incident_type"; + private IncidentHandleRelationship incidentType; + + public IncidentHandleRelationshipsRequest() {} + + @JsonCreator + public IncidentHandleRelationshipsRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_INCIDENT_TYPE) + IncidentHandleRelationship incidentType) { + this.incidentType = incidentType; + this.unparsed |= incidentType.unparsed; + } + + public IncidentHandleRelationshipsRequest commanderUser( + IncidentHandleRelationship commanderUser) { + this.commanderUser = commanderUser; + this.unparsed |= commanderUser.unparsed; + return this; + } + + /** + * GetcommanderUser + * + * @return commanderUser + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COMMANDER_USER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IncidentHandleRelationship getCommanderUser() { + return commanderUser; + } + + public void setCommanderUser(IncidentHandleRelationship commanderUser) { + this.commanderUser = commanderUser; + } + + public IncidentHandleRelationshipsRequest incidentType(IncidentHandleRelationship incidentType) { + this.incidentType = incidentType; + this.unparsed |= incidentType.unparsed; + return this; + } + + /** + * GetincidentType + * + * @return incidentType + */ + @JsonProperty(JSON_PROPERTY_INCIDENT_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IncidentHandleRelationship getIncidentType() { + return incidentType; + } + + public void setIncidentType(IncidentHandleRelationship incidentType) { + this.incidentType = incidentType; + } + + /** + * 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 IncidentHandleRelationshipsRequest + */ + @JsonAnySetter + public IncidentHandleRelationshipsRequest 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 IncidentHandleRelationshipsRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IncidentHandleRelationshipsRequest incidentHandleRelationshipsRequest = + (IncidentHandleRelationshipsRequest) o; + return Objects.equals(this.commanderUser, incidentHandleRelationshipsRequest.commanderUser) + && Objects.equals(this.incidentType, incidentHandleRelationshipsRequest.incidentType) + && Objects.equals( + this.additionalProperties, incidentHandleRelationshipsRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(commanderUser, incidentType, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IncidentHandleRelationshipsRequest {\n"); + sb.append(" commanderUser: ").append(toIndentedString(commanderUser)).append("\n"); + sb.append(" incidentType: ").append(toIndentedString(incidentType)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IncidentHandleRequest.java b/src/main/java/com/datadog/api/client/v2/model/IncidentHandleRequest.java new file mode 100644 index 00000000000..df8c64ccbd5 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentHandleRequest.java @@ -0,0 +1,145 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** */ +@JsonPropertyOrder({IncidentHandleRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IncidentHandleRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private IncidentHandleDataRequest data; + + public IncidentHandleRequest() {} + + @JsonCreator + public IncidentHandleRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) IncidentHandleDataRequest data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public IncidentHandleRequest data(IncidentHandleDataRequest data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Getdata + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IncidentHandleDataRequest getData() { + return data; + } + + public void setData(IncidentHandleDataRequest 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 IncidentHandleRequest + */ + @JsonAnySetter + public IncidentHandleRequest 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 IncidentHandleRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IncidentHandleRequest incidentHandleRequest = (IncidentHandleRequest) o; + return Objects.equals(this.data, incidentHandleRequest.data) + && Objects.equals(this.additionalProperties, incidentHandleRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IncidentHandleRequest {\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/IncidentHandleResponse.java b/src/main/java/com/datadog/api/client/v2/model/IncidentHandleResponse.java new file mode 100644 index 00000000000..59bf36d12b5 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentHandleResponse.java @@ -0,0 +1,188 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** */ +@JsonPropertyOrder({ + IncidentHandleResponse.JSON_PROPERTY_DATA, + IncidentHandleResponse.JSON_PROPERTY_INCLUDED +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IncidentHandleResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private IncidentHandleDataResponse data; + + public static final String JSON_PROPERTY_INCLUDED = "included"; + private List included = null; + + public IncidentHandleResponse() {} + + @JsonCreator + public IncidentHandleResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) IncidentHandleDataResponse data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public IncidentHandleResponse data(IncidentHandleDataResponse data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Getdata + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IncidentHandleDataResponse getData() { + return data; + } + + public void setData(IncidentHandleDataResponse data) { + this.data = data; + } + + public IncidentHandleResponse included(List included) { + this.included = included; + for (IncidentHandleIncludedItemResponse item : included) { + this.unparsed |= item.unparsed; + } + return this; + } + + public IncidentHandleResponse addIncludedItem(IncidentHandleIncludedItemResponse 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 IncidentHandleResponse + */ + @JsonAnySetter + public IncidentHandleResponse 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 IncidentHandleResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IncidentHandleResponse incidentHandleResponse = (IncidentHandleResponse) o; + return Objects.equals(this.data, incidentHandleResponse.data) + && Objects.equals(this.included, incidentHandleResponse.included) + && Objects.equals(this.additionalProperties, incidentHandleResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, included, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IncidentHandleResponse {\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/IncidentHandleType.java b/src/main/java/com/datadog/api/client/v2/model/IncidentHandleType.java new file mode 100644 index 00000000000..88d6068faf1 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentHandleType.java @@ -0,0 +1,55 @@ +/* + * 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; + +/** Incident handle resource type */ +@JsonSerialize(using = IncidentHandleType.IncidentHandleTypeSerializer.class) +public class IncidentHandleType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("incidents_handles")); + + public static final IncidentHandleType INCIDENTS_HANDLES = + new IncidentHandleType("incidents_handles"); + + IncidentHandleType(String value) { + super(value, allowedValues); + } + + public static class IncidentHandleTypeSerializer extends StdSerializer { + public IncidentHandleTypeSerializer(Class t) { + super(t); + } + + public IncidentHandleTypeSerializer() { + this(null); + } + + @Override + public void serialize(IncidentHandleType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static IncidentHandleType fromValue(String value) { + return new IncidentHandleType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IncidentHandlesResponse.java b/src/main/java/com/datadog/api/client/v2/model/IncidentHandlesResponse.java new file mode 100644 index 00000000000..288ad2f5257 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentHandlesResponse.java @@ -0,0 +1,196 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** */ +@JsonPropertyOrder({ + IncidentHandlesResponse.JSON_PROPERTY_DATA, + IncidentHandlesResponse.JSON_PROPERTY_INCLUDED +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IncidentHandlesResponse { + @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 IncidentHandlesResponse() {} + + @JsonCreator + public IncidentHandlesResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + List data) { + this.data = data; + } + + public IncidentHandlesResponse data(List data) { + this.data = data; + for (IncidentHandleDataResponse item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public IncidentHandlesResponse addDataItem(IncidentHandleDataResponse dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * Getdata + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public IncidentHandlesResponse included(List included) { + this.included = included; + for (IncidentHandleIncludedItemResponse item : included) { + this.unparsed |= item.unparsed; + } + return this; + } + + public IncidentHandlesResponse addIncludedItem(IncidentHandleIncludedItemResponse 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 IncidentHandlesResponse + */ + @JsonAnySetter + public IncidentHandlesResponse 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 IncidentHandlesResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IncidentHandlesResponse incidentHandlesResponse = (IncidentHandlesResponse) o; + return Objects.equals(this.data, incidentHandlesResponse.data) + && Objects.equals(this.included, incidentHandlesResponse.included) + && Objects.equals(this.additionalProperties, incidentHandlesResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, included, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IncidentHandlesResponse {\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/test/resources/com/datadog/api/client/v2/api/incidents.feature b/src/test/resources/com/datadog/api/client/v2/api/incidents.feature index 23e5882fa75..180a5fe3b53 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 @@ -186,6 +186,22 @@ Feature: Incidents When the request is sent Then the response status is 404 Not Found + @generated @skip @team:DataDog/incident-app + Scenario: Create global incident handle returns "Bad Request" response + Given operation "CreateGlobalIncidentHandle" enabled + And new "CreateGlobalIncidentHandle" request + And body with value {"data": {"attributes": {"fields": {"severity": ["SEV-1"]}, "name": "@incident-sev-1"}, "id": "b2494081-cdf0-4205-b366-4e1dd4fdf0bf", "relationships": {"commander_user": {"data": {"id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40", "type": "incident_types"}}, "incident_type": {"data": {"id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40", "type": "incident_types"}}}, "type": "incidents_handles"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/incident-app + Scenario: Create global incident handle returns "Created" response + Given operation "CreateGlobalIncidentHandle" enabled + And new "CreateGlobalIncidentHandle" request + And body with value {"data": {"attributes": {"fields": {"severity": ["SEV-1"]}, "name": "@incident-sev-1"}, "id": "b2494081-cdf0-4205-b366-4e1dd4fdf0bf", "relationships": {"commander_user": {"data": {"id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40", "type": "incident_types"}}, "incident_type": {"data": {"id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40", "type": "incident_types"}}}, "type": "incidents_handles"}} + When the request is sent + Then the response status is 201 Created + @generated @skip @team:DataDog/incident-app Scenario: Create incident attachment returns "Bad Request" response Given operation "CreateIncidentAttachment" enabled @@ -447,6 +463,20 @@ Feature: Incidents When the request is sent Then the response status is 204 OK + @generated @skip @team:DataDog/incident-app + Scenario: Delete global incident handle returns "Bad Request" response + Given operation "DeleteGlobalIncidentHandle" enabled + And new "DeleteGlobalIncidentHandle" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/incident-app + Scenario: Delete global incident handle returns "No Content" response + Given operation "DeleteGlobalIncidentHandle" enabled + And new "DeleteGlobalIncidentHandle" request + When the request is sent + Then the response status is 204 No Content + @generated @skip @team:DataDog/incident-app Scenario: Delete incident attachment returns "Bad Request" response Given operation "DeleteIncidentAttachment" enabled @@ -628,6 +658,20 @@ Feature: Incidents When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/incident-app + Scenario: Get global incident settings returns "Bad Request" response + Given operation "GetGlobalIncidentSettings" enabled + And new "GetGlobalIncidentSettings" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/incident-app + Scenario: Get global incident settings returns "OK" response + Given operation "GetGlobalIncidentSettings" enabled + And new "GetGlobalIncidentSettings" request + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/incident-app Scenario: Get incident integration metadata details returns "Bad Request" response Given operation "GetIncidentIntegration" enabled @@ -811,6 +855,20 @@ Feature: Incidents When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/incident-app + Scenario: List global incident handles returns "Bad Request" response + Given operation "ListGlobalIncidentHandles" enabled + And new "ListGlobalIncidentHandles" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/incident-app + Scenario: List global incident handles returns "OK" response + Given operation "ListGlobalIncidentHandles" enabled + And new "ListGlobalIncidentHandles" request + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/incident-app Scenario: List incident attachments returns "Bad Request" response Given operation "ListIncidentAttachments" enabled @@ -1073,6 +1131,38 @@ Feature: Incidents When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/incident-app + Scenario: Update global incident handle returns "Bad Request" response + Given operation "UpdateGlobalIncidentHandle" enabled + And new "UpdateGlobalIncidentHandle" request + And body with value {"data": {"attributes": {"fields": {"severity": ["SEV-1"]}, "name": "@incident-sev-1"}, "id": "b2494081-cdf0-4205-b366-4e1dd4fdf0bf", "relationships": {"commander_user": {"data": {"id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40", "type": "incident_types"}}, "incident_type": {"data": {"id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40", "type": "incident_types"}}}, "type": "incidents_handles"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/incident-app + Scenario: Update global incident handle returns "OK" response + Given operation "UpdateGlobalIncidentHandle" enabled + And new "UpdateGlobalIncidentHandle" request + And body with value {"data": {"attributes": {"fields": {"severity": ["SEV-1"]}, "name": "@incident-sev-1"}, "id": "b2494081-cdf0-4205-b366-4e1dd4fdf0bf", "relationships": {"commander_user": {"data": {"id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40", "type": "incident_types"}}, "incident_type": {"data": {"id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40", "type": "incident_types"}}}, "type": "incidents_handles"}} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/incident-app + Scenario: Update global incident settings returns "Bad Request" response + Given operation "UpdateGlobalIncidentSettings" enabled + And new "UpdateGlobalIncidentSettings" request + And body with value {"data": {"attributes": {"analytics_dashboard_id": "abc-123-def"}, "type": "incidents_global_settings"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/incident-app + Scenario: Update global incident settings returns "OK" response + Given operation "UpdateGlobalIncidentSettings" enabled + And new "UpdateGlobalIncidentSettings" request + And body with value {"data": {"attributes": {"analytics_dashboard_id": "abc-123-def"}, "type": "incidents_global_settings"}} + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/incident-app Scenario: Update incident attachment returns "Bad Request" response Given operation "UpdateIncidentAttachment" 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 d2f20a4d85c..dd0c8ed7c38 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 @@ -1576,6 +1576,44 @@ "type": "unsafe" } }, + "DeleteGlobalIncidentHandle": { + "tag": "Incidents", + "undo": { + "type": "idempotent" + } + }, + "ListGlobalIncidentHandles": { + "tag": "Incidents", + "undo": { + "type": "safe" + } + }, + "CreateGlobalIncidentHandle": { + "tag": "Incidents", + "undo": { + "operationId": "DeleteGlobalIncidentHandle", + "parameters": [], + "type": "unsafe" + } + }, + "UpdateGlobalIncidentHandle": { + "tag": "Incidents", + "undo": { + "type": "idempotent" + } + }, + "GetGlobalIncidentSettings": { + "tag": "Incidents", + "undo": { + "type": "safe" + } + }, + "UpdateGlobalIncidentSettings": { + "tag": "Incidents", + "undo": { + "type": "idempotent" + } + }, "ListIncidentNotificationRules": { "tag": "Incidents", "undo": {