diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 7b3c78ce423..21890fb8fe9 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -40214,6 +40214,68 @@ components: required: - type type: object + EscalationPolicies: + description: "A paginated list of escalation policies, with any related resources requested through `include`." + properties: + data: + description: "A list of escalation policies." + items: + $ref: "#/components/schemas/EscalationPolicyListItem" + type: array + included: + description: "Provides any included related resources, such as teams, steps, or targets, returned with the policies." + items: + $ref: "#/components/schemas/EscalationPolicyIncluded" + type: array + meta: + $ref: "#/components/schemas/EscalationPoliciesResponseMeta" + required: + - data + type: object + EscalationPoliciesResponseMeta: + description: Metadata included in the response when listing escalation policies. + properties: + page: + $ref: "#/components/schemas/EscalationPoliciesResponseMetaPage" + type: object + EscalationPoliciesResponseMetaPage: + description: Pagination metadata included in the response when listing escalation policies. + 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 EscalationPolicy: description: "Represents a complete escalation policy response, including policy data and optionally included related resources." example: @@ -40432,6 +40494,14 @@ components: maximum: 10 minimum: 0 type: integer + tags: + description: "A list of tags attached to the escalation policy, in `key:value` format." + example: + - "env:prod" + items: + description: "A tag in `key:value` format." + type: string + type: array required: - name type: object @@ -40493,6 +40563,23 @@ components: - $ref: "#/components/schemas/ScheduleData" - $ref: "#/components/schemas/ConfiguredSchedule" - $ref: "#/components/schemas/TeamReference" + EscalationPolicyListItem: + description: "Represents an escalation policy returned in a list, including its attributes, ID, relationships, and resource type." + properties: + attributes: + $ref: "#/components/schemas/EscalationPolicyDataAttributes" + id: + description: "Specifies the unique identifier of the escalation policy." + example: "ab000000-0000-0000-0000-000000000000" + type: string + relationships: + $ref: "#/components/schemas/EscalationPolicyDataRelationships" + type: + $ref: "#/components/schemas/EscalationPolicyDataType" + required: + - id + - type + type: object EscalationPolicyStep: description: "Represents a single step in an escalation policy, including its attributes, relationships, and resource type." properties: @@ -40709,6 +40796,10 @@ components: EscalationPolicyUserAttributes: description: Provides basic user information for an escalation policy, including a name and email address. properties: + color: + description: "The user's on-call color, as a hex code (for example, `#FF0000`). Included only when `user.color` is requested in the `include` parameter." + example: "#FF0000" + type: string email: description: The user's email address. example: "jane.doe@example.com" @@ -204642,6 +204733,129 @@ paths: permissions: - observability_pipelines_deploy /api/v2/on-call/escalation-policies: + get: + description: Retrieve a paginated list of On-Call escalation policies, sorted by name. + operationId: ListOnCallEscalationPolicies + parameters: + - description: Number of escalation policies to return per page. The maximum allowed value is 50. + in: query + name: page[size] + required: false + schema: + default: 20 + example: 20 + format: int64 + maximum: 50 + type: integer + - $ref: "#/components/parameters/PageNumber" + - description: "Search query to filter escalation policies. Supports free-text search on the policy name (case-insensitive) and structured filters on `team.id` and `tags`. When set, `filter[team_id]`, `filter[user_id]`, and `filter[schedule_id]` are ignored. Can't be combined with `filter[tags]` or `filter[tags_any]`." + in: query + name: filter[query] + required: false + schema: + type: string + - description: Comma-separated list of team IDs. Returns escalation policies that belong to any of these teams or have a step targeting any of them. + in: query + name: filter[team_id] + required: false + schema: + example: "00000000-da3a-0000-0000-000000000000" + type: string + - description: Comma-separated list of user IDs. Returns escalation policies with a step targeting any of these users. + in: query + name: filter[user_id] + required: false + schema: + example: "00000000-aba1-0000-0000-000000000000" + type: string + - description: Comma-separated list of schedule IDs. Returns escalation policies with a step targeting any of these schedules. + in: query + name: filter[schedule_id] + required: false + schema: + example: "00000000-aba2-0000-0000-000000000000" + type: string + - description: "Comma-separated list of `key:value` tags. Returns escalation policies that have all of these tags." + in: query + name: filter[tags] + required: false + schema: + example: "env:prod" + type: string + - description: "Comma-separated list of `key:value` tags. Returns escalation policies that have at least one of these tags." + in: query + name: filter[tags_any] + required: false + schema: + example: "env:prod,env:staging" + type: string + - description: "Comma-separated list of included relationships to be returned. Allowed values: `teams`, `steps`, `steps.targets`, `steps.targets.schedule`, `user.color`. `user.color` populates the `color` attribute of users included through `steps.targets`." + in: query + name: include + required: false + schema: + type: string + responses: + "200": + content: + "application/json": + examples: + default: + value: + data: + - attributes: + name: Escalation Policy 1 + resolve_page_on_policy_end: true + retries: 2 + tags: + - env:prod + id: 00000000-aba1-0000-0000-000000000000 + relationships: + steps: + data: + - id: 00000000-aba1-0000-0000-000000000000 + type: steps + teams: + data: + - id: 00000000-da3a-0000-0000-000000000000 + type: teams + type: policies + meta: + page: + first_number: 0 + last_number: 0 + next_number: + number: 0 + prev_number: + size: 20 + total: 1 + type: number_size + schema: + $ref: "#/components/schemas/EscalationPolicies" + 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 escalation policies + 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 escalation policy operationId: CreateOnCallEscalationPolicy diff --git a/examples/v2/on-call/ListOnCallEscalationPolicies.java b/examples/v2/on-call/ListOnCallEscalationPolicies.java new file mode 100644 index 00000000000..d25b813e7f1 --- /dev/null +++ b/examples/v2/on-call/ListOnCallEscalationPolicies.java @@ -0,0 +1,33 @@ +// List On-Call escalation policies 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.api.OnCallApi.ListOnCallEscalationPoliciesOptionalParameters; +import com.datadog.api.client.v2.model.EscalationPolicies; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN")); + OnCallApi apiInstance = new OnCallApi(defaultClient); + + // there is a valid "schedule" in the system + String SCHEDULE_DATA_ID = System.getenv("SCHEDULE_DATA_ID"); + + try { + EscalationPolicies result = + apiInstance.listOnCallEscalationPolicies( + new ListOnCallEscalationPoliciesOptionalParameters() + .filterScheduleId(SCHEDULE_DATA_ID) + .include("steps.targets")); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling OnCallApi#listOnCallEscalationPolicies"); + 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/ListOnCallEscalationPolicies_2198542788.java b/examples/v2/on-call/ListOnCallEscalationPolicies_2198542788.java new file mode 100644 index 00000000000..d4d491fc3ab --- /dev/null +++ b/examples/v2/on-call/ListOnCallEscalationPolicies_2198542788.java @@ -0,0 +1,28 @@ +// List On-Call escalation policies 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.EscalationPolicyListItem; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN")); + OnCallApi apiInstance = new OnCallApi(defaultClient); + + try { + PaginationIterable iterable = + apiInstance.listOnCallEscalationPoliciesWithPagination(); + + for (EscalationPolicyListItem item : iterable) { + System.out.println(item); + } + } catch (RuntimeException e) { + System.err.println( + "Exception when calling OnCallApi#listOnCallEscalationPoliciesWithPagination"); + 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 c414e93fe1a..698a1ec92dc 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 @@ -8,8 +8,10 @@ import com.datadog.api.client.v2.model.CreateOnCallNotificationRuleRequest; import com.datadog.api.client.v2.model.CreateOverridesRequest; import com.datadog.api.client.v2.model.CreateUserNotificationChannelRequest; +import com.datadog.api.client.v2.model.EscalationPolicies; import com.datadog.api.client.v2.model.EscalationPolicy; import com.datadog.api.client.v2.model.EscalationPolicyCreateRequest; +import com.datadog.api.client.v2.model.EscalationPolicyListItem; import com.datadog.api.client.v2.model.EscalationPolicyUpdateRequest; import com.datadog.api.client.v2.model.ListNotificationChannelsResponse; import com.datadog.api.client.v2.model.ListOnCallNotificationRulesResponse; @@ -3475,6 +3477,381 @@ public ApiResponse getUserNotificationRuleWithHttpInfo( new GenericType() {}); } + /** Manage optional parameters to listOnCallEscalationPolicies. */ + public static class ListOnCallEscalationPoliciesOptionalParameters { + private Long pageSize; + private Long pageNumber; + private String filterQuery; + private String filterTeamId; + private String filterUserId; + private String filterScheduleId; + private String filterTags; + private String filterTagsAny; + private String include; + + /** + * Set pageSize. + * + * @param pageSize Number of escalation policies to return per page. The maximum allowed value + * is 50. (optional, default to 20) + * @return ListOnCallEscalationPoliciesOptionalParameters + */ + public ListOnCallEscalationPoliciesOptionalParameters pageSize(Long pageSize) { + this.pageSize = pageSize; + return this; + } + + /** + * Set pageNumber. + * + * @param pageNumber Specific page number to return. (optional, default to 0) + * @return ListOnCallEscalationPoliciesOptionalParameters + */ + public ListOnCallEscalationPoliciesOptionalParameters pageNumber(Long pageNumber) { + this.pageNumber = pageNumber; + return this; + } + + /** + * Set filterQuery. + * + * @param filterQuery Search query to filter escalation policies. Supports free-text search on + * the policy name (case-insensitive) and structured filters on team.id and + * tags. When set, filter[team_id], filter[user_id], + * and filter[schedule_id] are ignored. Can't be combined with + * filter[tags] or filter[tags_any]. (optional) + * @return ListOnCallEscalationPoliciesOptionalParameters + */ + public ListOnCallEscalationPoliciesOptionalParameters filterQuery(String filterQuery) { + this.filterQuery = filterQuery; + return this; + } + + /** + * Set filterTeamId. + * + * @param filterTeamId Comma-separated list of team IDs. Returns escalation policies that belong + * to any of these teams or have a step targeting any of them. (optional) + * @return ListOnCallEscalationPoliciesOptionalParameters + */ + public ListOnCallEscalationPoliciesOptionalParameters filterTeamId(String filterTeamId) { + this.filterTeamId = filterTeamId; + return this; + } + + /** + * Set filterUserId. + * + * @param filterUserId Comma-separated list of user IDs. Returns escalation policies with a step + * targeting any of these users. (optional) + * @return ListOnCallEscalationPoliciesOptionalParameters + */ + public ListOnCallEscalationPoliciesOptionalParameters filterUserId(String filterUserId) { + this.filterUserId = filterUserId; + return this; + } + + /** + * Set filterScheduleId. + * + * @param filterScheduleId Comma-separated list of schedule IDs. Returns escalation policies + * with a step targeting any of these schedules. (optional) + * @return ListOnCallEscalationPoliciesOptionalParameters + */ + public ListOnCallEscalationPoliciesOptionalParameters filterScheduleId( + String filterScheduleId) { + this.filterScheduleId = filterScheduleId; + return this; + } + + /** + * Set filterTags. + * + * @param filterTags Comma-separated list of key:value tags. Returns escalation + * policies that have all of these tags. (optional) + * @return ListOnCallEscalationPoliciesOptionalParameters + */ + public ListOnCallEscalationPoliciesOptionalParameters filterTags(String filterTags) { + this.filterTags = filterTags; + return this; + } + + /** + * Set filterTagsAny. + * + * @param filterTagsAny Comma-separated list of key:value tags. Returns escalation + * policies that have at least one of these tags. (optional) + * @return ListOnCallEscalationPoliciesOptionalParameters + */ + public ListOnCallEscalationPoliciesOptionalParameters filterTagsAny(String filterTagsAny) { + this.filterTagsAny = filterTagsAny; + return this; + } + + /** + * Set include. + * + * @param include Comma-separated list of included relationships to be returned. Allowed values: + * teams, steps, steps.targets, + * steps.targets.schedule, user.color. user.color populates + * the color attribute of users included through steps.targets. + * (optional) + * @return ListOnCallEscalationPoliciesOptionalParameters + */ + public ListOnCallEscalationPoliciesOptionalParameters include(String include) { + this.include = include; + return this; + } + } + + /** + * List On-Call escalation policies. + * + *

See {@link #listOnCallEscalationPoliciesWithHttpInfo}. + * + * @return EscalationPolicies + * @throws ApiException if fails to make API call + */ + public EscalationPolicies listOnCallEscalationPolicies() throws ApiException { + return listOnCallEscalationPoliciesWithHttpInfo( + new ListOnCallEscalationPoliciesOptionalParameters()) + .getData(); + } + + /** + * List On-Call escalation policies. + * + *

See {@link #listOnCallEscalationPoliciesWithHttpInfoAsync}. + * + * @return CompletableFuture<EscalationPolicies> + */ + public CompletableFuture listOnCallEscalationPoliciesAsync() { + return listOnCallEscalationPoliciesWithHttpInfoAsync( + new ListOnCallEscalationPoliciesOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List On-Call escalation policies. + * + *

See {@link #listOnCallEscalationPoliciesWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return EscalationPolicies + * @throws ApiException if fails to make API call + */ + public EscalationPolicies listOnCallEscalationPolicies( + ListOnCallEscalationPoliciesOptionalParameters parameters) throws ApiException { + return listOnCallEscalationPoliciesWithHttpInfo(parameters).getData(); + } + + /** + * List On-Call escalation policies. + * + *

See {@link #listOnCallEscalationPoliciesWithHttpInfoAsync}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<EscalationPolicies> + */ + public CompletableFuture listOnCallEscalationPoliciesAsync( + ListOnCallEscalationPoliciesOptionalParameters parameters) { + return listOnCallEscalationPoliciesWithHttpInfoAsync(parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List On-Call escalation policies. + * + *

See {@link #listOnCallEscalationPoliciesWithHttpInfo}. + * + * @return PaginationIterable<EscalationPolicyListItem> + */ + public PaginationIterable listOnCallEscalationPoliciesWithPagination() { + ListOnCallEscalationPoliciesOptionalParameters parameters = + new ListOnCallEscalationPoliciesOptionalParameters(); + return listOnCallEscalationPoliciesWithPagination(parameters); + } + + /** + * List On-Call escalation policies. + * + *

See {@link #listOnCallEscalationPoliciesWithHttpInfo}. + * + * @return EscalationPolicies + */ + public PaginationIterable listOnCallEscalationPoliciesWithPagination( + ListOnCallEscalationPoliciesOptionalParameters parameters) { + String resultsPath = "getData"; + String valueGetterPath = ""; + String valueSetterPath = "pageNumber"; + Boolean valueSetterParamOptional = true; + parameters.pageNumber(0l); + Long limit; + + if (parameters.pageSize == null) { + limit = 20l; + parameters.pageSize(limit); + } else { + limit = parameters.pageSize; + } + + LinkedHashMap args = new LinkedHashMap(); + args.put("optionalParams", parameters); + + PaginationIterable iterator = + new PaginationIterable( + this, + "listOnCallEscalationPolicies", + resultsPath, + valueGetterPath, + valueSetterPath, + valueSetterParamOptional, + false, + false, + limit, + args, + 0); + + return iterator; + } + + /** + * Retrieve a paginated list of On-Call escalation policies, sorted by name. + * + * @param parameters Optional parameters for the request. + * @return ApiResponse<EscalationPolicies> + * @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 listOnCallEscalationPoliciesWithHttpInfo( + ListOnCallEscalationPoliciesOptionalParameters parameters) throws ApiException { + Object localVarPostBody = null; + Long pageSize = parameters.pageSize; + Long pageNumber = parameters.pageNumber; + String filterQuery = parameters.filterQuery; + String filterTeamId = parameters.filterTeamId; + String filterUserId = parameters.filterUserId; + String filterScheduleId = parameters.filterScheduleId; + String filterTags = parameters.filterTags; + String filterTagsAny = parameters.filterTagsAny; + String include = parameters.include; + // create path and map variables + String localVarPath = "/api/v2/on-call/escalation-policies"; + + 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("", "filter[team_id]", filterTeamId)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[user_id]", filterUserId)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[schedule_id]", filterScheduleId)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[tags]", filterTags)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[tags_any]", filterTagsAny)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "include", include)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.OnCallApi.listOnCallEscalationPolicies", + 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 escalation policies. + * + *

See {@link #listOnCallEscalationPoliciesWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<EscalationPolicies>> + */ + public CompletableFuture> + listOnCallEscalationPoliciesWithHttpInfoAsync( + ListOnCallEscalationPoliciesOptionalParameters parameters) { + Object localVarPostBody = null; + Long pageSize = parameters.pageSize; + Long pageNumber = parameters.pageNumber; + String filterQuery = parameters.filterQuery; + String filterTeamId = parameters.filterTeamId; + String filterUserId = parameters.filterUserId; + String filterScheduleId = parameters.filterScheduleId; + String filterTags = parameters.filterTags; + String filterTagsAny = parameters.filterTagsAny; + String include = parameters.include; + // create path and map variables + String localVarPath = "/api/v2/on-call/escalation-policies"; + + 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("", "filter[team_id]", filterTeamId)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[user_id]", filterUserId)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[schedule_id]", filterScheduleId)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[tags]", filterTags)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[tags_any]", filterTagsAny)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "include", include)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.OnCallApi.listOnCallEscalationPolicies", + 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() {}); + } + /** Manage optional parameters to listOnCallSchedules. */ public static class ListOnCallSchedulesOptionalParameters { private Long pageSize; diff --git a/src/main/java/com/datadog/api/client/v2/model/EscalationPolicies.java b/src/main/java/com/datadog/api/client/v2/model/EscalationPolicies.java new file mode 100644 index 00000000000..7815327985c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/EscalationPolicies.java @@ -0,0 +1,246 @@ +/* + * 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; + +/** + * A paginated list of escalation policies, with any related resources requested through + * include. + */ +@JsonPropertyOrder({ + EscalationPolicies.JSON_PROPERTY_DATA, + EscalationPolicies.JSON_PROPERTY_INCLUDED, + EscalationPolicies.JSON_PROPERTY_META +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class EscalationPolicies { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public static final String JSON_PROPERTY_INCLUDED = "included"; + private List included = null; + + public static final String JSON_PROPERTY_META = "meta"; + private EscalationPoliciesResponseMeta meta; + + public EscalationPolicies() {} + + @JsonCreator + public EscalationPolicies( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + List data) { + this.data = data; + for (EscalationPolicyListItem item : data) { + this.unparsed |= item.unparsed; + } + } + + public EscalationPolicies data(List data) { + this.data = data; + for (EscalationPolicyListItem item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public EscalationPolicies addDataItem(EscalationPolicyListItem dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * A list of escalation policies. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + if (data != null) { + for (EscalationPolicyListItem item : data) { + this.unparsed |= item.unparsed; + } + } + } + + public EscalationPolicies included(List included) { + this.included = included; + if (included != null) { + for (EscalationPolicyIncluded item : included) { + this.unparsed |= item.unparsed; + } + } + return this; + } + + public EscalationPolicies addIncludedItem(EscalationPolicyIncluded includedItem) { + if (this.included == null) { + this.included = new ArrayList<>(); + } + this.included.add(includedItem); + this.unparsed |= includedItem.unparsed; + return this; + } + + /** + * Provides any included related resources, such as teams, steps, or targets, returned with the + * policies. + * + * @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 (EscalationPolicyIncluded item : included) { + this.unparsed |= item.unparsed; + } + } + } + + public EscalationPolicies meta(EscalationPoliciesResponseMeta meta) { + this.meta = meta; + this.unparsed |= meta.unparsed; + return this; + } + + /** + * Metadata included in the response when listing escalation policies. + * + * @return meta + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_META) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EscalationPoliciesResponseMeta getMeta() { + return meta; + } + + public void setMeta(EscalationPoliciesResponseMeta 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 EscalationPolicies + */ + @JsonAnySetter + public EscalationPolicies 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 EscalationPolicies object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EscalationPolicies escalationPolicies = (EscalationPolicies) o; + return Objects.equals(this.data, escalationPolicies.data) + && Objects.equals(this.included, escalationPolicies.included) + && Objects.equals(this.meta, escalationPolicies.meta) + && Objects.equals(this.additionalProperties, escalationPolicies.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, included, meta, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EscalationPolicies {\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/EscalationPoliciesResponseMeta.java b/src/main/java/com/datadog/api/client/v2/model/EscalationPoliciesResponseMeta.java new file mode 100644 index 00000000000..68e247737e0 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/EscalationPoliciesResponseMeta.java @@ -0,0 +1,141 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Metadata included in the response when listing escalation policies. */ +@JsonPropertyOrder({EscalationPoliciesResponseMeta.JSON_PROPERTY_PAGE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class EscalationPoliciesResponseMeta { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_PAGE = "page"; + private EscalationPoliciesResponseMetaPage page; + + public EscalationPoliciesResponseMeta page(EscalationPoliciesResponseMetaPage page) { + this.page = page; + this.unparsed |= page.unparsed; + return this; + } + + /** + * Pagination metadata included in the response when listing escalation policies. + * + * @return page + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EscalationPoliciesResponseMetaPage getPage() { + return page; + } + + public void setPage(EscalationPoliciesResponseMetaPage 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 EscalationPoliciesResponseMeta + */ + @JsonAnySetter + public EscalationPoliciesResponseMeta 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 EscalationPoliciesResponseMeta object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EscalationPoliciesResponseMeta escalationPoliciesResponseMeta = + (EscalationPoliciesResponseMeta) o; + return Objects.equals(this.page, escalationPoliciesResponseMeta.page) + && Objects.equals( + this.additionalProperties, escalationPoliciesResponseMeta.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(page, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EscalationPoliciesResponseMeta {\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/EscalationPoliciesResponseMetaPage.java b/src/main/java/com/datadog/api/client/v2/model/EscalationPoliciesResponseMetaPage.java new file mode 100644 index 00000000000..29cb3ead3e1 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/EscalationPoliciesResponseMetaPage.java @@ -0,0 +1,358 @@ +/* + * 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; + +/** Pagination metadata included in the response when listing escalation policies. */ +@JsonPropertyOrder({ + EscalationPoliciesResponseMetaPage.JSON_PROPERTY_FIRST_NUMBER, + EscalationPoliciesResponseMetaPage.JSON_PROPERTY_LAST_NUMBER, + EscalationPoliciesResponseMetaPage.JSON_PROPERTY_NEXT_NUMBER, + EscalationPoliciesResponseMetaPage.JSON_PROPERTY_NUMBER, + EscalationPoliciesResponseMetaPage.JSON_PROPERTY_PREV_NUMBER, + EscalationPoliciesResponseMetaPage.JSON_PROPERTY_SIZE, + EscalationPoliciesResponseMetaPage.JSON_PROPERTY_TOTAL, + EscalationPoliciesResponseMetaPage.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class EscalationPoliciesResponseMetaPage { + @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 EscalationPoliciesResponseMetaPage 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 EscalationPoliciesResponseMetaPage 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 EscalationPoliciesResponseMetaPage 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 EscalationPoliciesResponseMetaPage 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 EscalationPoliciesResponseMetaPage 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 EscalationPoliciesResponseMetaPage 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 EscalationPoliciesResponseMetaPage 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 EscalationPoliciesResponseMetaPage 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 EscalationPoliciesResponseMetaPage + */ + @JsonAnySetter + public EscalationPoliciesResponseMetaPage 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 EscalationPoliciesResponseMetaPage object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EscalationPoliciesResponseMetaPage escalationPoliciesResponseMetaPage = + (EscalationPoliciesResponseMetaPage) o; + return Objects.equals(this.firstNumber, escalationPoliciesResponseMetaPage.firstNumber) + && Objects.equals(this.lastNumber, escalationPoliciesResponseMetaPage.lastNumber) + && Objects.equals(this.nextNumber, escalationPoliciesResponseMetaPage.nextNumber) + && Objects.equals(this.number, escalationPoliciesResponseMetaPage.number) + && Objects.equals(this.prevNumber, escalationPoliciesResponseMetaPage.prevNumber) + && Objects.equals(this.size, escalationPoliciesResponseMetaPage.size) + && Objects.equals(this.total, escalationPoliciesResponseMetaPage.total) + && Objects.equals(this.type, escalationPoliciesResponseMetaPage.type) + && Objects.equals( + this.additionalProperties, escalationPoliciesResponseMetaPage.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 EscalationPoliciesResponseMetaPage {\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/main/java/com/datadog/api/client/v2/model/EscalationPolicyDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/EscalationPolicyDataAttributes.java index 40d67906410..e798e99594b 100644 --- a/src/main/java/com/datadog/api/client/v2/model/EscalationPolicyDataAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/EscalationPolicyDataAttributes.java @@ -13,7 +13,9 @@ 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; @@ -23,7 +25,8 @@ @JsonPropertyOrder({ EscalationPolicyDataAttributes.JSON_PROPERTY_NAME, EscalationPolicyDataAttributes.JSON_PROPERTY_RESOLVE_PAGE_ON_POLICY_END, - EscalationPolicyDataAttributes.JSON_PROPERTY_RETRIES + EscalationPolicyDataAttributes.JSON_PROPERTY_RETRIES, + EscalationPolicyDataAttributes.JSON_PROPERTY_TAGS }) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") @@ -39,6 +42,9 @@ public class EscalationPolicyDataAttributes { public static final String JSON_PROPERTY_RETRIES = "retries"; private Long retries; + public static final String JSON_PROPERTY_TAGS = "tags"; + private List tags = null; + public EscalationPolicyDataAttributes() {} @JsonCreator @@ -110,6 +116,35 @@ public void setRetries(Long retries) { this.retries = retries; } + public EscalationPolicyDataAttributes tags(List tags) { + this.tags = tags; + return this; + } + + public EscalationPolicyDataAttributes addTagsItem(String tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * A list of tags attached to the escalation policy, in key:value format. + * + * @return tags + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTags() { + return tags; + } + + public void setTags(List tags) { + this.tags = tags; + } + /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -171,13 +206,14 @@ public boolean equals(Object o) { && Objects.equals( this.resolvePageOnPolicyEnd, escalationPolicyDataAttributes.resolvePageOnPolicyEnd) && Objects.equals(this.retries, escalationPolicyDataAttributes.retries) + && Objects.equals(this.tags, escalationPolicyDataAttributes.tags) && Objects.equals( this.additionalProperties, escalationPolicyDataAttributes.additionalProperties); } @Override public int hashCode() { - return Objects.hash(name, resolvePageOnPolicyEnd, retries, additionalProperties); + return Objects.hash(name, resolvePageOnPolicyEnd, retries, tags, additionalProperties); } @Override @@ -189,6 +225,7 @@ public String toString() { .append(toIndentedString(resolvePageOnPolicyEnd)) .append("\n"); sb.append(" retries: ").append(toIndentedString(retries)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); diff --git a/src/main/java/com/datadog/api/client/v2/model/EscalationPolicyListItem.java b/src/main/java/com/datadog/api/client/v2/model/EscalationPolicyListItem.java new file mode 100644 index 00000000000..ce5d7b00dc4 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/EscalationPolicyListItem.java @@ -0,0 +1,244 @@ +/* + * 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 an escalation policy returned in a list, including its attributes, ID, relationships, + * and resource type. + */ +@JsonPropertyOrder({ + EscalationPolicyListItem.JSON_PROPERTY_ATTRIBUTES, + EscalationPolicyListItem.JSON_PROPERTY_ID, + EscalationPolicyListItem.JSON_PROPERTY_RELATIONSHIPS, + EscalationPolicyListItem.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class EscalationPolicyListItem { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private EscalationPolicyDataAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private EscalationPolicyDataRelationships relationships; + + public static final String JSON_PROPERTY_TYPE = "type"; + private EscalationPolicyDataType type = EscalationPolicyDataType.POLICIES; + + public EscalationPolicyListItem() {} + + @JsonCreator + public EscalationPolicyListItem( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) EscalationPolicyDataType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public EscalationPolicyListItem attributes(EscalationPolicyDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Defines the main attributes of an escalation policy, such as its name and behavior on policy + * end. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EscalationPolicyDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(EscalationPolicyDataAttributes attributes) { + this.attributes = attributes; + if (attributes != null) { + this.unparsed |= attributes.unparsed; + } + } + + public EscalationPolicyListItem id(String id) { + this.id = id; + return this; + } + + /** + * Specifies the unique identifier of the escalation policy. + * + * @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 EscalationPolicyListItem relationships(EscalationPolicyDataRelationships relationships) { + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + return this; + } + + /** + * Represents the relationships for an escalation policy, including references to steps and teams. + * + * @return relationships + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EscalationPolicyDataRelationships getRelationships() { + return relationships; + } + + public void setRelationships(EscalationPolicyDataRelationships relationships) { + this.relationships = relationships; + if (relationships != null) { + this.unparsed |= relationships.unparsed; + } + } + + public EscalationPolicyListItem type(EscalationPolicyDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Indicates that the resource is of type policies. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public EscalationPolicyDataType getType() { + return type; + } + + public void setType(EscalationPolicyDataType 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 EscalationPolicyListItem + */ + @JsonAnySetter + public EscalationPolicyListItem 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 EscalationPolicyListItem object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EscalationPolicyListItem escalationPolicyListItem = (EscalationPolicyListItem) o; + return Objects.equals(this.attributes, escalationPolicyListItem.attributes) + && Objects.equals(this.id, escalationPolicyListItem.id) + && Objects.equals(this.relationships, escalationPolicyListItem.relationships) + && Objects.equals(this.type, escalationPolicyListItem.type) + && Objects.equals(this.additionalProperties, escalationPolicyListItem.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, relationships, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EscalationPolicyListItem {\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/EscalationPolicyUserAttributes.java b/src/main/java/com/datadog/api/client/v2/model/EscalationPolicyUserAttributes.java index 652678bddbe..f4f29636794 100644 --- a/src/main/java/com/datadog/api/client/v2/model/EscalationPolicyUserAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/EscalationPolicyUserAttributes.java @@ -18,6 +18,7 @@ /** Provides basic user information for an escalation policy, including a name and email address. */ @JsonPropertyOrder({ + EscalationPolicyUserAttributes.JSON_PROPERTY_COLOR, EscalationPolicyUserAttributes.JSON_PROPERTY_EMAIL, EscalationPolicyUserAttributes.JSON_PROPERTY_NAME, EscalationPolicyUserAttributes.JSON_PROPERTY_STATUS @@ -26,6 +27,9 @@ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") public class EscalationPolicyUserAttributes { @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_COLOR = "color"; + private String color; + public static final String JSON_PROPERTY_EMAIL = "email"; private String email; @@ -35,6 +39,28 @@ public class EscalationPolicyUserAttributes { public static final String JSON_PROPERTY_STATUS = "status"; private UserAttributesStatus status; + public EscalationPolicyUserAttributes color(String color) { + this.color = color; + return this; + } + + /** + * The user's on-call color, as a hex code (for example, #FF0000). Included only when + * user.color is requested in the include parameter. + * + * @return color + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getColor() { + return color; + } + + public void setColor(String color) { + this.color = color; + } + public EscalationPolicyUserAttributes email(String email) { this.email = email; return this; @@ -159,7 +185,8 @@ public boolean equals(Object o) { } EscalationPolicyUserAttributes escalationPolicyUserAttributes = (EscalationPolicyUserAttributes) o; - return Objects.equals(this.email, escalationPolicyUserAttributes.email) + return Objects.equals(this.color, escalationPolicyUserAttributes.color) + && Objects.equals(this.email, escalationPolicyUserAttributes.email) && Objects.equals(this.name, escalationPolicyUserAttributes.name) && Objects.equals(this.status, escalationPolicyUserAttributes.status) && Objects.equals( @@ -168,13 +195,14 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(email, name, status, additionalProperties); + return Objects.hash(color, email, name, status, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class EscalationPolicyUserAttributes {\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); sb.append(" email: ").append(toIndentedString(email)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\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 0288aa15cf4..f782b41d091 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 @@ -426,6 +426,32 @@ Feature: On-Call When the request is sent Then the response status is 200 OK + @generated @skip @team:ddoghq/on-call + Scenario: List On-Call escalation policies returns "Bad Request" response + Given new "ListOnCallEscalationPolicies" request + When the request is sent + Then the response status is 400 Bad Request + + @team:ddoghq/on-call + Scenario: List On-Call escalation policies returns "OK" response + Given new "ListOnCallEscalationPolicies" request + And there is a valid "user" in the system + And there is a valid "dd_team" in the system + And there is a valid "schedule" in the system + And there is a valid "escalation_policy" in the system + And request contains "filter[schedule_id]" parameter from "schedule.data.id" + And request contains "include" parameter with value "steps.targets" + When the request is sent + Then the response status is 200 OK + And the response "data" has length 1 + And the response "data[0].id" is equal to "{{ escalation_policy.data.id }}" + + @generated @skip @team:ddoghq/on-call @with-pagination + Scenario: List On-Call escalation policies returns "OK" response with pagination + Given new "ListOnCallEscalationPolicies" request + When the request with pagination is sent + Then the response status is 200 OK + @generated @skip @team:ddoghq/on-call Scenario: List On-Call notification channels for a user returns "Bad Request" response Given new "ListUserNotificationChannels" 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 3f937ed045d..37961c9528f 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 @@ -6656,6 +6656,12 @@ "type": "idempotent" } }, + "ListOnCallEscalationPolicies": { + "tag": "On-Call", + "undo": { + "type": "safe" + } + }, "CreateOnCallEscalationPolicy": { "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 c4c5760e839..b6576142c44 100644 --- a/src/test/resources/generated-test/test-runner-data/manifest.json +++ b/src/test/resources/generated-test/test-runner-data/manifest.json @@ -8988,6 +8988,13 @@ "scenario": "Get team on-call users 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-escalation-policies-returns-ok-response.json", + "scenario": "List On-Call escalation policies 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-escalation-policies-returns-ok-response.json b/src/test/resources/generated-test/test-runner-data/v2/on-call/list-on-call-escalation-policies-returns-ok-response.json new file mode 100644 index 00000000000..18b6c5dda9d --- /dev/null +++ b/src/test/resources/generated-test/test-runner-data/v2/on-call/list-on-call-escalation-policies-returns-ok-response.json @@ -0,0 +1,51 @@ +{ + "api": "On-Call", + "expected_status": 200, + "feature": "On-Call", + "id": "v2/On-Call/List On-Call escalation policies returns \"OK\" response", + "operation_id": "ListOnCallEscalationPolicies", + "request": { + "body": null, + "content_type": null, + "method": "GET", + "pagination": false, + "parameters": [ + { + "explode": null, + "in": "query", + "name": "filter[schedule_id]", + "required": false, + "schema": { + "format": null, + "ref": null, + "type": "string" + }, + "source": { + "path": "schedule.data.id", + "type": "fixture" + }, + "style": null + }, + { + "explode": null, + "in": "query", + "name": "include", + "required": false, + "schema": { + "format": null, + "ref": null, + "type": "string" + }, + "source": { + "type": "literal", + "value": "steps.targets" + }, + "style": null + } + ], + "path": "/api/v2/on-call/escalation-policies" + }, + "scenario": "List On-Call escalation policies 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 436a2fde97d..a6fe6f6f7cc 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 @@ -3674,6 +3674,340 @@ "scenario": "Get team on-call users returns \"OK\" response", "version": "v2" }, + { + "feature": "On-Call", + "frozen_at": "2026-10-21T07:56:00.111Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "email": "Test-List_On_Call_escalation_policies_returns_OK_response-1792569360@datadoghq.com", + "title": "user title" + }, + "type": "users" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/users", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"type\":\"users\",\"id\":\"b59d1cec-8aae-4b77-90b1-51383a15fa9c\",\"attributes\":{\"uuid\":\"b59d1cec-8aae-4b77-90b1-51383a15fa9c\",\"name\":null,\"handle\":\"test-list_on_call_escalation_policies_returns_ok_response-1792569360@datadoghq.com\",\"created_at\":\"2026-10-21T07:56:00.661034+00:00\",\"modified_at\":\"2026-10-21T07:56:00.661034+00:00\",\"email\":\"test-list_on_call_escalation_policies_returns_ok_response-1792569360@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/d037931a8597527c0e9740820b731ea9?s=48&d=retro\",\"title\":\"user title\",\"verified\":false,\"service_account\":false,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Pending\",\"last_login_time\":null},\"relationships\":{\"roles\":{\"data\":[]},\"org\":{\"data\":{\"type\":\"orgs\",\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\"}}}}}\n" + }, + "headers": { + "content-type": "application/json" + }, + "reason": "Created", + "status": 201 + } + }, + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "handle": "test-handle-4b526d34522a83e5", + "name": "test-name-4b526d34522a83e5" + }, + "type": "team" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/team", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"32f0af28-fc1d-4b2e-8e1d-9a39b3fb3aee\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":0,\"created_at\":\"2026-10-21T07:56:01.240173+00:00\",\"description\":null,\"handle\":\"test-handle-4b526d34522a83e5\",\"hidden_modules\":null,\"is_managed\":false,\"link_count\":0,\"modified_at\":\"2026-10-21T07:56:01.240173+00:00\",\"name\":\"test-name-4b526d34522a83e5\",\"summary\":null,\"user_count\":0,\"visible_modules\":null},\"relationships\":{\"team_links\":{\"data\":[],\"links\":{\"related\":\"/api/v2/team/32f0af28-fc1d-4b2e-8e1d-9a39b3fb3aee/links\"}},\"user_team_permissions\":{\"data\":null,\"links\":{\"related\":\"/api/v2/team/32f0af28-fc1d-4b2e-8e1d-9a39b3fb3aee/permission-settings\"}}}}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Created", + "status": 201 + } + }, + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "layers": [ + { + "effective_date": "2026-10-11T07:56:00.111Z", + "end_date": "2026-10-31T07:56:00.111Z", + "interval": { + "days": 1 + }, + "members": [ + { + "user": { + "id": "b59d1cec-8aae-4b77-90b1-51383a15fa9c" + } + } + ], + "name": "Layer 1", + "restrictions": [ + { + "end_day": "friday", + "end_time": "17:00:00", + "start_day": "monday", + "start_time": "09:00:00" + } + ], + "rotation_start": "2026-10-16T07:56:00.111Z" + } + ], + "name": "Test-List_On_Call_escalation_policies_returns_OK_response-1792569360", + "time_zone": "America/New_York" + }, + "relationships": { + "teams": { + "data": [ + { + "id": "65aea9d0-941c-4607-bf8a-14fc0dac2820", + "type": "teams" + } + ] + } + }, + "type": "schedules" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/on-call/schedules", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"4be12f3a-531d-472d-8597-796017572212\",\"type\":\"schedules\",\"attributes\":{\"name\":\"Test-List_On_Call_escalation_policies_returns_OK_response-1792569360\",\"tags\":[],\"time_zone\":\"America/New_York\"},\"relationships\":{\"layers\":{\"data\":[{\"id\":\"397a6351-607e-4151-8617-19f1b2107533\",\"type\":\"layers\"}]},\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}}}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Created", + "status": 201 + } + }, + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "name": "Test-List_On_Call_escalation_policies_returns_OK_response-1792569360", + "resolve_page_on_policy_end": true, + "retries": 2, + "steps": [ + { + "assignment": "default", + "escalate_after_seconds": 3600, + "targets": [ + { + "id": "32f0af28-fc1d-4b2e-8e1d-9a39b3fb3aee", + "type": "teams" + }, + { + "id": "4be12f3a-531d-472d-8597-796017572212", + "type": "schedules" + }, + { + "config": { + "schedule": { + "position": "previous" + } + }, + "id": "4be12f3a-531d-472d-8597-796017572212", + "type": "schedules" + }, + { + "id": "b59d1cec-8aae-4b77-90b1-51383a15fa9c", + "type": "users" + } + ] + }, + { + "assignment": "round-robin", + "escalate_after_seconds": 3600, + "targets": [ + { + "id": "32f0af28-fc1d-4b2e-8e1d-9a39b3fb3aee", + "type": "teams" + } + ] + } + ] + }, + "relationships": { + "teams": { + "data": [ + { + "id": "32f0af28-fc1d-4b2e-8e1d-9a39b3fb3aee", + "type": "teams" + } + ] + } + }, + "type": "policies" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/on-call/escalation-policies", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"fa88ac55-aa5d-470d-abbd-5a160d6f4d5c\",\"type\":\"policies\",\"attributes\":{\"name\":\"Test-List_On_Call_escalation_policies_returns_OK_response-1792569360\",\"resolve_page_on_policy_end\":true,\"retries\":2,\"tags\":[]},\"relationships\":{\"steps\":{\"data\":[{\"id\":\"cf613965-854c-48fd-a299-cda5d491a132\",\"type\":\"steps\"},{\"id\":\"11d3ca7e-aa82-4dcc-9147-6a0fec5f222c\",\"type\":\"steps\"}]},\"teams\":{\"data\":[{\"id\":\"32f0af28-fc1d-4b2e-8e1d-9a39b3fb3aee\",\"type\":\"teams\"}]}}}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Created", + "status": 201 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "GET", + "path": "/api/v2/on-call/escalation-policies", + "query": [ + [ + "filter[schedule_id]", + "4be12f3a-531d-472d-8597-796017572212" + ], + [ + "include", + "steps.targets" + ] + ] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":[{\"id\":\"fa88ac55-aa5d-470d-abbd-5a160d6f4d5c\",\"type\":\"policies\",\"attributes\":{\"name\":\"Test-List_On_Call_escalation_policies_returns_OK_response-1792569360\",\"resolve_page_on_policy_end\":true,\"retries\":2,\"tags\":[]},\"relationships\":{\"steps\":{\"data\":[{\"id\":\"cf613965-854c-48fd-a299-cda5d491a132\",\"type\":\"steps\"},{\"id\":\"11d3ca7e-aa82-4dcc-9147-6a0fec5f222c\",\"type\":\"steps\"}]},\"teams\":{\"data\":[{\"id\":\"32f0af28-fc1d-4b2e-8e1d-9a39b3fb3aee\",\"type\":\"teams\"}]}}}],\"meta\":{\"page\":{\"type\":\"number_size\",\"number\":0,\"size\":20,\"total\":1,\"first_number\":0,\"prev_number\":null,\"next_number\":null,\"last_number\":0}},\"included\":[{\"id\":\"cf613965-854c-48fd-a299-cda5d491a132\",\"type\":\"steps\",\"attributes\":{\"assignment\":\"default\",\"escalate_after_seconds\":3600},\"relationships\":{\"targets\":{\"data\":[{\"id\":\"32f0af28-fc1d-4b2e-8e1d-9a39b3fb3aee\",\"type\":\"teams\"},{\"id\":\"4be12f3a-531d-472d-8597-796017572212\",\"type\":\"schedules\"},{\"id\":\"4be12f3a-531d-472d-8597-796017572212_previous\",\"type\":\"schedule_target\"},{\"id\":\"b59d1cec-8aae-4b77-90b1-51383a15fa9c\",\"type\":\"users\"}]}}},{\"id\":\"4be12f3a-531d-472d-8597-796017572212_previous\",\"type\":\"schedule_target\",\"attributes\":{\"position\":\"previous\"},\"relationships\":{\"schedule\":{\"data\":{\"id\":\"4be12f3a-531d-472d-8597-796017572212\",\"type\":\"schedules\"}}}},{\"id\":\"11d3ca7e-aa82-4dcc-9147-6a0fec5f222c\",\"type\":\"steps\",\"attributes\":{\"assignment\":\"round-robin\",\"escalate_after_seconds\":3600},\"relationships\":{\"targets\":{\"data\":[{\"id\":\"32f0af28-fc1d-4b2e-8e1d-9a39b3fb3aee\",\"type\":\"teams\"}]}}},{\"id\":\"32f0af28-fc1d-4b2e-8e1d-9a39b3fb3aee\",\"type\":\"teams\",\"attributes\":{\"avatar\":\"\",\"description\":\"\",\"handle\":\"test-handle-4b526d34522a83e5\",\"name\":\"test-name-4b526d34522a83e5\"}},{\"id\":\"4be12f3a-531d-472d-8597-796017572212\",\"type\":\"schedules\",\"attributes\":{\"name\":\"Test-List_On_Call_escalation_policies_returns_OK_response-1792569360\",\"tags\":[],\"time_zone\":\"America/New_York\"},\"relationships\":{\"layers\":{\"data\":[{\"id\":\"397a6351-607e-4151-8617-19f1b2107533\",\"type\":\"layers\"}]},\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}}},{\"id\":\"b59d1cec-8aae-4b77-90b1-51383a15fa9c\",\"type\":\"users\",\"attributes\":{\"email\":\"test-list_on_call_escalation_policies_returns_ok_response-1792569360@datadoghq.com\",\"name\":\"\",\"status\":\"pending\"}}]}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/on-call/escalation-policies/fa88ac55-aa5d-470d-abbd-5a160d6f4d5c", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/on-call/schedules/4be12f3a-531d-472d-8597-796017572212", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/team/32f0af28-fc1d-4b2e-8e1d-9a39b3fb3aee", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/users/b59d1cec-8aae-4b77-90b1-51383a15fa9c", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + } + ], + "scenario": "List On-Call escalation policies returns \"OK\" response", + "version": "v2" + }, { "feature": "On-Call", "frozen_at": "2025-12-12T14:40:40.219Z",