diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 51127c3aea2..500a3319903 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -22843,7 +22843,6 @@ components: status: $ref: "#/components/schemas/CreateMaintenanceRequestDataAttributesUpdatesItemsStatus" required: - - components_affected - description - started_at - status @@ -23789,7 +23788,6 @@ components: example: "API Maintenance" type: string required: - - components_affected - title - completed_date - completed_description @@ -24472,6 +24470,9 @@ components: description: Base64-encoded image data included in email notifications sent to status page subscribers. example: data:image/png;base64,pQSLAw0KGgoAAAANSUhEUgAAAQ4AASJKFF type: string + enabled: + description: Whether the status page is enabled. + type: boolean favicon: description: Base64-encoded image data displayed in the browser tab. example: data:image/png;base64,kWMRNw0KGgoAAAANSUhEUgAAAEAAAABACA @@ -24480,6 +24481,12 @@ components: description: The name of the status page. example: Status Page US1 type: string + slack_app_icon: + description: The Slack app icon URL for the status page. + type: string + slack_subscriptions_enabled: + description: Whether Slack subscriptions are enabled for the status page. + type: boolean subscriptions_enabled: description: Whether users can subscribe to the status page. example: true @@ -29747,6 +29754,12 @@ components: format: date-time readOnly: true type: string + deleted_at: + description: The date and time the resource was deleted. + type: string + deleted_by_user_uuid: + description: UUID of the user who deleted the resource. + type: string description: description: Description of the update. type: string @@ -29871,6 +29884,162 @@ components: oneOf: - $ref: "#/components/schemas/StatusPagesUser" - $ref: "#/components/schemas/StatusPageAsIncluded" + DegradationUpdate: + description: Response object for a degradation update. + properties: + data: + $ref: "#/components/schemas/DegradationUpdateData" + included: + description: Resources related to the degradation update. + items: + $ref: "#/components/schemas/DegradationUpdateIncluded" + type: array + type: object + DegradationUpdateData: + description: The data object for a degradation update. + properties: + attributes: + $ref: "#/components/schemas/DegradationUpdateDataAttributes" + id: + description: The ID of the degradation update. + type: string + relationships: + $ref: "#/components/schemas/DegradationUpdateDataRelationships" + type: + $ref: "#/components/schemas/PatchDegradationUpdateRequestDataType" + required: + - type + type: object + DegradationUpdateDataAttributes: + description: Attributes of a degradation update resource. + properties: + components_affected: + description: Components affected by this update. + items: + $ref: "#/components/schemas/DegradationUpdateDataAttributesComponentsAffectedItems" + type: array + created_at: + description: The date and time the update was created. + format: date-time + type: string + deleted_at: + description: The date and time the update was soft-deleted. + format: date-time + type: string + description: + description: The message body of the update. + type: string + modified_at: + description: The date and time the update was last modified. + format: date-time + type: string + started_at: + description: The date and time the update started. + format: date-time + type: string + status: + $ref: "#/components/schemas/CreateDegradationRequestDataAttributesStatus" + type: object + DegradationUpdateDataAttributesComponentsAffectedItems: + description: A component affected by a degradation update. + properties: + id: + description: The ID of the affected component. + example: "" + type: string + name: + description: The name of the affected component. + readOnly: true + type: string + status: + $ref: "#/components/schemas/StatusPagesComponentDataAttributesStatus" + required: + - id + - status + type: object + DegradationUpdateDataRelationships: + description: Relationships of a degradation update resource. + properties: + created_by_user: + $ref: "#/components/schemas/DegradationUpdateDataRelationshipsUser" + degradation: + $ref: "#/components/schemas/DegradationUpdateDataRelationshipsDegradation" + deleted_by_user: + $ref: "#/components/schemas/DegradationUpdateDataRelationshipsUser" + last_modified_by_user: + $ref: "#/components/schemas/DegradationUpdateDataRelationshipsUser" + status_page: + $ref: "#/components/schemas/DegradationUpdateDataRelationshipsStatusPage" + type: object + DegradationUpdateDataRelationshipsDegradation: + description: The degradation relationship of a degradation update. + properties: + data: + $ref: "#/components/schemas/DegradationUpdateDataRelationshipsDegradationData" + required: + - data + type: object + DegradationUpdateDataRelationshipsDegradationData: + description: The degradation linked to a degradation update. + properties: + id: + description: The ID of the degradation. + example: "" + type: string + type: + $ref: "#/components/schemas/PatchDegradationRequestDataType" + required: + - type + - id + type: object + DegradationUpdateDataRelationshipsStatusPage: + description: The status page relationship of a degradation update. + properties: + data: + $ref: "#/components/schemas/DegradationUpdateDataRelationshipsStatusPageData" + required: + - data + type: object + DegradationUpdateDataRelationshipsStatusPageData: + description: The status page linked to a degradation update. + properties: + id: + description: The ID of the status page. + example: "" + type: string + type: + $ref: "#/components/schemas/StatusPageDataType" + required: + - type + - id + type: object + DegradationUpdateDataRelationshipsUser: + description: A user relationship of a degradation update. + properties: + data: + $ref: "#/components/schemas/DegradationUpdateDataRelationshipsUserData" + required: + - data + type: object + DegradationUpdateDataRelationshipsUserData: + description: A Datadog user linked to a degradation update. + properties: + id: + description: The ID of the user. + example: "" + type: string + type: + $ref: "#/components/schemas/StatusPagesUserType" + required: + - type + - id + type: object + DegradationUpdateIncluded: + description: Resources included in a degradation update response. + oneOf: + - $ref: "#/components/schemas/StatusPagesUser" + - $ref: "#/components/schemas/Degradation" + - $ref: "#/components/schemas/StatusPageAsIncluded" DeleteAppResponse: description: The response object after an app is successfully deleted. properties: @@ -71960,6 +72129,61 @@ components: type: string x-enum-varnames: - DEGRADATIONS + PatchDegradationUpdateRequest: + description: Request object for editing a degradation update. + example: + data: + attributes: + description: We've identified the source of the latency increase and are deploying a fix. + status: identified + id: 00000000-0000-0000-0000-000000000000 + type: degradation_updates + properties: + data: + $ref: "#/components/schemas/PatchDegradationUpdateRequestData" + type: object + PatchDegradationUpdateRequestData: + description: The data object for editing a degradation update. + properties: + attributes: + $ref: "#/components/schemas/PatchDegradationUpdateRequestDataAttributes" + id: + description: The ID of the degradation update to edit. + type: string + type: + $ref: "#/components/schemas/PatchDegradationUpdateRequestDataType" + required: + - type + type: object + PatchDegradationUpdateRequestDataAttributes: + description: Attributes for editing a degradation update. + properties: + description: + description: The message body of the update. + type: string + status: + $ref: "#/components/schemas/PatchDegradationUpdateRequestDataAttributesStatus" + type: object + PatchDegradationUpdateRequestDataAttributesStatus: + description: The status of the degradation update. + enum: + - investigating + - identified + - monitoring + type: string + x-enum-varnames: + - INVESTIGATING + - IDENTIFIED + - MONITORING + PatchDegradationUpdateRequestDataType: + default: degradation_updates + description: Degradation updates resource type. + enum: + - degradation_updates + example: degradation_updates + type: string + x-enum-varnames: + - DEGRADATION_UPDATES PatchIncidentNotificationTemplateRequest: description: Update request for a notification template. properties: @@ -72174,6 +72398,12 @@ components: description: The name of the status page. example: Status Page US1 type: string + slack_app_icon: + description: The Slack app icon URL for the status page. + type: string + slack_subscriptions_enabled: + description: Whether Slack subscriptions are enabled for the status page. + type: boolean subscriptions_enabled: description: Whether users can subscribe to the status page. example: true @@ -93878,6 +94108,12 @@ components: page_url: description: The url that the status page is accessible at. type: string + slack_app_icon: + description: The Slack app icon URL for the status page. + type: string + slack_subscriptions_enabled: + description: Whether Slack subscriptions are enabled for the status page. + type: boolean subscriptions_enabled: description: Whether users can subscribe to the status page. type: boolean @@ -94046,6 +94282,12 @@ components: page_url: description: The url that the status page is accessible at. type: string + slack_app_icon: + description: The Slack app icon URL for the status page. + type: string + slack_subscriptions_enabled: + description: Whether Slack subscriptions are enabled for the status page. + type: boolean subscriptions_enabled: description: Whether users can subscribe to the status page. type: boolean @@ -182940,7 +183182,8 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - - AuthZ: [] + - AuthZ: + - status_pages_settings_read summary: List status pages tags: - Status Pages @@ -183020,7 +183263,8 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - - AuthZ: [] + - AuthZ: + - status_pages_settings_write summary: Create status page tags: - Status Pages @@ -183093,7 +183337,8 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - - AuthZ: [] + - AuthZ: + - status_pages_settings_read summary: List degradations tags: - Status Pages @@ -183167,7 +183412,8 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - - AuthZ: [] + - AuthZ: + - status_pages_settings_read summary: List maintenances tags: - Status Pages @@ -183196,7 +183442,8 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - - AuthZ: [] + - AuthZ: + - status_pages_settings_write summary: Delete status page tags: - Status Pages @@ -183247,7 +183494,8 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - - AuthZ: [] + - AuthZ: + - status_pages_settings_read summary: Get status page tags: - Status Pages @@ -183326,7 +183574,8 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - - AuthZ: [] + - AuthZ: + - status_pages_settings_write summary: Update status page tags: - Status Pages @@ -183375,7 +183624,8 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - - AuthZ: [] + - AuthZ: + - status_pages_settings_read summary: List components tags: - Status Pages @@ -183441,7 +183691,8 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - - AuthZ: [] + - AuthZ: + - status_pages_settings_write summary: Create component tags: - Status Pages @@ -183478,7 +183729,8 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - - AuthZ: [] + - AuthZ: + - status_pages_settings_write summary: Delete component tags: - Status Pages @@ -183534,7 +183786,8 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - - AuthZ: [] + - AuthZ: + - status_pages_settings_read summary: Get component tags: - Status Pages @@ -183605,7 +183858,8 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - - AuthZ: [] + - AuthZ: + - status_pages_settings_write summary: Update component tags: - Status Pages @@ -183683,7 +183937,8 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - - AuthZ: [] + - AuthZ: + - status_pages_incident_write summary: Create degradation tags: - Status Pages @@ -183762,7 +184017,8 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - - AuthZ: [] + - AuthZ: + - status_pages_incident_write summary: Create backfilled degradation tags: - Status Pages @@ -183799,7 +184055,8 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - - AuthZ: [] + - AuthZ: + - status_pages_incident_write summary: Delete degradation tags: - Status Pages @@ -183860,7 +184117,8 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - - AuthZ: [] + - AuthZ: + - status_pages_settings_read summary: Get degradation tags: - Status Pages @@ -183946,7 +184204,8 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - - AuthZ: [] + - AuthZ: + - status_pages_incident_write summary: Update degradation tags: - Status Pages @@ -183954,6 +184213,116 @@ paths: operator: AND permissions: - status_pages_incident_write + /api/v2/statuspages/{page_id}/degradations/{degradation_id}/updates/{update_id}: + delete: + description: Soft-deletes a degradation update. + operationId: SoftDeleteDegradationUpdate + parameters: + - description: The ID of the degradation. + in: path + name: degradation_id + required: true + schema: + format: uuid + type: string + - description: The ID of the status page. + in: path + name: page_id + required: true + schema: + format: uuid + type: string + - description: The ID of the degradation update. + in: path + name: update_id + required: true + schema: + format: uuid + type: string + responses: + "204": + description: No Content + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - status_pages_incident_write + summary: Soft delete degradation update + tags: + - Status Pages + patch: + description: Edits a specific degradation update. + operationId: EditDegradationUpdate + parameters: + - description: The ID of the degradation. + in: path + name: degradation_id + required: true + schema: + format: uuid + type: string + - description: "Comma-separated list of resources to include. Supported values: created_by_user, last_modified_by_user, degradation, status_page." + in: query + name: include + schema: + type: string + - description: The ID of the status page. + in: path + name: page_id + required: true + schema: + format: uuid + type: string + - description: The ID of the degradation update. + in: path + name: update_id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + description: We've identified the source of the latency increase and are deploying a fix. + status: identified + id: 00000000-0000-0000-0000-000000000000 + type: degradation_updates + schema: + $ref: "#/components/schemas/PatchDegradationUpdateRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + description: We've identified the source of the latency increase and are deploying a fix. + status: identified + id: 00000000-0000-0000-0000-000000000000 + type: degradation_updates + schema: + $ref: "#/components/schemas/DegradationUpdate" + description: OK + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - status_pages_incident_write + summary: Edit degradation update + tags: + - Status Pages /api/v2/statuspages/{page_id}/maintenances: post: description: Schedules a new maintenance. @@ -184025,7 +184394,8 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - - AuthZ: [] + - AuthZ: + - status_pages_incident_write summary: Schedule maintenance tags: - Status Pages @@ -184103,7 +184473,8 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - - AuthZ: [] + - AuthZ: + - status_pages_incident_write summary: Create backfilled maintenance tags: - Status Pages @@ -184162,7 +184533,8 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - - AuthZ: [] + - AuthZ: + - status_pages_settings_read summary: Get maintenance tags: - Status Pages @@ -184244,7 +184616,8 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - - AuthZ: [] + - AuthZ: + - status_pages_incident_write summary: Update maintenance tags: - Status Pages @@ -184272,7 +184645,10 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - - AuthZ: [] + - AuthZ: + - status_pages_internal_page_publish + - status_pages_public_page_publish + - status_pages_settings_write summary: Publish status page tags: - Status Pages @@ -184302,7 +184678,10 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - - AuthZ: [] + - AuthZ: + - status_pages_internal_page_publish + - status_pages_public_page_publish + - status_pages_settings_write summary: Unpublish status page tags: - Status Pages diff --git a/examples/v2/status-pages/EditDegradationUpdate.java b/examples/v2/status-pages/EditDegradationUpdate.java new file mode 100644 index 00000000000..91f2a690ad8 --- /dev/null +++ b/examples/v2/status-pages/EditDegradationUpdate.java @@ -0,0 +1,48 @@ +// Edit degradation update returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.StatusPagesApi; +import com.datadog.api.client.v2.model.DegradationUpdate; +import com.datadog.api.client.v2.model.PatchDegradationUpdateRequest; +import com.datadog.api.client.v2.model.PatchDegradationUpdateRequestData; +import com.datadog.api.client.v2.model.PatchDegradationUpdateRequestDataAttributes; +import com.datadog.api.client.v2.model.PatchDegradationUpdateRequestDataAttributesStatus; +import com.datadog.api.client.v2.model.PatchDegradationUpdateRequestDataType; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + StatusPagesApi apiInstance = new StatusPagesApi(defaultClient); + + PatchDegradationUpdateRequest body = + new PatchDegradationUpdateRequest() + .data( + new PatchDegradationUpdateRequestData() + .attributes( + new PatchDegradationUpdateRequestDataAttributes() + .description( + "We've identified the source of the latency increase and are" + + " deploying a fix.") + .status(PatchDegradationUpdateRequestDataAttributesStatus.IDENTIFIED)) + .id("00000000-0000-0000-0000-000000000000") + .type(PatchDegradationUpdateRequestDataType.DEGRADATION_UPDATES)); + + try { + DegradationUpdate result = + apiInstance.editDegradationUpdate( + UUID.fromString("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"), + UUID.fromString("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"), + UUID.fromString("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"), + body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling StatusPagesApi#editDegradationUpdate"); + 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/status-pages/SoftDeleteDegradationUpdate.java b/examples/v2/status-pages/SoftDeleteDegradationUpdate.java new file mode 100644 index 00000000000..30ec1f112d3 --- /dev/null +++ b/examples/v2/status-pages/SoftDeleteDegradationUpdate.java @@ -0,0 +1,26 @@ +// Soft delete degradation update returns "No Content" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.StatusPagesApi; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + StatusPagesApi apiInstance = new StatusPagesApi(defaultClient); + + try { + apiInstance.softDeleteDegradationUpdate( + UUID.fromString("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"), + UUID.fromString("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"), + UUID.fromString("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d")); + } catch (ApiException e) { + System.err.println("Exception when calling StatusPagesApi#softDeleteDegradationUpdate"); + 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/StatusPagesApi.java b/src/main/java/com/datadog/api/client/v2/api/StatusPagesApi.java index 5e4b0009531..6c08cc8ae76 100644 --- a/src/main/java/com/datadog/api/client/v2/api/StatusPagesApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/StatusPagesApi.java @@ -12,10 +12,12 @@ import com.datadog.api.client.v2.model.CreateStatusPageRequest; import com.datadog.api.client.v2.model.Degradation; import com.datadog.api.client.v2.model.DegradationArray; +import com.datadog.api.client.v2.model.DegradationUpdate; import com.datadog.api.client.v2.model.Maintenance; import com.datadog.api.client.v2.model.MaintenanceArray; import com.datadog.api.client.v2.model.PatchComponentRequest; import com.datadog.api.client.v2.model.PatchDegradationRequest; +import com.datadog.api.client.v2.model.PatchDegradationUpdateRequest; import com.datadog.api.client.v2.model.PatchMaintenanceRequest; import com.datadog.api.client.v2.model.PatchStatusPageRequest; import com.datadog.api.client.v2.model.StatusPage; @@ -1855,6 +1857,294 @@ public CompletableFuture> deleteStatusPageWithHttpInfoAsync(UU null); } + /** Manage optional parameters to editDegradationUpdate. */ + public static class EditDegradationUpdateOptionalParameters { + private String include; + + /** + * Set include. + * + * @param include Comma-separated list of resources to include. Supported values: + * created_by_user, last_modified_by_user, degradation, status_page. (optional) + * @return EditDegradationUpdateOptionalParameters + */ + public EditDegradationUpdateOptionalParameters include(String include) { + this.include = include; + return this; + } + } + + /** + * Edit degradation update. + * + *

See {@link #editDegradationUpdateWithHttpInfo}. + * + * @param degradationId The ID of the degradation. (required) + * @param pageId The ID of the status page. (required) + * @param updateId The ID of the degradation update. (required) + * @param body (required) + * @return DegradationUpdate + * @throws ApiException if fails to make API call + */ + public DegradationUpdate editDegradationUpdate( + UUID degradationId, UUID pageId, UUID updateId, PatchDegradationUpdateRequest body) + throws ApiException { + return editDegradationUpdateWithHttpInfo( + degradationId, pageId, updateId, body, new EditDegradationUpdateOptionalParameters()) + .getData(); + } + + /** + * Edit degradation update. + * + *

See {@link #editDegradationUpdateWithHttpInfoAsync}. + * + * @param degradationId The ID of the degradation. (required) + * @param pageId The ID of the status page. (required) + * @param updateId The ID of the degradation update. (required) + * @param body (required) + * @return CompletableFuture<DegradationUpdate> + */ + public CompletableFuture editDegradationUpdateAsync( + UUID degradationId, UUID pageId, UUID updateId, PatchDegradationUpdateRequest body) { + return editDegradationUpdateWithHttpInfoAsync( + degradationId, pageId, updateId, body, new EditDegradationUpdateOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Edit degradation update. + * + *

See {@link #editDegradationUpdateWithHttpInfo}. + * + * @param degradationId The ID of the degradation. (required) + * @param pageId The ID of the status page. (required) + * @param updateId The ID of the degradation update. (required) + * @param body (required) + * @param parameters Optional parameters for the request. + * @return DegradationUpdate + * @throws ApiException if fails to make API call + */ + public DegradationUpdate editDegradationUpdate( + UUID degradationId, + UUID pageId, + UUID updateId, + PatchDegradationUpdateRequest body, + EditDegradationUpdateOptionalParameters parameters) + throws ApiException { + return editDegradationUpdateWithHttpInfo(degradationId, pageId, updateId, body, parameters) + .getData(); + } + + /** + * Edit degradation update. + * + *

See {@link #editDegradationUpdateWithHttpInfoAsync}. + * + * @param degradationId The ID of the degradation. (required) + * @param pageId The ID of the status page. (required) + * @param updateId The ID of the degradation update. (required) + * @param body (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<DegradationUpdate> + */ + public CompletableFuture editDegradationUpdateAsync( + UUID degradationId, + UUID pageId, + UUID updateId, + PatchDegradationUpdateRequest body, + EditDegradationUpdateOptionalParameters parameters) { + return editDegradationUpdateWithHttpInfoAsync(degradationId, pageId, updateId, body, parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Edits a specific degradation update. + * + * @param degradationId The ID of the degradation. (required) + * @param pageId The ID of the status page. (required) + * @param updateId The ID of the degradation update. (required) + * @param body (required) + * @param parameters Optional parameters for the request. + * @return ApiResponse<DegradationUpdate> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
429 Too many requests -
+ */ + public ApiResponse editDegradationUpdateWithHttpInfo( + UUID degradationId, + UUID pageId, + UUID updateId, + PatchDegradationUpdateRequest body, + EditDegradationUpdateOptionalParameters parameters) + throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'degradationId' is set + if (degradationId == null) { + throw new ApiException( + 400, "Missing the required parameter 'degradationId' when calling editDegradationUpdate"); + } + + // verify the required parameter 'pageId' is set + if (pageId == null) { + throw new ApiException( + 400, "Missing the required parameter 'pageId' when calling editDegradationUpdate"); + } + + // verify the required parameter 'updateId' is set + if (updateId == null) { + throw new ApiException( + 400, "Missing the required parameter 'updateId' when calling editDegradationUpdate"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling editDegradationUpdate"); + } + String include = parameters.include; + // create path and map variables + String localVarPath = + "/api/v2/statuspages/{page_id}/degradations/{degradation_id}/updates/{update_id}" + .replaceAll( + "\\{" + "degradation_id" + "\\}", apiClient.escapeString(degradationId.toString())) + .replaceAll("\\{" + "page_id" + "\\}", apiClient.escapeString(pageId.toString())) + .replaceAll("\\{" + "update_id" + "\\}", apiClient.escapeString(updateId.toString())); + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "include", include)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.StatusPagesApi.editDegradationUpdate", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Edit degradation update. + * + *

See {@link #editDegradationUpdateWithHttpInfo}. + * + * @param degradationId The ID of the degradation. (required) + * @param pageId The ID of the status page. (required) + * @param updateId The ID of the degradation update. (required) + * @param body (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<DegradationUpdate>> + */ + public CompletableFuture> editDegradationUpdateWithHttpInfoAsync( + UUID degradationId, + UUID pageId, + UUID updateId, + PatchDegradationUpdateRequest body, + EditDegradationUpdateOptionalParameters parameters) { + Object localVarPostBody = body; + + // verify the required parameter 'degradationId' is set + if (degradationId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'degradationId' when calling editDegradationUpdate")); + return result; + } + + // verify the required parameter 'pageId' is set + if (pageId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'pageId' when calling editDegradationUpdate")); + return result; + } + + // verify the required parameter 'updateId' is set + if (updateId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'updateId' when calling editDegradationUpdate")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling editDegradationUpdate")); + return result; + } + String include = parameters.include; + // create path and map variables + String localVarPath = + "/api/v2/statuspages/{page_id}/degradations/{degradation_id}/updates/{update_id}" + .replaceAll( + "\\{" + "degradation_id" + "\\}", apiClient.escapeString(degradationId.toString())) + .replaceAll("\\{" + "page_id" + "\\}", apiClient.escapeString(pageId.toString())) + .replaceAll("\\{" + "update_id" + "\\}", apiClient.escapeString(updateId.toString())); + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "include", include)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.StatusPagesApi.editDegradationUpdate", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + /** Manage optional parameters to getComponent. */ public static class GetComponentOptionalParameters { private String include; @@ -3761,6 +4051,192 @@ public CompletableFuture> publishStatusPageWithHttpInfoAsync(U null); } + /** + * Soft delete degradation update. + * + *

See {@link #softDeleteDegradationUpdateWithHttpInfo}. + * + * @param degradationId The ID of the degradation. (required) + * @param pageId The ID of the status page. (required) + * @param updateId The ID of the degradation update. (required) + * @throws ApiException if fails to make API call + */ + public void softDeleteDegradationUpdate(UUID degradationId, UUID pageId, UUID updateId) + throws ApiException { + softDeleteDegradationUpdateWithHttpInfo(degradationId, pageId, updateId); + } + + /** + * Soft delete degradation update. + * + *

See {@link #softDeleteDegradationUpdateWithHttpInfoAsync}. + * + * @param degradationId The ID of the degradation. (required) + * @param pageId The ID of the status page. (required) + * @param updateId The ID of the degradation update. (required) + * @return CompletableFuture + */ + public CompletableFuture softDeleteDegradationUpdateAsync( + UUID degradationId, UUID pageId, UUID updateId) { + return softDeleteDegradationUpdateWithHttpInfoAsync(degradationId, pageId, updateId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Soft-deletes a degradation update. + * + * @param degradationId The ID of the degradation. (required) + * @param pageId The ID of the status page. (required) + * @param updateId The ID of the degradation update. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + *
Response details
Status Code Description Response Headers
204 No Content -
429 Too many requests -
+ */ + public ApiResponse softDeleteDegradationUpdateWithHttpInfo( + UUID degradationId, UUID pageId, UUID updateId) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'degradationId' is set + if (degradationId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'degradationId' when calling" + + " softDeleteDegradationUpdate"); + } + + // verify the required parameter 'pageId' is set + if (pageId == null) { + throw new ApiException( + 400, "Missing the required parameter 'pageId' when calling softDeleteDegradationUpdate"); + } + + // verify the required parameter 'updateId' is set + if (updateId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'updateId' when calling softDeleteDegradationUpdate"); + } + // create path and map variables + String localVarPath = + "/api/v2/statuspages/{page_id}/degradations/{degradation_id}/updates/{update_id}" + .replaceAll( + "\\{" + "degradation_id" + "\\}", apiClient.escapeString(degradationId.toString())) + .replaceAll("\\{" + "page_id" + "\\}", apiClient.escapeString(pageId.toString())) + .replaceAll("\\{" + "update_id" + "\\}", apiClient.escapeString(updateId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.StatusPagesApi.softDeleteDegradationUpdate", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Soft delete degradation update. + * + *

See {@link #softDeleteDegradationUpdateWithHttpInfo}. + * + * @param degradationId The ID of the degradation. (required) + * @param pageId The ID of the status page. (required) + * @param updateId The ID of the degradation update. (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> softDeleteDegradationUpdateWithHttpInfoAsync( + UUID degradationId, UUID pageId, UUID updateId) { + Object localVarPostBody = null; + + // verify the required parameter 'degradationId' is set + if (degradationId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'degradationId' when calling" + + " softDeleteDegradationUpdate")); + return result; + } + + // verify the required parameter 'pageId' is set + if (pageId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'pageId' when calling softDeleteDegradationUpdate")); + return result; + } + + // verify the required parameter 'updateId' is set + if (updateId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'updateId' when calling" + + " softDeleteDegradationUpdate")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/statuspages/{page_id}/degradations/{degradation_id}/updates/{update_id}" + .replaceAll( + "\\{" + "degradation_id" + "\\}", apiClient.escapeString(degradationId.toString())) + .replaceAll("\\{" + "page_id" + "\\}", apiClient.escapeString(pageId.toString())) + .replaceAll("\\{" + "update_id" + "\\}", apiClient.escapeString(updateId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.StatusPagesApi.softDeleteDegradationUpdate", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + /** * Unpublish status page. * diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems.java b/src/main/java/com/datadog/api/client/v2/model/CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems.java index 4b29597d58e..4a1c96ed4d9 100644 --- a/src/main/java/com/datadog/api/client/v2/model/CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems.java +++ b/src/main/java/com/datadog/api/client/v2/model/CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems.java @@ -33,7 +33,7 @@ public class CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems { @JsonIgnore public boolean unparsed = false; public static final String JSON_PROPERTY_COMPONENTS_AFFECTED = "components_affected"; private List componentsAffected = - new ArrayList<>(); + null; public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; @@ -48,13 +48,10 @@ public CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems() {} @JsonCreator public CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems( - @JsonProperty(required = true, value = JSON_PROPERTY_COMPONENTS_AFFECTED) - List componentsAffected, @JsonProperty(required = true, value = JSON_PROPERTY_DESCRIPTION) String description, @JsonProperty(required = true, value = JSON_PROPERTY_STARTED_AT) OffsetDateTime startedAt, @JsonProperty(required = true, value = JSON_PROPERTY_STATUS) CreateMaintenanceRequestDataAttributesUpdatesItemsStatus status) { - this.componentsAffected = componentsAffected; this.description = description; this.startedAt = startedAt; this.status = status; @@ -72,6 +69,9 @@ public CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems componentsAf public CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems addComponentsAffectedItem( CreateMaintenanceRequestDataAttributesComponentsAffectedItems componentsAffectedItem) { + if (this.componentsAffected == null) { + this.componentsAffected = new ArrayList<>(); + } this.componentsAffected.add(componentsAffectedItem); this.unparsed |= componentsAffectedItem.unparsed; return this; @@ -82,8 +82,9 @@ public CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems addComponent * * @return componentsAffected */ + @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_COMPONENTS_AFFECTED) - @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public List getComponentsAffected() { return componentsAffected; diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateMaintenanceRequestDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CreateMaintenanceRequestDataAttributes.java index db2a0c687af..2acc88a2254 100644 --- a/src/main/java/com/datadog/api/client/v2/model/CreateMaintenanceRequestDataAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/CreateMaintenanceRequestDataAttributes.java @@ -42,7 +42,7 @@ public class CreateMaintenanceRequestDataAttributes { public static final String JSON_PROPERTY_COMPONENTS_AFFECTED = "components_affected"; private List componentsAffected = - new ArrayList<>(); + null; public static final String JSON_PROPERTY_IN_PROGRESS_DESCRIPTION = "in_progress_description"; private String inProgressDescription; @@ -64,8 +64,6 @@ public CreateMaintenanceRequestDataAttributes( OffsetDateTime completedDate, @JsonProperty(required = true, value = JSON_PROPERTY_COMPLETED_DESCRIPTION) String completedDescription, - @JsonProperty(required = true, value = JSON_PROPERTY_COMPONENTS_AFFECTED) - List componentsAffected, @JsonProperty(required = true, value = JSON_PROPERTY_IN_PROGRESS_DESCRIPTION) String inProgressDescription, @JsonProperty(required = true, value = JSON_PROPERTY_SCHEDULED_DESCRIPTION) @@ -74,7 +72,6 @@ public CreateMaintenanceRequestDataAttributes( @JsonProperty(required = true, value = JSON_PROPERTY_TITLE) String title) { this.completedDate = completedDate; this.completedDescription = completedDescription; - this.componentsAffected = componentsAffected; this.inProgressDescription = inProgressDescription; this.scheduledDescription = scheduledDescription; this.startDate = startDate; @@ -132,6 +129,9 @@ public CreateMaintenanceRequestDataAttributes componentsAffected( public CreateMaintenanceRequestDataAttributes addComponentsAffectedItem( CreateMaintenanceRequestDataAttributesComponentsAffectedItems componentsAffectedItem) { + if (this.componentsAffected == null) { + this.componentsAffected = new ArrayList<>(); + } this.componentsAffected.add(componentsAffectedItem); this.unparsed |= componentsAffectedItem.unparsed; return this; @@ -142,8 +142,9 @@ public CreateMaintenanceRequestDataAttributes addComponentsAffectedItem( * * @return componentsAffected */ + @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_COMPONENTS_AFFECTED) - @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public List getComponentsAffected() { return componentsAffected; diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateStatusPageRequestDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CreateStatusPageRequestDataAttributes.java index c50256dc4d9..c4ef8dc4092 100644 --- a/src/main/java/com/datadog/api/client/v2/model/CreateStatusPageRequestDataAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/CreateStatusPageRequestDataAttributes.java @@ -25,8 +25,11 @@ CreateStatusPageRequestDataAttributes.JSON_PROPERTY_COMPONENTS, CreateStatusPageRequestDataAttributes.JSON_PROPERTY_DOMAIN_PREFIX, CreateStatusPageRequestDataAttributes.JSON_PROPERTY_EMAIL_HEADER_IMAGE, + CreateStatusPageRequestDataAttributes.JSON_PROPERTY_ENABLED, CreateStatusPageRequestDataAttributes.JSON_PROPERTY_FAVICON, CreateStatusPageRequestDataAttributes.JSON_PROPERTY_NAME, + CreateStatusPageRequestDataAttributes.JSON_PROPERTY_SLACK_APP_ICON, + CreateStatusPageRequestDataAttributes.JSON_PROPERTY_SLACK_SUBSCRIPTIONS_ENABLED, CreateStatusPageRequestDataAttributes.JSON_PROPERTY_SUBSCRIPTIONS_ENABLED, CreateStatusPageRequestDataAttributes.JSON_PROPERTY_TYPE, CreateStatusPageRequestDataAttributes.JSON_PROPERTY_VISUALIZATION_TYPE @@ -47,12 +50,22 @@ public class CreateStatusPageRequestDataAttributes { public static final String JSON_PROPERTY_EMAIL_HEADER_IMAGE = "email_header_image"; private String emailHeaderImage; + public static final String JSON_PROPERTY_ENABLED = "enabled"; + private Boolean enabled; + public static final String JSON_PROPERTY_FAVICON = "favicon"; private String favicon; public static final String JSON_PROPERTY_NAME = "name"; private String name; + public static final String JSON_PROPERTY_SLACK_APP_ICON = "slack_app_icon"; + private String slackAppIcon; + + public static final String JSON_PROPERTY_SLACK_SUBSCRIPTIONS_ENABLED = + "slack_subscriptions_enabled"; + private Boolean slackSubscriptionsEnabled; + public static final String JSON_PROPERTY_SUBSCRIPTIONS_ENABLED = "subscriptions_enabled"; private Boolean subscriptionsEnabled; @@ -179,6 +192,27 @@ public void setEmailHeaderImage(String emailHeaderImage) { this.emailHeaderImage = emailHeaderImage; } + public CreateStatusPageRequestDataAttributes enabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Whether the status page is enabled. + * + * @return enabled + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + public CreateStatusPageRequestDataAttributes favicon(String favicon) { this.favicon = favicon; return this; @@ -220,6 +254,49 @@ public void setName(String name) { this.name = name; } + public CreateStatusPageRequestDataAttributes slackAppIcon(String slackAppIcon) { + this.slackAppIcon = slackAppIcon; + return this; + } + + /** + * The Slack app icon URL for the status page. + * + * @return slackAppIcon + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SLACK_APP_ICON) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSlackAppIcon() { + return slackAppIcon; + } + + public void setSlackAppIcon(String slackAppIcon) { + this.slackAppIcon = slackAppIcon; + } + + public CreateStatusPageRequestDataAttributes slackSubscriptionsEnabled( + Boolean slackSubscriptionsEnabled) { + this.slackSubscriptionsEnabled = slackSubscriptionsEnabled; + return this; + } + + /** + * Whether Slack subscriptions are enabled for the status page. + * + * @return slackSubscriptionsEnabled + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SLACK_SUBSCRIPTIONS_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSlackSubscriptionsEnabled() { + return slackSubscriptionsEnabled; + } + + public void setSlackSubscriptionsEnabled(Boolean slackSubscriptionsEnabled) { + this.slackSubscriptionsEnabled = slackSubscriptionsEnabled; + } + public CreateStatusPageRequestDataAttributes subscriptionsEnabled(Boolean subscriptionsEnabled) { this.subscriptionsEnabled = subscriptionsEnabled; return this; @@ -354,8 +431,13 @@ public boolean equals(Object o) { && Objects.equals(this.domainPrefix, createStatusPageRequestDataAttributes.domainPrefix) && Objects.equals( this.emailHeaderImage, createStatusPageRequestDataAttributes.emailHeaderImage) + && Objects.equals(this.enabled, createStatusPageRequestDataAttributes.enabled) && Objects.equals(this.favicon, createStatusPageRequestDataAttributes.favicon) && Objects.equals(this.name, createStatusPageRequestDataAttributes.name) + && Objects.equals(this.slackAppIcon, createStatusPageRequestDataAttributes.slackAppIcon) + && Objects.equals( + this.slackSubscriptionsEnabled, + createStatusPageRequestDataAttributes.slackSubscriptionsEnabled) && Objects.equals( this.subscriptionsEnabled, createStatusPageRequestDataAttributes.subscriptionsEnabled) && Objects.equals(this.type, createStatusPageRequestDataAttributes.type) @@ -372,8 +454,11 @@ public int hashCode() { components, domainPrefix, emailHeaderImage, + enabled, favicon, name, + slackAppIcon, + slackSubscriptionsEnabled, subscriptionsEnabled, type, visualizationType, @@ -388,8 +473,13 @@ public String toString() { sb.append(" components: ").append(toIndentedString(components)).append("\n"); sb.append(" domainPrefix: ").append(toIndentedString(domainPrefix)).append("\n"); sb.append(" emailHeaderImage: ").append(toIndentedString(emailHeaderImage)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); sb.append(" favicon: ").append(toIndentedString(favicon)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" slackAppIcon: ").append(toIndentedString(slackAppIcon)).append("\n"); + sb.append(" slackSubscriptionsEnabled: ") + .append(toIndentedString(slackSubscriptionsEnabled)) + .append("\n"); sb.append(" subscriptionsEnabled: ") .append(toIndentedString(subscriptionsEnabled)) .append("\n"); diff --git a/src/main/java/com/datadog/api/client/v2/model/DegradationDataAttributesUpdatesItems.java b/src/main/java/com/datadog/api/client/v2/model/DegradationDataAttributesUpdatesItems.java index cb39ebdbbd9..9ae3623fa3a 100644 --- a/src/main/java/com/datadog/api/client/v2/model/DegradationDataAttributesUpdatesItems.java +++ b/src/main/java/com/datadog/api/client/v2/model/DegradationDataAttributesUpdatesItems.java @@ -24,6 +24,8 @@ @JsonPropertyOrder({ DegradationDataAttributesUpdatesItems.JSON_PROPERTY_COMPONENTS_AFFECTED, DegradationDataAttributesUpdatesItems.JSON_PROPERTY_CREATED_AT, + DegradationDataAttributesUpdatesItems.JSON_PROPERTY_DELETED_AT, + DegradationDataAttributesUpdatesItems.JSON_PROPERTY_DELETED_BY_USER_UUID, DegradationDataAttributesUpdatesItems.JSON_PROPERTY_DESCRIPTION, DegradationDataAttributesUpdatesItems.JSON_PROPERTY_ID, DegradationDataAttributesUpdatesItems.JSON_PROPERTY_LAST_MODIFIED_BY_USER_UUID, @@ -42,6 +44,12 @@ public class DegradationDataAttributesUpdatesItems { public static final String JSON_PROPERTY_CREATED_AT = "created_at"; private OffsetDateTime createdAt; + public static final String JSON_PROPERTY_DELETED_AT = "deleted_at"; + private String deletedAt; + + public static final String JSON_PROPERTY_DELETED_BY_USER_UUID = "deleted_by_user_uuid"; + private String deletedByUserUuid; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; @@ -110,6 +118,48 @@ public OffsetDateTime getCreatedAt() { return createdAt; } + public DegradationDataAttributesUpdatesItems deletedAt(String deletedAt) { + this.deletedAt = deletedAt; + return this; + } + + /** + * The date and time the resource was deleted. + * + * @return deletedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DELETED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDeletedAt() { + return deletedAt; + } + + public void setDeletedAt(String deletedAt) { + this.deletedAt = deletedAt; + } + + public DegradationDataAttributesUpdatesItems deletedByUserUuid(String deletedByUserUuid) { + this.deletedByUserUuid = deletedByUserUuid; + return this; + } + + /** + * UUID of the user who deleted the resource. + * + * @return deletedByUserUuid + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DELETED_BY_USER_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDeletedByUserUuid() { + return deletedByUserUuid; + } + + public void setDeletedByUserUuid(String deletedByUserUuid) { + this.deletedByUserUuid = deletedByUserUuid; + } + public DegradationDataAttributesUpdatesItems description(String description) { this.description = description; return this; @@ -284,6 +334,9 @@ public boolean equals(Object o) { return Objects.equals( this.componentsAffected, degradationDataAttributesUpdatesItems.componentsAffected) && Objects.equals(this.createdAt, degradationDataAttributesUpdatesItems.createdAt) + && Objects.equals(this.deletedAt, degradationDataAttributesUpdatesItems.deletedAt) + && Objects.equals( + this.deletedByUserUuid, degradationDataAttributesUpdatesItems.deletedByUserUuid) && Objects.equals(this.description, degradationDataAttributesUpdatesItems.description) && Objects.equals(this.id, degradationDataAttributesUpdatesItems.id) && Objects.equals( @@ -301,6 +354,8 @@ public int hashCode() { return Objects.hash( componentsAffected, createdAt, + deletedAt, + deletedByUserUuid, description, id, lastModifiedByUserUuid, @@ -316,6 +371,8 @@ public String toString() { sb.append("class DegradationDataAttributesUpdatesItems {\n"); sb.append(" componentsAffected: ").append(toIndentedString(componentsAffected)).append("\n"); sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" deletedAt: ").append(toIndentedString(deletedAt)).append("\n"); + sb.append(" deletedByUserUuid: ").append(toIndentedString(deletedByUserUuid)).append("\n"); sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" lastModifiedByUserUuid: ") diff --git a/src/main/java/com/datadog/api/client/v2/model/DegradationUpdate.java b/src/main/java/com/datadog/api/client/v2/model/DegradationUpdate.java new file mode 100644 index 00000000000..253489f284b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DegradationUpdate.java @@ -0,0 +1,176 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Response object for a degradation update. */ +@JsonPropertyOrder({DegradationUpdate.JSON_PROPERTY_DATA, DegradationUpdate.JSON_PROPERTY_INCLUDED}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DegradationUpdate { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private DegradationUpdateData data; + + public static final String JSON_PROPERTY_INCLUDED = "included"; + private List included = null; + + public DegradationUpdate data(DegradationUpdateData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * The data object for a degradation update. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DegradationUpdateData getData() { + return data; + } + + public void setData(DegradationUpdateData data) { + this.data = data; + } + + public DegradationUpdate included(List included) { + this.included = included; + for (DegradationUpdateIncluded item : included) { + this.unparsed |= item.unparsed; + } + return this; + } + + public DegradationUpdate addIncludedItem(DegradationUpdateIncluded includedItem) { + if (this.included == null) { + this.included = new ArrayList<>(); + } + this.included.add(includedItem); + this.unparsed |= includedItem.unparsed; + return this; + } + + /** + * Resources related to the degradation update. + * + * @return included + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INCLUDED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getIncluded() { + return included; + } + + public void setIncluded(List included) { + this.included = included; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return DegradationUpdate + */ + @JsonAnySetter + public DegradationUpdate 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 DegradationUpdate object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DegradationUpdate degradationUpdate = (DegradationUpdate) o; + return Objects.equals(this.data, degradationUpdate.data) + && Objects.equals(this.included, degradationUpdate.included) + && Objects.equals(this.additionalProperties, degradationUpdate.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, included, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DegradationUpdate {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" included: ").append(toIndentedString(included)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/DegradationUpdateData.java b/src/main/java/com/datadog/api/client/v2/model/DegradationUpdateData.java new file mode 100644 index 00000000000..eaab94f94b5 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DegradationUpdateData.java @@ -0,0 +1,235 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The data object for a degradation update. */ +@JsonPropertyOrder({ + DegradationUpdateData.JSON_PROPERTY_ATTRIBUTES, + DegradationUpdateData.JSON_PROPERTY_ID, + DegradationUpdateData.JSON_PROPERTY_RELATIONSHIPS, + DegradationUpdateData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DegradationUpdateData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private DegradationUpdateDataAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private DegradationUpdateDataRelationships relationships; + + public static final String JSON_PROPERTY_TYPE = "type"; + private PatchDegradationUpdateRequestDataType type = + PatchDegradationUpdateRequestDataType.DEGRADATION_UPDATES; + + public DegradationUpdateData() {} + + @JsonCreator + public DegradationUpdateData( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + PatchDegradationUpdateRequestDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + } + + public DegradationUpdateData attributes(DegradationUpdateDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of a degradation update resource. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DegradationUpdateDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(DegradationUpdateDataAttributes attributes) { + this.attributes = attributes; + } + + public DegradationUpdateData id(String id) { + this.id = id; + return this; + } + + /** + * The ID of the degradation update. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public DegradationUpdateData relationships(DegradationUpdateDataRelationships relationships) { + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + return this; + } + + /** + * Relationships of a degradation update resource. + * + * @return relationships + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DegradationUpdateDataRelationships getRelationships() { + return relationships; + } + + public void setRelationships(DegradationUpdateDataRelationships relationships) { + this.relationships = relationships; + } + + public DegradationUpdateData type(PatchDegradationUpdateRequestDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Degradation updates resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public PatchDegradationUpdateRequestDataType getType() { + return type; + } + + public void setType(PatchDegradationUpdateRequestDataType 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 DegradationUpdateData + */ + @JsonAnySetter + public DegradationUpdateData 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 DegradationUpdateData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DegradationUpdateData degradationUpdateData = (DegradationUpdateData) o; + return Objects.equals(this.attributes, degradationUpdateData.attributes) + && Objects.equals(this.id, degradationUpdateData.id) + && Objects.equals(this.relationships, degradationUpdateData.relationships) + && Objects.equals(this.type, degradationUpdateData.type) + && Objects.equals(this.additionalProperties, degradationUpdateData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, relationships, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DegradationUpdateData {\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/DegradationUpdateDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/DegradationUpdateDataAttributes.java new file mode 100644 index 00000000000..6cf0e45b368 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DegradationUpdateDataAttributes.java @@ -0,0 +1,333 @@ +/* + * 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.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Attributes of a degradation update resource. */ +@JsonPropertyOrder({ + DegradationUpdateDataAttributes.JSON_PROPERTY_COMPONENTS_AFFECTED, + DegradationUpdateDataAttributes.JSON_PROPERTY_CREATED_AT, + DegradationUpdateDataAttributes.JSON_PROPERTY_DELETED_AT, + DegradationUpdateDataAttributes.JSON_PROPERTY_DESCRIPTION, + DegradationUpdateDataAttributes.JSON_PROPERTY_MODIFIED_AT, + DegradationUpdateDataAttributes.JSON_PROPERTY_STARTED_AT, + DegradationUpdateDataAttributes.JSON_PROPERTY_STATUS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DegradationUpdateDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_COMPONENTS_AFFECTED = "components_affected"; + private List componentsAffected = null; + + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + private OffsetDateTime createdAt; + + public static final String JSON_PROPERTY_DELETED_AT = "deleted_at"; + private OffsetDateTime deletedAt; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_MODIFIED_AT = "modified_at"; + private OffsetDateTime modifiedAt; + + public static final String JSON_PROPERTY_STARTED_AT = "started_at"; + private OffsetDateTime startedAt; + + public static final String JSON_PROPERTY_STATUS = "status"; + private CreateDegradationRequestDataAttributesStatus status; + + public DegradationUpdateDataAttributes componentsAffected( + List componentsAffected) { + this.componentsAffected = componentsAffected; + for (DegradationUpdateDataAttributesComponentsAffectedItems item : componentsAffected) { + this.unparsed |= item.unparsed; + } + return this; + } + + public DegradationUpdateDataAttributes addComponentsAffectedItem( + DegradationUpdateDataAttributesComponentsAffectedItems componentsAffectedItem) { + if (this.componentsAffected == null) { + this.componentsAffected = new ArrayList<>(); + } + this.componentsAffected.add(componentsAffectedItem); + this.unparsed |= componentsAffectedItem.unparsed; + return this; + } + + /** + * Components affected by this update. + * + * @return componentsAffected + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COMPONENTS_AFFECTED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getComponentsAffected() { + return componentsAffected; + } + + public void setComponentsAffected( + List componentsAffected) { + this.componentsAffected = componentsAffected; + } + + public DegradationUpdateDataAttributes createdAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * The date and time the update was created. + * + * @return createdAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + public DegradationUpdateDataAttributes deletedAt(OffsetDateTime deletedAt) { + this.deletedAt = deletedAt; + return this; + } + + /** + * The date and time the update was soft-deleted. + * + * @return deletedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DELETED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDeletedAt() { + return deletedAt; + } + + public void setDeletedAt(OffsetDateTime deletedAt) { + this.deletedAt = deletedAt; + } + + public DegradationUpdateDataAttributes description(String description) { + this.description = description; + return this; + } + + /** + * The message body of the update. + * + * @return description + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public DegradationUpdateDataAttributes modifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + /** + * The date and time the update was last modified. + * + * @return modifiedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MODIFIED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getModifiedAt() { + return modifiedAt; + } + + public void setModifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = modifiedAt; + } + + public DegradationUpdateDataAttributes startedAt(OffsetDateTime startedAt) { + this.startedAt = startedAt; + return this; + } + + /** + * The date and time the update started. + * + * @return startedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STARTED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getStartedAt() { + return startedAt; + } + + public void setStartedAt(OffsetDateTime startedAt) { + this.startedAt = startedAt; + } + + public DegradationUpdateDataAttributes status( + CreateDegradationRequestDataAttributesStatus status) { + this.status = status; + this.unparsed |= !status.isValid(); + return this; + } + + /** + * The status of the degradation. + * + * @return status + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CreateDegradationRequestDataAttributesStatus getStatus() { + return status; + } + + public void setStatus(CreateDegradationRequestDataAttributesStatus status) { + if (!status.isValid()) { + this.unparsed = true; + } + this.status = status; + } + + /** + * 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 DegradationUpdateDataAttributes + */ + @JsonAnySetter + public DegradationUpdateDataAttributes 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 DegradationUpdateDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DegradationUpdateDataAttributes degradationUpdateDataAttributes = + (DegradationUpdateDataAttributes) o; + return Objects.equals( + this.componentsAffected, degradationUpdateDataAttributes.componentsAffected) + && Objects.equals(this.createdAt, degradationUpdateDataAttributes.createdAt) + && Objects.equals(this.deletedAt, degradationUpdateDataAttributes.deletedAt) + && Objects.equals(this.description, degradationUpdateDataAttributes.description) + && Objects.equals(this.modifiedAt, degradationUpdateDataAttributes.modifiedAt) + && Objects.equals(this.startedAt, degradationUpdateDataAttributes.startedAt) + && Objects.equals(this.status, degradationUpdateDataAttributes.status) + && Objects.equals( + this.additionalProperties, degradationUpdateDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + componentsAffected, + createdAt, + deletedAt, + description, + modifiedAt, + startedAt, + status, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DegradationUpdateDataAttributes {\n"); + sb.append(" componentsAffected: ").append(toIndentedString(componentsAffected)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" deletedAt: ").append(toIndentedString(deletedAt)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" modifiedAt: ").append(toIndentedString(modifiedAt)).append("\n"); + sb.append(" startedAt: ").append(toIndentedString(startedAt)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).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/DegradationUpdateDataAttributesComponentsAffectedItems.java b/src/main/java/com/datadog/api/client/v2/model/DegradationUpdateDataAttributesComponentsAffectedItems.java new file mode 100644 index 00000000000..79df9407b6b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DegradationUpdateDataAttributesComponentsAffectedItems.java @@ -0,0 +1,207 @@ +/* + * 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; + +/** A component affected by a degradation update. */ +@JsonPropertyOrder({ + DegradationUpdateDataAttributesComponentsAffectedItems.JSON_PROPERTY_ID, + DegradationUpdateDataAttributesComponentsAffectedItems.JSON_PROPERTY_NAME, + DegradationUpdateDataAttributesComponentsAffectedItems.JSON_PROPERTY_STATUS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DegradationUpdateDataAttributesComponentsAffectedItems { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_STATUS = "status"; + private StatusPagesComponentDataAttributesStatus status; + + public DegradationUpdateDataAttributesComponentsAffectedItems() {} + + @JsonCreator + public DegradationUpdateDataAttributesComponentsAffectedItems( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_STATUS) + StatusPagesComponentDataAttributesStatus status) { + this.id = id; + this.status = status; + this.unparsed |= !status.isValid(); + } + + public DegradationUpdateDataAttributesComponentsAffectedItems id(String id) { + this.id = id; + return this; + } + + /** + * The ID of the affected component. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + /** + * The name of the affected component. + * + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + public DegradationUpdateDataAttributesComponentsAffectedItems status( + StatusPagesComponentDataAttributesStatus status) { + this.status = status; + this.unparsed |= !status.isValid(); + return this; + } + + /** + * The status of the component. + * + * @return status + */ + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public StatusPagesComponentDataAttributesStatus getStatus() { + return status; + } + + public void setStatus(StatusPagesComponentDataAttributesStatus status) { + if (!status.isValid()) { + this.unparsed = true; + } + this.status = status; + } + + /** + * 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 DegradationUpdateDataAttributesComponentsAffectedItems + */ + @JsonAnySetter + public DegradationUpdateDataAttributesComponentsAffectedItems 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 DegradationUpdateDataAttributesComponentsAffectedItems object is equal to + * o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DegradationUpdateDataAttributesComponentsAffectedItems + degradationUpdateDataAttributesComponentsAffectedItems = + (DegradationUpdateDataAttributesComponentsAffectedItems) o; + return Objects.equals(this.id, degradationUpdateDataAttributesComponentsAffectedItems.id) + && Objects.equals(this.name, degradationUpdateDataAttributesComponentsAffectedItems.name) + && Objects.equals( + this.status, degradationUpdateDataAttributesComponentsAffectedItems.status) + && Objects.equals( + this.additionalProperties, + degradationUpdateDataAttributesComponentsAffectedItems.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, status, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DegradationUpdateDataAttributesComponentsAffectedItems {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).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/DegradationUpdateDataRelationships.java b/src/main/java/com/datadog/api/client/v2/model/DegradationUpdateDataRelationships.java new file mode 100644 index 00000000000..aa9b3a32791 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DegradationUpdateDataRelationships.java @@ -0,0 +1,264 @@ +/* + * 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; + +/** Relationships of a degradation update resource. */ +@JsonPropertyOrder({ + DegradationUpdateDataRelationships.JSON_PROPERTY_CREATED_BY_USER, + DegradationUpdateDataRelationships.JSON_PROPERTY_DEGRADATION, + DegradationUpdateDataRelationships.JSON_PROPERTY_DELETED_BY_USER, + DegradationUpdateDataRelationships.JSON_PROPERTY_LAST_MODIFIED_BY_USER, + DegradationUpdateDataRelationships.JSON_PROPERTY_STATUS_PAGE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DegradationUpdateDataRelationships { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CREATED_BY_USER = "created_by_user"; + private DegradationUpdateDataRelationshipsUser createdByUser; + + public static final String JSON_PROPERTY_DEGRADATION = "degradation"; + private DegradationUpdateDataRelationshipsDegradation degradation; + + public static final String JSON_PROPERTY_DELETED_BY_USER = "deleted_by_user"; + private DegradationUpdateDataRelationshipsUser deletedByUser; + + public static final String JSON_PROPERTY_LAST_MODIFIED_BY_USER = "last_modified_by_user"; + private DegradationUpdateDataRelationshipsUser lastModifiedByUser; + + public static final String JSON_PROPERTY_STATUS_PAGE = "status_page"; + private DegradationUpdateDataRelationshipsStatusPage statusPage; + + public DegradationUpdateDataRelationships createdByUser( + DegradationUpdateDataRelationshipsUser createdByUser) { + this.createdByUser = createdByUser; + this.unparsed |= createdByUser.unparsed; + return this; + } + + /** + * A user relationship of a degradation update. + * + * @return createdByUser + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATED_BY_USER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DegradationUpdateDataRelationshipsUser getCreatedByUser() { + return createdByUser; + } + + public void setCreatedByUser(DegradationUpdateDataRelationshipsUser createdByUser) { + this.createdByUser = createdByUser; + } + + public DegradationUpdateDataRelationships degradation( + DegradationUpdateDataRelationshipsDegradation degradation) { + this.degradation = degradation; + this.unparsed |= degradation.unparsed; + return this; + } + + /** + * The degradation relationship of a degradation update. + * + * @return degradation + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DEGRADATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DegradationUpdateDataRelationshipsDegradation getDegradation() { + return degradation; + } + + public void setDegradation(DegradationUpdateDataRelationshipsDegradation degradation) { + this.degradation = degradation; + } + + public DegradationUpdateDataRelationships deletedByUser( + DegradationUpdateDataRelationshipsUser deletedByUser) { + this.deletedByUser = deletedByUser; + this.unparsed |= deletedByUser.unparsed; + return this; + } + + /** + * A user relationship of a degradation update. + * + * @return deletedByUser + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DELETED_BY_USER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DegradationUpdateDataRelationshipsUser getDeletedByUser() { + return deletedByUser; + } + + public void setDeletedByUser(DegradationUpdateDataRelationshipsUser deletedByUser) { + this.deletedByUser = deletedByUser; + } + + public DegradationUpdateDataRelationships lastModifiedByUser( + DegradationUpdateDataRelationshipsUser lastModifiedByUser) { + this.lastModifiedByUser = lastModifiedByUser; + this.unparsed |= lastModifiedByUser.unparsed; + return this; + } + + /** + * A user relationship of a degradation update. + * + * @return lastModifiedByUser + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LAST_MODIFIED_BY_USER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DegradationUpdateDataRelationshipsUser getLastModifiedByUser() { + return lastModifiedByUser; + } + + public void setLastModifiedByUser(DegradationUpdateDataRelationshipsUser lastModifiedByUser) { + this.lastModifiedByUser = lastModifiedByUser; + } + + public DegradationUpdateDataRelationships statusPage( + DegradationUpdateDataRelationshipsStatusPage statusPage) { + this.statusPage = statusPage; + this.unparsed |= statusPage.unparsed; + return this; + } + + /** + * The status page relationship of a degradation update. + * + * @return statusPage + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STATUS_PAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DegradationUpdateDataRelationshipsStatusPage getStatusPage() { + return statusPage; + } + + public void setStatusPage(DegradationUpdateDataRelationshipsStatusPage statusPage) { + this.statusPage = statusPage; + } + + /** + * 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 DegradationUpdateDataRelationships + */ + @JsonAnySetter + public DegradationUpdateDataRelationships 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 DegradationUpdateDataRelationships object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DegradationUpdateDataRelationships degradationUpdateDataRelationships = + (DegradationUpdateDataRelationships) o; + return Objects.equals(this.createdByUser, degradationUpdateDataRelationships.createdByUser) + && Objects.equals(this.degradation, degradationUpdateDataRelationships.degradation) + && Objects.equals(this.deletedByUser, degradationUpdateDataRelationships.deletedByUser) + && Objects.equals( + this.lastModifiedByUser, degradationUpdateDataRelationships.lastModifiedByUser) + && Objects.equals(this.statusPage, degradationUpdateDataRelationships.statusPage) + && Objects.equals( + this.additionalProperties, degradationUpdateDataRelationships.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + createdByUser, + degradation, + deletedByUser, + lastModifiedByUser, + statusPage, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DegradationUpdateDataRelationships {\n"); + sb.append(" createdByUser: ").append(toIndentedString(createdByUser)).append("\n"); + sb.append(" degradation: ").append(toIndentedString(degradation)).append("\n"); + sb.append(" deletedByUser: ").append(toIndentedString(deletedByUser)).append("\n"); + sb.append(" lastModifiedByUser: ").append(toIndentedString(lastModifiedByUser)).append("\n"); + sb.append(" statusPage: ").append(toIndentedString(statusPage)).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/DegradationUpdateDataRelationshipsDegradation.java b/src/main/java/com/datadog/api/client/v2/model/DegradationUpdateDataRelationshipsDegradation.java new file mode 100644 index 00000000000..006fc270b3a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DegradationUpdateDataRelationshipsDegradation.java @@ -0,0 +1,151 @@ +/* + * 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; + +/** The degradation relationship of a degradation update. */ +@JsonPropertyOrder({DegradationUpdateDataRelationshipsDegradation.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DegradationUpdateDataRelationshipsDegradation { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private DegradationUpdateDataRelationshipsDegradationData data; + + public DegradationUpdateDataRelationshipsDegradation() {} + + @JsonCreator + public DegradationUpdateDataRelationshipsDegradation( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + DegradationUpdateDataRelationshipsDegradationData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public DegradationUpdateDataRelationshipsDegradation data( + DegradationUpdateDataRelationshipsDegradationData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * The degradation linked to a degradation update. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DegradationUpdateDataRelationshipsDegradationData getData() { + return data; + } + + public void setData(DegradationUpdateDataRelationshipsDegradationData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return DegradationUpdateDataRelationshipsDegradation + */ + @JsonAnySetter + public DegradationUpdateDataRelationshipsDegradation 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 DegradationUpdateDataRelationshipsDegradation object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DegradationUpdateDataRelationshipsDegradation degradationUpdateDataRelationshipsDegradation = + (DegradationUpdateDataRelationshipsDegradation) o; + return Objects.equals(this.data, degradationUpdateDataRelationshipsDegradation.data) + && Objects.equals( + this.additionalProperties, + degradationUpdateDataRelationshipsDegradation.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DegradationUpdateDataRelationshipsDegradation {\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/DegradationUpdateDataRelationshipsDegradationData.java b/src/main/java/com/datadog/api/client/v2/model/DegradationUpdateDataRelationshipsDegradationData.java new file mode 100644 index 00000000000..fa1fa8c44d1 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DegradationUpdateDataRelationshipsDegradationData.java @@ -0,0 +1,185 @@ +/* + * 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; + +/** The degradation linked to a degradation update. */ +@JsonPropertyOrder({ + DegradationUpdateDataRelationshipsDegradationData.JSON_PROPERTY_ID, + DegradationUpdateDataRelationshipsDegradationData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DegradationUpdateDataRelationshipsDegradationData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private PatchDegradationRequestDataType type = PatchDegradationRequestDataType.DEGRADATIONS; + + public DegradationUpdateDataRelationshipsDegradationData() {} + + @JsonCreator + public DegradationUpdateDataRelationshipsDegradationData( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + PatchDegradationRequestDataType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public DegradationUpdateDataRelationshipsDegradationData id(String id) { + this.id = id; + return this; + } + + /** + * The ID of the degradation. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public DegradationUpdateDataRelationshipsDegradationData type( + PatchDegradationRequestDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Degradations resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public PatchDegradationRequestDataType getType() { + return type; + } + + public void setType(PatchDegradationRequestDataType 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 DegradationUpdateDataRelationshipsDegradationData + */ + @JsonAnySetter + public DegradationUpdateDataRelationshipsDegradationData 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 DegradationUpdateDataRelationshipsDegradationData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DegradationUpdateDataRelationshipsDegradationData + degradationUpdateDataRelationshipsDegradationData = + (DegradationUpdateDataRelationshipsDegradationData) o; + return Objects.equals(this.id, degradationUpdateDataRelationshipsDegradationData.id) + && Objects.equals(this.type, degradationUpdateDataRelationshipsDegradationData.type) + && Objects.equals( + this.additionalProperties, + degradationUpdateDataRelationshipsDegradationData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DegradationUpdateDataRelationshipsDegradationData {\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/DegradationUpdateDataRelationshipsStatusPage.java b/src/main/java/com/datadog/api/client/v2/model/DegradationUpdateDataRelationshipsStatusPage.java new file mode 100644 index 00000000000..12259fa4d03 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DegradationUpdateDataRelationshipsStatusPage.java @@ -0,0 +1,151 @@ +/* + * 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; + +/** The status page relationship of a degradation update. */ +@JsonPropertyOrder({DegradationUpdateDataRelationshipsStatusPage.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DegradationUpdateDataRelationshipsStatusPage { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private DegradationUpdateDataRelationshipsStatusPageData data; + + public DegradationUpdateDataRelationshipsStatusPage() {} + + @JsonCreator + public DegradationUpdateDataRelationshipsStatusPage( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + DegradationUpdateDataRelationshipsStatusPageData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public DegradationUpdateDataRelationshipsStatusPage data( + DegradationUpdateDataRelationshipsStatusPageData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * The status page linked to a degradation update. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DegradationUpdateDataRelationshipsStatusPageData getData() { + return data; + } + + public void setData(DegradationUpdateDataRelationshipsStatusPageData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return DegradationUpdateDataRelationshipsStatusPage + */ + @JsonAnySetter + public DegradationUpdateDataRelationshipsStatusPage 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 DegradationUpdateDataRelationshipsStatusPage object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DegradationUpdateDataRelationshipsStatusPage degradationUpdateDataRelationshipsStatusPage = + (DegradationUpdateDataRelationshipsStatusPage) o; + return Objects.equals(this.data, degradationUpdateDataRelationshipsStatusPage.data) + && Objects.equals( + this.additionalProperties, + degradationUpdateDataRelationshipsStatusPage.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DegradationUpdateDataRelationshipsStatusPage {\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/DegradationUpdateDataRelationshipsStatusPageData.java b/src/main/java/com/datadog/api/client/v2/model/DegradationUpdateDataRelationshipsStatusPageData.java new file mode 100644 index 00000000000..06edc924ac4 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DegradationUpdateDataRelationshipsStatusPageData.java @@ -0,0 +1,183 @@ +/* + * 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; + +/** The status page linked to a degradation update. */ +@JsonPropertyOrder({ + DegradationUpdateDataRelationshipsStatusPageData.JSON_PROPERTY_ID, + DegradationUpdateDataRelationshipsStatusPageData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DegradationUpdateDataRelationshipsStatusPageData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private StatusPageDataType type = StatusPageDataType.STATUS_PAGES; + + public DegradationUpdateDataRelationshipsStatusPageData() {} + + @JsonCreator + public DegradationUpdateDataRelationshipsStatusPageData( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) StatusPageDataType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public DegradationUpdateDataRelationshipsStatusPageData id(String id) { + this.id = id; + return this; + } + + /** + * The ID of the status page. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public DegradationUpdateDataRelationshipsStatusPageData type(StatusPageDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Status pages resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public StatusPageDataType getType() { + return type; + } + + public void setType(StatusPageDataType 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 DegradationUpdateDataRelationshipsStatusPageData + */ + @JsonAnySetter + public DegradationUpdateDataRelationshipsStatusPageData 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 DegradationUpdateDataRelationshipsStatusPageData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DegradationUpdateDataRelationshipsStatusPageData + degradationUpdateDataRelationshipsStatusPageData = + (DegradationUpdateDataRelationshipsStatusPageData) o; + return Objects.equals(this.id, degradationUpdateDataRelationshipsStatusPageData.id) + && Objects.equals(this.type, degradationUpdateDataRelationshipsStatusPageData.type) + && Objects.equals( + this.additionalProperties, + degradationUpdateDataRelationshipsStatusPageData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DegradationUpdateDataRelationshipsStatusPageData {\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/DegradationUpdateDataRelationshipsUser.java b/src/main/java/com/datadog/api/client/v2/model/DegradationUpdateDataRelationshipsUser.java new file mode 100644 index 00000000000..39581d79ad8 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DegradationUpdateDataRelationshipsUser.java @@ -0,0 +1,149 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** A user relationship of a degradation update. */ +@JsonPropertyOrder({DegradationUpdateDataRelationshipsUser.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DegradationUpdateDataRelationshipsUser { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private DegradationUpdateDataRelationshipsUserData data; + + public DegradationUpdateDataRelationshipsUser() {} + + @JsonCreator + public DegradationUpdateDataRelationshipsUser( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + DegradationUpdateDataRelationshipsUserData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public DegradationUpdateDataRelationshipsUser data( + DegradationUpdateDataRelationshipsUserData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * A Datadog user linked to a degradation update. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DegradationUpdateDataRelationshipsUserData getData() { + return data; + } + + public void setData(DegradationUpdateDataRelationshipsUserData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return DegradationUpdateDataRelationshipsUser + */ + @JsonAnySetter + public DegradationUpdateDataRelationshipsUser 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 DegradationUpdateDataRelationshipsUser object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DegradationUpdateDataRelationshipsUser degradationUpdateDataRelationshipsUser = + (DegradationUpdateDataRelationshipsUser) o; + return Objects.equals(this.data, degradationUpdateDataRelationshipsUser.data) + && Objects.equals( + this.additionalProperties, degradationUpdateDataRelationshipsUser.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DegradationUpdateDataRelationshipsUser {\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/DegradationUpdateDataRelationshipsUserData.java b/src/main/java/com/datadog/api/client/v2/model/DegradationUpdateDataRelationshipsUserData.java new file mode 100644 index 00000000000..d04d20066cc --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DegradationUpdateDataRelationshipsUserData.java @@ -0,0 +1,182 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** A Datadog user linked to a degradation update. */ +@JsonPropertyOrder({ + DegradationUpdateDataRelationshipsUserData.JSON_PROPERTY_ID, + DegradationUpdateDataRelationshipsUserData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DegradationUpdateDataRelationshipsUserData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private StatusPagesUserType type = StatusPagesUserType.USERS; + + public DegradationUpdateDataRelationshipsUserData() {} + + @JsonCreator + public DegradationUpdateDataRelationshipsUserData( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) StatusPagesUserType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public DegradationUpdateDataRelationshipsUserData id(String id) { + this.id = id; + return this; + } + + /** + * The ID of the user. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public DegradationUpdateDataRelationshipsUserData type(StatusPagesUserType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Users resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public StatusPagesUserType getType() { + return type; + } + + public void setType(StatusPagesUserType 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 DegradationUpdateDataRelationshipsUserData + */ + @JsonAnySetter + public DegradationUpdateDataRelationshipsUserData 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 DegradationUpdateDataRelationshipsUserData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DegradationUpdateDataRelationshipsUserData degradationUpdateDataRelationshipsUserData = + (DegradationUpdateDataRelationshipsUserData) o; + return Objects.equals(this.id, degradationUpdateDataRelationshipsUserData.id) + && Objects.equals(this.type, degradationUpdateDataRelationshipsUserData.type) + && Objects.equals( + this.additionalProperties, + degradationUpdateDataRelationshipsUserData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DegradationUpdateDataRelationshipsUserData {\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/DegradationUpdateIncluded.java b/src/main/java/com/datadog/api/client/v2/model/DegradationUpdateIncluded.java new file mode 100644 index 00000000000..0ea41ef41db --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DegradationUpdateIncluded.java @@ -0,0 +1,343 @@ +/* + * 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 = DegradationUpdateIncluded.DegradationUpdateIncludedDeserializer.class) +@JsonSerialize(using = DegradationUpdateIncluded.DegradationUpdateIncludedSerializer.class) +public class DegradationUpdateIncluded extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(DegradationUpdateIncluded.class.getName()); + + @JsonIgnore public boolean unparsed = false; + + public static class DegradationUpdateIncludedSerializer + extends StdSerializer { + public DegradationUpdateIncludedSerializer(Class t) { + super(t); + } + + public DegradationUpdateIncludedSerializer() { + this(null); + } + + @Override + public void serialize( + DegradationUpdateIncluded value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class DegradationUpdateIncludedDeserializer + extends StdDeserializer { + public DegradationUpdateIncludedDeserializer() { + this(DegradationUpdateIncluded.class); + } + + public DegradationUpdateIncludedDeserializer(Class vc) { + super(vc); + } + + @Override + public DegradationUpdateIncluded 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 StatusPagesUser + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (StatusPagesUser.class.equals(Integer.class) + || StatusPagesUser.class.equals(Long.class) + || StatusPagesUser.class.equals(Float.class) + || StatusPagesUser.class.equals(Double.class) + || StatusPagesUser.class.equals(Boolean.class) + || StatusPagesUser.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((StatusPagesUser.class.equals(Integer.class) + || StatusPagesUser.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((StatusPagesUser.class.equals(Float.class) + || StatusPagesUser.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (StatusPagesUser.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (StatusPagesUser.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(StatusPagesUser.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 (!((StatusPagesUser) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'StatusPagesUser'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'StatusPagesUser'", e); + } + + // deserialize Degradation + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (Degradation.class.equals(Integer.class) + || Degradation.class.equals(Long.class) + || Degradation.class.equals(Float.class) + || Degradation.class.equals(Double.class) + || Degradation.class.equals(Boolean.class) + || Degradation.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((Degradation.class.equals(Integer.class) || Degradation.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((Degradation.class.equals(Float.class) || Degradation.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (Degradation.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (Degradation.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(Degradation.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 (!((Degradation) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'Degradation'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'Degradation'", e); + } + + // deserialize StatusPageAsIncluded + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (StatusPageAsIncluded.class.equals(Integer.class) + || StatusPageAsIncluded.class.equals(Long.class) + || StatusPageAsIncluded.class.equals(Float.class) + || StatusPageAsIncluded.class.equals(Double.class) + || StatusPageAsIncluded.class.equals(Boolean.class) + || StatusPageAsIncluded.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((StatusPageAsIncluded.class.equals(Integer.class) + || StatusPageAsIncluded.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((StatusPageAsIncluded.class.equals(Float.class) + || StatusPageAsIncluded.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (StatusPageAsIncluded.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (StatusPageAsIncluded.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(StatusPageAsIncluded.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 (!((StatusPageAsIncluded) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'StatusPageAsIncluded'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'StatusPageAsIncluded'", e); + } + + DegradationUpdateIncluded ret = new DegradationUpdateIncluded(); + 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 DegradationUpdateIncluded getNullValue(DeserializationContext ctxt) + throws JsonMappingException { + throw new JsonMappingException(ctxt.getParser(), "DegradationUpdateIncluded cannot be null"); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public DegradationUpdateIncluded() { + super("oneOf", Boolean.FALSE); + } + + public DegradationUpdateIncluded(StatusPagesUser o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public DegradationUpdateIncluded(Degradation o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public DegradationUpdateIncluded(StatusPageAsIncluded o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("StatusPagesUser", new GenericType() {}); + schemas.put("Degradation", new GenericType() {}); + schemas.put("StatusPageAsIncluded", new GenericType() {}); + JSON.registerDescendants(DegradationUpdateIncluded.class, Collections.unmodifiableMap(schemas)); + } + + @Override + public Map getSchemas() { + return DegradationUpdateIncluded.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: StatusPagesUser, Degradation, StatusPageAsIncluded + * + *

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(StatusPagesUser.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf(Degradation.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf(StatusPageAsIncluded.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 StatusPagesUser, Degradation, StatusPageAsIncluded"); + } + + /** + * Get the actual instance, which can be the following: StatusPagesUser, Degradation, + * StatusPageAsIncluded + * + * @return The actual instance (StatusPagesUser, Degradation, StatusPageAsIncluded) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `StatusPagesUser`. If the actual instance is not `StatusPagesUser`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `StatusPagesUser` + * @throws ClassCastException if the instance is not `StatusPagesUser` + */ + public StatusPagesUser getStatusPagesUser() throws ClassCastException { + return (StatusPagesUser) super.getActualInstance(); + } + + /** + * Get the actual instance of `Degradation`. If the actual instance is not `Degradation`, the + * ClassCastException will be thrown. + * + * @return The actual instance of `Degradation` + * @throws ClassCastException if the instance is not `Degradation` + */ + public Degradation getDegradation() throws ClassCastException { + return (Degradation) super.getActualInstance(); + } + + /** + * Get the actual instance of `StatusPageAsIncluded`. If the actual instance is not + * `StatusPageAsIncluded`, the ClassCastException will be thrown. + * + * @return The actual instance of `StatusPageAsIncluded` + * @throws ClassCastException if the instance is not `StatusPageAsIncluded` + */ + public StatusPageAsIncluded getStatusPageAsIncluded() throws ClassCastException { + return (StatusPageAsIncluded) super.getActualInstance(); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/PatchDegradationUpdateRequest.java b/src/main/java/com/datadog/api/client/v2/model/PatchDegradationUpdateRequest.java new file mode 100644 index 00000000000..3a1dffdead9 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/PatchDegradationUpdateRequest.java @@ -0,0 +1,137 @@ +/* + * 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; + +/** Request object for editing a degradation update. */ +@JsonPropertyOrder({PatchDegradationUpdateRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class PatchDegradationUpdateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private PatchDegradationUpdateRequestData data; + + public PatchDegradationUpdateRequest data(PatchDegradationUpdateRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * The data object for editing a degradation update. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PatchDegradationUpdateRequestData getData() { + return data; + } + + public void setData(PatchDegradationUpdateRequestData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return PatchDegradationUpdateRequest + */ + @JsonAnySetter + public PatchDegradationUpdateRequest 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 PatchDegradationUpdateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PatchDegradationUpdateRequest patchDegradationUpdateRequest = (PatchDegradationUpdateRequest) o; + return Objects.equals(this.data, patchDegradationUpdateRequest.data) + && Objects.equals( + this.additionalProperties, patchDegradationUpdateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PatchDegradationUpdateRequest {\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/PatchDegradationUpdateRequestData.java b/src/main/java/com/datadog/api/client/v2/model/PatchDegradationUpdateRequestData.java new file mode 100644 index 00000000000..f0d2c429c83 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/PatchDegradationUpdateRequestData.java @@ -0,0 +1,210 @@ +/* + * 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; + +/** The data object for editing a degradation update. */ +@JsonPropertyOrder({ + PatchDegradationUpdateRequestData.JSON_PROPERTY_ATTRIBUTES, + PatchDegradationUpdateRequestData.JSON_PROPERTY_ID, + PatchDegradationUpdateRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class PatchDegradationUpdateRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private PatchDegradationUpdateRequestDataAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private PatchDegradationUpdateRequestDataType type = + PatchDegradationUpdateRequestDataType.DEGRADATION_UPDATES; + + public PatchDegradationUpdateRequestData() {} + + @JsonCreator + public PatchDegradationUpdateRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + PatchDegradationUpdateRequestDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + } + + public PatchDegradationUpdateRequestData attributes( + PatchDegradationUpdateRequestDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for editing a degradation update. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PatchDegradationUpdateRequestDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(PatchDegradationUpdateRequestDataAttributes attributes) { + this.attributes = attributes; + } + + public PatchDegradationUpdateRequestData id(String id) { + this.id = id; + return this; + } + + /** + * The ID of the degradation update to edit. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public PatchDegradationUpdateRequestData type(PatchDegradationUpdateRequestDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Degradation updates resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public PatchDegradationUpdateRequestDataType getType() { + return type; + } + + public void setType(PatchDegradationUpdateRequestDataType 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 PatchDegradationUpdateRequestData + */ + @JsonAnySetter + public PatchDegradationUpdateRequestData 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 PatchDegradationUpdateRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PatchDegradationUpdateRequestData patchDegradationUpdateRequestData = + (PatchDegradationUpdateRequestData) o; + return Objects.equals(this.attributes, patchDegradationUpdateRequestData.attributes) + && Objects.equals(this.id, patchDegradationUpdateRequestData.id) + && Objects.equals(this.type, patchDegradationUpdateRequestData.type) + && Objects.equals( + this.additionalProperties, patchDegradationUpdateRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PatchDegradationUpdateRequestData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/PatchDegradationUpdateRequestDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/PatchDegradationUpdateRequestDataAttributes.java new file mode 100644 index 00000000000..92b3261773a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/PatchDegradationUpdateRequestDataAttributes.java @@ -0,0 +1,173 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Attributes for editing a degradation update. */ +@JsonPropertyOrder({ + PatchDegradationUpdateRequestDataAttributes.JSON_PROPERTY_DESCRIPTION, + PatchDegradationUpdateRequestDataAttributes.JSON_PROPERTY_STATUS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class PatchDegradationUpdateRequestDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_STATUS = "status"; + private PatchDegradationUpdateRequestDataAttributesStatus status; + + public PatchDegradationUpdateRequestDataAttributes description(String description) { + this.description = description; + return this; + } + + /** + * The message body of the update. + * + * @return description + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public PatchDegradationUpdateRequestDataAttributes status( + PatchDegradationUpdateRequestDataAttributesStatus status) { + this.status = status; + this.unparsed |= !status.isValid(); + return this; + } + + /** + * The status of the degradation update. + * + * @return status + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PatchDegradationUpdateRequestDataAttributesStatus getStatus() { + return status; + } + + public void setStatus(PatchDegradationUpdateRequestDataAttributesStatus status) { + if (!status.isValid()) { + this.unparsed = true; + } + this.status = status; + } + + /** + * 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 PatchDegradationUpdateRequestDataAttributes + */ + @JsonAnySetter + public PatchDegradationUpdateRequestDataAttributes 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 PatchDegradationUpdateRequestDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PatchDegradationUpdateRequestDataAttributes patchDegradationUpdateRequestDataAttributes = + (PatchDegradationUpdateRequestDataAttributes) o; + return Objects.equals(this.description, patchDegradationUpdateRequestDataAttributes.description) + && Objects.equals(this.status, patchDegradationUpdateRequestDataAttributes.status) + && Objects.equals( + this.additionalProperties, + patchDegradationUpdateRequestDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(description, status, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PatchDegradationUpdateRequestDataAttributes {\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).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/PatchDegradationUpdateRequestDataAttributesStatus.java b/src/main/java/com/datadog/api/client/v2/model/PatchDegradationUpdateRequestDataAttributesStatus.java new file mode 100644 index 00000000000..b397795054f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/PatchDegradationUpdateRequestDataAttributesStatus.java @@ -0,0 +1,67 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The status of the degradation update. */ +@JsonSerialize( + using = + PatchDegradationUpdateRequestDataAttributesStatus + .PatchDegradationUpdateRequestDataAttributesStatusSerializer.class) +public class PatchDegradationUpdateRequestDataAttributesStatus extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("investigating", "identified", "monitoring")); + + public static final PatchDegradationUpdateRequestDataAttributesStatus INVESTIGATING = + new PatchDegradationUpdateRequestDataAttributesStatus("investigating"); + public static final PatchDegradationUpdateRequestDataAttributesStatus IDENTIFIED = + new PatchDegradationUpdateRequestDataAttributesStatus("identified"); + public static final PatchDegradationUpdateRequestDataAttributesStatus MONITORING = + new PatchDegradationUpdateRequestDataAttributesStatus("monitoring"); + + PatchDegradationUpdateRequestDataAttributesStatus(String value) { + super(value, allowedValues); + } + + public static class PatchDegradationUpdateRequestDataAttributesStatusSerializer + extends StdSerializer { + public PatchDegradationUpdateRequestDataAttributesStatusSerializer( + Class t) { + super(t); + } + + public PatchDegradationUpdateRequestDataAttributesStatusSerializer() { + this(null); + } + + @Override + public void serialize( + PatchDegradationUpdateRequestDataAttributesStatus value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static PatchDegradationUpdateRequestDataAttributesStatus fromValue(String value) { + return new PatchDegradationUpdateRequestDataAttributesStatus(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/PatchDegradationUpdateRequestDataType.java b/src/main/java/com/datadog/api/client/v2/model/PatchDegradationUpdateRequestDataType.java new file mode 100644 index 00000000000..576496c1a33 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/PatchDegradationUpdateRequestDataType.java @@ -0,0 +1,62 @@ +/* + * 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; + +/** Degradation updates resource type. */ +@JsonSerialize( + using = + PatchDegradationUpdateRequestDataType.PatchDegradationUpdateRequestDataTypeSerializer.class) +public class PatchDegradationUpdateRequestDataType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("degradation_updates")); + + public static final PatchDegradationUpdateRequestDataType DEGRADATION_UPDATES = + new PatchDegradationUpdateRequestDataType("degradation_updates"); + + PatchDegradationUpdateRequestDataType(String value) { + super(value, allowedValues); + } + + public static class PatchDegradationUpdateRequestDataTypeSerializer + extends StdSerializer { + public PatchDegradationUpdateRequestDataTypeSerializer( + Class t) { + super(t); + } + + public PatchDegradationUpdateRequestDataTypeSerializer() { + this(null); + } + + @Override + public void serialize( + PatchDegradationUpdateRequestDataType value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static PatchDegradationUpdateRequestDataType fromValue(String value) { + return new PatchDegradationUpdateRequestDataType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/PatchStatusPageRequestDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/PatchStatusPageRequestDataAttributes.java index 962b8a0a354..b7d7658c172 100644 --- a/src/main/java/com/datadog/api/client/v2/model/PatchStatusPageRequestDataAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/PatchStatusPageRequestDataAttributes.java @@ -24,6 +24,8 @@ PatchStatusPageRequestDataAttributes.JSON_PROPERTY_ENABLED, PatchStatusPageRequestDataAttributes.JSON_PROPERTY_FAVICON, PatchStatusPageRequestDataAttributes.JSON_PROPERTY_NAME, + PatchStatusPageRequestDataAttributes.JSON_PROPERTY_SLACK_APP_ICON, + PatchStatusPageRequestDataAttributes.JSON_PROPERTY_SLACK_SUBSCRIPTIONS_ENABLED, PatchStatusPageRequestDataAttributes.JSON_PROPERTY_SUBSCRIPTIONS_ENABLED, PatchStatusPageRequestDataAttributes.JSON_PROPERTY_TYPE, PatchStatusPageRequestDataAttributes.JSON_PROPERTY_VISUALIZATION_TYPE @@ -50,6 +52,13 @@ public class PatchStatusPageRequestDataAttributes { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public static final String JSON_PROPERTY_SLACK_APP_ICON = "slack_app_icon"; + private String slackAppIcon; + + public static final String JSON_PROPERTY_SLACK_SUBSCRIPTIONS_ENABLED = + "slack_subscriptions_enabled"; + private Boolean slackSubscriptionsEnabled; + public static final String JSON_PROPERTY_SUBSCRIPTIONS_ENABLED = "subscriptions_enabled"; private Boolean subscriptionsEnabled; @@ -187,6 +196,49 @@ public void setName(String name) { this.name = name; } + public PatchStatusPageRequestDataAttributes slackAppIcon(String slackAppIcon) { + this.slackAppIcon = slackAppIcon; + return this; + } + + /** + * The Slack app icon URL for the status page. + * + * @return slackAppIcon + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SLACK_APP_ICON) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSlackAppIcon() { + return slackAppIcon; + } + + public void setSlackAppIcon(String slackAppIcon) { + this.slackAppIcon = slackAppIcon; + } + + public PatchStatusPageRequestDataAttributes slackSubscriptionsEnabled( + Boolean slackSubscriptionsEnabled) { + this.slackSubscriptionsEnabled = slackSubscriptionsEnabled; + return this; + } + + /** + * Whether Slack subscriptions are enabled for the status page. + * + * @return slackSubscriptionsEnabled + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SLACK_SUBSCRIPTIONS_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSlackSubscriptionsEnabled() { + return slackSubscriptionsEnabled; + } + + public void setSlackSubscriptionsEnabled(Boolean slackSubscriptionsEnabled) { + this.slackSubscriptionsEnabled = slackSubscriptionsEnabled; + } + public PatchStatusPageRequestDataAttributes subscriptionsEnabled(Boolean subscriptionsEnabled) { this.subscriptionsEnabled = subscriptionsEnabled; return this; @@ -324,6 +376,10 @@ public boolean equals(Object o) { && Objects.equals(this.enabled, patchStatusPageRequestDataAttributes.enabled) && Objects.equals(this.favicon, patchStatusPageRequestDataAttributes.favicon) && Objects.equals(this.name, patchStatusPageRequestDataAttributes.name) + && Objects.equals(this.slackAppIcon, patchStatusPageRequestDataAttributes.slackAppIcon) + && Objects.equals( + this.slackSubscriptionsEnabled, + patchStatusPageRequestDataAttributes.slackSubscriptionsEnabled) && Objects.equals( this.subscriptionsEnabled, patchStatusPageRequestDataAttributes.subscriptionsEnabled) && Objects.equals(this.type, patchStatusPageRequestDataAttributes.type) @@ -342,6 +398,8 @@ public int hashCode() { enabled, favicon, name, + slackAppIcon, + slackSubscriptionsEnabled, subscriptionsEnabled, type, visualizationType, @@ -358,6 +416,10 @@ public String toString() { sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); sb.append(" favicon: ").append(toIndentedString(favicon)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" slackAppIcon: ").append(toIndentedString(slackAppIcon)).append("\n"); + sb.append(" slackSubscriptionsEnabled: ") + .append(toIndentedString(slackSubscriptionsEnabled)) + .append("\n"); sb.append(" subscriptionsEnabled: ") .append(toIndentedString(subscriptionsEnabled)) .append("\n"); diff --git a/src/main/java/com/datadog/api/client/v2/model/StatusPageAsIncludedAttributes.java b/src/main/java/com/datadog/api/client/v2/model/StatusPageAsIncludedAttributes.java index f97ea6ef4cf..99705f63e43 100644 --- a/src/main/java/com/datadog/api/client/v2/model/StatusPageAsIncludedAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/StatusPageAsIncludedAttributes.java @@ -33,6 +33,8 @@ StatusPageAsIncludedAttributes.JSON_PROPERTY_MODIFIED_AT, StatusPageAsIncludedAttributes.JSON_PROPERTY_NAME, StatusPageAsIncludedAttributes.JSON_PROPERTY_PAGE_URL, + StatusPageAsIncludedAttributes.JSON_PROPERTY_SLACK_APP_ICON, + StatusPageAsIncludedAttributes.JSON_PROPERTY_SLACK_SUBSCRIPTIONS_ENABLED, StatusPageAsIncludedAttributes.JSON_PROPERTY_SUBSCRIPTIONS_ENABLED, StatusPageAsIncludedAttributes.JSON_PROPERTY_TYPE, StatusPageAsIncludedAttributes.JSON_PROPERTY_VISUALIZATION_TYPE @@ -77,6 +79,13 @@ public class StatusPageAsIncludedAttributes { public static final String JSON_PROPERTY_PAGE_URL = "page_url"; private String pageUrl; + public static final String JSON_PROPERTY_SLACK_APP_ICON = "slack_app_icon"; + private String slackAppIcon; + + public static final String JSON_PROPERTY_SLACK_SUBSCRIPTIONS_ENABLED = + "slack_subscriptions_enabled"; + private Boolean slackSubscriptionsEnabled; + public static final String JSON_PROPERTY_SUBSCRIPTIONS_ENABLED = "subscriptions_enabled"; private Boolean subscriptionsEnabled; @@ -354,6 +363,49 @@ public void setPageUrl(String pageUrl) { this.pageUrl = pageUrl; } + public StatusPageAsIncludedAttributes slackAppIcon(String slackAppIcon) { + this.slackAppIcon = slackAppIcon; + return this; + } + + /** + * The Slack app icon URL for the status page. + * + * @return slackAppIcon + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SLACK_APP_ICON) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSlackAppIcon() { + return slackAppIcon; + } + + public void setSlackAppIcon(String slackAppIcon) { + this.slackAppIcon = slackAppIcon; + } + + public StatusPageAsIncludedAttributes slackSubscriptionsEnabled( + Boolean slackSubscriptionsEnabled) { + this.slackSubscriptionsEnabled = slackSubscriptionsEnabled; + return this; + } + + /** + * Whether Slack subscriptions are enabled for the status page. + * + * @return slackSubscriptionsEnabled + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SLACK_SUBSCRIPTIONS_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSlackSubscriptionsEnabled() { + return slackSubscriptionsEnabled; + } + + public void setSlackSubscriptionsEnabled(Boolean slackSubscriptionsEnabled) { + this.slackSubscriptionsEnabled = slackSubscriptionsEnabled; + } + public StatusPageAsIncludedAttributes subscriptionsEnabled(Boolean subscriptionsEnabled) { this.subscriptionsEnabled = subscriptionsEnabled; return this; @@ -497,6 +549,10 @@ public boolean equals(Object o) { && Objects.equals(this.modifiedAt, statusPageAsIncludedAttributes.modifiedAt) && Objects.equals(this.name, statusPageAsIncludedAttributes.name) && Objects.equals(this.pageUrl, statusPageAsIncludedAttributes.pageUrl) + && Objects.equals(this.slackAppIcon, statusPageAsIncludedAttributes.slackAppIcon) + && Objects.equals( + this.slackSubscriptionsEnabled, + statusPageAsIncludedAttributes.slackSubscriptionsEnabled) && Objects.equals( this.subscriptionsEnabled, statusPageAsIncludedAttributes.subscriptionsEnabled) && Objects.equals(this.type, statusPageAsIncludedAttributes.type) @@ -520,6 +576,8 @@ public int hashCode() { modifiedAt, name, pageUrl, + slackAppIcon, + slackSubscriptionsEnabled, subscriptionsEnabled, type, visualizationType, @@ -544,6 +602,10 @@ public String toString() { sb.append(" modifiedAt: ").append(toIndentedString(modifiedAt)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" pageUrl: ").append(toIndentedString(pageUrl)).append("\n"); + sb.append(" slackAppIcon: ").append(toIndentedString(slackAppIcon)).append("\n"); + sb.append(" slackSubscriptionsEnabled: ") + .append(toIndentedString(slackSubscriptionsEnabled)) + .append("\n"); sb.append(" subscriptionsEnabled: ") .append(toIndentedString(subscriptionsEnabled)) .append("\n"); diff --git a/src/main/java/com/datadog/api/client/v2/model/StatusPageDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/StatusPageDataAttributes.java index baeedaaca66..94f7d389f16 100644 --- a/src/main/java/com/datadog/api/client/v2/model/StatusPageDataAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/StatusPageDataAttributes.java @@ -34,6 +34,8 @@ StatusPageDataAttributes.JSON_PROPERTY_MODIFIED_AT, StatusPageDataAttributes.JSON_PROPERTY_NAME, StatusPageDataAttributes.JSON_PROPERTY_PAGE_URL, + StatusPageDataAttributes.JSON_PROPERTY_SLACK_APP_ICON, + StatusPageDataAttributes.JSON_PROPERTY_SLACK_SUBSCRIPTIONS_ENABLED, StatusPageDataAttributes.JSON_PROPERTY_SUBSCRIPTIONS_ENABLED, StatusPageDataAttributes.JSON_PROPERTY_TYPE, StatusPageDataAttributes.JSON_PROPERTY_VISUALIZATION_TYPE @@ -78,6 +80,13 @@ public class StatusPageDataAttributes { public static final String JSON_PROPERTY_PAGE_URL = "page_url"; private String pageUrl; + public static final String JSON_PROPERTY_SLACK_APP_ICON = "slack_app_icon"; + private String slackAppIcon; + + public static final String JSON_PROPERTY_SLACK_SUBSCRIPTIONS_ENABLED = + "slack_subscriptions_enabled"; + private Boolean slackSubscriptionsEnabled; + public static final String JSON_PROPERTY_SUBSCRIPTIONS_ENABLED = "subscriptions_enabled"; private Boolean subscriptionsEnabled; @@ -395,6 +404,48 @@ public void setPageUrl(String pageUrl) { this.pageUrl = pageUrl; } + public StatusPageDataAttributes slackAppIcon(String slackAppIcon) { + this.slackAppIcon = slackAppIcon; + return this; + } + + /** + * The Slack app icon URL for the status page. + * + * @return slackAppIcon + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SLACK_APP_ICON) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSlackAppIcon() { + return slackAppIcon; + } + + public void setSlackAppIcon(String slackAppIcon) { + this.slackAppIcon = slackAppIcon; + } + + public StatusPageDataAttributes slackSubscriptionsEnabled(Boolean slackSubscriptionsEnabled) { + this.slackSubscriptionsEnabled = slackSubscriptionsEnabled; + return this; + } + + /** + * Whether Slack subscriptions are enabled for the status page. + * + * @return slackSubscriptionsEnabled + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SLACK_SUBSCRIPTIONS_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSlackSubscriptionsEnabled() { + return slackSubscriptionsEnabled; + } + + public void setSlackSubscriptionsEnabled(Boolean slackSubscriptionsEnabled) { + this.slackSubscriptionsEnabled = slackSubscriptionsEnabled; + } + public StatusPageDataAttributes subscriptionsEnabled(Boolean subscriptionsEnabled) { this.subscriptionsEnabled = subscriptionsEnabled; return this; @@ -536,6 +587,9 @@ public boolean equals(Object o) { && Objects.equals(this.modifiedAt, statusPageDataAttributes.modifiedAt) && Objects.equals(this.name, statusPageDataAttributes.name) && Objects.equals(this.pageUrl, statusPageDataAttributes.pageUrl) + && Objects.equals(this.slackAppIcon, statusPageDataAttributes.slackAppIcon) + && Objects.equals( + this.slackSubscriptionsEnabled, statusPageDataAttributes.slackSubscriptionsEnabled) && Objects.equals(this.subscriptionsEnabled, statusPageDataAttributes.subscriptionsEnabled) && Objects.equals(this.type, statusPageDataAttributes.type) && Objects.equals(this.visualizationType, statusPageDataAttributes.visualizationType) @@ -557,6 +611,8 @@ public int hashCode() { modifiedAt, name, pageUrl, + slackAppIcon, + slackSubscriptionsEnabled, subscriptionsEnabled, type, visualizationType, @@ -581,6 +637,10 @@ public String toString() { sb.append(" modifiedAt: ").append(toIndentedString(modifiedAt)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" pageUrl: ").append(toIndentedString(pageUrl)).append("\n"); + sb.append(" slackAppIcon: ").append(toIndentedString(slackAppIcon)).append("\n"); + sb.append(" slackSubscriptionsEnabled: ") + .append(toIndentedString(slackSubscriptionsEnabled)) + .append("\n"); sb.append(" subscriptionsEnabled: ") .append(toIndentedString(subscriptionsEnabled)) .append("\n"); diff --git a/src/test/resources/com/datadog/api/client/v2/api/status_pages.feature b/src/test/resources/com/datadog/api/client/v2/api/status_pages.feature index 4e671f186de..99cb8e3ed61 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/status_pages.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/status_pages.feature @@ -94,6 +94,16 @@ Feature: Status Pages When the request is sent Then the response status is 204 No Content + @generated @skip @team:DataDog/incident-app + Scenario: Edit degradation update returns "OK" response + Given new "EditDegradationUpdate" request + And request contains "degradation_id" parameter from "REPLACE.ME" + And request contains "page_id" parameter from "REPLACE.ME" + And request contains "update_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "We've identified the source of the latency increase and are deploying a fix.", "status": "identified"}, "id": "00000000-0000-0000-0000-000000000000", "type": "degradation_updates"}} + When the request is sent + Then the response status is 200 OK + @team:DataDog/incident-app Scenario: Get component returns "OK" response Given new "GetComponent" request @@ -178,6 +188,15 @@ Feature: Status Pages When the request is sent Then the response status is 201 Created + @generated @skip @team:DataDog/incident-app + Scenario: Soft delete degradation update returns "No Content" response + Given new "SoftDeleteDegradationUpdate" request + And request contains "degradation_id" parameter from "REPLACE.ME" + And request contains "page_id" parameter from "REPLACE.ME" + And request contains "update_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + @generated @skip @team:DataDog/incident-app Scenario: Unpublish status page returns "No Content" response Given new "UnpublishStatusPage" request 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 89626bc569e..a5c43f6c0f2 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 @@ -8521,6 +8521,18 @@ "type": "idempotent" } }, + "SoftDeleteDegradationUpdate": { + "tag": "Status Pages", + "undo": { + "type": "idempotent" + } + }, + "EditDegradationUpdate": { + "tag": "Status Pages", + "undo": { + "type": "idempotent" + } + }, "CreateMaintenance": { "tag": "Status Pages", "undo": {