From a9c005f0a91201cf3283db7837b569ce8c96046b Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 10 Sep 2026 13:34:41 +0000 Subject: [PATCH] Regenerate client from commit 7a99e11 of spec repo --- .generator/schemas/v2/openapi.yaml | 179 +++++++++ examples/v2/on-call/ListOnCallSchedules.java | 24 ++ .../ListOnCallSchedules_2357269993.java | 26 ++ .../datadog/api/client/v2/api/OnCallApi.java | 283 ++++++++++++++ .../api/client/v2/model/ScheduleListItem.java | 240 ++++++++++++ .../model/ScheduleListItemRelationships.java | 140 +++++++ .../api/client/v2/model/Schedules.java | 237 ++++++++++++ .../v2/model/SchedulesResponseMeta.java | 139 +++++++ .../v2/model/SchedulesResponseMetaPage.java | 359 ++++++++++++++++++ .../datadog/api/client/v2/api/on-call.feature | 18 + .../com/datadog/api/client/v2/api/undo.json | 6 + .../test-runner-data/manifest.json | 7 + ...on-call-schedules-returns-ok-response.json | 18 + .../test-server-data/v2/on-call.json | 31 ++ 14 files changed, 1707 insertions(+) create mode 100644 examples/v2/on-call/ListOnCallSchedules.java create mode 100644 examples/v2/on-call/ListOnCallSchedules_2357269993.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ScheduleListItem.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ScheduleListItemRelationships.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/Schedules.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SchedulesResponseMeta.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SchedulesResponseMetaPage.java create mode 100644 src/test/resources/generated-test/test-runner-data/v2/on-call/list-on-call-schedules-returns-ok-response.json diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 8e53877feb3..1cf641bdf3d 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -98409,6 +98409,29 @@ components: type: string x-enum-varnames: - SCHEDULES + ScheduleListItem: + description: Represents a summary of a schedule, linking its core attributes and team relationships. + properties: + attributes: + $ref: '#/components/schemas/ScheduleDataAttributes' + id: + description: The schedule's unique identifier. + example: "3653d3c6-0c75-11ea-ad28-fb5701eabc7d" + type: string + relationships: + $ref: '#/components/schemas/ScheduleListItemRelationships' + type: + $ref: '#/components/schemas/ScheduleDataType' + required: + - id + - type + type: object + ScheduleListItemRelationships: + description: Groups the relationships for a schedule summary, referencing its teams. + properties: + teams: + $ref: '#/components/schemas/DataRelationshipsTeams' + type: object ScheduleMember: description: Represents a single member entry in a schedule, referencing a specific user. properties: @@ -98956,6 +98979,89 @@ components: type: string x-enum-varnames: - USERS + Schedules: + description: A list of schedules with pagination metadata and any related included resources (such as teams). + example: + data: + - attributes: + name: Primary On-Call + tags: [] + time_zone: America/New_York + id: 3653d3c6-0c75-11ea-ad28-fb5701eabc7d + relationships: + teams: + data: + - id: 00000000-da3a-0000-0000-000000000000 + type: teams + type: schedules + meta: + page: + first_number: 0 + last_number: 0 + next_number: + number: 0 + prev_number: + size: 10 + total: 1 + type: number_size + properties: + data: + description: A list of schedules. + items: + $ref: '#/components/schemas/ScheduleListItem' + type: array + included: + description: Any additional resources related to the schedules, such as teams. + items: + $ref: '#/components/schemas/TeamReference' + type: array + meta: + $ref: '#/components/schemas/SchedulesResponseMeta' + type: object + SchedulesResponseMeta: + description: Metadata that is included in the response when listing schedules. + properties: + page: + $ref: '#/components/schemas/SchedulesResponseMetaPage' + type: object + SchedulesResponseMetaPage: + description: Metadata related to paging information that is included in the response when listing schedules. + properties: + first_number: + description: First page number. + format: int64 + type: integer + last_number: + description: Last page number. + format: int64 + type: integer + next_number: + description: Next page number. + format: int64 + nullable: true + type: integer + number: + description: Page number. + format: int64 + type: integer + prev_number: + description: Previous page number. + format: int64 + nullable: true + type: integer + size: + description: Page size. + format: int64 + type: integer + total: + description: Total number of results. + format: int64 + type: integer + type: + description: Pagination type. + example: "number_size" + type: string + type: object ScorecardListResponseAttributes: description: Scorecard attributes. properties: @@ -183800,6 +183906,79 @@ paths: tags: - On-Call Paging /api/v2/on-call/schedules: + get: + description: Retrieve a list of On-Call schedules. + operationId: ListOnCallSchedules + parameters: + - $ref: "#/components/parameters/PageSize" + - $ref: "#/components/parameters/PageNumber" + - description: "Search query to filter schedules. Supports free-text search on schedule name (case-insensitive, `*` wildcards), and structured filters such as `team.id:` and `user.id:` (multiple values can be combined with `OR`, e.g. `user.id:( OR )`)." + in: query + name: "filter[query]" + required: false + schema: + type: string + - description: "Comma-separated list of included relationships to be returned. Allowed value: `teams`." + in: query + name: include + required: false + schema: + type: string + responses: + "200": + content: + "application/json": + examples: + default: + value: + data: + - attributes: + name: Primary On-Call + tags: [] + time_zone: America/New_York + id: 3653d3c6-0c75-11ea-ad28-fb5701eabc7d + relationships: + teams: + data: + - id: 00000000-da3a-0000-0000-000000000000 + type: teams + type: schedules + meta: + page: + first_number: 0 + last_number: 0 + next_number: + number: 0 + prev_number: + size: 10 + total: 1 + type: number_size + schema: + $ref: '#/components/schemas/Schedules' + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: [] + summary: List On-Call schedules + tags: + - On-Call + x-pagination: + limitParam: page[size] + pageParam: page[number] + resultsPath: data + "x-permission": + operator: AND + permissions: + - on_call_read post: description: Create a new On-Call schedule operationId: CreateOnCallSchedule diff --git a/examples/v2/on-call/ListOnCallSchedules.java b/examples/v2/on-call/ListOnCallSchedules.java new file mode 100644 index 00000000000..2fe8ea325be --- /dev/null +++ b/examples/v2/on-call/ListOnCallSchedules.java @@ -0,0 +1,24 @@ +// List On-Call schedules returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.OnCallApi; +import com.datadog.api.client.v2.model.Schedules; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + OnCallApi apiInstance = new OnCallApi(defaultClient); + + try { + Schedules result = apiInstance.listOnCallSchedules(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling OnCallApi#listOnCallSchedules"); + 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/on-call/ListOnCallSchedules_2357269993.java b/examples/v2/on-call/ListOnCallSchedules_2357269993.java new file mode 100644 index 00000000000..a9890aa3c20 --- /dev/null +++ b/examples/v2/on-call/ListOnCallSchedules_2357269993.java @@ -0,0 +1,26 @@ +// List On-Call schedules returns "OK" response with pagination + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.PaginationIterable; +import com.datadog.api.client.v2.api.OnCallApi; +import com.datadog.api.client.v2.model.ScheduleListItem; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + OnCallApi apiInstance = new OnCallApi(defaultClient); + + try { + PaginationIterable iterable = + apiInstance.listOnCallSchedulesWithPagination(); + + for (ScheduleListItem item : iterable) { + System.out.println(item); + } + } catch (RuntimeException e) { + System.err.println("Exception when calling OnCallApi#listOnCallSchedulesWithPagination"); + System.err.println("Reason: " + e.getMessage()); + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/datadog/api/client/v2/api/OnCallApi.java b/src/main/java/com/datadog/api/client/v2/api/OnCallApi.java index 27fc7e56e30..f2c40bb7cec 100644 --- a/src/main/java/com/datadog/api/client/v2/api/OnCallApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/OnCallApi.java @@ -3,6 +3,7 @@ import com.datadog.api.client.ApiClient; import com.datadog.api.client.ApiException; import com.datadog.api.client.ApiResponse; +import com.datadog.api.client.PaginationIterable; import com.datadog.api.client.Pair; import com.datadog.api.client.v2.model.CreateOnCallNotificationRuleRequest; import com.datadog.api.client.v2.model.CreateUserNotificationChannelRequest; @@ -15,8 +16,10 @@ import com.datadog.api.client.v2.model.OnCallNotificationRule; import com.datadog.api.client.v2.model.Schedule; import com.datadog.api.client.v2.model.ScheduleCreateRequest; +import com.datadog.api.client.v2.model.ScheduleListItem; import com.datadog.api.client.v2.model.ScheduleOnCallResponders; import com.datadog.api.client.v2.model.ScheduleUpdateRequest; +import com.datadog.api.client.v2.model.Schedules; import com.datadog.api.client.v2.model.Shift; import com.datadog.api.client.v2.model.TeamOnCallResponders; import com.datadog.api.client.v2.model.TeamRoutingRules; @@ -26,6 +29,7 @@ import jakarta.ws.rs.core.GenericType; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.concurrent.CompletableFuture; @@ -3068,6 +3072,285 @@ public ApiResponse getUserNotificationRuleWithHttpInfo( new GenericType() {}); } + /** Manage optional parameters to listOnCallSchedules. */ + public static class ListOnCallSchedulesOptionalParameters { + private Long pageSize; + private Long pageNumber; + private String filterQuery; + private String include; + + /** + * Set pageSize. + * + * @param pageSize Number of items to return per page. The maximum allowed value is 100. + * (optional, default to 10) + * @return ListOnCallSchedulesOptionalParameters + */ + public ListOnCallSchedulesOptionalParameters pageSize(Long pageSize) { + this.pageSize = pageSize; + return this; + } + + /** + * Set pageNumber. + * + * @param pageNumber Specific page number to return. (optional, default to 0) + * @return ListOnCallSchedulesOptionalParameters + */ + public ListOnCallSchedulesOptionalParameters pageNumber(Long pageNumber) { + this.pageNumber = pageNumber; + return this; + } + + /** + * Set filterQuery. + * + * @param filterQuery Search query to filter schedules. Supports free-text search on schedule + * name (case-insensitive, * wildcards), and structured filters such as + * team.id:<uuid> and user.id:<uuid> (multiple values can be + * combined with OR, e.g. user.id:(<uuid> OR <uuid>)). + * (optional) + * @return ListOnCallSchedulesOptionalParameters + */ + public ListOnCallSchedulesOptionalParameters filterQuery(String filterQuery) { + this.filterQuery = filterQuery; + return this; + } + + /** + * Set include. + * + * @param include Comma-separated list of included relationships to be returned. Allowed value: + * teams. (optional) + * @return ListOnCallSchedulesOptionalParameters + */ + public ListOnCallSchedulesOptionalParameters include(String include) { + this.include = include; + return this; + } + } + + /** + * List On-Call schedules. + * + *

See {@link #listOnCallSchedulesWithHttpInfo}. + * + * @return Schedules + * @throws ApiException if fails to make API call + */ + public Schedules listOnCallSchedules() throws ApiException { + return listOnCallSchedulesWithHttpInfo(new ListOnCallSchedulesOptionalParameters()).getData(); + } + + /** + * List On-Call schedules. + * + *

See {@link #listOnCallSchedulesWithHttpInfoAsync}. + * + * @return CompletableFuture<Schedules> + */ + public CompletableFuture listOnCallSchedulesAsync() { + return listOnCallSchedulesWithHttpInfoAsync(new ListOnCallSchedulesOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List On-Call schedules. + * + *

See {@link #listOnCallSchedulesWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return Schedules + * @throws ApiException if fails to make API call + */ + public Schedules listOnCallSchedules(ListOnCallSchedulesOptionalParameters parameters) + throws ApiException { + return listOnCallSchedulesWithHttpInfo(parameters).getData(); + } + + /** + * List On-Call schedules. + * + *

See {@link #listOnCallSchedulesWithHttpInfoAsync}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<Schedules> + */ + public CompletableFuture listOnCallSchedulesAsync( + ListOnCallSchedulesOptionalParameters parameters) { + return listOnCallSchedulesWithHttpInfoAsync(parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List On-Call schedules. + * + *

See {@link #listOnCallSchedulesWithHttpInfo}. + * + * @return PaginationIterable<ScheduleListItem> + */ + public PaginationIterable listOnCallSchedulesWithPagination() { + ListOnCallSchedulesOptionalParameters parameters = new ListOnCallSchedulesOptionalParameters(); + return listOnCallSchedulesWithPagination(parameters); + } + + /** + * List On-Call schedules. + * + *

See {@link #listOnCallSchedulesWithHttpInfo}. + * + * @return Schedules + */ + public PaginationIterable listOnCallSchedulesWithPagination( + ListOnCallSchedulesOptionalParameters parameters) { + String resultsPath = "getData"; + String valueGetterPath = ""; + String valueSetterPath = "pageNumber"; + Boolean valueSetterParamOptional = true; + parameters.pageNumber(0l); + Long limit; + + if (parameters.pageSize == null) { + limit = 10l; + parameters.pageSize(limit); + } else { + limit = parameters.pageSize; + } + + LinkedHashMap args = new LinkedHashMap(); + args.put("optionalParams", parameters); + + PaginationIterable iterator = + new PaginationIterable( + this, + "listOnCallSchedules", + resultsPath, + valueGetterPath, + valueSetterPath, + valueSetterParamOptional, + false, + false, + limit, + args, + 0); + + return iterator; + } + + /** + * Retrieve a list of On-Call schedules. + * + * @param parameters Optional parameters for the request. + * @return ApiResponse<Schedules> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
429 Too many requests -
+ */ + public ApiResponse listOnCallSchedulesWithHttpInfo( + ListOnCallSchedulesOptionalParameters parameters) throws ApiException { + Object localVarPostBody = null; + Long pageSize = parameters.pageSize; + Long pageNumber = parameters.pageNumber; + String filterQuery = parameters.filterQuery; + String include = parameters.include; + // create path and map variables + String localVarPath = "/api/v2/on-call/schedules"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[query]", filterQuery)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "include", include)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.OnCallApi.listOnCallSchedules", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * List On-Call schedules. + * + *

See {@link #listOnCallSchedulesWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<Schedules>> + */ + public CompletableFuture> listOnCallSchedulesWithHttpInfoAsync( + ListOnCallSchedulesOptionalParameters parameters) { + Object localVarPostBody = null; + Long pageSize = parameters.pageSize; + Long pageNumber = parameters.pageNumber; + String filterQuery = parameters.filterQuery; + String include = parameters.include; + // create path and map variables + String localVarPath = "/api/v2/on-call/schedules"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[query]", filterQuery)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "include", include)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.OnCallApi.listOnCallSchedules", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + /** * List On-Call notification channels for a user. * diff --git a/src/main/java/com/datadog/api/client/v2/model/ScheduleListItem.java b/src/main/java/com/datadog/api/client/v2/model/ScheduleListItem.java new file mode 100644 index 00000000000..a66834d56aa --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ScheduleListItem.java @@ -0,0 +1,240 @@ +/* + * 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; + +/** Represents a summary of a schedule, linking its core attributes and team relationships. */ +@JsonPropertyOrder({ + ScheduleListItem.JSON_PROPERTY_ATTRIBUTES, + ScheduleListItem.JSON_PROPERTY_ID, + ScheduleListItem.JSON_PROPERTY_RELATIONSHIPS, + ScheduleListItem.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ScheduleListItem { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private ScheduleDataAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private ScheduleListItemRelationships relationships; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ScheduleDataType type = ScheduleDataType.SCHEDULES; + + public ScheduleListItem() {} + + @JsonCreator + public ScheduleListItem( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) ScheduleDataType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ScheduleListItem attributes(ScheduleDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Provides core properties of a schedule object such as its name and time zone. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ScheduleDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(ScheduleDataAttributes attributes) { + this.attributes = attributes; + if (attributes != null) { + this.unparsed |= attributes.unparsed; + } + } + + public ScheduleListItem id(String id) { + this.id = id; + return this; + } + + /** + * The schedule's unique identifier. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public ScheduleListItem relationships(ScheduleListItemRelationships relationships) { + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + return this; + } + + /** + * Groups the relationships for a schedule summary, referencing its teams. + * + * @return relationships + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ScheduleListItemRelationships getRelationships() { + return relationships; + } + + public void setRelationships(ScheduleListItemRelationships relationships) { + this.relationships = relationships; + if (relationships != null) { + this.unparsed |= relationships.unparsed; + } + } + + public ScheduleListItem type(ScheduleDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Schedules resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ScheduleDataType getType() { + return type; + } + + public void setType(ScheduleDataType 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 ScheduleListItem + */ + @JsonAnySetter + public ScheduleListItem 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 ScheduleListItem object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ScheduleListItem scheduleListItem = (ScheduleListItem) o; + return Objects.equals(this.attributes, scheduleListItem.attributes) + && Objects.equals(this.id, scheduleListItem.id) + && Objects.equals(this.relationships, scheduleListItem.relationships) + && Objects.equals(this.type, scheduleListItem.type) + && Objects.equals(this.additionalProperties, scheduleListItem.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, relationships, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ScheduleListItem {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" relationships: ").append(toIndentedString(relationships)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ScheduleListItemRelationships.java b/src/main/java/com/datadog/api/client/v2/model/ScheduleListItemRelationships.java new file mode 100644 index 00000000000..b571e798e05 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ScheduleListItemRelationships.java @@ -0,0 +1,140 @@ +/* + * 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; + +/** Groups the relationships for a schedule summary, referencing its teams. */ +@JsonPropertyOrder({ScheduleListItemRelationships.JSON_PROPERTY_TEAMS}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ScheduleListItemRelationships { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_TEAMS = "teams"; + private DataRelationshipsTeams teams; + + public ScheduleListItemRelationships teams(DataRelationshipsTeams teams) { + this.teams = teams; + this.unparsed |= teams.unparsed; + return this; + } + + /** + * Associates teams with this schedule in a data structure. + * + * @return teams + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEAMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DataRelationshipsTeams getTeams() { + return teams; + } + + public void setTeams(DataRelationshipsTeams teams) { + this.teams = teams; + if (teams != null) { + this.unparsed |= teams.unparsed; + } + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ScheduleListItemRelationships + */ + @JsonAnySetter + public ScheduleListItemRelationships 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 ScheduleListItemRelationships object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ScheduleListItemRelationships scheduleListItemRelationships = (ScheduleListItemRelationships) o; + return Objects.equals(this.teams, scheduleListItemRelationships.teams) + && Objects.equals( + this.additionalProperties, scheduleListItemRelationships.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(teams, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ScheduleListItemRelationships {\n"); + sb.append(" teams: ").append(toIndentedString(teams)).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/Schedules.java b/src/main/java/com/datadog/api/client/v2/model/Schedules.java new file mode 100644 index 00000000000..c6ae49a0b3d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/Schedules.java @@ -0,0 +1,237 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** + * A list of schedules with pagination metadata and any related included resources (such as teams). + */ +@JsonPropertyOrder({ + Schedules.JSON_PROPERTY_DATA, + Schedules.JSON_PROPERTY_INCLUDED, + Schedules.JSON_PROPERTY_META +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class Schedules { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = null; + + public static final String JSON_PROPERTY_INCLUDED = "included"; + private List included = null; + + public static final String JSON_PROPERTY_META = "meta"; + private SchedulesResponseMeta meta; + + public Schedules data(List data) { + this.data = data; + if (data != null) { + for (ScheduleListItem item : data) { + this.unparsed |= item.unparsed; + } + } + return this; + } + + public Schedules addDataItem(ScheduleListItem dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * A list of schedules. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + if (data != null) { + for (ScheduleListItem item : data) { + this.unparsed |= item.unparsed; + } + } + } + + public Schedules included(List included) { + this.included = included; + if (included != null) { + for (TeamReference item : included) { + this.unparsed |= item.unparsed; + } + } + return this; + } + + public Schedules addIncludedItem(TeamReference includedItem) { + if (this.included == null) { + this.included = new ArrayList<>(); + } + this.included.add(includedItem); + this.unparsed |= includedItem.unparsed; + return this; + } + + /** + * Any additional resources related to the schedules, such as teams. + * + * @return included + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INCLUDED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getIncluded() { + return included; + } + + public void setIncluded(List included) { + this.included = included; + if (included != null) { + for (TeamReference item : included) { + this.unparsed |= item.unparsed; + } + } + } + + public Schedules meta(SchedulesResponseMeta meta) { + this.meta = meta; + this.unparsed |= meta.unparsed; + return this; + } + + /** + * Metadata that is included in the response when listing schedules. + * + * @return meta + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_META) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SchedulesResponseMeta getMeta() { + return meta; + } + + public void setMeta(SchedulesResponseMeta meta) { + this.meta = meta; + if (meta != null) { + this.unparsed |= meta.unparsed; + } + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + 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 Schedules + */ + @JsonAnySetter + public Schedules 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 Schedules object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Schedules schedules = (Schedules) o; + return Objects.equals(this.data, schedules.data) + && Objects.equals(this.included, schedules.included) + && Objects.equals(this.meta, schedules.meta) + && Objects.equals(this.additionalProperties, schedules.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, included, meta, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Schedules {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" included: ").append(toIndentedString(included)).append("\n"); + sb.append(" meta: ").append(toIndentedString(meta)).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/SchedulesResponseMeta.java b/src/main/java/com/datadog/api/client/v2/model/SchedulesResponseMeta.java new file mode 100644 index 00000000000..c67c593c476 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SchedulesResponseMeta.java @@ -0,0 +1,139 @@ +/* + * 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; + +/** Metadata that is included in the response when listing schedules. */ +@JsonPropertyOrder({SchedulesResponseMeta.JSON_PROPERTY_PAGE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SchedulesResponseMeta { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_PAGE = "page"; + private SchedulesResponseMetaPage page; + + public SchedulesResponseMeta page(SchedulesResponseMetaPage page) { + this.page = page; + this.unparsed |= page.unparsed; + return this; + } + + /** + * Metadata related to paging information that is included in the response when listing schedules. + * + * @return page + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SchedulesResponseMetaPage getPage() { + return page; + } + + public void setPage(SchedulesResponseMetaPage page) { + this.page = page; + if (page != null) { + this.unparsed |= page.unparsed; + } + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return SchedulesResponseMeta + */ + @JsonAnySetter + public SchedulesResponseMeta 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 SchedulesResponseMeta object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SchedulesResponseMeta schedulesResponseMeta = (SchedulesResponseMeta) o; + return Objects.equals(this.page, schedulesResponseMeta.page) + && Objects.equals(this.additionalProperties, schedulesResponseMeta.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(page, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SchedulesResponseMeta {\n"); + sb.append(" page: ").append(toIndentedString(page)).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/SchedulesResponseMetaPage.java b/src/main/java/com/datadog/api/client/v2/model/SchedulesResponseMetaPage.java new file mode 100644 index 00000000000..24247192e92 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SchedulesResponseMetaPage.java @@ -0,0 +1,359 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * Metadata related to paging information that is included in the response when listing schedules. + */ +@JsonPropertyOrder({ + SchedulesResponseMetaPage.JSON_PROPERTY_FIRST_NUMBER, + SchedulesResponseMetaPage.JSON_PROPERTY_LAST_NUMBER, + SchedulesResponseMetaPage.JSON_PROPERTY_NEXT_NUMBER, + SchedulesResponseMetaPage.JSON_PROPERTY_NUMBER, + SchedulesResponseMetaPage.JSON_PROPERTY_PREV_NUMBER, + SchedulesResponseMetaPage.JSON_PROPERTY_SIZE, + SchedulesResponseMetaPage.JSON_PROPERTY_TOTAL, + SchedulesResponseMetaPage.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SchedulesResponseMetaPage { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FIRST_NUMBER = "first_number"; + private Long firstNumber; + + public static final String JSON_PROPERTY_LAST_NUMBER = "last_number"; + private Long lastNumber; + + public static final String JSON_PROPERTY_NEXT_NUMBER = "next_number"; + private JsonNullable nextNumber = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_NUMBER = "number"; + private Long number; + + public static final String JSON_PROPERTY_PREV_NUMBER = "prev_number"; + private JsonNullable prevNumber = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_SIZE = "size"; + private Long size; + + public static final String JSON_PROPERTY_TOTAL = "total"; + private Long total; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public SchedulesResponseMetaPage firstNumber(Long firstNumber) { + this.firstNumber = firstNumber; + return this; + } + + /** + * First page number. + * + * @return firstNumber + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FIRST_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getFirstNumber() { + return firstNumber; + } + + public void setFirstNumber(Long firstNumber) { + this.firstNumber = firstNumber; + } + + public SchedulesResponseMetaPage lastNumber(Long lastNumber) { + this.lastNumber = lastNumber; + return this; + } + + /** + * Last page number. + * + * @return lastNumber + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LAST_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getLastNumber() { + return lastNumber; + } + + public void setLastNumber(Long lastNumber) { + this.lastNumber = lastNumber; + } + + public SchedulesResponseMetaPage nextNumber(Long nextNumber) { + this.nextNumber = JsonNullable.of(nextNumber); + return this; + } + + /** + * Next page number. + * + * @return nextNumber + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Long getNextNumber() { + return nextNumber.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_NEXT_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getNextNumber_JsonNullable() { + return nextNumber; + } + + @JsonProperty(JSON_PROPERTY_NEXT_NUMBER) + public void setNextNumber_JsonNullable(JsonNullable nextNumber) { + this.nextNumber = nextNumber; + } + + public void setNextNumber(Long nextNumber) { + this.nextNumber = JsonNullable.of(nextNumber); + } + + public SchedulesResponseMetaPage number(Long number) { + this.number = number; + return this; + } + + /** + * Page number. + * + * @return number + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getNumber() { + return number; + } + + public void setNumber(Long number) { + this.number = number; + } + + public SchedulesResponseMetaPage prevNumber(Long prevNumber) { + this.prevNumber = JsonNullable.of(prevNumber); + return this; + } + + /** + * Previous page number. + * + * @return prevNumber + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Long getPrevNumber() { + return prevNumber.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_PREV_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getPrevNumber_JsonNullable() { + return prevNumber; + } + + @JsonProperty(JSON_PROPERTY_PREV_NUMBER) + public void setPrevNumber_JsonNullable(JsonNullable prevNumber) { + this.prevNumber = prevNumber; + } + + public void setPrevNumber(Long prevNumber) { + this.prevNumber = JsonNullable.of(prevNumber); + } + + public SchedulesResponseMetaPage size(Long size) { + this.size = size; + return this; + } + + /** + * Page size. + * + * @return size + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getSize() { + return size; + } + + public void setSize(Long size) { + this.size = size; + } + + public SchedulesResponseMetaPage total(Long total) { + this.total = total; + return this; + } + + /** + * Total number of results. + * + * @return total + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TOTAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getTotal() { + return total; + } + + public void setTotal(Long total) { + this.total = total; + } + + public SchedulesResponseMetaPage type(String type) { + this.type = type; + return this; + } + + /** + * Pagination type. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return SchedulesResponseMetaPage + */ + @JsonAnySetter + public SchedulesResponseMetaPage 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 SchedulesResponseMetaPage object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SchedulesResponseMetaPage schedulesResponseMetaPage = (SchedulesResponseMetaPage) o; + return Objects.equals(this.firstNumber, schedulesResponseMetaPage.firstNumber) + && Objects.equals(this.lastNumber, schedulesResponseMetaPage.lastNumber) + && Objects.equals(this.nextNumber, schedulesResponseMetaPage.nextNumber) + && Objects.equals(this.number, schedulesResponseMetaPage.number) + && Objects.equals(this.prevNumber, schedulesResponseMetaPage.prevNumber) + && Objects.equals(this.size, schedulesResponseMetaPage.size) + && Objects.equals(this.total, schedulesResponseMetaPage.total) + && Objects.equals(this.type, schedulesResponseMetaPage.type) + && Objects.equals( + this.additionalProperties, schedulesResponseMetaPage.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + firstNumber, + lastNumber, + nextNumber, + number, + prevNumber, + size, + total, + type, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SchedulesResponseMetaPage {\n"); + sb.append(" firstNumber: ").append(toIndentedString(firstNumber)).append("\n"); + sb.append(" lastNumber: ").append(toIndentedString(lastNumber)).append("\n"); + sb.append(" nextNumber: ").append(toIndentedString(nextNumber)).append("\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" prevNumber: ").append(toIndentedString(prevNumber)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); + sb.append(" total: ").append(toIndentedString(total)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/test/resources/com/datadog/api/client/v2/api/on-call.feature b/src/test/resources/com/datadog/api/client/v2/api/on-call.feature index 208eca3cb95..71984f71c55 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/on-call.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/on-call.feature @@ -416,6 +416,24 @@ Feature: On-Call And the response "data" has length 1 And the response "included" has length 1 + @generated @skip @team:DataDog/on-call + Scenario: List On-Call schedules returns "Bad Request" response + Given new "ListOnCallSchedules" request + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/on-call + Scenario: List On-Call schedules returns "OK" response + Given new "ListOnCallSchedules" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/on-call @with-pagination + Scenario: List On-Call schedules returns "OK" response with pagination + Given new "ListOnCallSchedules" request + When the request with pagination is sent + Then the response status is 200 OK + @skip-python @team:DataDog/on-call Scenario: Set On-Call team routing rules returns "OK" response Given new "SetOnCallTeamRoutingRules" request diff --git a/src/test/resources/com/datadog/api/client/v2/api/undo.json b/src/test/resources/com/datadog/api/client/v2/api/undo.json index 22c02b5bcbd..7904fb64b67 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 @@ -6120,6 +6120,12 @@ "type": "unsafe" } }, + "ListOnCallSchedules": { + "tag": "On-Call", + "undo": { + "type": "safe" + } + }, "CreateOnCallSchedule": { "tag": "On-Call", "undo": { diff --git a/src/test/resources/generated-test/test-runner-data/manifest.json b/src/test/resources/generated-test/test-runner-data/manifest.json index 00630e15afc..3248ecb07ea 100644 --- a/src/test/resources/generated-test/test-runner-data/manifest.json +++ b/src/test/resources/generated-test/test-runner-data/manifest.json @@ -8183,6 +8183,13 @@ "scenario": "List On-Call notification rules for a user returns \"OK\" response", "version": "v2" }, + { + "feature": "On-Call", + "feature_file": "../../com/datadog/api/client/v2/api/on-call.feature", + "file": "v2/on-call/list-on-call-schedules-returns-ok-response.json", + "scenario": "List On-Call schedules returns \"OK\" response", + "version": "v2" + }, { "feature": "On-Call", "feature_file": "../../com/datadog/api/client/v2/api/on-call.feature", diff --git a/src/test/resources/generated-test/test-runner-data/v2/on-call/list-on-call-schedules-returns-ok-response.json b/src/test/resources/generated-test/test-runner-data/v2/on-call/list-on-call-schedules-returns-ok-response.json new file mode 100644 index 00000000000..b902cae6217 --- /dev/null +++ b/src/test/resources/generated-test/test-runner-data/v2/on-call/list-on-call-schedules-returns-ok-response.json @@ -0,0 +1,18 @@ +{ + "api": "On-Call", + "expected_status": 200, + "feature": "On-Call", + "id": "v2/On-Call/List On-Call schedules returns \"OK\" response", + "operation_id": "ListOnCallSchedules", + "request": { + "body": null, + "content_type": null, + "method": "GET", + "pagination": false, + "parameters": [], + "path": "/api/v2/on-call/schedules" + }, + "scenario": "List On-Call schedules returns \"OK\" response", + "schema_version": 1, + "version": "v2" +} diff --git a/src/test/resources/generated-test/test-server-data/v2/on-call.json b/src/test/resources/generated-test/test-server-data/v2/on-call.json index 24960addd99..80c11d997e7 100644 --- a/src/test/resources/generated-test/test-server-data/v2/on-call.json +++ b/src/test/resources/generated-test/test-server-data/v2/on-call.json @@ -3314,6 +3314,37 @@ "scenario": "List On-Call notification rules for a user returns \"OK\" response", "version": "v2" }, + { + "feature": "On-Call", + "frozen_at": "2026-09-09T14:54:42.222Z", + "interactions": [ + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "GET", + "path": "/api/v2/on-call/schedules", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":[{\"id\":\"a0a76964-f16e-4046-b004-3a0cc4c5dc8d\",\"type\":\"schedules\",\"attributes\":{\"name\":\"Example-Get_team_on_call_users_returns_OK_response_1780484684\",\"tags\":[],\"time_zone\":\"America/New_York\"},\"relationships\":{\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}}},{\"id\":\"6898691d-d088-482b-a6b2-4f99853b42cc\",\"type\":\"schedules\",\"attributes\":{\"name\":\"Example-Get_team_on_call_users_returns_OK_response_1781607884\",\"tags\":[],\"time_zone\":\"America/New_York\"},\"relationships\":{\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}}},{\"id\":\"a9f54856-1ea7-40e4-8208-eaa99c172c98\",\"type\":\"schedules\",\"attributes\":{\"name\":\"Example-Get_team_on_call_users_returns_OK_response_1787670284\",\"tags\":[],\"time_zone\":\"America/New_York\"},\"relationships\":{\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}}},{\"id\":\"4fdb7dfa-1269-4fbd-b818-f7ee0fa541f8\",\"type\":\"schedules\",\"attributes\":{\"name\":\"Example-Set_On_Call_team_routing_rules_returns_OK_response_1776121483\",\"tags\":[],\"time_zone\":\"America/New_York\"},\"relationships\":{\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}}},{\"id\":\"abc03348-514e-4d97-b90e-ba6514e2aee5\",\"type\":\"schedules\",\"attributes\":{\"name\":\"Example-Set_On_Call_team_routing_rules_returns_OK_response_1779291023\",\"tags\":[],\"time_zone\":\"America/New_York\"},\"relationships\":{\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}}},{\"id\":\"2913247a-d9a7-466e-94b6-ae494be44eeb\",\"type\":\"schedules\",\"attributes\":{\"name\":\"Example-Set_On_Call_team_routing_rules_returns_OK_response_1779291061\",\"tags\":[],\"time_zone\":\"America/New_York\"},\"relationships\":{\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}}},{\"id\":\"055c1bc1-92ff-4a96-a01f-5e3c3cde2e46\",\"type\":\"schedules\",\"attributes\":{\"name\":\"Test-Go-Create_On_Call_escalation_policy_returns_Created_response-1763772347\",\"tags\":[],\"time_zone\":\"America/New_York\"},\"relationships\":{\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}}},{\"id\":\"d4a45e02-85c1-4f1d-a110-f059e2d31d95\",\"type\":\"schedules\",\"attributes\":{\"name\":\"Test-Go-Create_On_Call_escalation_policy_returns_Created_response-1763859011\",\"tags\":[],\"time_zone\":\"America/New_York\"},\"relationships\":{\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}}},{\"id\":\"1fa8fdf5-13dd-4876-90db-18999f50917c\",\"type\":\"schedules\",\"attributes\":{\"name\":\"Test-Go-Create_On_Call_escalation_policy_returns_Created_response-1763945361\",\"tags\":[],\"time_zone\":\"America/New_York\"},\"relationships\":{\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}}},{\"id\":\"8c456447-4302-4e9e-9071-bf628ceaebbd\",\"type\":\"schedules\",\"attributes\":{\"name\":\"Test-Go-Create_On_Call_escalation_policy_returns_Created_response-1764031598\",\"tags\":[],\"time_zone\":\"America/New_York\"},\"relationships\":{\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}}}],\"meta\":{\"page\":{\"type\":\"number_size\",\"number\":0,\"size\":10,\"total\":885,\"first_number\":0,\"prev_number\":null,\"next_number\":1,\"last_number\":88}}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + } + ], + "scenario": "List On-Call schedules returns \"OK\" response", + "version": "v2" + }, { "feature": "On-Call", "frozen_at": "2026-05-15T14:39:18.459Z",