From c0054ff1fb31bd28cbec3565f5849f26999c3dce Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Tue, 5 May 2026 21:34:24 +0000 Subject: [PATCH] Regenerate client from commit 9048da9 of spec repo --- .generator/schemas/v2/openapi.yaml | 386 +++++++++++++++ .../CreateBackfilledDegradation.java | 107 ++++ .../CreateBackfilledMaintenance.java | 91 ++++ .../api/client/v2/api/StatusPagesApi.java | 464 ++++++++++++++++++ .../CreateBackfilledDegradationRequest.java | 138 ++++++ ...reateBackfilledDegradationRequestData.java | 182 +++++++ ...illedDegradationRequestDataAttributes.java | 194 ++++++++ ...tionRequestDataAttributesUpdatesItems.java | 270 ++++++++++ .../CreateBackfilledMaintenanceRequest.java | 138 ++++++ ...reateBackfilledMaintenanceRequestData.java | 182 +++++++ ...illedMaintenanceRequestDataAttributes.java | 195 ++++++++ ...anceRequestDataAttributesUpdatesItems.java | 271 ++++++++++ ...questDataAttributesUpdatesItemsStatus.java | 68 +++ ...reateDegradationRequestDataAttributes.java | 46 +- ...tionRequestDataAttributesUpdatesItems.java | 269 ++++++++++ ...esUpdatesItemsComponentsAffectedItems.java | 213 ++++++++ ...reateMaintenanceRequestDataAttributes.java | 44 +- ...anceRequestDataAttributesUpdatesItems.java | 266 ++++++++++ ...esUpdatesItemsComponentsAffectedItems.java | 213 ++++++++ ...questDataAttributesUpdatesItemsStatus.java | 67 +++ ...egradation_returns_Created_response.freeze | 1 + ..._degradation_returns_Created_response.json | 104 ++++ ...aintenance_returns_Created_response.freeze | 1 + ..._maintenance_returns_Created_response.json | 83 ++++ .../api/client/v2/api/status_pages.feature | 20 + .../com/datadog/api/client/v2/api/undo.json | 23 + 26 files changed, 4033 insertions(+), 3 deletions(-) create mode 100644 examples/v2/status-pages/CreateBackfilledDegradation.java create mode 100644 examples/v2/status-pages/CreateBackfilledMaintenance.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CreateBackfilledDegradationRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CreateBackfilledDegradationRequestData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CreateBackfilledDegradationRequestDataAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CreateBackfilledDegradationRequestDataAttributesUpdatesItems.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CreateBackfilledMaintenanceRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CreateBackfilledMaintenanceRequestData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CreateBackfilledMaintenanceRequestDataAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CreateBackfilledMaintenanceRequestDataAttributesUpdatesItemsStatus.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CreateDegradationRequestDataAttributesUpdatesItems.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CreateMaintenanceRequestDataAttributesUpdatesItems.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CreateMaintenanceRequestDataAttributesUpdatesItemsStatus.java create mode 100644 src/test/resources/cassettes/features/v2/Create_backfilled_degradation_returns_Created_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Create_backfilled_degradation_returns_Created_response.json create mode 100644 src/test/resources/cassettes/features/v2/Create_backfilled_maintenance_returns_Created_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Create_backfilled_maintenance_returns_Created_response.json diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index df325279eec..987935a333b 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -15902,6 +15902,170 @@ components: example: Postmortem-IR-123 type: string type: object + CreateBackfilledDegradationRequest: + description: Request object for creating a backfilled degradation. + example: + data: + attributes: + title: Past API Outage + updates: + - components_affected: + - id: 1234abcd-12ab-34cd-56ef-123456abcdef + status: degraded + description: We detected elevated error rates in the API. + started_at: "2026-04-27T13:37:31.038001628Z" + status: investigating + - components_affected: + - id: 1234abcd-12ab-34cd-56ef-123456abcdef + status: degraded + description: Root cause identified as a misconfigured deployment. + started_at: "2026-04-27T14:07:31.038001628Z" + status: identified + - components_affected: + - id: 1234abcd-12ab-34cd-56ef-123456abcdef + status: operational + description: The issue has been resolved and API is operating normally. + started_at: "2026-04-27T14:37:31.038001628Z" + status: resolved + type: degradations + properties: + data: + $ref: "#/components/schemas/CreateBackfilledDegradationRequestData" + type: object + CreateBackfilledDegradationRequestData: + description: The data object for creating a backfilled degradation. + properties: + attributes: + $ref: "#/components/schemas/CreateBackfilledDegradationRequestDataAttributes" + type: + $ref: "#/components/schemas/PatchDegradationRequestDataType" + required: + - type + type: object + CreateBackfilledDegradationRequestDataAttributes: + description: The supported attributes for creating a backfilled degradation. + properties: + title: + description: The title of the backfilled degradation. + example: "" + type: string + updates: + description: The list of status updates describing the timeline of the degradation. + items: + $ref: "#/components/schemas/CreateBackfilledDegradationRequestDataAttributesUpdatesItems" + type: array + required: + - title + - updates + type: object + CreateBackfilledDegradationRequestDataAttributesUpdatesItems: + description: A backfilled degradation update entry. + properties: + components_affected: + description: The components affected. + items: + $ref: "#/components/schemas/CreateDegradationRequestDataAttributesComponentsAffectedItems" + type: array + description: + description: A description of the update. + type: string + started_at: + description: Timestamp of when the update occurred. + example: "" + format: date-time + type: string + status: + $ref: "#/components/schemas/CreateDegradationRequestDataAttributesStatus" + required: + - started_at + - status + type: object + CreateBackfilledMaintenanceRequest: + description: Request object for creating a backfilled maintenance. + example: + data: + attributes: + title: Past Database Maintenance + updates: + - components_affected: + - id: 1234abcd-12ab-34cd-56ef-123456abcdef + status: maintenance + description: Database maintenance is in progress. + started_at: "2026-04-27T13:37:31.038003786Z" + status: in_progress + - components_affected: + - id: 1234abcd-12ab-34cd-56ef-123456abcdef + status: operational + description: Database maintenance has been completed successfully. + started_at: "2026-04-27T14:37:31.038003786Z" + status: completed + type: maintenances + properties: + data: + $ref: "#/components/schemas/CreateBackfilledMaintenanceRequestData" + type: object + CreateBackfilledMaintenanceRequestData: + description: The data object for creating a backfilled maintenance. + properties: + attributes: + $ref: "#/components/schemas/CreateBackfilledMaintenanceRequestDataAttributes" + type: + $ref: "#/components/schemas/PatchMaintenanceRequestDataType" + required: + - type + type: object + CreateBackfilledMaintenanceRequestDataAttributes: + description: The supported attributes for creating a backfilled maintenance. + properties: + title: + description: The title of the backfilled maintenance. + example: "" + type: string + updates: + description: "The list of updates. Exactly two updates are required: the start (`in_progress`) and the end (`completed`)." + items: + $ref: "#/components/schemas/CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems" + maxItems: 2 + minItems: 2 + type: array + required: + - title + - updates + type: object + CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems: + description: A backfilled maintenance update entry. + properties: + components_affected: + description: The components affected. + items: + $ref: "#/components/schemas/CreateMaintenanceRequestDataAttributesComponentsAffectedItems" + type: array + description: + description: A description of the update. + example: "" + type: string + started_at: + description: Timestamp of when the update occurred. + example: "" + format: date-time + type: string + status: + $ref: "#/components/schemas/CreateBackfilledMaintenanceRequestDataAttributesUpdatesItemsStatus" + required: + - description + - started_at + - status + type: object + CreateBackfilledMaintenanceRequestDataAttributesUpdatesItemsStatus: + description: The status of a backfilled maintenance update. + enum: + - in_progress + - completed + example: in_progress + type: string + x-enum-varnames: + - IN_PROGRESS + - COMPLETED CreateCampaignRequest: description: Request to create a new campaign. properties: @@ -16383,6 +16547,10 @@ components: description: The title of the degradation. example: Elevated API Latency type: string + updates: + items: + $ref: "#/components/schemas/CreateDegradationRequestDataAttributesUpdatesItems" + type: array required: - components_affected - status @@ -16420,6 +16588,45 @@ components: - IDENTIFIED - MONITORING - RESOLVED + CreateDegradationRequestDataAttributesUpdatesItems: + description: A degradation update entry. + properties: + components_affected: + description: The components affected. + items: + $ref: "#/components/schemas/CreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems" + type: array + description: + description: A description of the update. + type: string + started_at: + description: Timestamp of when the update occurred. + example: "" + format: date-time + type: string + status: + $ref: "#/components/schemas/CreateDegradationRequestDataAttributesStatus" + required: + - started_at + - status + type: object + CreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems: + description: A component affected by a degradation update. + properties: + id: + description: The ID of the component. Must be a component of type `component`. + example: "" + type: string + name: + description: The name of the component. + readOnly: true + type: string + status: + $ref: "#/components/schemas/StatusPagesComponentDataAttributesStatus" + required: + - id + - status + type: object CreateDeploymentGateParams: description: Parameters for creating a deployment gate. properties: @@ -16788,6 +16995,10 @@ components: description: The title of the maintenance. example: "API Maintenance" type: string + updates: + items: + $ref: "#/components/schemas/CreateMaintenanceRequestDataAttributesUpdatesItems" + type: array required: - components_affected - title @@ -16815,6 +17026,55 @@ components: - id - status type: object + CreateMaintenanceRequestDataAttributesUpdatesItems: + description: A maintenance update entry. + properties: + components_affected: + description: The components affected. + items: + $ref: "#/components/schemas/CreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems" + type: array + description: + description: A description of the update. + type: string + started_at: + description: Timestamp of when the update occurred. + example: "" + format: date-time + type: string + status: + $ref: "#/components/schemas/CreateMaintenanceRequestDataAttributesUpdatesItemsStatus" + required: + - started_at + type: object + CreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems: + description: A component affected by a maintenance update. + properties: + id: + description: The ID of the component. Must be a component of type `component`. + example: "" + type: string + name: + description: The name of the component. + readOnly: true + type: string + status: + $ref: "#/components/schemas/PatchMaintenanceRequestDataAttributesComponentsAffectedItemsStatus" + required: + - id + - status + type: object + CreateMaintenanceRequestDataAttributesUpdatesItemsStatus: + description: The status of a maintenance update. + enum: + - in_progress + - completed + - canceled + type: string + x-enum-varnames: + - IN_PROGRESS + - COMPLETED + - CANCELED CreateNotificationChannelAttributes: description: Attributes for creating an on-call notification channel. properties: @@ -128370,6 +128630,69 @@ paths: operator: AND permissions: - status_pages_incident_write + /api/v2/statuspages/{page_id}/degradations/backfill: + post: + description: Creates a backfilled degradation with predefined updates. + operationId: CreateBackfilledDegradation + parameters: + - description: "Comma-separated list of resources to include. Supported values: created_by_user, last_modified_by_user, 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 + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + title: Past API Outage + updates: + - components_affected: + - id: 1234abcd-12ab-34cd-56ef-123456abcdef + status: degraded + description: We detected elevated error rates in the API. + started_at: "2026-04-27T13:37:31Z" + status: investigating + - components_affected: + - id: 1234abcd-12ab-34cd-56ef-123456abcdef + status: operational + description: The issue has been resolved. + started_at: "2026-04-27T14:37:31Z" + status: resolved + type: degradations + schema: + $ref: "#/components/schemas/CreateBackfilledDegradationRequest" + required: true + responses: + "201": + content: + application/json: + schema: + $ref: "#/components/schemas/Degradation" + description: Created + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: [] + summary: Create backfilled degradation + tags: + - Status Pages + x-permission: + operator: AND + permissions: + - status_pages_incident_write /api/v2/statuspages/{page_id}/degradations/{degradation_id}: delete: description: Deletes a degradation by its ID. @@ -128586,6 +128909,69 @@ paths: operator: AND permissions: - status_pages_incident_write + /api/v2/statuspages/{page_id}/maintenances/backfill: + post: + description: Creates a backfilled maintenance with predefined updates. + operationId: CreateBackfilledMaintenance + parameters: + - description: "Comma-separated list of resources to include. Supported values: created_by_user, last_modified_by_user, 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 + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + title: Past Database Maintenance + updates: + - components_affected: + - id: 1234abcd-12ab-34cd-56ef-123456abcdef + status: maintenance + description: Database maintenance is in progress. + started_at: "2026-04-27T13:37:31Z" + status: in_progress + - components_affected: + - id: 1234abcd-12ab-34cd-56ef-123456abcdef + status: operational + description: Database maintenance has been completed. + started_at: "2026-04-27T14:37:31Z" + status: completed + type: maintenances + schema: + $ref: "#/components/schemas/CreateBackfilledMaintenanceRequest" + required: true + responses: + "201": + content: + application/json: + schema: + $ref: "#/components/schemas/Maintenance" + description: Created + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: [] + summary: Create backfilled maintenance + tags: + - Status Pages + x-permission: + operator: AND + permissions: + - status_pages_incident_write /api/v2/statuspages/{page_id}/maintenances/{maintenance_id}: get: description: Retrieves a specific maintenance by its ID. diff --git a/examples/v2/status-pages/CreateBackfilledDegradation.java b/examples/v2/status-pages/CreateBackfilledDegradation.java new file mode 100644 index 00000000000..55d5978ae84 --- /dev/null +++ b/examples/v2/status-pages/CreateBackfilledDegradation.java @@ -0,0 +1,107 @@ +// Create backfilled degradation returns "Created" 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.CreateBackfilledDegradationRequest; +import com.datadog.api.client.v2.model.CreateBackfilledDegradationRequestData; +import com.datadog.api.client.v2.model.CreateBackfilledDegradationRequestDataAttributes; +import com.datadog.api.client.v2.model.CreateBackfilledDegradationRequestDataAttributesUpdatesItems; +import com.datadog.api.client.v2.model.CreateDegradationRequestDataAttributesComponentsAffectedItems; +import com.datadog.api.client.v2.model.CreateDegradationRequestDataAttributesStatus; +import com.datadog.api.client.v2.model.Degradation; +import com.datadog.api.client.v2.model.PatchDegradationRequestDataType; +import com.datadog.api.client.v2.model.StatusPagesComponentDataAttributesStatus; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.Collections; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + StatusPagesApi apiInstance = new StatusPagesApi(defaultClient); + + // there is a valid "status_page" in the system + UUID STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_COMPONENTS_0_ID = null; + try { + STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_COMPONENTS_0_ID = + UUID.fromString( + System.getenv("STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_COMPONENTS_0_ID")); + } catch (IllegalArgumentException e) { + System.err.println("Error parsing UUID: " + e.getMessage()); + } + UUID STATUS_PAGE_DATA_ID = null; + try { + STATUS_PAGE_DATA_ID = UUID.fromString(System.getenv("STATUS_PAGE_DATA_ID")); + } catch (IllegalArgumentException e) { + System.err.println("Error parsing UUID: " + e.getMessage()); + } + + CreateBackfilledDegradationRequest body = + new CreateBackfilledDegradationRequest() + .data( + new CreateBackfilledDegradationRequestData() + .attributes( + new CreateBackfilledDegradationRequestDataAttributes() + .title("Past API Outage") + .updates( + Arrays.asList( + new CreateBackfilledDegradationRequestDataAttributesUpdatesItems() + .componentsAffected( + Collections.singletonList( + new CreateDegradationRequestDataAttributesComponentsAffectedItems() + .id( + STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_COMPONENTS_0_ID) + .status( + StatusPagesComponentDataAttributesStatus + .DEGRADED))) + .description("We detected elevated error rates in the API.") + .startedAt(OffsetDateTime.now().plusHours(-1)) + .status( + CreateDegradationRequestDataAttributesStatus + .INVESTIGATING), + new CreateBackfilledDegradationRequestDataAttributesUpdatesItems() + .componentsAffected( + Collections.singletonList( + new CreateDegradationRequestDataAttributesComponentsAffectedItems() + .id( + STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_COMPONENTS_0_ID) + .status( + StatusPagesComponentDataAttributesStatus + .DEGRADED))) + .description( + "Root cause identified as a misconfigured deployment.") + .startedAt(OffsetDateTime.now().plusMinutes(-30)) + .status( + CreateDegradationRequestDataAttributesStatus + .IDENTIFIED), + new CreateBackfilledDegradationRequestDataAttributesUpdatesItems() + .componentsAffected( + Collections.singletonList( + new CreateDegradationRequestDataAttributesComponentsAffectedItems() + .id( + STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_COMPONENTS_0_ID) + .status( + StatusPagesComponentDataAttributesStatus + .OPERATIONAL))) + .description( + "The issue has been resolved and API is operating" + + " normally.") + .startedAt(OffsetDateTime.now()) + .status( + CreateDegradationRequestDataAttributesStatus + .RESOLVED)))) + .type(PatchDegradationRequestDataType.DEGRADATIONS)); + + try { + Degradation result = apiInstance.createBackfilledDegradation(STATUS_PAGE_DATA_ID, body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling StatusPagesApi#createBackfilledDegradation"); + 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/CreateBackfilledMaintenance.java b/examples/v2/status-pages/CreateBackfilledMaintenance.java new file mode 100644 index 00000000000..f0b08b5aa0e --- /dev/null +++ b/examples/v2/status-pages/CreateBackfilledMaintenance.java @@ -0,0 +1,91 @@ +// Create backfilled maintenance returns "Created" 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.CreateBackfilledMaintenanceRequest; +import com.datadog.api.client.v2.model.CreateBackfilledMaintenanceRequestData; +import com.datadog.api.client.v2.model.CreateBackfilledMaintenanceRequestDataAttributes; +import com.datadog.api.client.v2.model.CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems; +import com.datadog.api.client.v2.model.CreateBackfilledMaintenanceRequestDataAttributesUpdatesItemsStatus; +import com.datadog.api.client.v2.model.CreateMaintenanceRequestDataAttributesComponentsAffectedItems; +import com.datadog.api.client.v2.model.Maintenance; +import com.datadog.api.client.v2.model.PatchMaintenanceRequestDataAttributesComponentsAffectedItemsStatus; +import com.datadog.api.client.v2.model.PatchMaintenanceRequestDataType; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.Collections; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + StatusPagesApi apiInstance = new StatusPagesApi(defaultClient); + + // there is a valid "status_page" in the system + UUID STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_COMPONENTS_0_ID = null; + try { + STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_COMPONENTS_0_ID = + UUID.fromString( + System.getenv("STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_COMPONENTS_0_ID")); + } catch (IllegalArgumentException e) { + System.err.println("Error parsing UUID: " + e.getMessage()); + } + UUID STATUS_PAGE_DATA_ID = null; + try { + STATUS_PAGE_DATA_ID = UUID.fromString(System.getenv("STATUS_PAGE_DATA_ID")); + } catch (IllegalArgumentException e) { + System.err.println("Error parsing UUID: " + e.getMessage()); + } + + CreateBackfilledMaintenanceRequest body = + new CreateBackfilledMaintenanceRequest() + .data( + new CreateBackfilledMaintenanceRequestData() + .attributes( + new CreateBackfilledMaintenanceRequestDataAttributes() + .title("Past Database Maintenance") + .updates( + Arrays.asList( + new CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems() + .componentsAffected( + Collections.singletonList( + new CreateMaintenanceRequestDataAttributesComponentsAffectedItems() + .id( + STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_COMPONENTS_0_ID) + .status( + PatchMaintenanceRequestDataAttributesComponentsAffectedItemsStatus + .MAINTENANCE))) + .description("Database maintenance is in progress.") + .startedAt(OffsetDateTime.now().plusHours(-1)) + .status( + CreateBackfilledMaintenanceRequestDataAttributesUpdatesItemsStatus + .IN_PROGRESS), + new CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems() + .componentsAffected( + Collections.singletonList( + new CreateMaintenanceRequestDataAttributesComponentsAffectedItems() + .id( + STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_COMPONENTS_0_ID) + .status( + PatchMaintenanceRequestDataAttributesComponentsAffectedItemsStatus + .OPERATIONAL))) + .description( + "Database maintenance has been completed successfully.") + .startedAt(OffsetDateTime.now()) + .status( + CreateBackfilledMaintenanceRequestDataAttributesUpdatesItemsStatus + .COMPLETED)))) + .type(PatchMaintenanceRequestDataType.MAINTENANCES)); + + try { + Maintenance result = apiInstance.createBackfilledMaintenance(STATUS_PAGE_DATA_ID, body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling StatusPagesApi#createBackfilledMaintenance"); + 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 ed15c45861c..96e8da1022d 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 @@ -4,6 +4,8 @@ import com.datadog.api.client.ApiException; import com.datadog.api.client.ApiResponse; import com.datadog.api.client.Pair; +import com.datadog.api.client.v2.model.CreateBackfilledDegradationRequest; +import com.datadog.api.client.v2.model.CreateBackfilledMaintenanceRequest; import com.datadog.api.client.v2.model.CreateComponentRequest; import com.datadog.api.client.v2.model.CreateDegradationRequest; import com.datadog.api.client.v2.model.CreateMaintenanceRequest; @@ -60,6 +62,468 @@ public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; } + /** Manage optional parameters to createBackfilledDegradation. */ + public static class CreateBackfilledDegradationOptionalParameters { + private String include; + + /** + * Set include. + * + * @param include Comma-separated list of resources to include. Supported values: + * created_by_user, last_modified_by_user, status_page. (optional) + * @return CreateBackfilledDegradationOptionalParameters + */ + public CreateBackfilledDegradationOptionalParameters include(String include) { + this.include = include; + return this; + } + } + + /** + * Create backfilled degradation. + * + *

See {@link #createBackfilledDegradationWithHttpInfo}. + * + * @param pageId The ID of the status page. (required) + * @param body (required) + * @return Degradation + * @throws ApiException if fails to make API call + */ + public Degradation createBackfilledDegradation( + UUID pageId, CreateBackfilledDegradationRequest body) throws ApiException { + return createBackfilledDegradationWithHttpInfo( + pageId, body, new CreateBackfilledDegradationOptionalParameters()) + .getData(); + } + + /** + * Create backfilled degradation. + * + *

See {@link #createBackfilledDegradationWithHttpInfoAsync}. + * + * @param pageId The ID of the status page. (required) + * @param body (required) + * @return CompletableFuture<Degradation> + */ + public CompletableFuture createBackfilledDegradationAsync( + UUID pageId, CreateBackfilledDegradationRequest body) { + return createBackfilledDegradationWithHttpInfoAsync( + pageId, body, new CreateBackfilledDegradationOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Create backfilled degradation. + * + *

See {@link #createBackfilledDegradationWithHttpInfo}. + * + * @param pageId The ID of the status page. (required) + * @param body (required) + * @param parameters Optional parameters for the request. + * @return Degradation + * @throws ApiException if fails to make API call + */ + public Degradation createBackfilledDegradation( + UUID pageId, + CreateBackfilledDegradationRequest body, + CreateBackfilledDegradationOptionalParameters parameters) + throws ApiException { + return createBackfilledDegradationWithHttpInfo(pageId, body, parameters).getData(); + } + + /** + * Create backfilled degradation. + * + *

See {@link #createBackfilledDegradationWithHttpInfoAsync}. + * + * @param pageId The ID of the status page. (required) + * @param body (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<Degradation> + */ + public CompletableFuture createBackfilledDegradationAsync( + UUID pageId, + CreateBackfilledDegradationRequest body, + CreateBackfilledDegradationOptionalParameters parameters) { + return createBackfilledDegradationWithHttpInfoAsync(pageId, body, parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Creates a backfilled degradation with predefined updates. + * + * @param pageId The ID of the status page. (required) + * @param body (required) + * @param parameters Optional parameters for the request. + * @return ApiResponse<Degradation> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + *
Response details
Status Code Description Response Headers
201 Created -
429 Too many requests -
+ */ + public ApiResponse createBackfilledDegradationWithHttpInfo( + UUID pageId, + CreateBackfilledDegradationRequest body, + CreateBackfilledDegradationOptionalParameters parameters) + throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'pageId' is set + if (pageId == null) { + throw new ApiException( + 400, "Missing the required parameter 'pageId' when calling createBackfilledDegradation"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling createBackfilledDegradation"); + } + String include = parameters.include; + // create path and map variables + String localVarPath = + "/api/v2/statuspages/{page_id}/degradations/backfill" + .replaceAll("\\{" + "page_id" + "\\}", apiClient.escapeString(pageId.toString())); + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "include", include)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.StatusPagesApi.createBackfilledDegradation", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Create backfilled degradation. + * + *

See {@link #createBackfilledDegradationWithHttpInfo}. + * + * @param pageId The ID of the status page. (required) + * @param body (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<Degradation>> + */ + public CompletableFuture> createBackfilledDegradationWithHttpInfoAsync( + UUID pageId, + CreateBackfilledDegradationRequest body, + CreateBackfilledDegradationOptionalParameters parameters) { + Object localVarPostBody = body; + + // 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 createBackfilledDegradation")); + 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 createBackfilledDegradation")); + return result; + } + String include = parameters.include; + // create path and map variables + String localVarPath = + "/api/v2/statuspages/{page_id}/degradations/backfill" + .replaceAll("\\{" + "page_id" + "\\}", apiClient.escapeString(pageId.toString())); + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "include", include)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.StatusPagesApi.createBackfilledDegradation", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** Manage optional parameters to createBackfilledMaintenance. */ + public static class CreateBackfilledMaintenanceOptionalParameters { + private String include; + + /** + * Set include. + * + * @param include Comma-separated list of resources to include. Supported values: + * created_by_user, last_modified_by_user, status_page. (optional) + * @return CreateBackfilledMaintenanceOptionalParameters + */ + public CreateBackfilledMaintenanceOptionalParameters include(String include) { + this.include = include; + return this; + } + } + + /** + * Create backfilled maintenance. + * + *

See {@link #createBackfilledMaintenanceWithHttpInfo}. + * + * @param pageId The ID of the status page. (required) + * @param body (required) + * @return Maintenance + * @throws ApiException if fails to make API call + */ + public Maintenance createBackfilledMaintenance( + UUID pageId, CreateBackfilledMaintenanceRequest body) throws ApiException { + return createBackfilledMaintenanceWithHttpInfo( + pageId, body, new CreateBackfilledMaintenanceOptionalParameters()) + .getData(); + } + + /** + * Create backfilled maintenance. + * + *

See {@link #createBackfilledMaintenanceWithHttpInfoAsync}. + * + * @param pageId The ID of the status page. (required) + * @param body (required) + * @return CompletableFuture<Maintenance> + */ + public CompletableFuture createBackfilledMaintenanceAsync( + UUID pageId, CreateBackfilledMaintenanceRequest body) { + return createBackfilledMaintenanceWithHttpInfoAsync( + pageId, body, new CreateBackfilledMaintenanceOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Create backfilled maintenance. + * + *

See {@link #createBackfilledMaintenanceWithHttpInfo}. + * + * @param pageId The ID of the status page. (required) + * @param body (required) + * @param parameters Optional parameters for the request. + * @return Maintenance + * @throws ApiException if fails to make API call + */ + public Maintenance createBackfilledMaintenance( + UUID pageId, + CreateBackfilledMaintenanceRequest body, + CreateBackfilledMaintenanceOptionalParameters parameters) + throws ApiException { + return createBackfilledMaintenanceWithHttpInfo(pageId, body, parameters).getData(); + } + + /** + * Create backfilled maintenance. + * + *

See {@link #createBackfilledMaintenanceWithHttpInfoAsync}. + * + * @param pageId The ID of the status page. (required) + * @param body (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<Maintenance> + */ + public CompletableFuture createBackfilledMaintenanceAsync( + UUID pageId, + CreateBackfilledMaintenanceRequest body, + CreateBackfilledMaintenanceOptionalParameters parameters) { + return createBackfilledMaintenanceWithHttpInfoAsync(pageId, body, parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Creates a backfilled maintenance with predefined updates. + * + * @param pageId The ID of the status page. (required) + * @param body (required) + * @param parameters Optional parameters for the request. + * @return ApiResponse<Maintenance> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + *
Response details
Status Code Description Response Headers
201 Created -
429 Too many requests -
+ */ + public ApiResponse createBackfilledMaintenanceWithHttpInfo( + UUID pageId, + CreateBackfilledMaintenanceRequest body, + CreateBackfilledMaintenanceOptionalParameters parameters) + throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'pageId' is set + if (pageId == null) { + throw new ApiException( + 400, "Missing the required parameter 'pageId' when calling createBackfilledMaintenance"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling createBackfilledMaintenance"); + } + String include = parameters.include; + // create path and map variables + String localVarPath = + "/api/v2/statuspages/{page_id}/maintenances/backfill" + .replaceAll("\\{" + "page_id" + "\\}", apiClient.escapeString(pageId.toString())); + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "include", include)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.StatusPagesApi.createBackfilledMaintenance", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Create backfilled maintenance. + * + *

See {@link #createBackfilledMaintenanceWithHttpInfo}. + * + * @param pageId The ID of the status page. (required) + * @param body (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<Maintenance>> + */ + public CompletableFuture> createBackfilledMaintenanceWithHttpInfoAsync( + UUID pageId, + CreateBackfilledMaintenanceRequest body, + CreateBackfilledMaintenanceOptionalParameters parameters) { + Object localVarPostBody = body; + + // 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 createBackfilledMaintenance")); + 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 createBackfilledMaintenance")); + return result; + } + String include = parameters.include; + // create path and map variables + String localVarPath = + "/api/v2/statuspages/{page_id}/maintenances/backfill" + .replaceAll("\\{" + "page_id" + "\\}", apiClient.escapeString(pageId.toString())); + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "include", include)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.StatusPagesApi.createBackfilledMaintenance", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + /** Manage optional parameters to createComponent. */ public static class CreateComponentOptionalParameters { private String include; diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateBackfilledDegradationRequest.java b/src/main/java/com/datadog/api/client/v2/model/CreateBackfilledDegradationRequest.java new file mode 100644 index 00000000000..6363592274d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateBackfilledDegradationRequest.java @@ -0,0 +1,138 @@ +/* + * 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 creating a backfilled degradation. */ +@JsonPropertyOrder({CreateBackfilledDegradationRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateBackfilledDegradationRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private CreateBackfilledDegradationRequestData data; + + public CreateBackfilledDegradationRequest data(CreateBackfilledDegradationRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * The data object for creating a backfilled degradation. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CreateBackfilledDegradationRequestData getData() { + return data; + } + + public void setData(CreateBackfilledDegradationRequestData 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 CreateBackfilledDegradationRequest + */ + @JsonAnySetter + public CreateBackfilledDegradationRequest 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 CreateBackfilledDegradationRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateBackfilledDegradationRequest createBackfilledDegradationRequest = + (CreateBackfilledDegradationRequest) o; + return Objects.equals(this.data, createBackfilledDegradationRequest.data) + && Objects.equals( + this.additionalProperties, createBackfilledDegradationRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateBackfilledDegradationRequest {\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/CreateBackfilledDegradationRequestData.java b/src/main/java/com/datadog/api/client/v2/model/CreateBackfilledDegradationRequestData.java new file mode 100644 index 00000000000..b464a9c798a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateBackfilledDegradationRequestData.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; + +/** The data object for creating a backfilled degradation. */ +@JsonPropertyOrder({ + CreateBackfilledDegradationRequestData.JSON_PROPERTY_ATTRIBUTES, + CreateBackfilledDegradationRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateBackfilledDegradationRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private CreateBackfilledDegradationRequestDataAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private PatchDegradationRequestDataType type = PatchDegradationRequestDataType.DEGRADATIONS; + + public CreateBackfilledDegradationRequestData() {} + + @JsonCreator + public CreateBackfilledDegradationRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + PatchDegradationRequestDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + } + + public CreateBackfilledDegradationRequestData attributes( + CreateBackfilledDegradationRequestDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * The supported attributes for creating a backfilled degradation. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CreateBackfilledDegradationRequestDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(CreateBackfilledDegradationRequestDataAttributes attributes) { + this.attributes = attributes; + } + + public CreateBackfilledDegradationRequestData 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 CreateBackfilledDegradationRequestData + */ + @JsonAnySetter + public CreateBackfilledDegradationRequestData 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 CreateBackfilledDegradationRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateBackfilledDegradationRequestData createBackfilledDegradationRequestData = + (CreateBackfilledDegradationRequestData) o; + return Objects.equals(this.attributes, createBackfilledDegradationRequestData.attributes) + && Objects.equals(this.type, createBackfilledDegradationRequestData.type) + && Objects.equals( + this.additionalProperties, createBackfilledDegradationRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateBackfilledDegradationRequestData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateBackfilledDegradationRequestDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CreateBackfilledDegradationRequestDataAttributes.java new file mode 100644 index 00000000000..3c4ba1c9bcc --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateBackfilledDegradationRequestDataAttributes.java @@ -0,0 +1,194 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** The supported attributes for creating a backfilled degradation. */ +@JsonPropertyOrder({ + CreateBackfilledDegradationRequestDataAttributes.JSON_PROPERTY_TITLE, + CreateBackfilledDegradationRequestDataAttributes.JSON_PROPERTY_UPDATES +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateBackfilledDegradationRequestDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_TITLE = "title"; + private String title; + + public static final String JSON_PROPERTY_UPDATES = "updates"; + private List updates = + new ArrayList<>(); + + public CreateBackfilledDegradationRequestDataAttributes() {} + + @JsonCreator + public CreateBackfilledDegradationRequestDataAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_TITLE) String title, + @JsonProperty(required = true, value = JSON_PROPERTY_UPDATES) + List updates) { + this.title = title; + this.updates = updates; + } + + public CreateBackfilledDegradationRequestDataAttributes title(String title) { + this.title = title; + return this; + } + + /** + * The title of the backfilled degradation. + * + * @return title + */ + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public CreateBackfilledDegradationRequestDataAttributes updates( + List updates) { + this.updates = updates; + for (CreateBackfilledDegradationRequestDataAttributesUpdatesItems item : updates) { + this.unparsed |= item.unparsed; + } + return this; + } + + public CreateBackfilledDegradationRequestDataAttributes addUpdatesItem( + CreateBackfilledDegradationRequestDataAttributesUpdatesItems updatesItem) { + this.updates.add(updatesItem); + this.unparsed |= updatesItem.unparsed; + return this; + } + + /** + * The list of status updates describing the timeline of the degradation. + * + * @return updates + */ + @JsonProperty(JSON_PROPERTY_UPDATES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getUpdates() { + return updates; + } + + public void setUpdates( + List updates) { + this.updates = updates; + } + + /** + * 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 CreateBackfilledDegradationRequestDataAttributes + */ + @JsonAnySetter + public CreateBackfilledDegradationRequestDataAttributes 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 CreateBackfilledDegradationRequestDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateBackfilledDegradationRequestDataAttributes + createBackfilledDegradationRequestDataAttributes = + (CreateBackfilledDegradationRequestDataAttributes) o; + return Objects.equals(this.title, createBackfilledDegradationRequestDataAttributes.title) + && Objects.equals(this.updates, createBackfilledDegradationRequestDataAttributes.updates) + && Objects.equals( + this.additionalProperties, + createBackfilledDegradationRequestDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(title, updates, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateBackfilledDegradationRequestDataAttributes {\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" updates: ").append(toIndentedString(updates)).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/CreateBackfilledDegradationRequestDataAttributesUpdatesItems.java b/src/main/java/com/datadog/api/client/v2/model/CreateBackfilledDegradationRequestDataAttributesUpdatesItems.java new file mode 100644 index 00000000000..bea563626e9 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateBackfilledDegradationRequestDataAttributesUpdatesItems.java @@ -0,0 +1,270 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** A backfilled degradation update entry. */ +@JsonPropertyOrder({ + CreateBackfilledDegradationRequestDataAttributesUpdatesItems.JSON_PROPERTY_COMPONENTS_AFFECTED, + CreateBackfilledDegradationRequestDataAttributesUpdatesItems.JSON_PROPERTY_DESCRIPTION, + CreateBackfilledDegradationRequestDataAttributesUpdatesItems.JSON_PROPERTY_STARTED_AT, + CreateBackfilledDegradationRequestDataAttributesUpdatesItems.JSON_PROPERTY_STATUS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateBackfilledDegradationRequestDataAttributesUpdatesItems { + @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_DESCRIPTION = "description"; + private String description; + + 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 CreateBackfilledDegradationRequestDataAttributesUpdatesItems() {} + + @JsonCreator + public CreateBackfilledDegradationRequestDataAttributesUpdatesItems( + @JsonProperty(required = true, value = JSON_PROPERTY_STARTED_AT) OffsetDateTime startedAt, + @JsonProperty(required = true, value = JSON_PROPERTY_STATUS) + CreateDegradationRequestDataAttributesStatus status) { + this.startedAt = startedAt; + this.status = status; + this.unparsed |= !status.isValid(); + } + + public CreateBackfilledDegradationRequestDataAttributesUpdatesItems componentsAffected( + List componentsAffected) { + this.componentsAffected = componentsAffected; + for (CreateDegradationRequestDataAttributesComponentsAffectedItems item : componentsAffected) { + this.unparsed |= item.unparsed; + } + return this; + } + + public CreateBackfilledDegradationRequestDataAttributesUpdatesItems addComponentsAffectedItem( + CreateDegradationRequestDataAttributesComponentsAffectedItems componentsAffectedItem) { + if (this.componentsAffected == null) { + this.componentsAffected = new ArrayList<>(); + } + this.componentsAffected.add(componentsAffectedItem); + this.unparsed |= componentsAffectedItem.unparsed; + return this; + } + + /** + * The components affected. + * + * @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 CreateBackfilledDegradationRequestDataAttributesUpdatesItems description( + String description) { + this.description = description; + return this; + } + + /** + * A description 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 CreateBackfilledDegradationRequestDataAttributesUpdatesItems startedAt( + OffsetDateTime startedAt) { + this.startedAt = startedAt; + return this; + } + + /** + * Timestamp of when the update occurred. + * + * @return startedAt + */ + @JsonProperty(JSON_PROPERTY_STARTED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getStartedAt() { + return startedAt; + } + + public void setStartedAt(OffsetDateTime startedAt) { + this.startedAt = startedAt; + } + + public CreateBackfilledDegradationRequestDataAttributesUpdatesItems status( + CreateDegradationRequestDataAttributesStatus status) { + this.status = status; + this.unparsed |= !status.isValid(); + return this; + } + + /** + * The status of the degradation. + * + * @return status + */ + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + 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 CreateBackfilledDegradationRequestDataAttributesUpdatesItems + */ + @JsonAnySetter + public CreateBackfilledDegradationRequestDataAttributesUpdatesItems 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 CreateBackfilledDegradationRequestDataAttributesUpdatesItems object is + * equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateBackfilledDegradationRequestDataAttributesUpdatesItems + createBackfilledDegradationRequestDataAttributesUpdatesItems = + (CreateBackfilledDegradationRequestDataAttributesUpdatesItems) o; + return Objects.equals( + this.componentsAffected, + createBackfilledDegradationRequestDataAttributesUpdatesItems.componentsAffected) + && Objects.equals( + this.description, + createBackfilledDegradationRequestDataAttributesUpdatesItems.description) + && Objects.equals( + this.startedAt, createBackfilledDegradationRequestDataAttributesUpdatesItems.startedAt) + && Objects.equals( + this.status, createBackfilledDegradationRequestDataAttributesUpdatesItems.status) + && Objects.equals( + this.additionalProperties, + createBackfilledDegradationRequestDataAttributesUpdatesItems.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(componentsAffected, description, startedAt, status, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateBackfilledDegradationRequestDataAttributesUpdatesItems {\n"); + sb.append(" componentsAffected: ").append(toIndentedString(componentsAffected)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).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/CreateBackfilledMaintenanceRequest.java b/src/main/java/com/datadog/api/client/v2/model/CreateBackfilledMaintenanceRequest.java new file mode 100644 index 00000000000..9e2db80e274 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateBackfilledMaintenanceRequest.java @@ -0,0 +1,138 @@ +/* + * 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 creating a backfilled maintenance. */ +@JsonPropertyOrder({CreateBackfilledMaintenanceRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateBackfilledMaintenanceRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private CreateBackfilledMaintenanceRequestData data; + + public CreateBackfilledMaintenanceRequest data(CreateBackfilledMaintenanceRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * The data object for creating a backfilled maintenance. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CreateBackfilledMaintenanceRequestData getData() { + return data; + } + + public void setData(CreateBackfilledMaintenanceRequestData 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 CreateBackfilledMaintenanceRequest + */ + @JsonAnySetter + public CreateBackfilledMaintenanceRequest 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 CreateBackfilledMaintenanceRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateBackfilledMaintenanceRequest createBackfilledMaintenanceRequest = + (CreateBackfilledMaintenanceRequest) o; + return Objects.equals(this.data, createBackfilledMaintenanceRequest.data) + && Objects.equals( + this.additionalProperties, createBackfilledMaintenanceRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateBackfilledMaintenanceRequest {\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/CreateBackfilledMaintenanceRequestData.java b/src/main/java/com/datadog/api/client/v2/model/CreateBackfilledMaintenanceRequestData.java new file mode 100644 index 00000000000..d8c5e3154f2 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateBackfilledMaintenanceRequestData.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; + +/** The data object for creating a backfilled maintenance. */ +@JsonPropertyOrder({ + CreateBackfilledMaintenanceRequestData.JSON_PROPERTY_ATTRIBUTES, + CreateBackfilledMaintenanceRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateBackfilledMaintenanceRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private CreateBackfilledMaintenanceRequestDataAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private PatchMaintenanceRequestDataType type = PatchMaintenanceRequestDataType.MAINTENANCES; + + public CreateBackfilledMaintenanceRequestData() {} + + @JsonCreator + public CreateBackfilledMaintenanceRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + PatchMaintenanceRequestDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + } + + public CreateBackfilledMaintenanceRequestData attributes( + CreateBackfilledMaintenanceRequestDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * The supported attributes for creating a backfilled maintenance. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CreateBackfilledMaintenanceRequestDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(CreateBackfilledMaintenanceRequestDataAttributes attributes) { + this.attributes = attributes; + } + + public CreateBackfilledMaintenanceRequestData type(PatchMaintenanceRequestDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Maintenances resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public PatchMaintenanceRequestDataType getType() { + return type; + } + + public void setType(PatchMaintenanceRequestDataType 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 CreateBackfilledMaintenanceRequestData + */ + @JsonAnySetter + public CreateBackfilledMaintenanceRequestData 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 CreateBackfilledMaintenanceRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateBackfilledMaintenanceRequestData createBackfilledMaintenanceRequestData = + (CreateBackfilledMaintenanceRequestData) o; + return Objects.equals(this.attributes, createBackfilledMaintenanceRequestData.attributes) + && Objects.equals(this.type, createBackfilledMaintenanceRequestData.type) + && Objects.equals( + this.additionalProperties, createBackfilledMaintenanceRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateBackfilledMaintenanceRequestData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateBackfilledMaintenanceRequestDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CreateBackfilledMaintenanceRequestDataAttributes.java new file mode 100644 index 00000000000..c006fd4f955 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateBackfilledMaintenanceRequestDataAttributes.java @@ -0,0 +1,195 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** The supported attributes for creating a backfilled maintenance. */ +@JsonPropertyOrder({ + CreateBackfilledMaintenanceRequestDataAttributes.JSON_PROPERTY_TITLE, + CreateBackfilledMaintenanceRequestDataAttributes.JSON_PROPERTY_UPDATES +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateBackfilledMaintenanceRequestDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_TITLE = "title"; + private String title; + + public static final String JSON_PROPERTY_UPDATES = "updates"; + private List updates = + new ArrayList<>(); + + public CreateBackfilledMaintenanceRequestDataAttributes() {} + + @JsonCreator + public CreateBackfilledMaintenanceRequestDataAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_TITLE) String title, + @JsonProperty(required = true, value = JSON_PROPERTY_UPDATES) + List updates) { + this.title = title; + this.updates = updates; + } + + public CreateBackfilledMaintenanceRequestDataAttributes title(String title) { + this.title = title; + return this; + } + + /** + * The title of the backfilled maintenance. + * + * @return title + */ + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public CreateBackfilledMaintenanceRequestDataAttributes updates( + List updates) { + this.updates = updates; + for (CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems item : updates) { + this.unparsed |= item.unparsed; + } + return this; + } + + public CreateBackfilledMaintenanceRequestDataAttributes addUpdatesItem( + CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems updatesItem) { + this.updates.add(updatesItem); + this.unparsed |= updatesItem.unparsed; + return this; + } + + /** + * The list of updates. Exactly two updates are required: the start (in_progress) and + * the end (completed). + * + * @return updates + */ + @JsonProperty(JSON_PROPERTY_UPDATES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getUpdates() { + return updates; + } + + public void setUpdates( + List updates) { + this.updates = updates; + } + + /** + * 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 CreateBackfilledMaintenanceRequestDataAttributes + */ + @JsonAnySetter + public CreateBackfilledMaintenanceRequestDataAttributes 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 CreateBackfilledMaintenanceRequestDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateBackfilledMaintenanceRequestDataAttributes + createBackfilledMaintenanceRequestDataAttributes = + (CreateBackfilledMaintenanceRequestDataAttributes) o; + return Objects.equals(this.title, createBackfilledMaintenanceRequestDataAttributes.title) + && Objects.equals(this.updates, createBackfilledMaintenanceRequestDataAttributes.updates) + && Objects.equals( + this.additionalProperties, + createBackfilledMaintenanceRequestDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(title, updates, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateBackfilledMaintenanceRequestDataAttributes {\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" updates: ").append(toIndentedString(updates)).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/CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems.java b/src/main/java/com/datadog/api/client/v2/model/CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems.java new file mode 100644 index 00000000000..ceb02008aa8 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems.java @@ -0,0 +1,271 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** A backfilled maintenance update entry. */ +@JsonPropertyOrder({ + CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems.JSON_PROPERTY_COMPONENTS_AFFECTED, + CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems.JSON_PROPERTY_DESCRIPTION, + CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems.JSON_PROPERTY_STARTED_AT, + CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems.JSON_PROPERTY_STATUS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems { + @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_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_STARTED_AT = "started_at"; + private OffsetDateTime startedAt; + + public static final String JSON_PROPERTY_STATUS = "status"; + private CreateBackfilledMaintenanceRequestDataAttributesUpdatesItemsStatus status; + + public CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems() {} + + @JsonCreator + public CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems( + @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) + CreateBackfilledMaintenanceRequestDataAttributesUpdatesItemsStatus status) { + this.description = description; + this.startedAt = startedAt; + this.status = status; + this.unparsed |= !status.isValid(); + } + + public CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems componentsAffected( + List componentsAffected) { + this.componentsAffected = componentsAffected; + for (CreateMaintenanceRequestDataAttributesComponentsAffectedItems item : componentsAffected) { + this.unparsed |= item.unparsed; + } + return this; + } + + public CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems addComponentsAffectedItem( + CreateMaintenanceRequestDataAttributesComponentsAffectedItems componentsAffectedItem) { + if (this.componentsAffected == null) { + this.componentsAffected = new ArrayList<>(); + } + this.componentsAffected.add(componentsAffectedItem); + this.unparsed |= componentsAffectedItem.unparsed; + return this; + } + + /** + * The components affected. + * + * @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 CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems description( + String description) { + this.description = description; + return this; + } + + /** + * A description of the update. + * + * @return description + */ + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems startedAt( + OffsetDateTime startedAt) { + this.startedAt = startedAt; + return this; + } + + /** + * Timestamp of when the update occurred. + * + * @return startedAt + */ + @JsonProperty(JSON_PROPERTY_STARTED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getStartedAt() { + return startedAt; + } + + public void setStartedAt(OffsetDateTime startedAt) { + this.startedAt = startedAt; + } + + public CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems status( + CreateBackfilledMaintenanceRequestDataAttributesUpdatesItemsStatus status) { + this.status = status; + this.unparsed |= !status.isValid(); + return this; + } + + /** + * The status of a backfilled maintenance update. + * + * @return status + */ + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CreateBackfilledMaintenanceRequestDataAttributesUpdatesItemsStatus getStatus() { + return status; + } + + public void setStatus(CreateBackfilledMaintenanceRequestDataAttributesUpdatesItemsStatus 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 CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems + */ + @JsonAnySetter + public CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems 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 CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems object is + * equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems + createBackfilledMaintenanceRequestDataAttributesUpdatesItems = + (CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems) o; + return Objects.equals( + this.componentsAffected, + createBackfilledMaintenanceRequestDataAttributesUpdatesItems.componentsAffected) + && Objects.equals( + this.description, + createBackfilledMaintenanceRequestDataAttributesUpdatesItems.description) + && Objects.equals( + this.startedAt, createBackfilledMaintenanceRequestDataAttributesUpdatesItems.startedAt) + && Objects.equals( + this.status, createBackfilledMaintenanceRequestDataAttributesUpdatesItems.status) + && Objects.equals( + this.additionalProperties, + createBackfilledMaintenanceRequestDataAttributesUpdatesItems.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(componentsAffected, description, startedAt, status, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems {\n"); + sb.append(" componentsAffected: ").append(toIndentedString(componentsAffected)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).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/CreateBackfilledMaintenanceRequestDataAttributesUpdatesItemsStatus.java b/src/main/java/com/datadog/api/client/v2/model/CreateBackfilledMaintenanceRequestDataAttributesUpdatesItemsStatus.java new file mode 100644 index 00000000000..f1208777e7f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateBackfilledMaintenanceRequestDataAttributesUpdatesItemsStatus.java @@ -0,0 +1,68 @@ +/* + * 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 a backfilled maintenance update. */ +@JsonSerialize( + using = + CreateBackfilledMaintenanceRequestDataAttributesUpdatesItemsStatus + .CreateBackfilledMaintenanceRequestDataAttributesUpdatesItemsStatusSerializer.class) +public class CreateBackfilledMaintenanceRequestDataAttributesUpdatesItemsStatus + extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("in_progress", "completed")); + + public static final CreateBackfilledMaintenanceRequestDataAttributesUpdatesItemsStatus + IN_PROGRESS = + new CreateBackfilledMaintenanceRequestDataAttributesUpdatesItemsStatus("in_progress"); + public static final CreateBackfilledMaintenanceRequestDataAttributesUpdatesItemsStatus COMPLETED = + new CreateBackfilledMaintenanceRequestDataAttributesUpdatesItemsStatus("completed"); + + CreateBackfilledMaintenanceRequestDataAttributesUpdatesItemsStatus(String value) { + super(value, allowedValues); + } + + public static class CreateBackfilledMaintenanceRequestDataAttributesUpdatesItemsStatusSerializer + extends StdSerializer { + public CreateBackfilledMaintenanceRequestDataAttributesUpdatesItemsStatusSerializer( + Class t) { + super(t); + } + + public CreateBackfilledMaintenanceRequestDataAttributesUpdatesItemsStatusSerializer() { + this(null); + } + + @Override + public void serialize( + CreateBackfilledMaintenanceRequestDataAttributesUpdatesItemsStatus value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static CreateBackfilledMaintenanceRequestDataAttributesUpdatesItemsStatus fromValue( + String value) { + return new CreateBackfilledMaintenanceRequestDataAttributesUpdatesItemsStatus(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateDegradationRequestDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CreateDegradationRequestDataAttributes.java index bda54c008be..66219f32e52 100644 --- a/src/main/java/com/datadog/api/client/v2/model/CreateDegradationRequestDataAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/CreateDegradationRequestDataAttributes.java @@ -24,7 +24,8 @@ CreateDegradationRequestDataAttributes.JSON_PROPERTY_COMPONENTS_AFFECTED, CreateDegradationRequestDataAttributes.JSON_PROPERTY_DESCRIPTION, CreateDegradationRequestDataAttributes.JSON_PROPERTY_STATUS, - CreateDegradationRequestDataAttributes.JSON_PROPERTY_TITLE + CreateDegradationRequestDataAttributes.JSON_PROPERTY_TITLE, + CreateDegradationRequestDataAttributes.JSON_PROPERTY_UPDATES }) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") @@ -43,6 +44,9 @@ public class CreateDegradationRequestDataAttributes { public static final String JSON_PROPERTY_TITLE = "title"; private String title; + public static final String JSON_PROPERTY_UPDATES = "updates"; + private List updates = null; + public CreateDegradationRequestDataAttributes() {} @JsonCreator @@ -157,6 +161,41 @@ public void setTitle(String title) { this.title = title; } + public CreateDegradationRequestDataAttributes updates( + List updates) { + this.updates = updates; + for (CreateDegradationRequestDataAttributesUpdatesItems item : updates) { + this.unparsed |= item.unparsed; + } + return this; + } + + public CreateDegradationRequestDataAttributes addUpdatesItem( + CreateDegradationRequestDataAttributesUpdatesItems updatesItem) { + if (this.updates == null) { + this.updates = new ArrayList<>(); + } + this.updates.add(updatesItem); + this.unparsed |= updatesItem.unparsed; + return this; + } + + /** + * Getupdates + * + * @return updates + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UPDATES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getUpdates() { + return updates; + } + + public void setUpdates(List updates) { + this.updates = updates; + } + /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -219,13 +258,15 @@ public boolean equals(Object o) { && Objects.equals(this.description, createDegradationRequestDataAttributes.description) && Objects.equals(this.status, createDegradationRequestDataAttributes.status) && Objects.equals(this.title, createDegradationRequestDataAttributes.title) + && Objects.equals(this.updates, createDegradationRequestDataAttributes.updates) && Objects.equals( this.additionalProperties, createDegradationRequestDataAttributes.additionalProperties); } @Override public int hashCode() { - return Objects.hash(componentsAffected, description, status, title, additionalProperties); + return Objects.hash( + componentsAffected, description, status, title, updates, additionalProperties); } @Override @@ -236,6 +277,7 @@ public String toString() { sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" updates: ").append(toIndentedString(updates)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateDegradationRequestDataAttributesUpdatesItems.java b/src/main/java/com/datadog/api/client/v2/model/CreateDegradationRequestDataAttributesUpdatesItems.java new file mode 100644 index 00000000000..79e349069c3 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateDegradationRequestDataAttributesUpdatesItems.java @@ -0,0 +1,269 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** A degradation update entry. */ +@JsonPropertyOrder({ + CreateDegradationRequestDataAttributesUpdatesItems.JSON_PROPERTY_COMPONENTS_AFFECTED, + CreateDegradationRequestDataAttributesUpdatesItems.JSON_PROPERTY_DESCRIPTION, + CreateDegradationRequestDataAttributesUpdatesItems.JSON_PROPERTY_STARTED_AT, + CreateDegradationRequestDataAttributesUpdatesItems.JSON_PROPERTY_STATUS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateDegradationRequestDataAttributesUpdatesItems { + @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_DESCRIPTION = "description"; + private String description; + + 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 CreateDegradationRequestDataAttributesUpdatesItems() {} + + @JsonCreator + public CreateDegradationRequestDataAttributesUpdatesItems( + @JsonProperty(required = true, value = JSON_PROPERTY_STARTED_AT) OffsetDateTime startedAt, + @JsonProperty(required = true, value = JSON_PROPERTY_STATUS) + CreateDegradationRequestDataAttributesStatus status) { + this.startedAt = startedAt; + this.status = status; + this.unparsed |= !status.isValid(); + } + + public CreateDegradationRequestDataAttributesUpdatesItems componentsAffected( + List + componentsAffected) { + this.componentsAffected = componentsAffected; + for (CreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems item : + componentsAffected) { + this.unparsed |= item.unparsed; + } + return this; + } + + public CreateDegradationRequestDataAttributesUpdatesItems addComponentsAffectedItem( + CreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems + componentsAffectedItem) { + if (this.componentsAffected == null) { + this.componentsAffected = new ArrayList<>(); + } + this.componentsAffected.add(componentsAffectedItem); + this.unparsed |= componentsAffectedItem.unparsed; + return this; + } + + /** + * The components affected. + * + * @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 CreateDegradationRequestDataAttributesUpdatesItems description(String description) { + this.description = description; + return this; + } + + /** + * A description 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 CreateDegradationRequestDataAttributesUpdatesItems startedAt(OffsetDateTime startedAt) { + this.startedAt = startedAt; + return this; + } + + /** + * Timestamp of when the update occurred. + * + * @return startedAt + */ + @JsonProperty(JSON_PROPERTY_STARTED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getStartedAt() { + return startedAt; + } + + public void setStartedAt(OffsetDateTime startedAt) { + this.startedAt = startedAt; + } + + public CreateDegradationRequestDataAttributesUpdatesItems status( + CreateDegradationRequestDataAttributesStatus status) { + this.status = status; + this.unparsed |= !status.isValid(); + return this; + } + + /** + * The status of the degradation. + * + * @return status + */ + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + 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 CreateDegradationRequestDataAttributesUpdatesItems + */ + @JsonAnySetter + public CreateDegradationRequestDataAttributesUpdatesItems 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 CreateDegradationRequestDataAttributesUpdatesItems object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateDegradationRequestDataAttributesUpdatesItems + createDegradationRequestDataAttributesUpdatesItems = + (CreateDegradationRequestDataAttributesUpdatesItems) o; + return Objects.equals( + this.componentsAffected, + createDegradationRequestDataAttributesUpdatesItems.componentsAffected) + && Objects.equals( + this.description, createDegradationRequestDataAttributesUpdatesItems.description) + && Objects.equals( + this.startedAt, createDegradationRequestDataAttributesUpdatesItems.startedAt) + && Objects.equals(this.status, createDegradationRequestDataAttributesUpdatesItems.status) + && Objects.equals( + this.additionalProperties, + createDegradationRequestDataAttributesUpdatesItems.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(componentsAffected, description, startedAt, status, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateDegradationRequestDataAttributesUpdatesItems {\n"); + sb.append(" componentsAffected: ").append(toIndentedString(componentsAffected)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).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/CreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems.java b/src/main/java/com/datadog/api/client/v2/model/CreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems.java new file mode 100644 index 00000000000..5c45b097b4c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems.java @@ -0,0 +1,213 @@ +/* + * 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({ + CreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems.JSON_PROPERTY_ID, + CreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems.JSON_PROPERTY_NAME, + CreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems.JSON_PROPERTY_STATUS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems { + @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 CreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems() {} + + @JsonCreator + public CreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems( + @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 CreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems id(String id) { + this.id = id; + return this; + } + + /** + * The ID of the component. Must be a component of type 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 component. + * + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + public CreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems 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 CreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems + */ + @JsonAnySetter + public CreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems + 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 CreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems + * object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems + createDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems = + (CreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems) o; + return Objects.equals( + this.id, createDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems.id) + && Objects.equals( + this.name, + createDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems.name) + && Objects.equals( + this.status, + createDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems.status) + && Objects.equals( + this.additionalProperties, + createDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems + .additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, status, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append( + "class CreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems {\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/CreateMaintenanceRequestDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CreateMaintenanceRequestDataAttributes.java index db2a0c687af..912d2633137 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 @@ -28,7 +28,8 @@ CreateMaintenanceRequestDataAttributes.JSON_PROPERTY_IN_PROGRESS_DESCRIPTION, CreateMaintenanceRequestDataAttributes.JSON_PROPERTY_SCHEDULED_DESCRIPTION, CreateMaintenanceRequestDataAttributes.JSON_PROPERTY_START_DATE, - CreateMaintenanceRequestDataAttributes.JSON_PROPERTY_TITLE + CreateMaintenanceRequestDataAttributes.JSON_PROPERTY_TITLE, + CreateMaintenanceRequestDataAttributes.JSON_PROPERTY_UPDATES }) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") @@ -56,6 +57,9 @@ public class CreateMaintenanceRequestDataAttributes { public static final String JSON_PROPERTY_TITLE = "title"; private String title; + public static final String JSON_PROPERTY_UPDATES = "updates"; + private List updates = null; + public CreateMaintenanceRequestDataAttributes() {} @JsonCreator @@ -235,6 +239,41 @@ public void setTitle(String title) { this.title = title; } + public CreateMaintenanceRequestDataAttributes updates( + List updates) { + this.updates = updates; + for (CreateMaintenanceRequestDataAttributesUpdatesItems item : updates) { + this.unparsed |= item.unparsed; + } + return this; + } + + public CreateMaintenanceRequestDataAttributes addUpdatesItem( + CreateMaintenanceRequestDataAttributesUpdatesItems updatesItem) { + if (this.updates == null) { + this.updates = new ArrayList<>(); + } + this.updates.add(updatesItem); + this.unparsed |= updatesItem.unparsed; + return this; + } + + /** + * Getupdates + * + * @return updates + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UPDATES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getUpdates() { + return updates; + } + + public void setUpdates(List updates) { + this.updates = updates; + } + /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -304,6 +343,7 @@ public boolean equals(Object o) { this.scheduledDescription, createMaintenanceRequestDataAttributes.scheduledDescription) && Objects.equals(this.startDate, createMaintenanceRequestDataAttributes.startDate) && Objects.equals(this.title, createMaintenanceRequestDataAttributes.title) + && Objects.equals(this.updates, createMaintenanceRequestDataAttributes.updates) && Objects.equals( this.additionalProperties, createMaintenanceRequestDataAttributes.additionalProperties); } @@ -318,6 +358,7 @@ public int hashCode() { scheduledDescription, startDate, title, + updates, additionalProperties); } @@ -338,6 +379,7 @@ public String toString() { .append("\n"); sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" updates: ").append(toIndentedString(updates)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateMaintenanceRequestDataAttributesUpdatesItems.java b/src/main/java/com/datadog/api/client/v2/model/CreateMaintenanceRequestDataAttributesUpdatesItems.java new file mode 100644 index 00000000000..b6f1284fc6f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateMaintenanceRequestDataAttributesUpdatesItems.java @@ -0,0 +1,266 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** A maintenance update entry. */ +@JsonPropertyOrder({ + CreateMaintenanceRequestDataAttributesUpdatesItems.JSON_PROPERTY_COMPONENTS_AFFECTED, + CreateMaintenanceRequestDataAttributesUpdatesItems.JSON_PROPERTY_DESCRIPTION, + CreateMaintenanceRequestDataAttributesUpdatesItems.JSON_PROPERTY_STARTED_AT, + CreateMaintenanceRequestDataAttributesUpdatesItems.JSON_PROPERTY_STATUS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateMaintenanceRequestDataAttributesUpdatesItems { + @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_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_STARTED_AT = "started_at"; + private OffsetDateTime startedAt; + + public static final String JSON_PROPERTY_STATUS = "status"; + private CreateMaintenanceRequestDataAttributesUpdatesItemsStatus status; + + public CreateMaintenanceRequestDataAttributesUpdatesItems() {} + + @JsonCreator + public CreateMaintenanceRequestDataAttributesUpdatesItems( + @JsonProperty(required = true, value = JSON_PROPERTY_STARTED_AT) OffsetDateTime startedAt) { + this.startedAt = startedAt; + } + + public CreateMaintenanceRequestDataAttributesUpdatesItems componentsAffected( + List + componentsAffected) { + this.componentsAffected = componentsAffected; + for (CreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems item : + componentsAffected) { + this.unparsed |= item.unparsed; + } + return this; + } + + public CreateMaintenanceRequestDataAttributesUpdatesItems addComponentsAffectedItem( + CreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems + componentsAffectedItem) { + if (this.componentsAffected == null) { + this.componentsAffected = new ArrayList<>(); + } + this.componentsAffected.add(componentsAffectedItem); + this.unparsed |= componentsAffectedItem.unparsed; + return this; + } + + /** + * The components affected. + * + * @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 CreateMaintenanceRequestDataAttributesUpdatesItems description(String description) { + this.description = description; + return this; + } + + /** + * A description 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 CreateMaintenanceRequestDataAttributesUpdatesItems startedAt(OffsetDateTime startedAt) { + this.startedAt = startedAt; + return this; + } + + /** + * Timestamp of when the update occurred. + * + * @return startedAt + */ + @JsonProperty(JSON_PROPERTY_STARTED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getStartedAt() { + return startedAt; + } + + public void setStartedAt(OffsetDateTime startedAt) { + this.startedAt = startedAt; + } + + public CreateMaintenanceRequestDataAttributesUpdatesItems status( + CreateMaintenanceRequestDataAttributesUpdatesItemsStatus status) { + this.status = status; + this.unparsed |= !status.isValid(); + return this; + } + + /** + * The status of a maintenance update. + * + * @return status + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CreateMaintenanceRequestDataAttributesUpdatesItemsStatus getStatus() { + return status; + } + + public void setStatus(CreateMaintenanceRequestDataAttributesUpdatesItemsStatus 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 CreateMaintenanceRequestDataAttributesUpdatesItems + */ + @JsonAnySetter + public CreateMaintenanceRequestDataAttributesUpdatesItems 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 CreateMaintenanceRequestDataAttributesUpdatesItems object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateMaintenanceRequestDataAttributesUpdatesItems + createMaintenanceRequestDataAttributesUpdatesItems = + (CreateMaintenanceRequestDataAttributesUpdatesItems) o; + return Objects.equals( + this.componentsAffected, + createMaintenanceRequestDataAttributesUpdatesItems.componentsAffected) + && Objects.equals( + this.description, createMaintenanceRequestDataAttributesUpdatesItems.description) + && Objects.equals( + this.startedAt, createMaintenanceRequestDataAttributesUpdatesItems.startedAt) + && Objects.equals(this.status, createMaintenanceRequestDataAttributesUpdatesItems.status) + && Objects.equals( + this.additionalProperties, + createMaintenanceRequestDataAttributesUpdatesItems.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(componentsAffected, description, startedAt, status, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateMaintenanceRequestDataAttributesUpdatesItems {\n"); + sb.append(" componentsAffected: ").append(toIndentedString(componentsAffected)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).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/CreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems.java b/src/main/java/com/datadog/api/client/v2/model/CreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems.java new file mode 100644 index 00000000000..58ddeb87bcf --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems.java @@ -0,0 +1,213 @@ +/* + * 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 maintenance update. */ +@JsonPropertyOrder({ + CreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems.JSON_PROPERTY_ID, + CreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems.JSON_PROPERTY_NAME, + CreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems.JSON_PROPERTY_STATUS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems { + @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 PatchMaintenanceRequestDataAttributesComponentsAffectedItemsStatus status; + + public CreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems() {} + + @JsonCreator + public CreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_STATUS) + PatchMaintenanceRequestDataAttributesComponentsAffectedItemsStatus status) { + this.id = id; + this.status = status; + this.unparsed |= !status.isValid(); + } + + public CreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems id(String id) { + this.id = id; + return this; + } + + /** + * The ID of the component. Must be a component of type 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 component. + * + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + public CreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems status( + PatchMaintenanceRequestDataAttributesComponentsAffectedItemsStatus 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 PatchMaintenanceRequestDataAttributesComponentsAffectedItemsStatus getStatus() { + return status; + } + + public void setStatus(PatchMaintenanceRequestDataAttributesComponentsAffectedItemsStatus 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 CreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems + */ + @JsonAnySetter + public CreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems + 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 CreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems + * object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems + createMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems = + (CreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems) o; + return Objects.equals( + this.id, createMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems.id) + && Objects.equals( + this.name, + createMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems.name) + && Objects.equals( + this.status, + createMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems.status) + && Objects.equals( + this.additionalProperties, + createMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems + .additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, status, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append( + "class CreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems {\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/CreateMaintenanceRequestDataAttributesUpdatesItemsStatus.java b/src/main/java/com/datadog/api/client/v2/model/CreateMaintenanceRequestDataAttributesUpdatesItemsStatus.java new file mode 100644 index 00000000000..149f3c25379 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateMaintenanceRequestDataAttributesUpdatesItemsStatus.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 a maintenance update. */ +@JsonSerialize( + using = + CreateMaintenanceRequestDataAttributesUpdatesItemsStatus + .CreateMaintenanceRequestDataAttributesUpdatesItemsStatusSerializer.class) +public class CreateMaintenanceRequestDataAttributesUpdatesItemsStatus extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("in_progress", "completed", "canceled")); + + public static final CreateMaintenanceRequestDataAttributesUpdatesItemsStatus IN_PROGRESS = + new CreateMaintenanceRequestDataAttributesUpdatesItemsStatus("in_progress"); + public static final CreateMaintenanceRequestDataAttributesUpdatesItemsStatus COMPLETED = + new CreateMaintenanceRequestDataAttributesUpdatesItemsStatus("completed"); + public static final CreateMaintenanceRequestDataAttributesUpdatesItemsStatus CANCELED = + new CreateMaintenanceRequestDataAttributesUpdatesItemsStatus("canceled"); + + CreateMaintenanceRequestDataAttributesUpdatesItemsStatus(String value) { + super(value, allowedValues); + } + + public static class CreateMaintenanceRequestDataAttributesUpdatesItemsStatusSerializer + extends StdSerializer { + public CreateMaintenanceRequestDataAttributesUpdatesItemsStatusSerializer( + Class t) { + super(t); + } + + public CreateMaintenanceRequestDataAttributesUpdatesItemsStatusSerializer() { + this(null); + } + + @Override + public void serialize( + CreateMaintenanceRequestDataAttributesUpdatesItemsStatus value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static CreateMaintenanceRequestDataAttributesUpdatesItemsStatus fromValue(String value) { + return new CreateMaintenanceRequestDataAttributesUpdatesItemsStatus(value); + } +} diff --git a/src/test/resources/cassettes/features/v2/Create_backfilled_degradation_returns_Created_response.freeze b/src/test/resources/cassettes/features/v2/Create_backfilled_degradation_returns_Created_response.freeze new file mode 100644 index 00000000000..29a31337fe4 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_backfilled_degradation_returns_Created_response.freeze @@ -0,0 +1 @@ +2026-05-04T14:30:13.862Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_backfilled_degradation_returns_Created_response.json b/src/test/resources/cassettes/features/v2/Create_backfilled_degradation_returns_Created_response.json new file mode 100644 index 00000000000..4523f548602 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_backfilled_degradation_returns_Created_response.json @@ -0,0 +1,104 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"components\":[{\"components\":[{\"name\":\"Login\",\"position\":0,\"type\":\"component\"},{\"name\":\"Settings\",\"position\":1,\"type\":\"component\"}],\"name\":\"Application\",\"type\":\"group\"}],\"domain_prefix\":\"2aea4cad6466d9b2\",\"name\":\"A Status Page\",\"type\":\"internal\",\"visualization_type\":\"bars_and_uptime_percentage\"},\"type\":\"status_pages\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/statuspages", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"a8c9f5bc-864f-4984-8420-736468d76baf\",\"type\":\"status_pages\",\"attributes\":{\"company_logo\":null,\"components\":[{\"id\":\"5f67ec78-bc7f-4930-91ae-b29b64e4440e\",\"name\":\"Application\",\"type\":\"group\",\"position\":0,\"components\":[{\"id\":\"b2e9cb5e-57d3-4c32-9ed2-f2883441ca75\",\"name\":\"Login\",\"type\":\"component\",\"status\":\"operational\",\"position\":0},{\"id\":\"6eba0779-8989-43e2-994d-56d244a4ffac\",\"name\":\"Settings\",\"type\":\"component\",\"status\":\"operational\",\"position\":1}]}],\"created_at\":\"2026-05-04T14:30:15.791383Z\",\"custom_domain\":null,\"custom_domain_enabled\":false,\"domain_prefix\":\"2aea4cad6466d9b2\",\"email_header_image\":null,\"enabled\":true,\"favicon\":null,\"modified_at\":\"2026-05-04T14:30:15.791383Z\",\"name\":\"A Status Page\",\"page_url\":\"https://frog.datadoghq.com/status-pages/a8c9f5bc-864f-4984-8420-736468d76baf/view\",\"subscriptions_enabled\":false,\"type\":\"internal\",\"visualization_type\":\"bars_and_uptime_percentage\"},\"relationships\":{\"created_by_user\":{\"data\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"users\"}},\"last_modified_by_user\":{\"data\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"users\"}}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "047abc5f-044c-f589-8c0c-42674ca2d305" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"title\":\"Past API Outage\",\"updates\":[{\"components_affected\":[{\"id\":\"b2e9cb5e-57d3-4c32-9ed2-f2883441ca75\",\"status\":\"degraded\"}],\"description\":\"We detected elevated error rates in the API.\",\"started_at\":\"2026-05-04T13:30:13.862Z\",\"status\":\"investigating\"},{\"components_affected\":[{\"id\":\"b2e9cb5e-57d3-4c32-9ed2-f2883441ca75\",\"status\":\"degraded\"}],\"description\":\"Root cause identified as a misconfigured deployment.\",\"started_at\":\"2026-05-04T14:00:13.862Z\",\"status\":\"identified\"},{\"components_affected\":[{\"id\":\"b2e9cb5e-57d3-4c32-9ed2-f2883441ca75\",\"status\":\"operational\"}],\"description\":\"The issue has been resolved and API is operating normally.\",\"started_at\":\"2026-05-04T14:30:13.862Z\",\"status\":\"resolved\"}]},\"type\":\"degradations\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/statuspages/a8c9f5bc-864f-4984-8420-736468d76baf/degradations/backfill", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"6d4e1a6f-df56-4178-88c3-f950b9da3f95\",\"type\":\"degradations\",\"attributes\":{\"components_affected\":[{\"id\":\"b2e9cb5e-57d3-4c32-9ed2-f2883441ca75\",\"name\":\"Login\",\"status\":\"operational\"}],\"created_at\":\"2026-05-04T13:30:13.862Z\",\"description\":\"The issue has been resolved and API is operating normally.\",\"modified_at\":\"2026-05-04T14:30:16.509023Z\",\"status\":\"resolved\",\"title\":\"Past API Outage\",\"updates\":[{\"id\":\"7acc1fa8-556f-4fa8-978a-58f5c19bcc6d\",\"created_at\":\"2026-05-04T14:30:16.509023Z\",\"modified_at\":\"2026-05-04T14:30:16.509023Z\",\"started_at\":\"2026-05-04T13:30:13.862Z\",\"status\":\"investigating\",\"description\":\"We detected elevated error rates in the API.\",\"components_affected\":[{\"id\":\"b2e9cb5e-57d3-4c32-9ed2-f2883441ca75\",\"name\":\"Login\",\"status\":\"degraded\"}]},{\"id\":\"e927896e-cd9e-4c1a-bf41-427ce44e8372\",\"created_at\":\"2026-05-04T14:30:16.509023Z\",\"modified_at\":\"2026-05-04T14:30:16.509023Z\",\"started_at\":\"2026-05-04T14:00:13.862Z\",\"status\":\"identified\",\"description\":\"Root cause identified as a misconfigured deployment.\",\"components_affected\":[{\"id\":\"b2e9cb5e-57d3-4c32-9ed2-f2883441ca75\",\"name\":\"Login\",\"status\":\"degraded\"}]},{\"id\":\"82326cfc-b8f7-4276-bde4-d023d5958541\",\"created_at\":\"2026-05-04T14:30:16.509023Z\",\"modified_at\":\"2026-05-04T14:30:16.509023Z\",\"started_at\":\"2026-05-04T14:30:13.862Z\",\"status\":\"resolved\",\"description\":\"The issue has been resolved and API is operating normally.\",\"components_affected\":[{\"id\":\"b2e9cb5e-57d3-4c32-9ed2-f2883441ca75\",\"name\":\"Login\",\"status\":\"operational\"}]}]},\"relationships\":{\"created_by_user\":{\"data\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"users\"}},\"last_modified_by_user\":{\"data\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"users\"}},\"status_page\":{\"data\":{\"id\":\"a8c9f5bc-864f-4984-8420-736468d76baf\",\"type\":\"status_pages\"}}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "d4fda06b-323c-bd60-100d-04f5d1baefc4" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/statuspages/a8c9f5bc-864f-4984-8420-736468d76baf/degradations/6d4e1a6f-df56-4178-88c3-f950b9da3f95", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "2bf8199d-4194-941c-f357-09dfafc2be81" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/statuspages/a8c9f5bc-864f-4984-8420-736468d76baf", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "cf394791-8858-17cc-ea8f-ed114bdef000" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_backfilled_maintenance_returns_Created_response.freeze b/src/test/resources/cassettes/features/v2/Create_backfilled_maintenance_returns_Created_response.freeze new file mode 100644 index 00000000000..ddbc04f32e4 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_backfilled_maintenance_returns_Created_response.freeze @@ -0,0 +1 @@ +2026-05-04T14:30:17.282Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_backfilled_maintenance_returns_Created_response.json b/src/test/resources/cassettes/features/v2/Create_backfilled_maintenance_returns_Created_response.json new file mode 100644 index 00000000000..67ffcea2e02 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_backfilled_maintenance_returns_Created_response.json @@ -0,0 +1,83 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"components\":[{\"components\":[{\"name\":\"Login\",\"position\":0,\"type\":\"component\"},{\"name\":\"Settings\",\"position\":1,\"type\":\"component\"}],\"name\":\"Application\",\"type\":\"group\"}],\"domain_prefix\":\"29b08dd63fb635d7\",\"name\":\"A Status Page\",\"type\":\"internal\",\"visualization_type\":\"bars_and_uptime_percentage\"},\"type\":\"status_pages\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/statuspages", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"bbf96c2c-48cf-4951-96d2-f5b503c93c49\",\"type\":\"status_pages\",\"attributes\":{\"company_logo\":null,\"components\":[{\"id\":\"b7d32c93-3ab3-4d77-af3b-541a45eb3553\",\"name\":\"Application\",\"type\":\"group\",\"position\":0,\"components\":[{\"id\":\"02c0c5d4-6735-45c8-a184-4a6d5b746793\",\"name\":\"Login\",\"type\":\"component\",\"status\":\"operational\",\"position\":0},{\"id\":\"b99b72d3-4df4-4242-82d9-ebb96c301c8d\",\"name\":\"Settings\",\"type\":\"component\",\"status\":\"operational\",\"position\":1}]}],\"created_at\":\"2026-05-04T14:30:17.408759Z\",\"custom_domain\":null,\"custom_domain_enabled\":false,\"domain_prefix\":\"29b08dd63fb635d7\",\"email_header_image\":null,\"enabled\":true,\"favicon\":null,\"modified_at\":\"2026-05-04T14:30:17.408759Z\",\"name\":\"A Status Page\",\"page_url\":\"https://frog.datadoghq.com/status-pages/bbf96c2c-48cf-4951-96d2-f5b503c93c49/view\",\"subscriptions_enabled\":false,\"type\":\"internal\",\"visualization_type\":\"bars_and_uptime_percentage\"},\"relationships\":{\"created_by_user\":{\"data\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"users\"}},\"last_modified_by_user\":{\"data\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"users\"}}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "1b1c0733-c12e-cb0f-e240-6fdb5104811a" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"title\":\"Past Database Maintenance\",\"updates\":[{\"components_affected\":[{\"id\":\"02c0c5d4-6735-45c8-a184-4a6d5b746793\",\"status\":\"maintenance\"}],\"description\":\"Database maintenance is in progress.\",\"started_at\":\"2026-05-04T13:30:17.282Z\",\"status\":\"in_progress\"},{\"components_affected\":[{\"id\":\"02c0c5d4-6735-45c8-a184-4a6d5b746793\",\"status\":\"operational\"}],\"description\":\"Database maintenance has been completed successfully.\",\"started_at\":\"2026-05-04T14:30:17.282Z\",\"status\":\"completed\"}]},\"type\":\"maintenances\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/statuspages/bbf96c2c-48cf-4951-96d2-f5b503c93c49/maintenances/backfill", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"1f1ccbc5-14dd-45e2-9e81-b767b4d342f0\",\"type\":\"maintenances\",\"attributes\":{\"completed_date\":\"2026-05-04T14:30:17.282Z\",\"completed_description\":\"Database maintenance has been completed successfully.\",\"components_affected\":[{\"id\":\"02c0c5d4-6735-45c8-a184-4a6d5b746793\",\"name\":\"Login\",\"status\":\"operational\"}],\"in_progress_description\":\"Database maintenance is in progress.\",\"modified_at\":\"2026-05-04T14:30:17.979727Z\",\"published_date\":\"2026-05-04T13:30:17.282Z\",\"scheduled_description\":\"\",\"start_date\":\"2026-05-04T13:30:17.282Z\",\"status\":\"completed\",\"title\":\"Past Database Maintenance\",\"updates\":[{\"id\":\"56f63654-5c40-4eed-8af0-dd53a7bb251c\",\"created_at\":\"2026-05-04T14:30:17.979727Z\",\"modified_at\":\"2026-05-04T14:30:17.979727Z\",\"started_at\":\"2026-05-04T13:30:17.282Z\",\"manual_transition\":false,\"status\":\"in_progress\",\"description\":\"Database maintenance is in progress.\",\"components_affected\":[{\"id\":\"02c0c5d4-6735-45c8-a184-4a6d5b746793\",\"name\":\"Login\",\"status\":\"maintenance\"}]},{\"id\":\"7e2dd268-c76e-4186-9a2c-b7ca7039485b\",\"created_at\":\"2026-05-04T14:30:17.979727Z\",\"modified_at\":\"2026-05-04T14:30:17.979727Z\",\"started_at\":\"2026-05-04T14:30:17.282Z\",\"manual_transition\":false,\"status\":\"completed\",\"description\":\"Database maintenance has been completed successfully.\",\"components_affected\":[{\"id\":\"02c0c5d4-6735-45c8-a184-4a6d5b746793\",\"name\":\"Login\",\"status\":\"operational\"}]}]},\"relationships\":{\"created_by_user\":{\"data\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"users\"}},\"last_modified_by_user\":{\"data\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"users\"}},\"status_page\":{\"data\":{\"id\":\"bbf96c2c-48cf-4951-96d2-f5b503c93c49\",\"type\":\"status_pages\"}}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "7e1abf66-00bd-a837-d502-c20f3ce686ef" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/statuspages/bbf96c2c-48cf-4951-96d2-f5b503c93c49", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "2792a1ad-a20a-3013-0c3e-bf14df4ab594" + } +] \ No newline at end of file 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 2a4cb273a61..4e671f186de 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 @@ -10,6 +10,26 @@ Feature: Status Pages And a valid "appKeyAuth" key in the system And an instance of "StatusPages" API + @team:DataDog/incident-app + Scenario: Create backfilled degradation returns "Created" response + Given there is a valid "status_page" in the system + And new "CreateBackfilledDegradation" request + And request contains "page_id" parameter from "status_page.data.id" + And body with value {"data": {"attributes": {"title": "Past API Outage", "updates": [{"components_affected": [{"id": "{{ status_page.data.attributes.components[0].components[0].id }}", "status": "degraded"}], "description": "We detected elevated error rates in the API.", "started_at": "{{ timeISO('now - 1h') }}", "status": "investigating"}, {"components_affected": [{"id": "{{ status_page.data.attributes.components[0].components[0].id }}", "status": "degraded"}], "description": "Root cause identified as a misconfigured deployment.", "started_at": "{{ timeISO('now - 30m') }}", "status": "identified"}, {"components_affected": [{"id": "{{ status_page.data.attributes.components[0].components[0].id }}", "status": "operational"}], "description": "The issue has been resolved and API is operating normally.", "started_at": "{{ timeISO('now') }}", "status": "resolved"}]}, "type": "degradations"}} + When the request is sent + Then the response status is 201 Created + And the response "data.attributes.title" is equal to "Past API Outage" + + @team:DataDog/incident-app + Scenario: Create backfilled maintenance returns "Created" response + Given there is a valid "status_page" in the system + And new "CreateBackfilledMaintenance" request + And request contains "page_id" parameter from "status_page.data.id" + And body with value {"data": {"attributes": {"title": "Past Database Maintenance", "updates": [{"components_affected": [{"id": "{{ status_page.data.attributes.components[0].components[0].id }}", "status": "maintenance"}], "description": "Database maintenance is in progress.", "started_at": "{{ timeISO('now - 1h') }}", "status": "in_progress"}, {"components_affected": [{"id": "{{ status_page.data.attributes.components[0].components[0].id }}", "status": "operational"}], "description": "Database maintenance has been completed successfully.", "started_at": "{{ timeISO('now') }}", "status": "completed"}]}, "type": "maintenances"}} + When the request is sent + Then the response status is 201 Created + And the response "data.attributes.title" is equal to "Past Database Maintenance" + @team:DataDog/incident-app Scenario: Create component returns "Created" response Given there is a valid "status_page" in the system 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 d5a8323e270..1ac199fd2f8 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 @@ -6386,6 +6386,23 @@ "type": "unsafe" } }, + "CreateBackfilledDegradation": { + "tag": "Status Pages", + "undo": { + "operationId": "DeleteDegradation", + "parameters": [ + { + "name": "page_id", + "source": "data.relationships.status_page.data.id" + }, + { + "name": "degradation_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, "DeleteDegradation": { "tag": "Status Pages", "undo": { @@ -6410,6 +6427,12 @@ "type": "safe" } }, + "CreateBackfilledMaintenance": { + "tag": "Status Pages", + "undo": { + "type": "safe" + } + }, "GetMaintenance": { "tag": "Status Pages", "undo": {