From 514f33e53fcac6628b6e4d66aab85043774b7c5a Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Wed, 28 Oct 2026 14:22:25 +0000 Subject: [PATCH] Regenerate client from commit 9464b04 of spec repo --- .generator/schemas/v2/openapi.yaml | 250 +++++++++++- .../v2/incidents/CreateIncidentResponder.java | 49 +++ .../v2/incidents/DeleteIncidentResponder.java | 26 ++ .../v2/incidents/GetIncidentResponder.java | 29 ++ .../v2/incidents/ListIncidentResponders.java | 26 ++ .../ListIncidentResponders_3179157290.java | 40 ++ .../api/client/v2/api/IncidentsApi.java | 110 ++++- .../model/IncidentResponderIncludedItem.java | 290 ++++++++++++++ .../model/IncidentResponderRelatedObject.java | 60 +++ .../model/IncidentRespondersPagination.java | 377 ++++++++++++++++++ .../v2/model/IncidentRespondersResponse.java | 74 +++- .../model/IncidentRespondersResponseMeta.java | 174 ++++++++ .../IncidentRespondersResponseMetaPage.java | 147 +++++++ .../model/IncidentResponseRelationships.java | 32 ++ ...tRoleAssignmentDataAttributesResponse.java | 263 ++++++++++++ .../IncidentRoleAssignmentDataResponse.java | 248 ++++++++++++ ...ntRoleAssignmentRelationshipsResponse.java | 295 ++++++++++++++ ...ntRoleAssignmentResponderRelationship.java | 154 +++++++ ...leAssignmentResponderRelationshipData.java | 179 +++++++++ ...ncidentRoleAssignmentRoleRelationship.java | 150 +++++++ ...entRoleAssignmentRoleRelationshipData.java | 178 +++++++++ .../v2/model/IncidentRoleAssignmentType.java | 57 +++ .../com/datadog/api/client/v2/api/given.json | 12 + .../api/client/v2/api/incidents.feature | 120 ++++++ .../com/datadog/api/client/v2/api/undo.json | 35 ++ .../test-runner-data/manifest.json | 7 + ...s-includes-users-and-role-assignments.json | 59 +++ .../test-server-data/v2/incidents.json | 148 +++++++ 28 files changed, 3578 insertions(+), 11 deletions(-) create mode 100644 examples/v2/incidents/CreateIncidentResponder.java create mode 100644 examples/v2/incidents/DeleteIncidentResponder.java create mode 100644 examples/v2/incidents/GetIncidentResponder.java create mode 100644 examples/v2/incidents/ListIncidentResponders.java create mode 100644 examples/v2/incidents/ListIncidentResponders_3179157290.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IncidentResponderIncludedItem.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IncidentResponderRelatedObject.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IncidentRespondersPagination.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IncidentRespondersResponseMeta.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IncidentRespondersResponseMetaPage.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IncidentRoleAssignmentDataAttributesResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IncidentRoleAssignmentDataResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IncidentRoleAssignmentRelationshipsResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IncidentRoleAssignmentResponderRelationship.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IncidentRoleAssignmentResponderRelationshipData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IncidentRoleAssignmentRoleRelationship.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IncidentRoleAssignmentRoleRelationshipData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IncidentRoleAssignmentType.java create mode 100644 src/test/resources/generated-test/test-runner-data/v2/incidents/list-incident-responders-includes-users-and-role-assignments.json diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index e0e9db98e4a..f993e36c750 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -868,6 +868,40 @@ components: schema: format: uuid type: string + IncidentResponderIncludeQueryParameter: + description: Comma-separated related resource types to include. Supported values are `users` and `role_assignments`. + explode: false + in: query + name: include + required: false + schema: + example: + - users + - role_assignments + items: + $ref: "#/components/schemas/IncidentResponderRelatedObject" + type: array + style: form + IncidentResponderPageLimitParameter: + description: Maximum number of responders to return per page. + in: query + name: page[limit] + required: false + schema: + default: 25 + example: 25 + format: int64 + maximum: 1000 + type: integer + IncidentResponderPageOffsetParameter: + description: The offset of the first responder to return. + in: query + name: page[offset] + required: false + schema: + example: 0 + format: int64 + type: integer IncidentRuleIDPathParameter: description: The UUID of the incident rule. in: path @@ -63016,6 +63050,20 @@ components: - type - attributes type: object + IncidentResponderIncludedItem: + description: A user or role assignment related to an incident responder. + oneOf: + - $ref: "#/components/schemas/IncidentUserData" + - $ref: "#/components/schemas/IncidentRoleAssignmentDataResponse" + IncidentResponderRelatedObject: + description: Object related to an incident responder. + enum: + - users + - role_assignments + type: string + x-enum-varnames: + - USERS + - ROLE_ASSIGNMENTS IncidentResponderRelationships: description: Relationships for an incident responder. properties: @@ -63115,6 +63163,53 @@ components: - id - type type: object + IncidentRespondersPagination: + description: Offset-based pagination for incident responders. + properties: + first_offset: + description: The offset of the first page. + example: 0 + format: int64 + type: integer + last_offset: + description: The offset of the last page, if available. + example: 25 + format: int64 + nullable: true + type: integer + limit: + description: The maximum number of elements returned per page. + example: 25 + format: int64 + type: integer + next_offset: + description: The offset of the next page, if available. + example: 25 + format: int64 + nullable: true + type: integer + offset: + description: The index of the first element in the current page. + example: 0 + format: int64 + type: integer + prev_offset: + description: The offset of the previous page, if available. + example: 0 + format: int64 + nullable: true + type: integer + total: + description: The total number of elements, when available. + example: 1 + format: int64 + nullable: true + type: integer + type: + description: The pagination type. + example: offset_limit + type: string + type: object IncidentRespondersResponse: description: Response with a list of incident responders. properties: @@ -63126,12 +63221,38 @@ components: included: description: Included related resources. items: - $ref: "#/components/schemas/IncidentUserData" + $ref: "#/components/schemas/IncidentResponderIncludedItem" readOnly: true type: array + links: + additionalProperties: + type: string + description: Links to pages of incident responders. + type: object + meta: + $ref: "#/components/schemas/IncidentRespondersResponseMeta" required: - data type: object + IncidentRespondersResponseMeta: + description: Pagination metadata for the responder list. + properties: + page: + $ref: "#/components/schemas/IncidentRespondersResponseMetaPage" + pagination: + $ref: "#/components/schemas/IncidentRespondersPagination" + type: object + IncidentRespondersResponseMetaPage: + description: Total count for the responder list. + properties: + total_filtered_count: + description: Total number of responders matching the query, before pagination. + example: 1 + format: int64 + type: integer + required: + - total_filtered_count + type: object IncidentRespondersType: description: The incident responders type. enum: @@ -63358,6 +63479,8 @@ components: $ref: "#/components/schemas/RelationshipToUser" impacts: $ref: "#/components/schemas/RelationshipToIncidentImpacts" + incident_type: + $ref: "#/components/schemas/RelationshipToIncidentType" integrations: $ref: "#/components/schemas/RelationshipToIncidentIntegrationMetadatas" last_modified_by_user: @@ -63367,6 +63490,128 @@ components: user_defined_fields: $ref: "#/components/schemas/RelationshipToIncidentUserDefinedFields" type: object + IncidentRoleAssignmentDataAttributesResponse: + description: Attributes of an incident role assignment. + properties: + created: + description: Timestamp when the role assignment was created. + example: "2024-01-01T00:00:00.000Z" + format: date-time + type: string + deleted: + description: Timestamp when the role assignment was deleted, or the zero timestamp if it has not been deleted. + example: "0001-01-01T00:00:00Z" + format: date-time + type: string + modified: + description: Timestamp when the role assignment was last modified. + example: "2024-01-01T00:00:00.000Z" + format: date-time + type: string + responder_type: + description: The type of the responder. + example: user + type: string + role: + description: The name of the assigned role. + example: commander + type: string + required: + - role + - responder_type + - created + - modified + type: object + IncidentRoleAssignmentDataResponse: + description: Role assignment data in a response. + properties: + attributes: + $ref: "#/components/schemas/IncidentRoleAssignmentDataAttributesResponse" + id: + description: The role assignment identifier. + example: 00000000-0000-0000-0000-000000000000 + format: uuid + type: string + relationships: + $ref: "#/components/schemas/IncidentRoleAssignmentRelationshipsResponse" + type: + $ref: "#/components/schemas/IncidentRoleAssignmentType" + required: + - id + - type + - attributes + type: object + IncidentRoleAssignmentRelationshipsResponse: + description: Relationships of a role assignment. + properties: + created_by_user: + $ref: "#/components/schemas/IncidentRoleAssignmentResponderRelationship" + last_modified_by_user: + $ref: "#/components/schemas/IncidentRoleAssignmentResponderRelationship" + reserved_role: + $ref: "#/components/schemas/IncidentRoleAssignmentRoleRelationship" + responder: + $ref: "#/components/schemas/IncidentRoleAssignmentResponderRelationship" + user_defined_role: + $ref: "#/components/schemas/IncidentRoleAssignmentRoleRelationship" + required: + - responder + type: object + IncidentRoleAssignmentResponderRelationship: + description: Relationship to a responder. + properties: + data: + $ref: "#/components/schemas/IncidentRoleAssignmentResponderRelationshipData" + required: + - data + type: object + IncidentRoleAssignmentResponderRelationshipData: + description: Responder relationship data. + properties: + id: + description: The responder identifier. + example: 00000000-0000-0000-0000-000000000000 + format: uuid + type: string + type: + description: The responder resource type. + example: users + type: string + required: + - id + - type + type: object + IncidentRoleAssignmentRoleRelationship: + description: Relationship to a role. + properties: + data: + $ref: "#/components/schemas/IncidentRoleAssignmentRoleRelationshipData" + type: object + IncidentRoleAssignmentRoleRelationshipData: + description: Role relationship data. + nullable: true + properties: + id: + description: The role identifier. + example: 00000000-0000-0000-0000-000000000000 + format: uuid + type: string + type: + description: The role resource type. + example: incident_reserved_roles + type: string + required: + - id + - type + type: object + IncidentRoleAssignmentType: + description: Incident role assignment resource type. + enum: + - incident_role_assignments + example: incident_role_assignments + type: string + x-enum-varnames: + - INCIDENT_ROLE_ASSIGNMENTS IncidentRuleCondition: description: A condition for an incident rule. properties: @@ -186122,6 +186367,9 @@ paths: operationId: ListIncidentResponders parameters: - $ref: "#/components/parameters/IncidentIDPathParameter" + - $ref: "#/components/parameters/IncidentResponderIncludeQueryParameter" + - $ref: "#/components/parameters/IncidentResponderPageLimitParameter" + - $ref: "#/components/parameters/IncidentResponderPageOffsetParameter" responses: "200": content: diff --git a/examples/v2/incidents/CreateIncidentResponder.java b/examples/v2/incidents/CreateIncidentResponder.java new file mode 100644 index 00000000000..22b441251ce --- /dev/null +++ b/examples/v2/incidents/CreateIncidentResponder.java @@ -0,0 +1,49 @@ +// Create an incident responder 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.IncidentResponderDataRequest; +import com.datadog.api.client.v2.model.IncidentResponderRelationshipsRequest; +import com.datadog.api.client.v2.model.IncidentResponderRequest; +import com.datadog.api.client.v2.model.IncidentResponderResponse; +import com.datadog.api.client.v2.model.IncidentResponderType; +import com.datadog.api.client.v2.model.IncidentResponderUserRelationship; +import com.datadog.api.client.v2.model.IncidentResponderUserRelationshipData; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN")); + defaultClient.setUnstableOperationEnabled("v2.createIncidentResponder", true); + IncidentsApi apiInstance = new IncidentsApi(defaultClient); + + IncidentResponderRequest body = + new IncidentResponderRequest() + .data( + new IncidentResponderDataRequest() + .relationships( + new IncidentResponderRelationshipsRequest() + .user( + new IncidentResponderUserRelationship() + .data( + new IncidentResponderUserRelationshipData() + .id( + UUID.fromString( + "00000000-0000-0000-0000-000000000000")) + .type("users")))) + .type(IncidentResponderType.INCIDENT_RESPONDERS)); + + try { + IncidentResponderResponse result = apiInstance.createIncidentResponder("incident_id", body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling IncidentsApi#createIncidentResponder"); + 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/DeleteIncidentResponder.java b/examples/v2/incidents/DeleteIncidentResponder.java new file mode 100644 index 00000000000..a4a01369748 --- /dev/null +++ b/examples/v2/incidents/DeleteIncidentResponder.java @@ -0,0 +1,26 @@ +// Delete an incident responder returns "No Content" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.IncidentsApi; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN")); + defaultClient.setUnstableOperationEnabled("v2.deleteIncidentResponder", true); + IncidentsApi apiInstance = new IncidentsApi(defaultClient); + + try { + apiInstance.deleteIncidentResponder( + "incident_id", UUID.fromString("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d")); + } catch (ApiException e) { + System.err.println("Exception when calling IncidentsApi#deleteIncidentResponder"); + 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/GetIncidentResponder.java b/examples/v2/incidents/GetIncidentResponder.java new file mode 100644 index 00000000000..8b05adb87ac --- /dev/null +++ b/examples/v2/incidents/GetIncidentResponder.java @@ -0,0 +1,29 @@ +// Get an incident responder 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.IncidentResponderResponse; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN")); + defaultClient.setUnstableOperationEnabled("v2.getIncidentResponder", true); + IncidentsApi apiInstance = new IncidentsApi(defaultClient); + + try { + IncidentResponderResponse result = + apiInstance.getIncidentResponder( + "incident_id", UUID.fromString("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d")); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling IncidentsApi#getIncidentResponder"); + 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/ListIncidentResponders.java b/examples/v2/incidents/ListIncidentResponders.java new file mode 100644 index 00000000000..6cf13b70857 --- /dev/null +++ b/examples/v2/incidents/ListIncidentResponders.java @@ -0,0 +1,26 @@ +// List incident responders 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.IncidentRespondersResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN")); + defaultClient.setUnstableOperationEnabled("v2.listIncidentResponders", true); + IncidentsApi apiInstance = new IncidentsApi(defaultClient); + + try { + IncidentRespondersResponse result = apiInstance.listIncidentResponders("incident_id"); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling IncidentsApi#listIncidentResponders"); + 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/ListIncidentResponders_3179157290.java b/examples/v2/incidents/ListIncidentResponders_3179157290.java new file mode 100644 index 00000000000..cb2620f07d4 --- /dev/null +++ b/examples/v2/incidents/ListIncidentResponders_3179157290.java @@ -0,0 +1,40 @@ +// List incident responders includes users and role assignments + +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.api.IncidentsApi.ListIncidentRespondersOptionalParameters; +import com.datadog.api.client.v2.model.IncidentResponderRelatedObject; +import com.datadog.api.client.v2.model.IncidentRespondersResponse; +import java.util.Arrays; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN")); + defaultClient.setUnstableOperationEnabled("v2.createIncident", true); + defaultClient.setUnstableOperationEnabled("v2.listIncidentResponders", true); + IncidentsApi apiInstance = new IncidentsApi(defaultClient); + + // there is a valid "incident_with_commander" in the system + String INCIDENT_WITH_COMMANDER_DATA_ID = System.getenv("INCIDENT_WITH_COMMANDER_DATA_ID"); + + try { + IncidentRespondersResponse result = + apiInstance.listIncidentResponders( + INCIDENT_WITH_COMMANDER_DATA_ID, + new ListIncidentRespondersOptionalParameters() + .include( + Arrays.asList( + IncidentResponderRelatedObject.USERS, + IncidentResponderRelatedObject.ROLE_ASSIGNMENTS))); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling IncidentsApi#listIncidentResponders"); + 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/v2/api/IncidentsApi.java b/src/main/java/com/datadog/api/client/v2/api/IncidentsApi.java index 6fcb53b87b2..4c06583052f 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 @@ -52,6 +52,7 @@ import com.datadog.api.client.v2.model.IncidentOrgSettingsResponse; import com.datadog.api.client.v2.model.IncidentPageUUIDResponse; import com.datadog.api.client.v2.model.IncidentRelatedObject; +import com.datadog.api.client.v2.model.IncidentResponderRelatedObject; import com.datadog.api.client.v2.model.IncidentResponderRequest; import com.datadog.api.client.v2.model.IncidentResponderResponse; import com.datadog.api.client.v2.model.IncidentRespondersResponse; @@ -11640,6 +11641,48 @@ public ApiResponse listIncidentPostmortemTemplatesW new GenericType() {}); } + /** Manage optional parameters to listIncidentResponders. */ + public static class ListIncidentRespondersOptionalParameters { + private List include; + private Long pageLimit; + private Long pageOffset; + + /** + * Set include. + * + * @param include Comma-separated related resource types to include. Supported values are + * users and role_assignments. (optional) + * @return ListIncidentRespondersOptionalParameters + */ + public ListIncidentRespondersOptionalParameters include( + List include) { + this.include = include; + return this; + } + + /** + * Set pageLimit. + * + * @param pageLimit Maximum number of responders to return per page. (optional, default to 25) + * @return ListIncidentRespondersOptionalParameters + */ + public ListIncidentRespondersOptionalParameters pageLimit(Long pageLimit) { + this.pageLimit = pageLimit; + return this; + } + + /** + * Set pageOffset. + * + * @param pageOffset The offset of the first responder to return. (optional) + * @return ListIncidentRespondersOptionalParameters + */ + public ListIncidentRespondersOptionalParameters pageOffset(Long pageOffset) { + this.pageOffset = pageOffset; + return this; + } + } + /** * List incident responders. * @@ -11650,7 +11693,9 @@ public ApiResponse listIncidentPostmortemTemplatesW * @throws ApiException if fails to make API call */ public IncidentRespondersResponse listIncidentResponders(String incidentId) throws ApiException { - return listIncidentRespondersWithHttpInfo(incidentId).getData(); + return listIncidentRespondersWithHttpInfo( + incidentId, new ListIncidentRespondersOptionalParameters()) + .getData(); } /** @@ -11663,7 +11708,41 @@ public IncidentRespondersResponse listIncidentResponders(String incidentId) thro */ public CompletableFuture listIncidentRespondersAsync( String incidentId) { - return listIncidentRespondersWithHttpInfoAsync(incidentId) + return listIncidentRespondersWithHttpInfoAsync( + incidentId, new ListIncidentRespondersOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List incident responders. + * + *

See {@link #listIncidentRespondersWithHttpInfo}. + * + * @param incidentId The UUID of the incident. (required) + * @param parameters Optional parameters for the request. + * @return IncidentRespondersResponse + * @throws ApiException if fails to make API call + */ + public IncidentRespondersResponse listIncidentResponders( + String incidentId, ListIncidentRespondersOptionalParameters parameters) throws ApiException { + return listIncidentRespondersWithHttpInfo(incidentId, parameters).getData(); + } + + /** + * List incident responders. + * + *

See {@link #listIncidentRespondersWithHttpInfoAsync}. + * + * @param incidentId The UUID of the incident. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<IncidentRespondersResponse> + */ + public CompletableFuture listIncidentRespondersAsync( + String incidentId, ListIncidentRespondersOptionalParameters parameters) { + return listIncidentRespondersWithHttpInfoAsync(incidentId, parameters) .thenApply( response -> { return response.getData(); @@ -11674,6 +11753,7 @@ public CompletableFuture listIncidentRespondersAsync * List all responders for an incident. * * @param incidentId The UUID of the incident. (required) + * @param parameters Optional parameters for the request. * @return ApiResponse<IncidentRespondersResponse> * @throws ApiException if fails to make API call * @http.response.details @@ -11689,7 +11769,7 @@ public CompletableFuture listIncidentRespondersAsync * */ public ApiResponse listIncidentRespondersWithHttpInfo( - String incidentId) throws ApiException { + String incidentId, ListIncidentRespondersOptionalParameters parameters) throws ApiException { // Check if unstable operation is enabled String operationId = "listIncidentResponders"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { @@ -11704,19 +11784,27 @@ public ApiResponse listIncidentRespondersWithHttpInf throw new ApiException( 400, "Missing the required parameter 'incidentId' when calling listIncidentResponders"); } + List include = parameters.include; + Long pageLimit = parameters.pageLimit; + Long pageOffset = parameters.pageOffset; // create path and map variables String localVarPath = "/api/v2/incidents/{incident_id}/responders" .replaceAll( "\\{" + "incident_id" + "\\}", apiClient.escapeString(incidentId.toString())); + List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); + localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "include", include)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[limit]", pageLimit)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[offset]", pageOffset)); + Invocation.Builder builder = apiClient.createBuilder( "v2.IncidentsApi.listIncidentResponders", localVarPath, - new ArrayList(), + localVarQueryParams, localVarHeaderParams, new HashMap(), new String[] {"application/json"}, @@ -11738,10 +11826,12 @@ public ApiResponse listIncidentRespondersWithHttpInf *

See {@link #listIncidentRespondersWithHttpInfo}. * * @param incidentId The UUID of the incident. (required) + * @param parameters Optional parameters for the request. * @return CompletableFuture<ApiResponse<IncidentRespondersResponse>> */ public CompletableFuture> - listIncidentRespondersWithHttpInfoAsync(String incidentId) { + listIncidentRespondersWithHttpInfoAsync( + String incidentId, ListIncidentRespondersOptionalParameters parameters) { // Check if unstable operation is enabled String operationId = "listIncidentResponders"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { @@ -11763,21 +11853,29 @@ public ApiResponse listIncidentRespondersWithHttpInf "Missing the required parameter 'incidentId' when calling listIncidentResponders")); return result; } + List include = parameters.include; + Long pageLimit = parameters.pageLimit; + Long pageOffset = parameters.pageOffset; // create path and map variables String localVarPath = "/api/v2/incidents/{incident_id}/responders" .replaceAll( "\\{" + "incident_id" + "\\}", apiClient.escapeString(incidentId.toString())); + List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); + localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "include", include)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[limit]", pageLimit)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[offset]", pageOffset)); + Invocation.Builder builder; try { builder = apiClient.createBuilder( "v2.IncidentsApi.listIncidentResponders", localVarPath, - new ArrayList(), + localVarQueryParams, localVarHeaderParams, new HashMap(), new String[] {"application/json"}, diff --git a/src/main/java/com/datadog/api/client/v2/model/IncidentResponderIncludedItem.java b/src/main/java/com/datadog/api/client/v2/model/IncidentResponderIncludedItem.java new file mode 100644 index 00000000000..a66b4c2f322 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentResponderIncludedItem.java @@ -0,0 +1,290 @@ +/* + * 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 = IncidentResponderIncludedItem.IncidentResponderIncludedItemDeserializer.class) +@JsonSerialize(using = IncidentResponderIncludedItem.IncidentResponderIncludedItemSerializer.class) +public class IncidentResponderIncludedItem extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(IncidentResponderIncludedItem.class.getName()); + + @JsonIgnore public boolean unparsed = false; + + public static class IncidentResponderIncludedItemSerializer + extends StdSerializer { + public IncidentResponderIncludedItemSerializer(Class t) { + super(t); + } + + public IncidentResponderIncludedItemSerializer() { + this(null); + } + + @Override + public void serialize( + IncidentResponderIncludedItem value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class IncidentResponderIncludedItemDeserializer + extends StdDeserializer { + public IncidentResponderIncludedItemDeserializer() { + this(IncidentResponderIncludedItem.class); + } + + public IncidentResponderIncludedItemDeserializer(Class vc) { + super(vc); + } + + @Override + public IncidentResponderIncludedItem 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); + } + + // deserialize IncidentRoleAssignmentDataResponse + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (IncidentRoleAssignmentDataResponse.class.equals(Integer.class) + || IncidentRoleAssignmentDataResponse.class.equals(Long.class) + || IncidentRoleAssignmentDataResponse.class.equals(Float.class) + || IncidentRoleAssignmentDataResponse.class.equals(Double.class) + || IncidentRoleAssignmentDataResponse.class.equals(Boolean.class) + || IncidentRoleAssignmentDataResponse.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((IncidentRoleAssignmentDataResponse.class.equals(Integer.class) + || IncidentRoleAssignmentDataResponse.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((IncidentRoleAssignmentDataResponse.class.equals(Float.class) + || IncidentRoleAssignmentDataResponse.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (IncidentRoleAssignmentDataResponse.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (IncidentRoleAssignmentDataResponse.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(IncidentRoleAssignmentDataResponse.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 (!((IncidentRoleAssignmentDataResponse) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'IncidentRoleAssignmentDataResponse'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log( + Level.FINER, + "Input data does not match schema 'IncidentRoleAssignmentDataResponse'", + e); + } + + IncidentResponderIncludedItem ret = new IncidentResponderIncludedItem(); + 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 IncidentResponderIncludedItem getNullValue(DeserializationContext ctxt) + throws JsonMappingException { + throw new JsonMappingException( + ctxt.getParser(), "IncidentResponderIncludedItem cannot be null"); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public IncidentResponderIncludedItem() { + super("oneOf", Boolean.FALSE); + } + + public IncidentResponderIncludedItem(IncidentUserData o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public IncidentResponderIncludedItem(IncidentRoleAssignmentDataResponse o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("IncidentUserData", new GenericType() {}); + schemas.put( + "IncidentRoleAssignmentDataResponse", + new GenericType() {}); + JSON.registerDescendants( + IncidentResponderIncludedItem.class, Collections.unmodifiableMap(schemas)); + } + + @Override + public Map getSchemas() { + return IncidentResponderIncludedItem.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: IncidentUserData, IncidentRoleAssignmentDataResponse + * + *

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( + IncidentRoleAssignmentDataResponse.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, IncidentRoleAssignmentDataResponse"); + } + + /** + * Get the actual instance, which can be the following: IncidentUserData, + * IncidentRoleAssignmentDataResponse + * + * @return The actual instance (IncidentUserData, IncidentRoleAssignmentDataResponse) + */ + @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(); + } + + /** + * Get the actual instance of `IncidentRoleAssignmentDataResponse`. If the actual instance is not + * `IncidentRoleAssignmentDataResponse`, the ClassCastException will be thrown. + * + * @return The actual instance of `IncidentRoleAssignmentDataResponse` + * @throws ClassCastException if the instance is not `IncidentRoleAssignmentDataResponse` + */ + public IncidentRoleAssignmentDataResponse getIncidentRoleAssignmentDataResponse() + throws ClassCastException { + return (IncidentRoleAssignmentDataResponse) super.getActualInstance(); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IncidentResponderRelatedObject.java b/src/main/java/com/datadog/api/client/v2/model/IncidentResponderRelatedObject.java new file mode 100644 index 00000000000..2dbf139a4dc --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentResponderRelatedObject.java @@ -0,0 +1,60 @@ +/* + * 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; + +/** Object related to an incident responder. */ +@JsonSerialize( + using = IncidentResponderRelatedObject.IncidentResponderRelatedObjectSerializer.class) +public class IncidentResponderRelatedObject extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("users", "role_assignments")); + + public static final IncidentResponderRelatedObject USERS = + new IncidentResponderRelatedObject("users"); + public static final IncidentResponderRelatedObject ROLE_ASSIGNMENTS = + new IncidentResponderRelatedObject("role_assignments"); + + IncidentResponderRelatedObject(String value) { + super(value, allowedValues); + } + + public static class IncidentResponderRelatedObjectSerializer + extends StdSerializer { + public IncidentResponderRelatedObjectSerializer(Class t) { + super(t); + } + + public IncidentResponderRelatedObjectSerializer() { + this(null); + } + + @Override + public void serialize( + IncidentResponderRelatedObject value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static IncidentResponderRelatedObject fromValue(String value) { + return new IncidentResponderRelatedObject(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IncidentRespondersPagination.java b/src/main/java/com/datadog/api/client/v2/model/IncidentRespondersPagination.java new file mode 100644 index 00000000000..a4367e8bb52 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentRespondersPagination.java @@ -0,0 +1,377 @@ +/* + * 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; +import org.openapitools.jackson.nullable.JsonNullable; + +/** Offset-based pagination for incident responders. */ +@JsonPropertyOrder({ + IncidentRespondersPagination.JSON_PROPERTY_FIRST_OFFSET, + IncidentRespondersPagination.JSON_PROPERTY_LAST_OFFSET, + IncidentRespondersPagination.JSON_PROPERTY_LIMIT, + IncidentRespondersPagination.JSON_PROPERTY_NEXT_OFFSET, + IncidentRespondersPagination.JSON_PROPERTY_OFFSET, + IncidentRespondersPagination.JSON_PROPERTY_PREV_OFFSET, + IncidentRespondersPagination.JSON_PROPERTY_TOTAL, + IncidentRespondersPagination.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IncidentRespondersPagination { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FIRST_OFFSET = "first_offset"; + private Long firstOffset; + + public static final String JSON_PROPERTY_LAST_OFFSET = "last_offset"; + private JsonNullable lastOffset = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_LIMIT = "limit"; + private Long limit; + + public static final String JSON_PROPERTY_NEXT_OFFSET = "next_offset"; + private JsonNullable nextOffset = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_OFFSET = "offset"; + private Long offset; + + public static final String JSON_PROPERTY_PREV_OFFSET = "prev_offset"; + private JsonNullable prevOffset = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_TOTAL = "total"; + private JsonNullable total = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public IncidentRespondersPagination firstOffset(Long firstOffset) { + this.firstOffset = firstOffset; + return this; + } + + /** + * The offset of the first page. + * + * @return firstOffset + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FIRST_OFFSET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getFirstOffset() { + return firstOffset; + } + + public void setFirstOffset(Long firstOffset) { + this.firstOffset = firstOffset; + } + + public IncidentRespondersPagination lastOffset(Long lastOffset) { + this.lastOffset = JsonNullable.of(lastOffset); + return this; + } + + /** + * The offset of the last page, if available. + * + * @return lastOffset + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Long getLastOffset() { + return lastOffset.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_LAST_OFFSET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getLastOffset_JsonNullable() { + return lastOffset; + } + + @JsonProperty(JSON_PROPERTY_LAST_OFFSET) + public void setLastOffset_JsonNullable(JsonNullable lastOffset) { + this.lastOffset = lastOffset; + } + + public void setLastOffset(Long lastOffset) { + this.lastOffset = JsonNullable.of(lastOffset); + } + + public IncidentRespondersPagination limit(Long limit) { + this.limit = limit; + return this; + } + + /** + * The maximum number of elements returned per page. + * + * @return limit + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LIMIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getLimit() { + return limit; + } + + public void setLimit(Long limit) { + this.limit = limit; + } + + public IncidentRespondersPagination nextOffset(Long nextOffset) { + this.nextOffset = JsonNullable.of(nextOffset); + return this; + } + + /** + * The offset of the next page, if available. + * + * @return nextOffset + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Long getNextOffset() { + return nextOffset.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_NEXT_OFFSET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getNextOffset_JsonNullable() { + return nextOffset; + } + + @JsonProperty(JSON_PROPERTY_NEXT_OFFSET) + public void setNextOffset_JsonNullable(JsonNullable nextOffset) { + this.nextOffset = nextOffset; + } + + public void setNextOffset(Long nextOffset) { + this.nextOffset = JsonNullable.of(nextOffset); + } + + public IncidentRespondersPagination offset(Long offset) { + this.offset = offset; + return this; + } + + /** + * The index of the first element in the current page. + * + * @return offset + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OFFSET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getOffset() { + return offset; + } + + public void setOffset(Long offset) { + this.offset = offset; + } + + public IncidentRespondersPagination prevOffset(Long prevOffset) { + this.prevOffset = JsonNullable.of(prevOffset); + return this; + } + + /** + * The offset of the previous page, if available. + * + * @return prevOffset + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Long getPrevOffset() { + return prevOffset.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_PREV_OFFSET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getPrevOffset_JsonNullable() { + return prevOffset; + } + + @JsonProperty(JSON_PROPERTY_PREV_OFFSET) + public void setPrevOffset_JsonNullable(JsonNullable prevOffset) { + this.prevOffset = prevOffset; + } + + public void setPrevOffset(Long prevOffset) { + this.prevOffset = JsonNullable.of(prevOffset); + } + + public IncidentRespondersPagination total(Long total) { + this.total = JsonNullable.of(total); + return this; + } + + /** + * The total number of elements, when available. + * + * @return total + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Long getTotal() { + return total.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_TOTAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getTotal_JsonNullable() { + return total; + } + + @JsonProperty(JSON_PROPERTY_TOTAL) + public void setTotal_JsonNullable(JsonNullable total) { + this.total = total; + } + + public void setTotal(Long total) { + this.total = JsonNullable.of(total); + } + + public IncidentRespondersPagination type(String type) { + this.type = type; + return this; + } + + /** + * The pagination type. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + 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 IncidentRespondersPagination + */ + @JsonAnySetter + public IncidentRespondersPagination 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 IncidentRespondersPagination object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IncidentRespondersPagination incidentRespondersPagination = (IncidentRespondersPagination) o; + return Objects.equals(this.firstOffset, incidentRespondersPagination.firstOffset) + && Objects.equals(this.lastOffset, incidentRespondersPagination.lastOffset) + && Objects.equals(this.limit, incidentRespondersPagination.limit) + && Objects.equals(this.nextOffset, incidentRespondersPagination.nextOffset) + && Objects.equals(this.offset, incidentRespondersPagination.offset) + && Objects.equals(this.prevOffset, incidentRespondersPagination.prevOffset) + && Objects.equals(this.total, incidentRespondersPagination.total) + && Objects.equals(this.type, incidentRespondersPagination.type) + && Objects.equals( + this.additionalProperties, incidentRespondersPagination.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + firstOffset, + lastOffset, + limit, + nextOffset, + offset, + prevOffset, + total, + type, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IncidentRespondersPagination {\n"); + sb.append(" firstOffset: ").append(toIndentedString(firstOffset)).append("\n"); + sb.append(" lastOffset: ").append(toIndentedString(lastOffset)).append("\n"); + sb.append(" limit: ").append(toIndentedString(limit)).append("\n"); + sb.append(" nextOffset: ").append(toIndentedString(nextOffset)).append("\n"); + sb.append(" offset: ").append(toIndentedString(offset)).append("\n"); + sb.append(" prevOffset: ").append(toIndentedString(prevOffset)).append("\n"); + sb.append(" total: ").append(toIndentedString(total)).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/IncidentRespondersResponse.java b/src/main/java/com/datadog/api/client/v2/model/IncidentRespondersResponse.java index 6f71684b6fb..a295226c653 100644 --- a/src/main/java/com/datadog/api/client/v2/model/IncidentRespondersResponse.java +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentRespondersResponse.java @@ -22,7 +22,9 @@ /** Response with a list of incident responders. */ @JsonPropertyOrder({ IncidentRespondersResponse.JSON_PROPERTY_DATA, - IncidentRespondersResponse.JSON_PROPERTY_INCLUDED + IncidentRespondersResponse.JSON_PROPERTY_INCLUDED, + IncidentRespondersResponse.JSON_PROPERTY_LINKS, + IncidentRespondersResponse.JSON_PROPERTY_META }) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") @@ -32,7 +34,13 @@ public class IncidentRespondersResponse { private List data = new ArrayList<>(); public static final String JSON_PROPERTY_INCLUDED = "included"; - private List included = null; + private List included = null; + + public static final String JSON_PROPERTY_LINKS = "links"; + private Map links = null; + + public static final String JSON_PROPERTY_META = "meta"; + private IncidentRespondersResponseMeta meta; public IncidentRespondersResponse() {} @@ -88,10 +96,64 @@ public void setData(List data) { @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_INCLUDED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getIncluded() { + public List getIncluded() { return included; } + public IncidentRespondersResponse links(Map links) { + this.links = links; + return this; + } + + public IncidentRespondersResponse putLinksItem(String key, String linksItem) { + if (this.links == null) { + this.links = new HashMap<>(); + } + this.links.put(key, linksItem); + return this; + } + + /** + * Links to pages of incident responders. + * + * @return links + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LINKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getLinks() { + return links; + } + + public void setLinks(Map links) { + this.links = links; + } + + public IncidentRespondersResponse meta(IncidentRespondersResponseMeta meta) { + this.meta = meta; + this.unparsed |= meta.unparsed; + return this; + } + + /** + * Pagination metadata for the responder list. + * + * @return meta + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_META) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IncidentRespondersResponseMeta getMeta() { + return meta; + } + + public void setMeta(IncidentRespondersResponseMeta meta) { + this.meta = meta; + if (meta != null) { + this.unparsed |= meta.unparsed; + } + } + /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -150,13 +212,15 @@ public boolean equals(Object o) { IncidentRespondersResponse incidentRespondersResponse = (IncidentRespondersResponse) o; return Objects.equals(this.data, incidentRespondersResponse.data) && Objects.equals(this.included, incidentRespondersResponse.included) + && Objects.equals(this.links, incidentRespondersResponse.links) + && Objects.equals(this.meta, incidentRespondersResponse.meta) && Objects.equals( this.additionalProperties, incidentRespondersResponse.additionalProperties); } @Override public int hashCode() { - return Objects.hash(data, included, additionalProperties); + return Objects.hash(data, included, links, meta, additionalProperties); } @Override @@ -165,6 +229,8 @@ public String toString() { sb.append("class IncidentRespondersResponse {\n"); sb.append(" data: ").append(toIndentedString(data)).append("\n"); sb.append(" included: ").append(toIndentedString(included)).append("\n"); + sb.append(" links: ").append(toIndentedString(links)).append("\n"); + sb.append(" meta: ").append(toIndentedString(meta)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); diff --git a/src/main/java/com/datadog/api/client/v2/model/IncidentRespondersResponseMeta.java b/src/main/java/com/datadog/api/client/v2/model/IncidentRespondersResponseMeta.java new file mode 100644 index 00000000000..eb7c8ef8b74 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentRespondersResponseMeta.java @@ -0,0 +1,174 @@ +/* + * 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; + +/** Pagination metadata for the responder list. */ +@JsonPropertyOrder({ + IncidentRespondersResponseMeta.JSON_PROPERTY_PAGE, + IncidentRespondersResponseMeta.JSON_PROPERTY_PAGINATION +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IncidentRespondersResponseMeta { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_PAGE = "page"; + private IncidentRespondersResponseMetaPage page; + + public static final String JSON_PROPERTY_PAGINATION = "pagination"; + private IncidentRespondersPagination pagination; + + public IncidentRespondersResponseMeta page(IncidentRespondersResponseMetaPage page) { + this.page = page; + this.unparsed |= page.unparsed; + return this; + } + + /** + * Total count for the responder list. + * + * @return page + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IncidentRespondersResponseMetaPage getPage() { + return page; + } + + public void setPage(IncidentRespondersResponseMetaPage page) { + this.page = page; + if (page != null) { + this.unparsed |= page.unparsed; + } + } + + public IncidentRespondersResponseMeta pagination(IncidentRespondersPagination pagination) { + this.pagination = pagination; + this.unparsed |= pagination.unparsed; + return this; + } + + /** + * Offset-based pagination for incident responders. + * + * @return pagination + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PAGINATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IncidentRespondersPagination getPagination() { + return pagination; + } + + public void setPagination(IncidentRespondersPagination pagination) { + this.pagination = pagination; + if (pagination != null) { + this.unparsed |= pagination.unparsed; + } + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return IncidentRespondersResponseMeta + */ + @JsonAnySetter + public IncidentRespondersResponseMeta 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 IncidentRespondersResponseMeta object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IncidentRespondersResponseMeta incidentRespondersResponseMeta = + (IncidentRespondersResponseMeta) o; + return Objects.equals(this.page, incidentRespondersResponseMeta.page) + && Objects.equals(this.pagination, incidentRespondersResponseMeta.pagination) + && Objects.equals( + this.additionalProperties, incidentRespondersResponseMeta.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(page, pagination, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IncidentRespondersResponseMeta {\n"); + sb.append(" page: ").append(toIndentedString(page)).append("\n"); + sb.append(" pagination: ").append(toIndentedString(pagination)).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/IncidentRespondersResponseMetaPage.java b/src/main/java/com/datadog/api/client/v2/model/IncidentRespondersResponseMetaPage.java new file mode 100644 index 00000000000..4e313fc7b72 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentRespondersResponseMetaPage.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; + +/** Total count for the responder list. */ +@JsonPropertyOrder({IncidentRespondersResponseMetaPage.JSON_PROPERTY_TOTAL_FILTERED_COUNT}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IncidentRespondersResponseMetaPage { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_TOTAL_FILTERED_COUNT = "total_filtered_count"; + private Long totalFilteredCount; + + public IncidentRespondersResponseMetaPage() {} + + @JsonCreator + public IncidentRespondersResponseMetaPage( + @JsonProperty(required = true, value = JSON_PROPERTY_TOTAL_FILTERED_COUNT) + Long totalFilteredCount) { + this.totalFilteredCount = totalFilteredCount; + } + + public IncidentRespondersResponseMetaPage totalFilteredCount(Long totalFilteredCount) { + this.totalFilteredCount = totalFilteredCount; + return this; + } + + /** + * Total number of responders matching the query, before pagination. + * + * @return totalFilteredCount + */ + @JsonProperty(JSON_PROPERTY_TOTAL_FILTERED_COUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getTotalFilteredCount() { + return totalFilteredCount; + } + + public void setTotalFilteredCount(Long totalFilteredCount) { + this.totalFilteredCount = totalFilteredCount; + } + + /** + * 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 IncidentRespondersResponseMetaPage + */ + @JsonAnySetter + public IncidentRespondersResponseMetaPage 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 IncidentRespondersResponseMetaPage object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IncidentRespondersResponseMetaPage incidentRespondersResponseMetaPage = + (IncidentRespondersResponseMetaPage) o; + return Objects.equals( + this.totalFilteredCount, incidentRespondersResponseMetaPage.totalFilteredCount) + && Objects.equals( + this.additionalProperties, incidentRespondersResponseMetaPage.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(totalFilteredCount, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IncidentRespondersResponseMetaPage {\n"); + sb.append(" totalFilteredCount: ").append(toIndentedString(totalFilteredCount)).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/IncidentResponseRelationships.java b/src/main/java/com/datadog/api/client/v2/model/IncidentResponseRelationships.java index df5813b4b15..6e3d75d6d26 100644 --- a/src/main/java/com/datadog/api/client/v2/model/IncidentResponseRelationships.java +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentResponseRelationships.java @@ -24,6 +24,7 @@ IncidentResponseRelationships.JSON_PROPERTY_CREATED_BY_USER, IncidentResponseRelationships.JSON_PROPERTY_DECLARED_BY_USER, IncidentResponseRelationships.JSON_PROPERTY_IMPACTS, + IncidentResponseRelationships.JSON_PROPERTY_INCIDENT_TYPE, IncidentResponseRelationships.JSON_PROPERTY_INTEGRATIONS, IncidentResponseRelationships.JSON_PROPERTY_LAST_MODIFIED_BY_USER, IncidentResponseRelationships.JSON_PROPERTY_RESPONDERS, @@ -49,6 +50,9 @@ public class IncidentResponseRelationships { public static final String JSON_PROPERTY_IMPACTS = "impacts"; private RelationshipToIncidentImpacts impacts; + public static final String JSON_PROPERTY_INCIDENT_TYPE = "incident_type"; + private RelationshipToIncidentType incidentType; + public static final String JSON_PROPERTY_INTEGRATIONS = "integrations"; private RelationshipToIncidentIntegrationMetadatas integrations; @@ -193,6 +197,31 @@ public void setImpacts(RelationshipToIncidentImpacts impacts) { } } + public IncidentResponseRelationships incidentType(RelationshipToIncidentType incidentType) { + this.incidentType = incidentType; + this.unparsed |= incidentType.unparsed; + return this; + } + + /** + * Relationship to an incident type. + * + * @return incidentType + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INCIDENT_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RelationshipToIncidentType getIncidentType() { + return incidentType; + } + + public void setIncidentType(RelationshipToIncidentType incidentType) { + this.incidentType = incidentType; + if (incidentType != null) { + this.unparsed |= incidentType.unparsed; + } + } + public IncidentResponseRelationships integrations( RelationshipToIncidentIntegrationMetadatas integrations) { this.integrations = integrations; @@ -356,6 +385,7 @@ public boolean equals(Object o) { && Objects.equals(this.createdByUser, incidentResponseRelationships.createdByUser) && Objects.equals(this.declaredByUser, incidentResponseRelationships.declaredByUser) && Objects.equals(this.impacts, incidentResponseRelationships.impacts) + && Objects.equals(this.incidentType, incidentResponseRelationships.incidentType) && Objects.equals(this.integrations, incidentResponseRelationships.integrations) && Objects.equals(this.lastModifiedByUser, incidentResponseRelationships.lastModifiedByUser) && Objects.equals(this.responders, incidentResponseRelationships.responders) @@ -372,6 +402,7 @@ public int hashCode() { createdByUser, declaredByUser, impacts, + incidentType, integrations, lastModifiedByUser, responders, @@ -388,6 +419,7 @@ public String toString() { sb.append(" createdByUser: ").append(toIndentedString(createdByUser)).append("\n"); sb.append(" declaredByUser: ").append(toIndentedString(declaredByUser)).append("\n"); sb.append(" impacts: ").append(toIndentedString(impacts)).append("\n"); + sb.append(" incidentType: ").append(toIndentedString(incidentType)).append("\n"); sb.append(" integrations: ").append(toIndentedString(integrations)).append("\n"); sb.append(" lastModifiedByUser: ").append(toIndentedString(lastModifiedByUser)).append("\n"); sb.append(" responders: ").append(toIndentedString(responders)).append("\n"); diff --git a/src/main/java/com/datadog/api/client/v2/model/IncidentRoleAssignmentDataAttributesResponse.java b/src/main/java/com/datadog/api/client/v2/model/IncidentRoleAssignmentDataAttributesResponse.java new file mode 100644 index 00000000000..cc714630363 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentRoleAssignmentDataAttributesResponse.java @@ -0,0 +1,263 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Attributes of an incident role assignment. */ +@JsonPropertyOrder({ + IncidentRoleAssignmentDataAttributesResponse.JSON_PROPERTY_CREATED, + IncidentRoleAssignmentDataAttributesResponse.JSON_PROPERTY_DELETED, + IncidentRoleAssignmentDataAttributesResponse.JSON_PROPERTY_MODIFIED, + IncidentRoleAssignmentDataAttributesResponse.JSON_PROPERTY_RESPONDER_TYPE, + IncidentRoleAssignmentDataAttributesResponse.JSON_PROPERTY_ROLE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IncidentRoleAssignmentDataAttributesResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CREATED = "created"; + private OffsetDateTime created; + + public static final String JSON_PROPERTY_DELETED = "deleted"; + private OffsetDateTime deleted; + + public static final String JSON_PROPERTY_MODIFIED = "modified"; + private OffsetDateTime modified; + + public static final String JSON_PROPERTY_RESPONDER_TYPE = "responder_type"; + private String responderType; + + public static final String JSON_PROPERTY_ROLE = "role"; + private String role; + + public IncidentRoleAssignmentDataAttributesResponse() {} + + @JsonCreator + public IncidentRoleAssignmentDataAttributesResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_CREATED) OffsetDateTime created, + @JsonProperty(required = true, value = JSON_PROPERTY_MODIFIED) OffsetDateTime modified, + @JsonProperty(required = true, value = JSON_PROPERTY_RESPONDER_TYPE) String responderType, + @JsonProperty(required = true, value = JSON_PROPERTY_ROLE) String role) { + this.created = created; + this.modified = modified; + this.responderType = responderType; + this.role = role; + } + + public IncidentRoleAssignmentDataAttributesResponse created(OffsetDateTime created) { + this.created = created; + return this; + } + + /** + * Timestamp when the role assignment was 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 IncidentRoleAssignmentDataAttributesResponse deleted(OffsetDateTime deleted) { + this.deleted = deleted; + return this; + } + + /** + * Timestamp when the role assignment was deleted, or the zero timestamp if it has not been + * deleted. + * + * @return deleted + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DELETED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDeleted() { + return deleted; + } + + public void setDeleted(OffsetDateTime deleted) { + this.deleted = deleted; + } + + public IncidentRoleAssignmentDataAttributesResponse modified(OffsetDateTime modified) { + this.modified = modified; + return this; + } + + /** + * Timestamp when the role assignment was 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; + } + + public IncidentRoleAssignmentDataAttributesResponse responderType(String responderType) { + this.responderType = responderType; + return this; + } + + /** + * The type of the responder. + * + * @return responderType + */ + @JsonProperty(JSON_PROPERTY_RESPONDER_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getResponderType() { + return responderType; + } + + public void setResponderType(String responderType) { + this.responderType = responderType; + } + + public IncidentRoleAssignmentDataAttributesResponse role(String role) { + this.role = role; + return this; + } + + /** + * The name of the assigned role. + * + * @return role + */ + @JsonProperty(JSON_PROPERTY_ROLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getRole() { + return role; + } + + public void setRole(String role) { + this.role = role; + } + + /** + * 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 IncidentRoleAssignmentDataAttributesResponse + */ + @JsonAnySetter + public IncidentRoleAssignmentDataAttributesResponse 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 IncidentRoleAssignmentDataAttributesResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IncidentRoleAssignmentDataAttributesResponse incidentRoleAssignmentDataAttributesResponse = + (IncidentRoleAssignmentDataAttributesResponse) o; + return Objects.equals(this.created, incidentRoleAssignmentDataAttributesResponse.created) + && Objects.equals(this.deleted, incidentRoleAssignmentDataAttributesResponse.deleted) + && Objects.equals(this.modified, incidentRoleAssignmentDataAttributesResponse.modified) + && Objects.equals( + this.responderType, incidentRoleAssignmentDataAttributesResponse.responderType) + && Objects.equals(this.role, incidentRoleAssignmentDataAttributesResponse.role) + && Objects.equals( + this.additionalProperties, + incidentRoleAssignmentDataAttributesResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(created, deleted, modified, responderType, role, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IncidentRoleAssignmentDataAttributesResponse {\n"); + sb.append(" created: ").append(toIndentedString(created)).append("\n"); + sb.append(" deleted: ").append(toIndentedString(deleted)).append("\n"); + sb.append(" modified: ").append(toIndentedString(modified)).append("\n"); + sb.append(" responderType: ").append(toIndentedString(responderType)).append("\n"); + sb.append(" role: ").append(toIndentedString(role)).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/IncidentRoleAssignmentDataResponse.java b/src/main/java/com/datadog/api/client/v2/model/IncidentRoleAssignmentDataResponse.java new file mode 100644 index 00000000000..1c4d51adfd5 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentRoleAssignmentDataResponse.java @@ -0,0 +1,248 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.UUID; + +/** Role assignment data in a response. */ +@JsonPropertyOrder({ + IncidentRoleAssignmentDataResponse.JSON_PROPERTY_ATTRIBUTES, + IncidentRoleAssignmentDataResponse.JSON_PROPERTY_ID, + IncidentRoleAssignmentDataResponse.JSON_PROPERTY_RELATIONSHIPS, + IncidentRoleAssignmentDataResponse.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IncidentRoleAssignmentDataResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private IncidentRoleAssignmentDataAttributesResponse attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private UUID id; + + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private IncidentRoleAssignmentRelationshipsResponse relationships; + + public static final String JSON_PROPERTY_TYPE = "type"; + private IncidentRoleAssignmentType type; + + public IncidentRoleAssignmentDataResponse() {} + + @JsonCreator + public IncidentRoleAssignmentDataResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + IncidentRoleAssignmentDataAttributesResponse attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) UUID id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) IncidentRoleAssignmentType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public IncidentRoleAssignmentDataResponse attributes( + IncidentRoleAssignmentDataAttributesResponse attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of an incident role assignment. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IncidentRoleAssignmentDataAttributesResponse getAttributes() { + return attributes; + } + + public void setAttributes(IncidentRoleAssignmentDataAttributesResponse attributes) { + this.attributes = attributes; + if (attributes != null) { + this.unparsed |= attributes.unparsed; + } + } + + public IncidentRoleAssignmentDataResponse id(UUID id) { + this.id = id; + return this; + } + + /** + * The role assignment identifier. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UUID getId() { + return id; + } + + public void setId(UUID id) { + this.id = id; + } + + public IncidentRoleAssignmentDataResponse relationships( + IncidentRoleAssignmentRelationshipsResponse relationships) { + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + return this; + } + + /** + * Relationships of a role assignment. + * + * @return relationships + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IncidentRoleAssignmentRelationshipsResponse getRelationships() { + return relationships; + } + + public void setRelationships(IncidentRoleAssignmentRelationshipsResponse relationships) { + this.relationships = relationships; + if (relationships != null) { + this.unparsed |= relationships.unparsed; + } + } + + public IncidentRoleAssignmentDataResponse type(IncidentRoleAssignmentType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Incident role assignment resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IncidentRoleAssignmentType getType() { + return type; + } + + public void setType(IncidentRoleAssignmentType 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 IncidentRoleAssignmentDataResponse + */ + @JsonAnySetter + public IncidentRoleAssignmentDataResponse 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 IncidentRoleAssignmentDataResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IncidentRoleAssignmentDataResponse incidentRoleAssignmentDataResponse = + (IncidentRoleAssignmentDataResponse) o; + return Objects.equals(this.attributes, incidentRoleAssignmentDataResponse.attributes) + && Objects.equals(this.id, incidentRoleAssignmentDataResponse.id) + && Objects.equals(this.relationships, incidentRoleAssignmentDataResponse.relationships) + && Objects.equals(this.type, incidentRoleAssignmentDataResponse.type) + && Objects.equals( + this.additionalProperties, incidentRoleAssignmentDataResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, relationships, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IncidentRoleAssignmentDataResponse {\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/IncidentRoleAssignmentRelationshipsResponse.java b/src/main/java/com/datadog/api/client/v2/model/IncidentRoleAssignmentRelationshipsResponse.java new file mode 100644 index 00000000000..eb819658216 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentRoleAssignmentRelationshipsResponse.java @@ -0,0 +1,295 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Relationships of a role assignment. */ +@JsonPropertyOrder({ + IncidentRoleAssignmentRelationshipsResponse.JSON_PROPERTY_CREATED_BY_USER, + IncidentRoleAssignmentRelationshipsResponse.JSON_PROPERTY_LAST_MODIFIED_BY_USER, + IncidentRoleAssignmentRelationshipsResponse.JSON_PROPERTY_RESERVED_ROLE, + IncidentRoleAssignmentRelationshipsResponse.JSON_PROPERTY_RESPONDER, + IncidentRoleAssignmentRelationshipsResponse.JSON_PROPERTY_USER_DEFINED_ROLE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IncidentRoleAssignmentRelationshipsResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CREATED_BY_USER = "created_by_user"; + private IncidentRoleAssignmentResponderRelationship createdByUser; + + public static final String JSON_PROPERTY_LAST_MODIFIED_BY_USER = "last_modified_by_user"; + private IncidentRoleAssignmentResponderRelationship lastModifiedByUser; + + public static final String JSON_PROPERTY_RESERVED_ROLE = "reserved_role"; + private IncidentRoleAssignmentRoleRelationship reservedRole; + + public static final String JSON_PROPERTY_RESPONDER = "responder"; + private IncidentRoleAssignmentResponderRelationship responder; + + public static final String JSON_PROPERTY_USER_DEFINED_ROLE = "user_defined_role"; + private IncidentRoleAssignmentRoleRelationship userDefinedRole; + + public IncidentRoleAssignmentRelationshipsResponse() {} + + @JsonCreator + public IncidentRoleAssignmentRelationshipsResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_RESPONDER) + IncidentRoleAssignmentResponderRelationship responder) { + this.responder = responder; + this.unparsed |= responder.unparsed; + } + + public IncidentRoleAssignmentRelationshipsResponse createdByUser( + IncidentRoleAssignmentResponderRelationship createdByUser) { + this.createdByUser = createdByUser; + this.unparsed |= createdByUser.unparsed; + return this; + } + + /** + * Relationship to a responder. + * + * @return createdByUser + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATED_BY_USER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IncidentRoleAssignmentResponderRelationship getCreatedByUser() { + return createdByUser; + } + + public void setCreatedByUser(IncidentRoleAssignmentResponderRelationship createdByUser) { + this.createdByUser = createdByUser; + if (createdByUser != null) { + this.unparsed |= createdByUser.unparsed; + } + } + + public IncidentRoleAssignmentRelationshipsResponse lastModifiedByUser( + IncidentRoleAssignmentResponderRelationship lastModifiedByUser) { + this.lastModifiedByUser = lastModifiedByUser; + this.unparsed |= lastModifiedByUser.unparsed; + return this; + } + + /** + * Relationship to a responder. + * + * @return lastModifiedByUser + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LAST_MODIFIED_BY_USER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IncidentRoleAssignmentResponderRelationship getLastModifiedByUser() { + return lastModifiedByUser; + } + + public void setLastModifiedByUser( + IncidentRoleAssignmentResponderRelationship lastModifiedByUser) { + this.lastModifiedByUser = lastModifiedByUser; + if (lastModifiedByUser != null) { + this.unparsed |= lastModifiedByUser.unparsed; + } + } + + public IncidentRoleAssignmentRelationshipsResponse reservedRole( + IncidentRoleAssignmentRoleRelationship reservedRole) { + this.reservedRole = reservedRole; + this.unparsed |= reservedRole.unparsed; + return this; + } + + /** + * Relationship to a role. + * + * @return reservedRole + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RESERVED_ROLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IncidentRoleAssignmentRoleRelationship getReservedRole() { + return reservedRole; + } + + public void setReservedRole(IncidentRoleAssignmentRoleRelationship reservedRole) { + this.reservedRole = reservedRole; + if (reservedRole != null) { + this.unparsed |= reservedRole.unparsed; + } + } + + public IncidentRoleAssignmentRelationshipsResponse responder( + IncidentRoleAssignmentResponderRelationship responder) { + this.responder = responder; + this.unparsed |= responder.unparsed; + return this; + } + + /** + * Relationship to a responder. + * + * @return responder + */ + @JsonProperty(JSON_PROPERTY_RESPONDER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IncidentRoleAssignmentResponderRelationship getResponder() { + return responder; + } + + public void setResponder(IncidentRoleAssignmentResponderRelationship responder) { + this.responder = responder; + if (responder != null) { + this.unparsed |= responder.unparsed; + } + } + + public IncidentRoleAssignmentRelationshipsResponse userDefinedRole( + IncidentRoleAssignmentRoleRelationship userDefinedRole) { + this.userDefinedRole = userDefinedRole; + this.unparsed |= userDefinedRole.unparsed; + return this; + } + + /** + * Relationship to a role. + * + * @return userDefinedRole + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USER_DEFINED_ROLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IncidentRoleAssignmentRoleRelationship getUserDefinedRole() { + return userDefinedRole; + } + + public void setUserDefinedRole(IncidentRoleAssignmentRoleRelationship userDefinedRole) { + this.userDefinedRole = userDefinedRole; + if (userDefinedRole != null) { + this.unparsed |= userDefinedRole.unparsed; + } + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return IncidentRoleAssignmentRelationshipsResponse + */ + @JsonAnySetter + public IncidentRoleAssignmentRelationshipsResponse 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 IncidentRoleAssignmentRelationshipsResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IncidentRoleAssignmentRelationshipsResponse incidentRoleAssignmentRelationshipsResponse = + (IncidentRoleAssignmentRelationshipsResponse) o; + return Objects.equals( + this.createdByUser, incidentRoleAssignmentRelationshipsResponse.createdByUser) + && Objects.equals( + this.lastModifiedByUser, incidentRoleAssignmentRelationshipsResponse.lastModifiedByUser) + && Objects.equals( + this.reservedRole, incidentRoleAssignmentRelationshipsResponse.reservedRole) + && Objects.equals(this.responder, incidentRoleAssignmentRelationshipsResponse.responder) + && Objects.equals( + this.userDefinedRole, incidentRoleAssignmentRelationshipsResponse.userDefinedRole) + && Objects.equals( + this.additionalProperties, + incidentRoleAssignmentRelationshipsResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + createdByUser, + lastModifiedByUser, + reservedRole, + responder, + userDefinedRole, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IncidentRoleAssignmentRelationshipsResponse {\n"); + sb.append(" createdByUser: ").append(toIndentedString(createdByUser)).append("\n"); + sb.append(" lastModifiedByUser: ").append(toIndentedString(lastModifiedByUser)).append("\n"); + sb.append(" reservedRole: ").append(toIndentedString(reservedRole)).append("\n"); + sb.append(" responder: ").append(toIndentedString(responder)).append("\n"); + sb.append(" userDefinedRole: ").append(toIndentedString(userDefinedRole)).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/IncidentRoleAssignmentResponderRelationship.java b/src/main/java/com/datadog/api/client/v2/model/IncidentRoleAssignmentResponderRelationship.java new file mode 100644 index 00000000000..9ee767604cf --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentRoleAssignmentResponderRelationship.java @@ -0,0 +1,154 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Relationship to a responder. */ +@JsonPropertyOrder({IncidentRoleAssignmentResponderRelationship.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IncidentRoleAssignmentResponderRelationship { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private IncidentRoleAssignmentResponderRelationshipData data; + + public IncidentRoleAssignmentResponderRelationship() {} + + @JsonCreator + public IncidentRoleAssignmentResponderRelationship( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + IncidentRoleAssignmentResponderRelationshipData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public IncidentRoleAssignmentResponderRelationship data( + IncidentRoleAssignmentResponderRelationshipData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Responder relationship data. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IncidentRoleAssignmentResponderRelationshipData getData() { + return data; + } + + public void setData(IncidentRoleAssignmentResponderRelationshipData data) { + this.data = data; + if (data != null) { + this.unparsed |= data.unparsed; + } + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return IncidentRoleAssignmentResponderRelationship + */ + @JsonAnySetter + public IncidentRoleAssignmentResponderRelationship 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 IncidentRoleAssignmentResponderRelationship object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IncidentRoleAssignmentResponderRelationship incidentRoleAssignmentResponderRelationship = + (IncidentRoleAssignmentResponderRelationship) o; + return Objects.equals(this.data, incidentRoleAssignmentResponderRelationship.data) + && Objects.equals( + this.additionalProperties, + incidentRoleAssignmentResponderRelationship.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IncidentRoleAssignmentResponderRelationship {\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/IncidentRoleAssignmentResponderRelationshipData.java b/src/main/java/com/datadog/api/client/v2/model/IncidentRoleAssignmentResponderRelationshipData.java new file mode 100644 index 00000000000..3cfbd07e519 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentRoleAssignmentResponderRelationshipData.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; +import java.util.UUID; + +/** Responder relationship data. */ +@JsonPropertyOrder({ + IncidentRoleAssignmentResponderRelationshipData.JSON_PROPERTY_ID, + IncidentRoleAssignmentResponderRelationshipData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IncidentRoleAssignmentResponderRelationshipData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private UUID id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public IncidentRoleAssignmentResponderRelationshipData() {} + + @JsonCreator + public IncidentRoleAssignmentResponderRelationshipData( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) UUID id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) String type) { + this.id = id; + this.type = type; + } + + public IncidentRoleAssignmentResponderRelationshipData id(UUID id) { + this.id = id; + return this; + } + + /** + * The responder identifier. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UUID getId() { + return id; + } + + public void setId(UUID id) { + this.id = id; + } + + public IncidentRoleAssignmentResponderRelationshipData type(String type) { + this.type = type; + return this; + } + + /** + * The responder resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return IncidentRoleAssignmentResponderRelationshipData + */ + @JsonAnySetter + public IncidentRoleAssignmentResponderRelationshipData 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 IncidentRoleAssignmentResponderRelationshipData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IncidentRoleAssignmentResponderRelationshipData + incidentRoleAssignmentResponderRelationshipData = + (IncidentRoleAssignmentResponderRelationshipData) o; + return Objects.equals(this.id, incidentRoleAssignmentResponderRelationshipData.id) + && Objects.equals(this.type, incidentRoleAssignmentResponderRelationshipData.type) + && Objects.equals( + this.additionalProperties, + incidentRoleAssignmentResponderRelationshipData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IncidentRoleAssignmentResponderRelationshipData {\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/IncidentRoleAssignmentRoleRelationship.java b/src/main/java/com/datadog/api/client/v2/model/IncidentRoleAssignmentRoleRelationship.java new file mode 100644 index 00000000000..4e45892e199 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentRoleAssignmentRoleRelationship.java @@ -0,0 +1,150 @@ +/* + * 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; +import org.openapitools.jackson.nullable.JsonNullable; + +/** Relationship to a role. */ +@JsonPropertyOrder({IncidentRoleAssignmentRoleRelationship.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IncidentRoleAssignmentRoleRelationship { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private JsonNullable data = + JsonNullable.undefined(); + + public IncidentRoleAssignmentRoleRelationship data( + IncidentRoleAssignmentRoleRelationshipData data) { + this.data = JsonNullable.of(data); + return this; + } + + /** + * Role relationship data. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonIgnore + public IncidentRoleAssignmentRoleRelationshipData getData() { + return data.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getData_JsonNullable() { + return data; + } + + @JsonProperty(JSON_PROPERTY_DATA) + public void setData_JsonNullable(JsonNullable data) { + this.data = data; + } + + public void setData(IncidentRoleAssignmentRoleRelationshipData data) { + this.data = JsonNullable.of(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 IncidentRoleAssignmentRoleRelationship + */ + @JsonAnySetter + public IncidentRoleAssignmentRoleRelationship 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 IncidentRoleAssignmentRoleRelationship object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IncidentRoleAssignmentRoleRelationship incidentRoleAssignmentRoleRelationship = + (IncidentRoleAssignmentRoleRelationship) o; + return Objects.equals(this.data, incidentRoleAssignmentRoleRelationship.data) + && Objects.equals( + this.additionalProperties, incidentRoleAssignmentRoleRelationship.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IncidentRoleAssignmentRoleRelationship {\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/IncidentRoleAssignmentRoleRelationshipData.java b/src/main/java/com/datadog/api/client/v2/model/IncidentRoleAssignmentRoleRelationshipData.java new file mode 100644 index 00000000000..25c94463c70 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentRoleAssignmentRoleRelationshipData.java @@ -0,0 +1,178 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.UUID; + +/** Role relationship data. */ +@JsonPropertyOrder({ + IncidentRoleAssignmentRoleRelationshipData.JSON_PROPERTY_ID, + IncidentRoleAssignmentRoleRelationshipData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IncidentRoleAssignmentRoleRelationshipData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private UUID id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public IncidentRoleAssignmentRoleRelationshipData() {} + + @JsonCreator + public IncidentRoleAssignmentRoleRelationshipData( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) UUID id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) String type) { + this.id = id; + this.type = type; + } + + public IncidentRoleAssignmentRoleRelationshipData id(UUID id) { + this.id = id; + return this; + } + + /** + * The role identifier. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UUID getId() { + return id; + } + + public void setId(UUID id) { + this.id = id; + } + + public IncidentRoleAssignmentRoleRelationshipData type(String type) { + this.type = type; + return this; + } + + /** + * The role resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return IncidentRoleAssignmentRoleRelationshipData + */ + @JsonAnySetter + public IncidentRoleAssignmentRoleRelationshipData 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 IncidentRoleAssignmentRoleRelationshipData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IncidentRoleAssignmentRoleRelationshipData incidentRoleAssignmentRoleRelationshipData = + (IncidentRoleAssignmentRoleRelationshipData) o; + return Objects.equals(this.id, incidentRoleAssignmentRoleRelationshipData.id) + && Objects.equals(this.type, incidentRoleAssignmentRoleRelationshipData.type) + && Objects.equals( + this.additionalProperties, + incidentRoleAssignmentRoleRelationshipData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IncidentRoleAssignmentRoleRelationshipData {\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/IncidentRoleAssignmentType.java b/src/main/java/com/datadog/api/client/v2/model/IncidentRoleAssignmentType.java new file mode 100644 index 00000000000..00fa12242f6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentRoleAssignmentType.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; + +/** Incident role assignment resource type. */ +@JsonSerialize(using = IncidentRoleAssignmentType.IncidentRoleAssignmentTypeSerializer.class) +public class IncidentRoleAssignmentType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("incident_role_assignments")); + + public static final IncidentRoleAssignmentType INCIDENT_ROLE_ASSIGNMENTS = + new IncidentRoleAssignmentType("incident_role_assignments"); + + IncidentRoleAssignmentType(String value) { + super(value, allowedValues); + } + + public static class IncidentRoleAssignmentTypeSerializer + extends StdSerializer { + public IncidentRoleAssignmentTypeSerializer(Class t) { + super(t); + } + + public IncidentRoleAssignmentTypeSerializer() { + this(null); + } + + @Override + public void serialize( + IncidentRoleAssignmentType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static IncidentRoleAssignmentType fromValue(String value) { + return new IncidentRoleAssignmentType(value); + } +} diff --git a/src/test/resources/com/datadog/api/client/v2/api/given.json b/src/test/resources/com/datadog/api/client/v2/api/given.json index 9400f1fd234..84ca5af22e2 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/given.json +++ b/src/test/resources/com/datadog/api/client/v2/api/given.json @@ -738,6 +738,18 @@ "tag": "Incidents", "operationId": "CreateIncident" }, + { + "parameters": [ + { + "name": "body", + "value": "{\"data\":{\"type\":\"incidents\",\"attributes\":{\"title\":\"{{ unique }}\",\"customer_impacted\":false},\"relationships\":{\"commander_user\":{\"data\":{\"id\":\"{{ user.data.id }}\",\"type\":\"users\"}}}}}" + } + ], + "step": "there is a valid \"incident_with_commander\" in the system", + "key": "incident_with_commander", + "tag": "Incidents", + "operationId": "CreateIncident" + }, { "operationId": "CreateIncidentNotificationRule", "parameters": [ 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 95b84ab7a38..e51464f5d2b 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 @@ -106,6 +106,33 @@ Feature: Incidents When the request is sent Then the response status is 404 Not Found + @generated @skip @team:ddoghq/incident-app + Scenario: Create an incident responder returns "Bad Request" response + Given operation "CreateIncidentResponder" enabled + And new "CreateIncidentResponder" request + And request contains "incident_id" parameter from "REPLACE.ME" + And body with value {"data": {"relationships": {"user": {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "users"}}}, "type": "incident_responders"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:ddoghq/incident-app + Scenario: Create an incident responder returns "Created" response + Given operation "CreateIncidentResponder" enabled + And new "CreateIncidentResponder" request + And request contains "incident_id" parameter from "REPLACE.ME" + And body with value {"data": {"relationships": {"user": {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "users"}}}, "type": "incident_responders"}} + When the request is sent + Then the response status is 201 Created + + @generated @skip @team:ddoghq/incident-app + Scenario: Create an incident responder returns "Not Found" response + Given operation "CreateIncidentResponder" enabled + And new "CreateIncidentResponder" request + And request contains "incident_id" parameter from "REPLACE.ME" + And body with value {"data": {"relationships": {"user": {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "users"}}}, "type": "incident_responders"}} + When the request is sent + Then the response status is 404 Not Found + @generated @skip @team:ddoghq/incident-app Scenario: Create an incident returns "Bad Request" response Given operation "CreateIncident" enabled @@ -468,6 +495,33 @@ Feature: Incidents When the request is sent Then the response status is 404 Not Found + @generated @skip @team:ddoghq/incident-app + Scenario: Delete an incident responder returns "Bad Request" response + Given operation "DeleteIncidentResponder" enabled + And new "DeleteIncidentResponder" request + And request contains "incident_id" parameter from "REPLACE.ME" + And request contains "responder_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:ddoghq/incident-app + Scenario: Delete an incident responder returns "No Content" response + Given operation "DeleteIncidentResponder" enabled + And new "DeleteIncidentResponder" request + And request contains "incident_id" parameter from "REPLACE.ME" + And request contains "responder_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:ddoghq/incident-app + Scenario: Delete an incident responder returns "Not Found" response + Given operation "DeleteIncidentResponder" enabled + And new "DeleteIncidentResponder" request + And request contains "incident_id" parameter from "REPLACE.ME" + And request contains "responder_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + @generated @skip @team:ddoghq/incident-app Scenario: Delete an incident todo returns "Bad Request" response Given operation "DeleteIncidentTodo" enabled @@ -805,6 +859,33 @@ Feature: Incidents When the request is sent Then the response status is 200 OK + @generated @skip @team:ddoghq/incident-app + Scenario: Get an incident responder returns "Bad Request" response + Given operation "GetIncidentResponder" enabled + And new "GetIncidentResponder" request + And request contains "incident_id" parameter from "REPLACE.ME" + And request contains "responder_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:ddoghq/incident-app + Scenario: Get an incident responder returns "Not Found" response + Given operation "GetIncidentResponder" enabled + And new "GetIncidentResponder" request + And request contains "incident_id" parameter from "REPLACE.ME" + And request contains "responder_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:ddoghq/incident-app + Scenario: Get an incident responder returns "OK" response + Given operation "GetIncidentResponder" enabled + And new "GetIncidentResponder" request + And request contains "incident_id" parameter from "REPLACE.ME" + And request contains "responder_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:ddoghq/incident-app Scenario: Get an incident user-defined field returns "Not Found" response Given operation "GetIncidentUserDefinedField" enabled @@ -1172,6 +1253,45 @@ Feature: Incidents Then the response status is 200 OK And the response "data" has length 0 + @team:ddoghq/incident-app + Scenario: List incident responders includes users and role assignments + Given operation "CreateIncident" enabled + And operation "ListIncidentResponders" enabled + And there is a valid "user" in the system + And there is a valid "incident_with_commander" in the system + And new "ListIncidentResponders" request + And request contains "incident_id" parameter from "incident_with_commander.data.id" + And request contains "include" parameter with value ["users", "role_assignments"] + When the request is sent + Then the response status is 200 OK + And the response "included" has item with field "type" with value "users" + And the response "included" has item with field "type" with value "incident_role_assignments" + And the response "included" has item with field "id" with value "{{ user.data.id }}" + + @generated @skip @team:ddoghq/incident-app + Scenario: List incident responders returns "Bad Request" response + Given operation "ListIncidentResponders" enabled + And new "ListIncidentResponders" request + And request contains "incident_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:ddoghq/incident-app + Scenario: List incident responders returns "Not Found" response + Given operation "ListIncidentResponders" enabled + And new "ListIncidentResponders" request + And request contains "incident_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:ddoghq/incident-app + Scenario: List incident responders returns "OK" response + Given operation "ListIncidentResponders" enabled + And new "ListIncidentResponders" request + And request contains "incident_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:ddoghq/incident-app Scenario: List incident user-defined roles returns "Bad Request" response Given operation "ListIncidentUserDefinedRoles" 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 8ce55668e7f..2b20834efcf 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 @@ -4215,6 +4215,41 @@ "type": "idempotent" } }, + "ListIncidentResponders": { + "tag": "Incidents", + "undo": { + "type": "safe" + } + }, + "CreateIncidentResponder": { + "tag": "Incidents", + "undo": { + "operationId": "DeleteIncidentResponder", + "parameters": [ + { + "name": "incident_id", + "source": "data.relationships.incident.data.id" + }, + { + "name": "responder_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "DeleteIncidentResponder": { + "tag": "Incidents", + "undo": { + "type": "idempotent" + } + }, + "GetIncidentResponder": { + "tag": "Incidents", + "undo": { + "type": "safe" + } + }, "ListDatabricksIntegrationAccounts": { "tag": "Databricks Integration", "undo": { diff --git a/src/test/resources/generated-test/test-runner-data/manifest.json b/src/test/resources/generated-test/test-runner-data/manifest.json index fd76cf04532..1f460bf5a18 100644 --- a/src/test/resources/generated-test/test-runner-data/manifest.json +++ b/src/test/resources/generated-test/test-runner-data/manifest.json @@ -6755,6 +6755,13 @@ "scenario": "List incident notification templates returns \"OK\" response", "version": "v2" }, + { + "feature": "Incidents", + "feature_file": "../../com/datadog/api/client/v2/api/incidents.feature", + "file": "v2/incidents/list-incident-responders-includes-users-and-role-assignments.json", + "scenario": "List incident responders includes users and role assignments", + "version": "v2" + }, { "feature": "Incidents", "feature_file": "../../com/datadog/api/client/v2/api/incidents.feature", diff --git a/src/test/resources/generated-test/test-runner-data/v2/incidents/list-incident-responders-includes-users-and-role-assignments.json b/src/test/resources/generated-test/test-runner-data/v2/incidents/list-incident-responders-includes-users-and-role-assignments.json new file mode 100644 index 00000000000..244d03105a7 --- /dev/null +++ b/src/test/resources/generated-test/test-runner-data/v2/incidents/list-incident-responders-includes-users-and-role-assignments.json @@ -0,0 +1,59 @@ +{ + "api": "Incidents", + "expected_status": 200, + "feature": "Incidents", + "id": "v2/Incidents/List incident responders includes users and role assignments", + "operation_id": "ListIncidentResponders", + "request": { + "body": null, + "content_type": null, + "method": "GET", + "pagination": false, + "parameters": [ + { + "explode": null, + "in": "path", + "name": "incident_id", + "required": true, + "schema": { + "format": null, + "ref": null, + "type": "string" + }, + "source": { + "path": "incident_with_commander.data.id", + "type": "fixture" + }, + "style": null + }, + { + "explode": false, + "in": "query", + "name": "include", + "required": false, + "schema": { + "format": null, + "items": { + "format": null, + "ref": "IncidentResponderRelatedObject", + "type": "string" + }, + "ref": null, + "type": "array" + }, + "source": { + "type": "literal", + "value": [ + "users", + "role_assignments" + ] + }, + "style": "form" + } + ], + "path": "/api/v2/incidents/{incident_id}/responders" + }, + "scenario": "List incident responders includes users and role assignments", + "schema_version": 1, + "version": "v2" +} diff --git a/src/test/resources/generated-test/test-server-data/v2/incidents.json b/src/test/resources/generated-test/test-server-data/v2/incidents.json index dfd1ebe4531..8d80c054cac 100644 --- a/src/test/resources/generated-test/test-server-data/v2/incidents.json +++ b/src/test/resources/generated-test/test-server-data/v2/incidents.json @@ -4116,6 +4116,154 @@ "scenario": "List incident notification templates returns \"OK\" response", "version": "v2" }, + { + "feature": "Incidents", + "frozen_at": "2026-10-26T18:25:38.922Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "email": "Test-List_incident_responders_includes_users_and_role_assignments-1793039138@datadoghq.com", + "title": "user title" + }, + "type": "users" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/users", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"type\":\"users\",\"id\":\"59b0865d-569a-4e8c-bf20-082d6b9d04b5\",\"attributes\":{\"uuid\":\"59b0865d-569a-4e8c-bf20-082d6b9d04b5\",\"name\":null,\"handle\":\"test-list_incident_responders_includes_users_and_role_assignments-1793039138@datadoghq.com\",\"created_at\":\"2026-10-26T18:25:40.973286+00:00\",\"modified_at\":\"2026-10-26T18:25:40.973286+00:00\",\"email\":\"test-list_incident_responders_includes_users_and_role_assignments-1793039138@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/363c5a1b731e4c8877fb5b13df6819f1?s=48&d=retro\",\"title\":\"user title\",\"verified\":false,\"service_account\":false,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Pending\",\"last_login_time\":null},\"relationships\":{\"roles\":{\"data\":[]},\"org\":{\"data\":{\"type\":\"orgs\",\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\"}}}}}" + }, + "headers": { + "content-type": "application/json" + }, + "reason": "Created", + "status": 201 + } + }, + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "customer_impacted": false, + "title": "Test-List_incident_responders_includes_users_and_role_assignments-1793039138" + }, + "relationships": { + "commander_user": { + "data": { + "id": "59b0865d-569a-4e8c-bf20-082d6b9d04b5", + "type": "users" + } + } + }, + "type": "incidents" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/incidents", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"7f2dae66-cde0-4662-b36e-4d33505dc14e\",\"type\":\"incidents\",\"attributes\":{\"case_id\":null,\"created\":\"2026-10-26T18:25:41.068723Z\",\"created_by_uuid\":\"028000b7-d90f-4d20-b4a9-6ff4a83b7950\",\"creation_idempotency_key\":null,\"customer_impact_duration\":0,\"customer_impact_end\":null,\"customer_impact_scope\":null,\"customer_impact_start\":null,\"customer_impacted\":false,\"declared\":\"2026-10-26T18:25:41.068723Z\",\"declared_by_uuid\":\"028000b7-d90f-4d20-b4a9-6ff4a83b7950\",\"detected\":\"2026-10-26T18:25:41.068723Z\",\"field_analytics\":null,\"fields\":{\"detection_method\":{\"type\":\"dropdown\",\"value\":\"unknown\"},\"root_cause\":{\"type\":\"textbox\",\"value\":null},\"services\":{\"type\":\"autocomplete\",\"value\":null},\"severity\":{\"type\":\"dropdown\",\"value\":\"UNKNOWN\"},\"slug\":{\"type\":\"textbox\",\"value\":\"IR-384168\"},\"state\":{\"type\":\"dropdown\",\"value\":\"active\"},\"state_category\":{\"type\":\"dropdown\",\"value\":\"live\"},\"summary\":{\"type\":\"textbox\",\"value\":null},\"teams\":{\"type\":\"autocomplete\",\"value\":null}},\"incident_type_uuid\":\"41d2e10b-4108-4736-92d7-791d00ea0702\",\"is_test\":false,\"last_modified_by_uuid\":\"028000b7-d90f-4d20-b4a9-6ff4a83b7950\",\"modified\":\"2026-10-26T18:25:41.068723Z\",\"non_datadog_creator\":null,\"notification_handles\":null,\"public_id\":384168,\"resolved\":null,\"severity\":\"UNKNOWN\",\"state\":\"active\",\"time_from_detect_to_resolve\":0,\"time_to_detect\":0,\"time_to_internal_response\":0,\"time_to_repair\":0,\"time_to_resolve\":0,\"title\":\"Test-List_incident_responders_includes_users_and_role_assignments-1793039138\",\"visibility\":\"organization\"},\"relationships\":{\"attachments\":{\"data\":[]},\"commander_user\":{\"data\":{\"id\":\"59b0865d-569a-4e8c-bf20-082d6b9d04b5\",\"type\":\"users\"}},\"created_by_user\":{\"data\":{\"id\":\"028000b7-d90f-4d20-b4a9-6ff4a83b7950\",\"type\":\"users\"}},\"declared_by_user\":{\"data\":{\"id\":\"028000b7-d90f-4d20-b4a9-6ff4a83b7950\",\"type\":\"users\"}},\"impacts\":{\"data\":[]},\"incident_type\":{\"data\":{\"id\":\"41d2e10b-4108-4736-92d7-791d00ea0702\",\"type\":\"incident_types\"}},\"integrations\":{\"data\":[]},\"last_modified_by_user\":{\"data\":{\"id\":\"028000b7-d90f-4d20-b4a9-6ff4a83b7950\",\"type\":\"users\"}},\"responders\":{\"data\":[{\"id\":\"3fe10d30-0416-475b-8c4d-d4b11de61b38\",\"type\":\"incident_responders\"}]},\"user_defined_fields\":{\"data\":[{\"id\":\"706cbbab-4951-4b12-8ab1-8de176b0b8ad\",\"type\":\"user_defined_field\"},{\"id\":\"33457d2a-570c-5567-b4af-979a2a8f1164\",\"type\":\"user_defined_field\"},{\"id\":\"1ddff6f6-cb1f-51a0-9d81-dc18ef52cc9d\",\"type\":\"user_defined_field\"},{\"id\":\"39044b03-cee4-555f-b1e0-3eb3aa759a86\",\"type\":\"user_defined_field\"},{\"id\":\"2b9f1063-b915-4c7a-8bbd-fc3940245529\",\"type\":\"user_defined_field\"},{\"id\":\"d003693c-bee9-5420-8d46-859269c20914\",\"type\":\"user_defined_field\"},{\"id\":\"6bc9d32b-c2cd-591e-9b7a-74c886a5ddcf\",\"type\":\"user_defined_field\"},{\"id\":\"95c53547-2ba3-5d8a-9c3b-cf245bc0c629\",\"type\":\"user_defined_field\"},{\"id\":\"3cbe9e60-d794-532c-acc0-73641f782813\",\"type\":\"user_defined_field\"}]}}}}" + }, + "headers": { + "content-type": "application/json" + }, + "reason": "Created", + "status": 201 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "GET", + "path": "/api/v2/incidents/7f2dae66-cde0-4662-b36e-4d33505dc14e/responders", + "query": [ + [ + "include", + "users,role_assignments" + ] + ] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":[{\"id\":\"3fe10d30-0416-475b-8c4d-d4b11de61b38\",\"type\":\"incident_responders\",\"attributes\":{\"created\":\"2026-10-26T18:25:41.068723Z\",\"external_id\":null,\"external_source\":null,\"is_billable\":false,\"last_active\":null,\"meta\":null,\"modified\":\"2026-10-26T18:25:41.068723Z\"},\"relationships\":{\"created_by\":{\"data\":{\"id\":\"028000b7-d90f-4d20-b4a9-6ff4a83b7950\",\"type\":\"users\"}},\"last_modified_by\":{\"data\":{\"id\":\"028000b7-d90f-4d20-b4a9-6ff4a83b7950\",\"type\":\"users\"}},\"role_assignments\":{\"data\":[{\"id\":\"a7fcc9d3-2702-474f-9f8a-8c5e70cb5400\",\"type\":\"incident_role_assignments\"}]},\"user\":{\"data\":{\"id\":\"59b0865d-569a-4e8c-bf20-082d6b9d04b5\",\"type\":\"users\"}}}}],\"meta\":{\"pagination\":{\"type\":\"offset_limit\",\"offset\":0,\"limit\":25,\"total\":null,\"first_offset\":0,\"prev_offset\":null,\"next_offset\":25,\"last_offset\":null}},\"links\":{\"self\":\"https://api.datadoghq.com/api/v2/incidents/7f2dae66-cde0-4662-b36e-4d33505dc14e/responders?include=users%2Crole_assignments\",\"first\":\"https://api.datadoghq.com/api/v2/incidents/7f2dae66-cde0-4662-b36e-4d33505dc14e/responders?include=users,role_assignments&page[limit]=25&page[offset]=0\",\"next\":\"https://api.datadoghq.com/api/v2/incidents/7f2dae66-cde0-4662-b36e-4d33505dc14e/responders?include=users,role_assignments&page[limit]=25&page[offset]=25\"},\"included\":[{\"id\":\"a7fcc9d3-2702-474f-9f8a-8c5e70cb5400\",\"type\":\"incident_role_assignments\",\"attributes\":{\"created\":\"2026-10-26T18:25:41.068723Z\",\"deleted\":\"0001-01-01T00:00:00Z\",\"modified\":\"2026-10-26T18:25:41.068723Z\",\"responder_type\":\"Incident Commander\",\"role\":\"Incident Commander\"},\"relationships\":{\"created_by_user\":{\"data\":{\"id\":\"028000b7-d90f-4d20-b4a9-6ff4a83b7950\",\"type\":\"users\"}},\"last_modified_by_user\":{\"data\":{\"id\":\"028000b7-d90f-4d20-b4a9-6ff4a83b7950\",\"type\":\"users\"}},\"reserved_role\":{\"data\":{\"id\":\"14fd9cd1-5c99-4d94-9d78-d017810d9d80\",\"type\":\"incident_reserved_roles\"}},\"responder\":{\"data\":{\"id\":\"3fe10d30-0416-475b-8c4d-d4b11de61b38\",\"type\":\"incident_responders\"}},\"user_defined_role\":{\"data\":null}}},{\"id\":\"59b0865d-569a-4e8c-bf20-082d6b9d04b5\",\"type\":\"users\",\"attributes\":{\"email\":\"test-list_incident_responders_includes_users_and_role_assignments-1793039138@datadoghq.com\",\"handle\":\"test-list_incident_responders_includes_users_and_role_assignments-1793039138@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/363c5a1b731e4c8877fb5b13df6819f1?d=retro&s=48\",\"name\":\"\",\"uuid\":\"59b0865d-569a-4e8c-bf20-082d6b9d04b5\"}},{\"id\":\"028000b7-d90f-4d20-b4a9-6ff4a83b7950\",\"type\":\"users\",\"attributes\":{\"email\":\"recorded-user@example.com\",\"handle\":\"recorded-user@example.com\",\"icon\":\"https://example.com/avatar.png\",\"name\":\"Example User\",\"uuid\":\"028000b7-d90f-4d20-b4a9-6ff4a83b7950\"}}]}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/incidents/7f2dae66-cde0-4662-b36e-4d33505dc14e", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/users/59b0865d-569a-4e8c-bf20-082d6b9d04b5", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + } + ], + "scenario": "List incident responders includes users and role assignments", + "version": "v2" + }, { "feature": "Incidents", "frozen_at": "2026-02-23T14:06:50.098Z",