diff --git a/.apigentools-info b/.apigentools-info index 7ba703377a0..46cec5c0902 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2025-06-04 10:47:59.772145", - "spec_repo_commit": "1f58e760" + "regenerated": "2025-06-04 12:51:37.536059", + "spec_repo_commit": "35a63137" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2025-06-04 10:47:59.788728", - "spec_repo_commit": "1f58e760" + "regenerated": "2025-06-04 12:51:37.554861", + "spec_repo_commit": "35a63137" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index b26a7733a20..c4ba008b54d 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -13844,6 +13844,19 @@ components: - retryStrategy - fallbackStepName type: object + Escalation: + description: Represents an escalation policy step. + properties: + id: + description: Unique identifier of the escalation step. + type: string + relationships: + $ref: '#/components/schemas/EscalationRelationships' + type: + $ref: '#/components/schemas/EscalationType' + required: + - type + type: object EscalationPolicy: description: Represents a complete escalation policy response, including policy data and optionally included related resources. @@ -14353,6 +14366,46 @@ components: type: string x-enum-varnames: - USERS + EscalationRelationships: + description: Contains the relationships of an escalation object, including its + responders. + properties: + responders: + $ref: '#/components/schemas/EscalationRelationshipsResponders' + type: object + EscalationRelationshipsResponders: + description: Lists the users involved in a specific step of the escalation policy. + properties: + data: + description: Array of user references assigned as responders for this escalation + step. + items: + $ref: '#/components/schemas/EscalationRelationshipsRespondersDataItems' + type: array + type: object + EscalationRelationshipsRespondersDataItems: + description: Represents a user assigned to an escalation step. + properties: + id: + description: Unique identifier of the user assigned to the escalation step. + example: '' + type: string + type: + $ref: '#/components/schemas/EscalationRelationshipsRespondersDataItemsType' + required: + - type + - id + type: object + EscalationRelationshipsRespondersDataItemsType: + default: users + description: Represents the resource type for users assigned as responders in + an escalation step. + enum: + - users + example: users + type: string + x-enum-varnames: + - USERS EscalationTarget: description: Represents an escalation target, which can be a team, user, or schedule. @@ -14369,6 +14422,16 @@ components: $ref: '#/components/schemas/EscalationTarget' type: array type: object + EscalationType: + default: escalation_policy_steps + description: Represents the resource type for individual steps in an escalation + policy used during incident response. + enum: + - escalation_policy_steps + example: escalation_policy_steps + type: string + x-enum-varnames: + - ESCALATION_POLICY_STEPS Event: description: The metadata associated with a request. properties: @@ -37980,6 +38043,150 @@ components: $ref: '#/components/schemas/TeamLink' type: array type: object + TeamOnCallResponders: + description: Root object representing a team's on-call responder configuration. + example: + data: + id: 111ee23r-aaaaa-aaaa-aaww-1234wertsd23 + relationships: + escalations: + data: + - id: 111ee23r-aaaaa-aaaa-aaww-1234wertsd23 + type: escalation_policy_steps + responders: + data: + - id: 111ee23r-aaaaa-aaaa-aaww-1234wertsd23 + type: users + type: team_oncall_responders + included: + - attributes: + email: test@test.com + name: Test User + status: active + id: 111ee23r-aaaaa-aaaa-aaww-1234wertsd23 + type: users + - id: 111ee23r-aaaaa-aaaa-aaww-1234wertsd23 + relationships: + responders: + data: + - id: 111ee23r-aaaaa-aaaa-aaww-1234wertsd23 + type: users + type: escalation_policy_steps + properties: + data: + $ref: '#/components/schemas/TeamOnCallRespondersData' + included: + description: The `TeamOnCallResponders` `included`. + items: + $ref: '#/components/schemas/TeamOnCallRespondersIncluded' + type: array + type: object + TeamOnCallRespondersData: + description: Defines the main on-call responder object for a team, including + relationships and metadata. + properties: + id: + description: Unique identifier of the on-call responder configuration. + type: string + relationships: + $ref: '#/components/schemas/TeamOnCallRespondersDataRelationships' + type: + $ref: '#/components/schemas/TeamOnCallRespondersDataType' + required: + - type + type: object + TeamOnCallRespondersDataRelationships: + description: Relationship objects linked to a team's on-call responder configuration, + including escalations and responders. + properties: + escalations: + $ref: '#/components/schemas/TeamOnCallRespondersDataRelationshipsEscalations' + responders: + $ref: '#/components/schemas/TeamOnCallRespondersDataRelationshipsResponders' + type: object + TeamOnCallRespondersDataRelationshipsEscalations: + description: Defines the escalation policy steps linked to the team's on-call + configuration. + properties: + data: + description: Array of escalation step references. + items: + $ref: '#/components/schemas/TeamOnCallRespondersDataRelationshipsEscalationsDataItems' + type: array + type: object + TeamOnCallRespondersDataRelationshipsEscalationsDataItems: + description: Represents a link to a specific escalation policy step associated + with the on-call team. + properties: + id: + description: Unique identifier of the escalation step. + example: '' + type: string + type: + $ref: '#/components/schemas/TeamOnCallRespondersDataRelationshipsEscalationsDataItemsType' + required: + - type + - id + type: object + TeamOnCallRespondersDataRelationshipsEscalationsDataItemsType: + default: escalation_policy_steps + description: Identifies the resource type for escalation policy steps linked + to a team's on-call configuration. + enum: + - escalation_policy_steps + example: escalation_policy_steps + type: string + x-enum-varnames: + - ESCALATION_POLICY_STEPS + TeamOnCallRespondersDataRelationshipsResponders: + description: Defines the list of users assigned as on-call responders for the + team. + properties: + data: + description: Array of user references associated as responders. + items: + $ref: '#/components/schemas/TeamOnCallRespondersDataRelationshipsRespondersDataItems' + type: array + type: object + TeamOnCallRespondersDataRelationshipsRespondersDataItems: + description: Represents a user responder associated with the on-call team. + properties: + id: + description: Unique identifier of the responder. + example: '' + type: string + type: + $ref: '#/components/schemas/TeamOnCallRespondersDataRelationshipsRespondersDataItemsType' + required: + - type + - id + type: object + TeamOnCallRespondersDataRelationshipsRespondersDataItemsType: + default: users + description: Identifies the resource type for individual user entities associated + with on-call response. + enum: + - users + example: users + type: string + x-enum-varnames: + - USERS + TeamOnCallRespondersDataType: + default: team_oncall_responders + description: Represents the resource type for a group of users assigned to handle + on-call duties within a team. + enum: + - team_oncall_responders + example: team_oncall_responders + type: string + x-enum-varnames: + - TEAM_ONCALL_RESPONDERS + TeamOnCallRespondersIncluded: + description: Represents an union of related resources included in the response, + such as users and escalation steps. + oneOf: + - $ref: '#/components/schemas/User' + - $ref: '#/components/schemas/Escalation' TeamPermissionSetting: description: Team permission setting properties: @@ -52562,6 +52769,48 @@ paths: summary: Get the schedule on-call user tags: - On-Call + /api/v2/on-call/teams/{team_id}/on-call: + get: + description: Get a team's on-call users at a given time + operationId: GetTeamOnCallUsers + parameters: + - description: 'Comma-separated list of included relationships to be returned. + Allowed values: `responders`, `escalations`, `escalations.responders`.' + in: query + name: include + schema: + type: string + - description: The team ID + in: path + name: team_id + required: true + schema: + example: 27590dae-47be-4a7d-9abf-8f4e45124020 + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/TeamOnCallResponders' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: [] + summary: Get team on-call users + tags: + - On-Call /api/v2/on-call/teams/{team_id}/routing-rules: get: description: Get a team's On-Call routing rules diff --git a/examples/v2/on-call/GetTeamOnCallUsers.java b/examples/v2/on-call/GetTeamOnCallUsers.java new file mode 100644 index 00000000000..ead5411f44e --- /dev/null +++ b/examples/v2/on-call/GetTeamOnCallUsers.java @@ -0,0 +1,32 @@ +// Get team on-call users 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.GetTeamOnCallUsersOptionalParameters; +import com.datadog.api.client.v2.model.TeamOnCallResponders; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + OnCallApi apiInstance = new OnCallApi(defaultClient); + + // there are valid "routing_rules" in the system + String ROUTING_RULES_DATA_ID = System.getenv("ROUTING_RULES_DATA_ID"); + + try { + TeamOnCallResponders result = + apiInstance.getTeamOnCallUsers( + ROUTING_RULES_DATA_ID, + new GetTeamOnCallUsersOptionalParameters() + .include("responders,escalations.responders")); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling OnCallApi#getTeamOnCallUsers"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/datadog/api/client/v2/api/OnCallApi.java b/src/main/java/com/datadog/api/client/v2/api/OnCallApi.java index 02811c7a337..d7f61c7710a 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 @@ -11,6 +11,7 @@ import com.datadog.api.client.v2.model.ScheduleCreateRequest; import com.datadog.api.client.v2.model.ScheduleUpdateRequest; import com.datadog.api.client.v2.model.Shift; +import com.datadog.api.client.v2.model.TeamOnCallResponders; import com.datadog.api.client.v2.model.TeamRoutingRules; import com.datadog.api.client.v2.model.TeamRoutingRulesRequest; import jakarta.ws.rs.client.Invocation; @@ -1546,6 +1547,205 @@ public CompletableFuture> getScheduleOnCallUserWithHttpInfoAs new GenericType() {}); } + /** Manage optional parameters to getTeamOnCallUsers. */ + public static class GetTeamOnCallUsersOptionalParameters { + private String include; + + /** + * Set include. + * + * @param include Comma-separated list of included relationships to be returned. Allowed values: + * responders, escalations, escalations.responders. + * (optional) + * @return GetTeamOnCallUsersOptionalParameters + */ + public GetTeamOnCallUsersOptionalParameters include(String include) { + this.include = include; + return this; + } + } + + /** + * Get team on-call users. + * + *

See {@link #getTeamOnCallUsersWithHttpInfo}. + * + * @param teamId The team ID (required) + * @return TeamOnCallResponders + * @throws ApiException if fails to make API call + */ + public TeamOnCallResponders getTeamOnCallUsers(String teamId) throws ApiException { + return getTeamOnCallUsersWithHttpInfo(teamId, new GetTeamOnCallUsersOptionalParameters()) + .getData(); + } + + /** + * Get team on-call users. + * + *

See {@link #getTeamOnCallUsersWithHttpInfoAsync}. + * + * @param teamId The team ID (required) + * @return CompletableFuture<TeamOnCallResponders> + */ + public CompletableFuture getTeamOnCallUsersAsync(String teamId) { + return getTeamOnCallUsersWithHttpInfoAsync(teamId, new GetTeamOnCallUsersOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get team on-call users. + * + *

See {@link #getTeamOnCallUsersWithHttpInfo}. + * + * @param teamId The team ID (required) + * @param parameters Optional parameters for the request. + * @return TeamOnCallResponders + * @throws ApiException if fails to make API call + */ + public TeamOnCallResponders getTeamOnCallUsers( + String teamId, GetTeamOnCallUsersOptionalParameters parameters) throws ApiException { + return getTeamOnCallUsersWithHttpInfo(teamId, parameters).getData(); + } + + /** + * Get team on-call users. + * + *

See {@link #getTeamOnCallUsersWithHttpInfoAsync}. + * + * @param teamId The team ID (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<TeamOnCallResponders> + */ + public CompletableFuture getTeamOnCallUsersAsync( + String teamId, GetTeamOnCallUsersOptionalParameters parameters) { + return getTeamOnCallUsersWithHttpInfoAsync(teamId, parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get a team's on-call users at a given time + * + * @param teamId The team ID (required) + * @param parameters Optional parameters for the request. + * @return ApiResponse<TeamOnCallResponders> + * @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 -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse getTeamOnCallUsersWithHttpInfo( + String teamId, GetTeamOnCallUsersOptionalParameters parameters) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'teamId' is set + if (teamId == null) { + throw new ApiException( + 400, "Missing the required parameter 'teamId' when calling getTeamOnCallUsers"); + } + String include = parameters.include; + // create path and map variables + String localVarPath = + "/api/v2/on-call/teams/{team_id}/on-call" + .replaceAll("\\{" + "team_id" + "\\}", apiClient.escapeString(teamId.toString())); + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "include", include)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.OnCallApi.getTeamOnCallUsers", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get team on-call users. + * + *

See {@link #getTeamOnCallUsersWithHttpInfo}. + * + * @param teamId The team ID (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<TeamOnCallResponders>> + */ + public CompletableFuture> getTeamOnCallUsersWithHttpInfoAsync( + String teamId, GetTeamOnCallUsersOptionalParameters parameters) { + Object localVarPostBody = null; + + // verify the required parameter 'teamId' is set + if (teamId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'teamId' when calling getTeamOnCallUsers")); + return result; + } + String include = parameters.include; + // create path and map variables + String localVarPath = + "/api/v2/on-call/teams/{team_id}/on-call" + .replaceAll("\\{" + "team_id" + "\\}", apiClient.escapeString(teamId.toString())); + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "include", include)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.OnCallApi.getTeamOnCallUsers", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + } 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 setOnCallTeamRoutingRules. */ public static class SetOnCallTeamRoutingRulesOptionalParameters { private String include; diff --git a/src/main/java/com/datadog/api/client/v2/model/Escalation.java b/src/main/java/com/datadog/api/client/v2/model/Escalation.java new file mode 100644 index 00000000000..3f5b87f8bd5 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/Escalation.java @@ -0,0 +1,206 @@ +/* + * 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 step. */ +@JsonPropertyOrder({ + Escalation.JSON_PROPERTY_ID, + Escalation.JSON_PROPERTY_RELATIONSHIPS, + Escalation.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class Escalation { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private EscalationRelationships relationships; + + public static final String JSON_PROPERTY_TYPE = "type"; + private EscalationType type = EscalationType.ESCALATION_POLICY_STEPS; + + public Escalation() {} + + @JsonCreator + public Escalation( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) EscalationType type) { + this.type = type; + this.unparsed |= !type.isValid(); + } + + public Escalation id(String id) { + this.id = id; + return this; + } + + /** + * Unique identifier of the escalation step. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Escalation relationships(EscalationRelationships relationships) { + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + return this; + } + + /** + * Contains the relationships of an escalation object, including its responders. + * + * @return relationships + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EscalationRelationships getRelationships() { + return relationships; + } + + public void setRelationships(EscalationRelationships relationships) { + this.relationships = relationships; + } + + public Escalation type(EscalationType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Represents the resource type for individual steps in an escalation policy used during incident + * response. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public EscalationType getType() { + return type; + } + + public void setType(EscalationType 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 Escalation + */ + @JsonAnySetter + public Escalation 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 Escalation object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Escalation escalation = (Escalation) o; + return Objects.equals(this.id, escalation.id) + && Objects.equals(this.relationships, escalation.relationships) + && Objects.equals(this.type, escalation.type) + && Objects.equals(this.additionalProperties, escalation.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, relationships, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Escalation {\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/EscalationRelationships.java b/src/main/java/com/datadog/api/client/v2/model/EscalationRelationships.java new file mode 100644 index 00000000000..a923071dd0e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/EscalationRelationships.java @@ -0,0 +1,136 @@ +/* + * 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; + +/** Contains the relationships of an escalation object, including its responders. */ +@JsonPropertyOrder({EscalationRelationships.JSON_PROPERTY_RESPONDERS}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class EscalationRelationships { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_RESPONDERS = "responders"; + private EscalationRelationshipsResponders responders; + + public EscalationRelationships responders(EscalationRelationshipsResponders responders) { + this.responders = responders; + this.unparsed |= responders.unparsed; + return this; + } + + /** + * Lists the users involved in a specific step of the escalation policy. + * + * @return responders + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RESPONDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EscalationRelationshipsResponders getResponders() { + return responders; + } + + public void setResponders(EscalationRelationshipsResponders responders) { + this.responders = responders; + } + + /** + * 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 EscalationRelationships + */ + @JsonAnySetter + public EscalationRelationships 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 EscalationRelationships object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EscalationRelationships escalationRelationships = (EscalationRelationships) o; + return Objects.equals(this.responders, escalationRelationships.responders) + && Objects.equals(this.additionalProperties, escalationRelationships.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(responders, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EscalationRelationships {\n"); + sb.append(" responders: ").append(toIndentedString(responders)).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/EscalationRelationshipsResponders.java b/src/main/java/com/datadog/api/client/v2/model/EscalationRelationshipsResponders.java new file mode 100644 index 00000000000..9e1ccdb1870 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/EscalationRelationshipsResponders.java @@ -0,0 +1,153 @@ +/* + * 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; + +/** Lists the users involved in a specific step of the escalation policy. */ +@JsonPropertyOrder({EscalationRelationshipsResponders.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class EscalationRelationshipsResponders { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = null; + + public EscalationRelationshipsResponders data( + List data) { + this.data = data; + for (EscalationRelationshipsRespondersDataItems item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public EscalationRelationshipsResponders addDataItem( + EscalationRelationshipsRespondersDataItems dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * Array of user references assigned as responders for this escalation step. + * + * @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; + } + + /** + * 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 EscalationRelationshipsResponders + */ + @JsonAnySetter + public EscalationRelationshipsResponders 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 EscalationRelationshipsResponders object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EscalationRelationshipsResponders escalationRelationshipsResponders = + (EscalationRelationshipsResponders) o; + return Objects.equals(this.data, escalationRelationshipsResponders.data) + && Objects.equals( + this.additionalProperties, escalationRelationshipsResponders.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EscalationRelationshipsResponders {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/EscalationRelationshipsRespondersDataItems.java b/src/main/java/com/datadog/api/client/v2/model/EscalationRelationshipsRespondersDataItems.java new file mode 100644 index 00000000000..7d8854a4eda --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/EscalationRelationshipsRespondersDataItems.java @@ -0,0 +1,185 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Represents a user assigned to an escalation step. */ +@JsonPropertyOrder({ + EscalationRelationshipsRespondersDataItems.JSON_PROPERTY_ID, + EscalationRelationshipsRespondersDataItems.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class EscalationRelationshipsRespondersDataItems { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private EscalationRelationshipsRespondersDataItemsType type = + EscalationRelationshipsRespondersDataItemsType.USERS; + + public EscalationRelationshipsRespondersDataItems() {} + + @JsonCreator + public EscalationRelationshipsRespondersDataItems( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + EscalationRelationshipsRespondersDataItemsType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public EscalationRelationshipsRespondersDataItems id(String id) { + this.id = id; + return this; + } + + /** + * Unique identifier of the user assigned to the escalation step. + * + * @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 EscalationRelationshipsRespondersDataItems type( + EscalationRelationshipsRespondersDataItemsType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Represents the resource type for users assigned as responders in an escalation step. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public EscalationRelationshipsRespondersDataItemsType getType() { + return type; + } + + public void setType(EscalationRelationshipsRespondersDataItemsType 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 EscalationRelationshipsRespondersDataItems + */ + @JsonAnySetter + public EscalationRelationshipsRespondersDataItems 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 EscalationRelationshipsRespondersDataItems object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EscalationRelationshipsRespondersDataItems escalationRelationshipsRespondersDataItems = + (EscalationRelationshipsRespondersDataItems) o; + return Objects.equals(this.id, escalationRelationshipsRespondersDataItems.id) + && Objects.equals(this.type, escalationRelationshipsRespondersDataItems.type) + && Objects.equals( + this.additionalProperties, + escalationRelationshipsRespondersDataItems.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EscalationRelationshipsRespondersDataItems {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/EscalationRelationshipsRespondersDataItemsType.java b/src/main/java/com/datadog/api/client/v2/model/EscalationRelationshipsRespondersDataItemsType.java new file mode 100644 index 00000000000..17e69d3e3d9 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/EscalationRelationshipsRespondersDataItemsType.java @@ -0,0 +1,62 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Represents the resource type for users assigned as responders in an escalation step. */ +@JsonSerialize( + using = + EscalationRelationshipsRespondersDataItemsType + .EscalationRelationshipsRespondersDataItemsTypeSerializer.class) +public class EscalationRelationshipsRespondersDataItemsType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("users")); + + public static final EscalationRelationshipsRespondersDataItemsType USERS = + new EscalationRelationshipsRespondersDataItemsType("users"); + + EscalationRelationshipsRespondersDataItemsType(String value) { + super(value, allowedValues); + } + + public static class EscalationRelationshipsRespondersDataItemsTypeSerializer + extends StdSerializer { + public EscalationRelationshipsRespondersDataItemsTypeSerializer( + Class t) { + super(t); + } + + public EscalationRelationshipsRespondersDataItemsTypeSerializer() { + this(null); + } + + @Override + public void serialize( + EscalationRelationshipsRespondersDataItemsType value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static EscalationRelationshipsRespondersDataItemsType fromValue(String value) { + return new EscalationRelationshipsRespondersDataItemsType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/EscalationType.java b/src/main/java/com/datadog/api/client/v2/model/EscalationType.java new file mode 100644 index 00000000000..fa77f1901d6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/EscalationType.java @@ -0,0 +1,58 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** + * Represents the resource type for individual steps in an escalation policy used during incident + * response. + */ +@JsonSerialize(using = EscalationType.EscalationTypeSerializer.class) +public class EscalationType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("escalation_policy_steps")); + + public static final EscalationType ESCALATION_POLICY_STEPS = + new EscalationType("escalation_policy_steps"); + + EscalationType(String value) { + super(value, allowedValues); + } + + public static class EscalationTypeSerializer extends StdSerializer { + public EscalationTypeSerializer(Class t) { + super(t); + } + + public EscalationTypeSerializer() { + this(null); + } + + @Override + public void serialize(EscalationType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static EscalationType fromValue(String value) { + return new EscalationType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamOnCallResponders.java b/src/main/java/com/datadog/api/client/v2/model/TeamOnCallResponders.java new file mode 100644 index 00000000000..ff440bb1446 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamOnCallResponders.java @@ -0,0 +1,179 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.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; + +/** Root object representing a team's on-call responder configuration. */ +@JsonPropertyOrder({ + TeamOnCallResponders.JSON_PROPERTY_DATA, + TeamOnCallResponders.JSON_PROPERTY_INCLUDED +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamOnCallResponders { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private TeamOnCallRespondersData data; + + public static final String JSON_PROPERTY_INCLUDED = "included"; + private List included = null; + + public TeamOnCallResponders data(TeamOnCallRespondersData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Defines the main on-call responder object for a team, including relationships and metadata. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TeamOnCallRespondersData getData() { + return data; + } + + public void setData(TeamOnCallRespondersData data) { + this.data = data; + } + + public TeamOnCallResponders included(List included) { + this.included = included; + for (TeamOnCallRespondersIncluded item : included) { + this.unparsed |= item.unparsed; + } + return this; + } + + public TeamOnCallResponders addIncludedItem(TeamOnCallRespondersIncluded includedItem) { + if (this.included == null) { + this.included = new ArrayList<>(); + } + this.included.add(includedItem); + this.unparsed |= includedItem.unparsed; + return this; + } + + /** + * The TeamOnCallResponders included. + * + * @return included + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INCLUDED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getIncluded() { + return included; + } + + public void setIncluded(List included) { + this.included = included; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TeamOnCallResponders + */ + @JsonAnySetter + public TeamOnCallResponders 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 TeamOnCallResponders object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamOnCallResponders teamOnCallResponders = (TeamOnCallResponders) o; + return Objects.equals(this.data, teamOnCallResponders.data) + && Objects.equals(this.included, teamOnCallResponders.included) + && Objects.equals(this.additionalProperties, teamOnCallResponders.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, included, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamOnCallResponders {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" included: ").append(toIndentedString(included)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamOnCallRespondersData.java b/src/main/java/com/datadog/api/client/v2/model/TeamOnCallRespondersData.java new file mode 100644 index 00000000000..90e8dc10a33 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamOnCallRespondersData.java @@ -0,0 +1,209 @@ +/* + * 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; + +/** Defines the main on-call responder object for a team, including relationships and metadata. */ +@JsonPropertyOrder({ + TeamOnCallRespondersData.JSON_PROPERTY_ID, + TeamOnCallRespondersData.JSON_PROPERTY_RELATIONSHIPS, + TeamOnCallRespondersData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamOnCallRespondersData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private TeamOnCallRespondersDataRelationships relationships; + + public static final String JSON_PROPERTY_TYPE = "type"; + private TeamOnCallRespondersDataType type = TeamOnCallRespondersDataType.TEAM_ONCALL_RESPONDERS; + + public TeamOnCallRespondersData() {} + + @JsonCreator + public TeamOnCallRespondersData( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + TeamOnCallRespondersDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + } + + public TeamOnCallRespondersData id(String id) { + this.id = id; + return this; + } + + /** + * Unique identifier of the on-call responder configuration. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public TeamOnCallRespondersData relationships( + TeamOnCallRespondersDataRelationships relationships) { + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + return this; + } + + /** + * Relationship objects linked to a team's on-call responder configuration, including escalations + * and responders. + * + * @return relationships + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TeamOnCallRespondersDataRelationships getRelationships() { + return relationships; + } + + public void setRelationships(TeamOnCallRespondersDataRelationships relationships) { + this.relationships = relationships; + } + + public TeamOnCallRespondersData type(TeamOnCallRespondersDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Represents the resource type for a group of users assigned to handle on-call duties within a + * team. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TeamOnCallRespondersDataType getType() { + return type; + } + + public void setType(TeamOnCallRespondersDataType 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 TeamOnCallRespondersData + */ + @JsonAnySetter + public TeamOnCallRespondersData 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 TeamOnCallRespondersData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamOnCallRespondersData teamOnCallRespondersData = (TeamOnCallRespondersData) o; + return Objects.equals(this.id, teamOnCallRespondersData.id) + && Objects.equals(this.relationships, teamOnCallRespondersData.relationships) + && Objects.equals(this.type, teamOnCallRespondersData.type) + && Objects.equals(this.additionalProperties, teamOnCallRespondersData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, relationships, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamOnCallRespondersData {\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/TeamOnCallRespondersDataRelationships.java b/src/main/java/com/datadog/api/client/v2/model/TeamOnCallRespondersDataRelationships.java new file mode 100644 index 00000000000..6c50fe45b17 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamOnCallRespondersDataRelationships.java @@ -0,0 +1,173 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * Relationship objects linked to a team's on-call responder configuration, including escalations + * and responders. + */ +@JsonPropertyOrder({ + TeamOnCallRespondersDataRelationships.JSON_PROPERTY_ESCALATIONS, + TeamOnCallRespondersDataRelationships.JSON_PROPERTY_RESPONDERS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamOnCallRespondersDataRelationships { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ESCALATIONS = "escalations"; + private TeamOnCallRespondersDataRelationshipsEscalations escalations; + + public static final String JSON_PROPERTY_RESPONDERS = "responders"; + private TeamOnCallRespondersDataRelationshipsResponders responders; + + public TeamOnCallRespondersDataRelationships escalations( + TeamOnCallRespondersDataRelationshipsEscalations escalations) { + this.escalations = escalations; + this.unparsed |= escalations.unparsed; + return this; + } + + /** + * Defines the escalation policy steps linked to the team's on-call configuration. + * + * @return escalations + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ESCALATIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TeamOnCallRespondersDataRelationshipsEscalations getEscalations() { + return escalations; + } + + public void setEscalations(TeamOnCallRespondersDataRelationshipsEscalations escalations) { + this.escalations = escalations; + } + + public TeamOnCallRespondersDataRelationships responders( + TeamOnCallRespondersDataRelationshipsResponders responders) { + this.responders = responders; + this.unparsed |= responders.unparsed; + return this; + } + + /** + * Defines the list of users assigned as on-call responders for the team. + * + * @return responders + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RESPONDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TeamOnCallRespondersDataRelationshipsResponders getResponders() { + return responders; + } + + public void setResponders(TeamOnCallRespondersDataRelationshipsResponders responders) { + this.responders = responders; + } + + /** + * 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 TeamOnCallRespondersDataRelationships + */ + @JsonAnySetter + public TeamOnCallRespondersDataRelationships 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 TeamOnCallRespondersDataRelationships object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamOnCallRespondersDataRelationships teamOnCallRespondersDataRelationships = + (TeamOnCallRespondersDataRelationships) o; + return Objects.equals(this.escalations, teamOnCallRespondersDataRelationships.escalations) + && Objects.equals(this.responders, teamOnCallRespondersDataRelationships.responders) + && Objects.equals( + this.additionalProperties, teamOnCallRespondersDataRelationships.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(escalations, responders, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamOnCallRespondersDataRelationships {\n"); + sb.append(" escalations: ").append(toIndentedString(escalations)).append("\n"); + sb.append(" responders: ").append(toIndentedString(responders)).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/TeamOnCallRespondersDataRelationshipsEscalations.java b/src/main/java/com/datadog/api/client/v2/model/TeamOnCallRespondersDataRelationshipsEscalations.java new file mode 100644 index 00000000000..42ec57f4fb7 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamOnCallRespondersDataRelationshipsEscalations.java @@ -0,0 +1,156 @@ +/* + * 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; + +/** Defines the escalation policy steps linked to the team's on-call configuration. */ +@JsonPropertyOrder({TeamOnCallRespondersDataRelationshipsEscalations.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamOnCallRespondersDataRelationshipsEscalations { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = null; + + public TeamOnCallRespondersDataRelationshipsEscalations data( + List data) { + this.data = data; + for (TeamOnCallRespondersDataRelationshipsEscalationsDataItems item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public TeamOnCallRespondersDataRelationshipsEscalations addDataItem( + TeamOnCallRespondersDataRelationshipsEscalationsDataItems dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * Array of escalation step references. + * + * @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; + } + + /** + * 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 TeamOnCallRespondersDataRelationshipsEscalations + */ + @JsonAnySetter + public TeamOnCallRespondersDataRelationshipsEscalations 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 TeamOnCallRespondersDataRelationshipsEscalations object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamOnCallRespondersDataRelationshipsEscalations + teamOnCallRespondersDataRelationshipsEscalations = + (TeamOnCallRespondersDataRelationshipsEscalations) o; + return Objects.equals(this.data, teamOnCallRespondersDataRelationshipsEscalations.data) + && Objects.equals( + this.additionalProperties, + teamOnCallRespondersDataRelationshipsEscalations.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamOnCallRespondersDataRelationshipsEscalations {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamOnCallRespondersDataRelationshipsEscalationsDataItems.java b/src/main/java/com/datadog/api/client/v2/model/TeamOnCallRespondersDataRelationshipsEscalationsDataItems.java new file mode 100644 index 00000000000..9e15a649352 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamOnCallRespondersDataRelationshipsEscalationsDataItems.java @@ -0,0 +1,190 @@ +/* + * 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 link to a specific escalation policy step associated with the on-call team. */ +@JsonPropertyOrder({ + TeamOnCallRespondersDataRelationshipsEscalationsDataItems.JSON_PROPERTY_ID, + TeamOnCallRespondersDataRelationshipsEscalationsDataItems.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamOnCallRespondersDataRelationshipsEscalationsDataItems { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private TeamOnCallRespondersDataRelationshipsEscalationsDataItemsType type = + TeamOnCallRespondersDataRelationshipsEscalationsDataItemsType.ESCALATION_POLICY_STEPS; + + public TeamOnCallRespondersDataRelationshipsEscalationsDataItems() {} + + @JsonCreator + public TeamOnCallRespondersDataRelationshipsEscalationsDataItems( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + TeamOnCallRespondersDataRelationshipsEscalationsDataItemsType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public TeamOnCallRespondersDataRelationshipsEscalationsDataItems id(String id) { + this.id = id; + return this; + } + + /** + * Unique identifier of the escalation step. + * + * @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 TeamOnCallRespondersDataRelationshipsEscalationsDataItems type( + TeamOnCallRespondersDataRelationshipsEscalationsDataItemsType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Identifies the resource type for escalation policy steps linked to a team's on-call + * configuration. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TeamOnCallRespondersDataRelationshipsEscalationsDataItemsType getType() { + return type; + } + + public void setType(TeamOnCallRespondersDataRelationshipsEscalationsDataItemsType 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 TeamOnCallRespondersDataRelationshipsEscalationsDataItems + */ + @JsonAnySetter + public TeamOnCallRespondersDataRelationshipsEscalationsDataItems 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 TeamOnCallRespondersDataRelationshipsEscalationsDataItems object is equal + * to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamOnCallRespondersDataRelationshipsEscalationsDataItems + teamOnCallRespondersDataRelationshipsEscalationsDataItems = + (TeamOnCallRespondersDataRelationshipsEscalationsDataItems) o; + return Objects.equals(this.id, teamOnCallRespondersDataRelationshipsEscalationsDataItems.id) + && Objects.equals(this.type, teamOnCallRespondersDataRelationshipsEscalationsDataItems.type) + && Objects.equals( + this.additionalProperties, + teamOnCallRespondersDataRelationshipsEscalationsDataItems.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamOnCallRespondersDataRelationshipsEscalationsDataItems {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamOnCallRespondersDataRelationshipsEscalationsDataItemsType.java b/src/main/java/com/datadog/api/client/v2/model/TeamOnCallRespondersDataRelationshipsEscalationsDataItemsType.java new file mode 100644 index 00000000000..1dc8e982a75 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamOnCallRespondersDataRelationshipsEscalationsDataItemsType.java @@ -0,0 +1,70 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** + * Identifies the resource type for escalation policy steps linked to a team's on-call + * configuration. + */ +@JsonSerialize( + using = + TeamOnCallRespondersDataRelationshipsEscalationsDataItemsType + .TeamOnCallRespondersDataRelationshipsEscalationsDataItemsTypeSerializer.class) +public class TeamOnCallRespondersDataRelationshipsEscalationsDataItemsType + extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("escalation_policy_steps")); + + public static final TeamOnCallRespondersDataRelationshipsEscalationsDataItemsType + ESCALATION_POLICY_STEPS = + new TeamOnCallRespondersDataRelationshipsEscalationsDataItemsType( + "escalation_policy_steps"); + + TeamOnCallRespondersDataRelationshipsEscalationsDataItemsType(String value) { + super(value, allowedValues); + } + + public static class TeamOnCallRespondersDataRelationshipsEscalationsDataItemsTypeSerializer + extends StdSerializer { + public TeamOnCallRespondersDataRelationshipsEscalationsDataItemsTypeSerializer( + Class t) { + super(t); + } + + public TeamOnCallRespondersDataRelationshipsEscalationsDataItemsTypeSerializer() { + this(null); + } + + @Override + public void serialize( + TeamOnCallRespondersDataRelationshipsEscalationsDataItemsType value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static TeamOnCallRespondersDataRelationshipsEscalationsDataItemsType fromValue( + String value) { + return new TeamOnCallRespondersDataRelationshipsEscalationsDataItemsType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamOnCallRespondersDataRelationshipsResponders.java b/src/main/java/com/datadog/api/client/v2/model/TeamOnCallRespondersDataRelationshipsResponders.java new file mode 100644 index 00000000000..064e081e391 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamOnCallRespondersDataRelationshipsResponders.java @@ -0,0 +1,156 @@ +/* + * 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; + +/** Defines the list of users assigned as on-call responders for the team. */ +@JsonPropertyOrder({TeamOnCallRespondersDataRelationshipsResponders.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamOnCallRespondersDataRelationshipsResponders { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = null; + + public TeamOnCallRespondersDataRelationshipsResponders data( + List data) { + this.data = data; + for (TeamOnCallRespondersDataRelationshipsRespondersDataItems item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public TeamOnCallRespondersDataRelationshipsResponders addDataItem( + TeamOnCallRespondersDataRelationshipsRespondersDataItems dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * Array of user references associated as responders. + * + * @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; + } + + /** + * 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 TeamOnCallRespondersDataRelationshipsResponders + */ + @JsonAnySetter + public TeamOnCallRespondersDataRelationshipsResponders 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 TeamOnCallRespondersDataRelationshipsResponders object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamOnCallRespondersDataRelationshipsResponders + teamOnCallRespondersDataRelationshipsResponders = + (TeamOnCallRespondersDataRelationshipsResponders) o; + return Objects.equals(this.data, teamOnCallRespondersDataRelationshipsResponders.data) + && Objects.equals( + this.additionalProperties, + teamOnCallRespondersDataRelationshipsResponders.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamOnCallRespondersDataRelationshipsResponders {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamOnCallRespondersDataRelationshipsRespondersDataItems.java b/src/main/java/com/datadog/api/client/v2/model/TeamOnCallRespondersDataRelationshipsRespondersDataItems.java new file mode 100644 index 00000000000..3da66cd95ec --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamOnCallRespondersDataRelationshipsRespondersDataItems.java @@ -0,0 +1,189 @@ +/* + * 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 user responder associated with the on-call team. */ +@JsonPropertyOrder({ + TeamOnCallRespondersDataRelationshipsRespondersDataItems.JSON_PROPERTY_ID, + TeamOnCallRespondersDataRelationshipsRespondersDataItems.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamOnCallRespondersDataRelationshipsRespondersDataItems { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private TeamOnCallRespondersDataRelationshipsRespondersDataItemsType type = + TeamOnCallRespondersDataRelationshipsRespondersDataItemsType.USERS; + + public TeamOnCallRespondersDataRelationshipsRespondersDataItems() {} + + @JsonCreator + public TeamOnCallRespondersDataRelationshipsRespondersDataItems( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + TeamOnCallRespondersDataRelationshipsRespondersDataItemsType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public TeamOnCallRespondersDataRelationshipsRespondersDataItems id(String id) { + this.id = id; + return this; + } + + /** + * Unique identifier of the responder. + * + * @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 TeamOnCallRespondersDataRelationshipsRespondersDataItems type( + TeamOnCallRespondersDataRelationshipsRespondersDataItemsType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Identifies the resource type for individual user entities associated with on-call response. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TeamOnCallRespondersDataRelationshipsRespondersDataItemsType getType() { + return type; + } + + public void setType(TeamOnCallRespondersDataRelationshipsRespondersDataItemsType 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 TeamOnCallRespondersDataRelationshipsRespondersDataItems + */ + @JsonAnySetter + public TeamOnCallRespondersDataRelationshipsRespondersDataItems 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 TeamOnCallRespondersDataRelationshipsRespondersDataItems object is equal to + * o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamOnCallRespondersDataRelationshipsRespondersDataItems + teamOnCallRespondersDataRelationshipsRespondersDataItems = + (TeamOnCallRespondersDataRelationshipsRespondersDataItems) o; + return Objects.equals(this.id, teamOnCallRespondersDataRelationshipsRespondersDataItems.id) + && Objects.equals(this.type, teamOnCallRespondersDataRelationshipsRespondersDataItems.type) + && Objects.equals( + this.additionalProperties, + teamOnCallRespondersDataRelationshipsRespondersDataItems.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamOnCallRespondersDataRelationshipsRespondersDataItems {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamOnCallRespondersDataRelationshipsRespondersDataItemsType.java b/src/main/java/com/datadog/api/client/v2/model/TeamOnCallRespondersDataRelationshipsRespondersDataItemsType.java new file mode 100644 index 00000000000..692427b5608 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamOnCallRespondersDataRelationshipsRespondersDataItemsType.java @@ -0,0 +1,64 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Identifies the resource type for individual user entities associated with on-call response. */ +@JsonSerialize( + using = + TeamOnCallRespondersDataRelationshipsRespondersDataItemsType + .TeamOnCallRespondersDataRelationshipsRespondersDataItemsTypeSerializer.class) +public class TeamOnCallRespondersDataRelationshipsRespondersDataItemsType + extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("users")); + + public static final TeamOnCallRespondersDataRelationshipsRespondersDataItemsType USERS = + new TeamOnCallRespondersDataRelationshipsRespondersDataItemsType("users"); + + TeamOnCallRespondersDataRelationshipsRespondersDataItemsType(String value) { + super(value, allowedValues); + } + + public static class TeamOnCallRespondersDataRelationshipsRespondersDataItemsTypeSerializer + extends StdSerializer { + public TeamOnCallRespondersDataRelationshipsRespondersDataItemsTypeSerializer( + Class t) { + super(t); + } + + public TeamOnCallRespondersDataRelationshipsRespondersDataItemsTypeSerializer() { + this(null); + } + + @Override + public void serialize( + TeamOnCallRespondersDataRelationshipsRespondersDataItemsType value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static TeamOnCallRespondersDataRelationshipsRespondersDataItemsType fromValue( + String value) { + return new TeamOnCallRespondersDataRelationshipsRespondersDataItemsType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamOnCallRespondersDataType.java b/src/main/java/com/datadog/api/client/v2/model/TeamOnCallRespondersDataType.java new file mode 100644 index 00000000000..46e1f686ad3 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamOnCallRespondersDataType.java @@ -0,0 +1,60 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** + * Represents the resource type for a group of users assigned to handle on-call duties within a + * team. + */ +@JsonSerialize(using = TeamOnCallRespondersDataType.TeamOnCallRespondersDataTypeSerializer.class) +public class TeamOnCallRespondersDataType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("team_oncall_responders")); + + public static final TeamOnCallRespondersDataType TEAM_ONCALL_RESPONDERS = + new TeamOnCallRespondersDataType("team_oncall_responders"); + + TeamOnCallRespondersDataType(String value) { + super(value, allowedValues); + } + + public static class TeamOnCallRespondersDataTypeSerializer + extends StdSerializer { + public TeamOnCallRespondersDataTypeSerializer(Class t) { + super(t); + } + + public TeamOnCallRespondersDataTypeSerializer() { + this(null); + } + + @Override + public void serialize( + TeamOnCallRespondersDataType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static TeamOnCallRespondersDataType fromValue(String value) { + return new TeamOnCallRespondersDataType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamOnCallRespondersIncluded.java b/src/main/java/com/datadog/api/client/v2/model/TeamOnCallRespondersIncluded.java new file mode 100644 index 00000000000..3ef8ab55663 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamOnCallRespondersIncluded.java @@ -0,0 +1,275 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.AbstractOpenApiSchema; +import com.datadog.api.client.JSON; +import com.datadog.api.client.UnparsedObject; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.JsonToken; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.MapperFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import jakarta.ws.rs.core.GenericType; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; + +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +@JsonDeserialize( + using = TeamOnCallRespondersIncluded.TeamOnCallRespondersIncludedDeserializer.class) +@JsonSerialize(using = TeamOnCallRespondersIncluded.TeamOnCallRespondersIncludedSerializer.class) +public class TeamOnCallRespondersIncluded extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(TeamOnCallRespondersIncluded.class.getName()); + + @JsonIgnore public boolean unparsed = false; + + public static class TeamOnCallRespondersIncludedSerializer + extends StdSerializer { + public TeamOnCallRespondersIncludedSerializer(Class t) { + super(t); + } + + public TeamOnCallRespondersIncludedSerializer() { + this(null); + } + + @Override + public void serialize( + TeamOnCallRespondersIncluded value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class TeamOnCallRespondersIncludedDeserializer + extends StdDeserializer { + public TeamOnCallRespondersIncludedDeserializer() { + this(TeamOnCallRespondersIncluded.class); + } + + public TeamOnCallRespondersIncludedDeserializer(Class vc) { + super(vc); + } + + @Override + public TeamOnCallRespondersIncluded deserialize(JsonParser jp, DeserializationContext ctxt) + throws IOException, JsonProcessingException { + JsonNode tree = jp.readValueAsTree(); + Object deserialized = null; + Object tmp = null; + boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); + int match = 0; + JsonToken token = tree.traverse(jp.getCodec()).nextToken(); + // deserialize User + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (User.class.equals(Integer.class) + || User.class.equals(Long.class) + || User.class.equals(Float.class) + || User.class.equals(Double.class) + || User.class.equals(Boolean.class) + || User.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((User.class.equals(Integer.class) || User.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((User.class.equals(Float.class) || User.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (User.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (User.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(User.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((User) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'User'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'User'", e); + } + + // deserialize Escalation + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (Escalation.class.equals(Integer.class) + || Escalation.class.equals(Long.class) + || Escalation.class.equals(Float.class) + || Escalation.class.equals(Double.class) + || Escalation.class.equals(Boolean.class) + || Escalation.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((Escalation.class.equals(Integer.class) || Escalation.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((Escalation.class.equals(Float.class) || Escalation.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (Escalation.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (Escalation.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(Escalation.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((Escalation) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'Escalation'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'Escalation'", e); + } + + TeamOnCallRespondersIncluded ret = new TeamOnCallRespondersIncluded(); + if (match == 1) { + ret.setActualInstance(deserialized); + } else { + Map res = + new ObjectMapper() + .readValue( + tree.traverse(jp.getCodec()).readValueAsTree().toString(), + new TypeReference>() {}); + ret.setActualInstance(new UnparsedObject(res)); + } + return ret; + } + + /** Handle deserialization of the 'null' value. */ + @Override + public TeamOnCallRespondersIncluded getNullValue(DeserializationContext ctxt) + throws JsonMappingException { + throw new JsonMappingException( + ctxt.getParser(), "TeamOnCallRespondersIncluded cannot be null"); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public TeamOnCallRespondersIncluded() { + super("oneOf", Boolean.FALSE); + } + + public TeamOnCallRespondersIncluded(User o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public TeamOnCallRespondersIncluded(Escalation o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("User", new GenericType() {}); + schemas.put("Escalation", new GenericType() {}); + JSON.registerDescendants( + TeamOnCallRespondersIncluded.class, Collections.unmodifiableMap(schemas)); + } + + @Override + public Map getSchemas() { + return TeamOnCallRespondersIncluded.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: User, Escalation + * + *

It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be a + * composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf(User.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf(Escalation.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(UnparsedObject.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + throw new RuntimeException("Invalid instance type. Must be User, Escalation"); + } + + /** + * Get the actual instance, which can be the following: User, Escalation + * + * @return The actual instance (User, Escalation) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `User`. If the actual instance is not `User`, the ClassCastException + * will be thrown. + * + * @return The actual instance of `User` + * @throws ClassCastException if the instance is not `User` + */ + public User getUser() throws ClassCastException { + return (User) super.getActualInstance(); + } + + /** + * Get the actual instance of `Escalation`. If the actual instance is not `Escalation`, the + * ClassCastException will be thrown. + * + * @return The actual instance of `Escalation` + * @throws ClassCastException if the instance is not `Escalation` + */ + public Escalation getEscalation() throws ClassCastException { + return (Escalation) super.getActualInstance(); + } +} diff --git a/src/test/resources/cassettes/features/v2/Create_On_Call_escalation_policy_returns_Created_response.freeze b/src/test/resources/cassettes/features/v2/Create_On_Call_escalation_policy_returns_Created_response.freeze index 6ffd5131319..b8ab6c2926a 100644 --- a/src/test/resources/cassettes/features/v2/Create_On_Call_escalation_policy_returns_Created_response.freeze +++ b/src/test/resources/cassettes/features/v2/Create_On_Call_escalation_policy_returns_Created_response.freeze @@ -1 +1 @@ -2025-05-22T07:28:52.187Z \ No newline at end of file +2025-05-29T04:53:30.847Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_On_Call_escalation_policy_returns_Created_response.json b/src/test/resources/cassettes/features/v2/Create_On_Call_escalation_policy_returns_Created_response.json index f39792daa97..ad3e1e7fab2 100644 --- a/src/test/resources/cassettes/features/v2/Create_On_Call_escalation_policy_returns_Created_response.json +++ b/src/test/resources/cassettes/features/v2/Create_On_Call_escalation_policy_returns_Created_response.json @@ -3,19 +3,19 @@ "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"layers\":[{\"effective_date\":\"2025-05-12T07:28:52.187Z\",\"end_date\":\"2025-06-01T07:28:52.187Z\",\"interval\":{\"days\":1},\"members\":[{\"user\":{\"id\":\"890f29d4-0b7a-11f0-aeb2-760fcae4f596\"}}],\"name\":\"Layer 1\",\"restrictions\":[{\"end_day\":\"friday\",\"end_time\":\"17:00:00\",\"start_day\":\"monday\",\"start_time\":\"09:00:00\"}],\"rotation_start\":\"2025-05-17T07:28:52.187Z\"}],\"name\":\"Test-Create_On_Call_escalation_policy_returns_Created_response-1747898932\",\"time_zone\":\"America/New_York\"},\"relationships\":{\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}},\"type\":\"schedules\"}}" + "json": "{\"data\":{\"attributes\":{\"email\":\"Test-Create_On_Call_escalation_policy_returns_Created_response-1748494410@datadoghq.com\",\"title\":\"user title\"},\"type\":\"users\"}}" }, "headers": {}, "method": "POST", - "path": "/api/v2/on-call/schedules", + "path": "/api/v2/users", "keepAlive": false, "secure": true }, "httpResponse": { - "body": "{\"data\":{\"id\":\"b1732c80-9bb6-47e6-878d-9e672e4148a6\",\"type\":\"schedules\",\"attributes\":{\"name\":\"Test-Create_On_Call_escalation_policy_returns_Created_response-1747898932\",\"time_zone\":\"America/New_York\"},\"relationships\":{\"layers\":{\"data\":[{\"id\":\"98d7c183-739e-4ef5-ae40-27e7612bf939\",\"type\":\"layers\"}]},\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}}}}", + "body": "{\"data\":{\"type\":\"users\",\"id\":\"de86b01f-3c48-11f0-927d-aedf77869272\",\"attributes\":{\"name\":null,\"handle\":\"test-create_on_call_escalation_policy_returns_created_response-1748494410@datadoghq.com\",\"created_at\":\"2025-05-29T04:53:31.716641+00:00\",\"modified_at\":\"2025-05-29T04:53:31.716641+00:00\",\"email\":\"test-create_on_call_escalation_policy_returns_created_response-1748494410@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/bd817280fe52b9652bd2877bf9041f78?s=48&d=retro\",\"title\":\"user title\",\"verified\":false,\"service_account\":false,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Pending\"},\"relationships\":{\"roles\":{\"data\":[]},\"org\":{\"data\":{\"type\":\"orgs\",\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\"}}}}}\n", "headers": { "Content-Type": [ - "application/vnd.api+json" + "application/json" ] }, "statusCode": 201, @@ -27,25 +27,25 @@ "timeToLive": { "unlimited": true }, - "id": "65272199-52a2-05e7-f1e0-bfc448832a3f" + "id": "c8e2a80f-86f5-a1f5-d306-6ae4cc88d177" }, { "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"handle\":\"test-handle-af3e241f3f3acc33\",\"name\":\"test-name-af3e241f3f3acc33\"},\"type\":\"team\"}}" + "json": "{\"data\":{\"attributes\":{\"layers\":[{\"effective_date\":\"2025-05-19T04:53:30.847Z\",\"end_date\":\"2025-06-08T04:53:30.847Z\",\"interval\":{\"days\":1},\"members\":[{\"user\":{\"id\":\"de86b01f-3c48-11f0-927d-aedf77869272\"}}],\"name\":\"Layer 1\",\"restrictions\":[{\"end_day\":\"friday\",\"end_time\":\"17:00:00\",\"start_day\":\"monday\",\"start_time\":\"09:00:00\"}],\"rotation_start\":\"2025-05-24T04:53:30.847Z\"}],\"name\":\"Test-Create_On_Call_escalation_policy_returns_Created_response-1748494410\",\"time_zone\":\"America/New_York\"},\"relationships\":{\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}},\"type\":\"schedules\"}}" }, "headers": {}, "method": "POST", - "path": "/api/v2/team", + "path": "/api/v2/on-call/schedules", "keepAlive": false, "secure": true }, "httpResponse": { - "body": "{\"data\":{\"type\":\"team\",\"id\":\"403df2c1-7163-494a-8f34-6b73a2e51893\",\"attributes\":{\"name\":\"test-name-af3e241f3f3acc33\",\"handle\":\"test-handle-af3e241f3f3acc33\",\"summary\":null,\"description\":null,\"avatar\":null,\"banner\":13,\"visible_modules\":[],\"hidden_modules\":[],\"created_at\":\"2025-05-22T07:28:53.300763+00:00\",\"modified_at\":\"2025-05-22T07:28:53.300772+00:00\",\"user_count\":0,\"link_count\":0},\"relationships\":{\"team_links\":{\"links\":{\"related\":\"/api/v2/team/403df2c1-7163-494a-8f34-6b73a2e51893/links\"}},\"user_team_permissions\":{\"links\":{\"related\":\"/api/v2/team/403df2c1-7163-494a-8f34-6b73a2e51893/permission-settings\"}}}}}\n", + "body": "{\"data\":{\"id\":\"2e70ff45-cb63-4609-900b-cc9fe95e063b\",\"type\":\"schedules\",\"attributes\":{\"name\":\"Test-Create_On_Call_escalation_policy_returns_Created_response-1748494410\",\"time_zone\":\"America/New_York\"},\"relationships\":{\"layers\":{\"data\":[{\"id\":\"f1949bc4-1f01-4081-8002-d6029ace0bc9\",\"type\":\"layers\"}]},\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}}}}", "headers": { "Content-Type": [ - "application/json" + "application/vnd.api+json" ] }, "statusCode": 201, @@ -57,22 +57,22 @@ "timeToLive": { "unlimited": true }, - "id": "a267d2d6-a478-89d2-c56e-b9114dcc313c" + "id": "f2f49a8d-5bce-77b1-3bde-b727ba9817e5" }, { "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"email\":\"Test-Create_On_Call_escalation_policy_returns_Created_response-1747898932@datadoghq.com\",\"title\":\"user title\"},\"type\":\"users\"}}" + "json": "{\"data\":{\"attributes\":{\"handle\":\"test-handle-cfbc9f18713005c6\",\"name\":\"test-name-cfbc9f18713005c6\"},\"type\":\"team\"}}" }, "headers": {}, "method": "POST", - "path": "/api/v2/users", + "path": "/api/v2/team", "keepAlive": false, "secure": true }, "httpResponse": { - "body": "{\"data\":{\"type\":\"users\",\"id\":\"6a0710e3-36de-11f0-b303-0a167fbfaaab\",\"attributes\":{\"name\":null,\"handle\":\"test-create_on_call_escalation_policy_returns_created_response-1747898932@datadoghq.com\",\"created_at\":\"2025-05-22T07:28:53.797325+00:00\",\"modified_at\":\"2025-05-22T07:28:53.797325+00:00\",\"email\":\"test-create_on_call_escalation_policy_returns_created_response-1747898932@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/004cc14226c3e9b0e2d890d1cf40991a?s=48&d=retro\",\"title\":\"user title\",\"verified\":false,\"service_account\":false,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Pending\"},\"relationships\":{\"roles\":{\"data\":[]},\"org\":{\"data\":{\"type\":\"orgs\",\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\"}}}}}\n", + "body": "{\"data\":{\"type\":\"team\",\"id\":\"fa4d082c-6733-4bd0-9083-f7bf2f8d4259\",\"attributes\":{\"name\":\"test-name-cfbc9f18713005c6\",\"handle\":\"test-handle-cfbc9f18713005c6\",\"summary\":null,\"description\":null,\"avatar\":null,\"banner\":14,\"visible_modules\":[],\"hidden_modules\":[],\"created_at\":\"2025-05-29T04:53:32.646359+00:00\",\"modified_at\":\"2025-05-29T04:53:32.646369+00:00\",\"user_count\":0,\"link_count\":0},\"relationships\":{\"team_links\":{\"links\":{\"related\":\"/api/v2/team/fa4d082c-6733-4bd0-9083-f7bf2f8d4259/links\"}},\"user_team_permissions\":{\"links\":{\"related\":\"/api/v2/team/fa4d082c-6733-4bd0-9083-f7bf2f8d4259/permission-settings\"}}}}}\n", "headers": { "Content-Type": [ "application/json" @@ -87,13 +87,13 @@ "timeToLive": { "unlimited": true }, - "id": "478faaf1-0e01-3d12-5fb4-0643244ad165" + "id": "6813dede-55f3-60ba-3436-b2be356874e5" }, { "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"name\":\"Test-Create_On_Call_escalation_policy_returns_Created_response-1747898932\",\"resolve_page_on_policy_end\":true,\"retries\":2,\"steps\":[{\"assignment\":\"default\",\"escalate_after_seconds\":3600,\"targets\":[{\"id\":\"6a0710e3-36de-11f0-b303-0a167fbfaaab\",\"type\":\"users\"},{\"id\":\"b1732c80-9bb6-47e6-878d-9e672e4148a6\",\"type\":\"schedules\"},{\"id\":\"403df2c1-7163-494a-8f34-6b73a2e51893\",\"type\":\"teams\"}]},{\"assignment\":\"round-robin\",\"escalate_after_seconds\":3600,\"targets\":[{\"id\":\"403df2c1-7163-494a-8f34-6b73a2e51893\",\"type\":\"teams\"}]}]},\"relationships\":{\"teams\":{\"data\":[{\"id\":\"403df2c1-7163-494a-8f34-6b73a2e51893\",\"type\":\"teams\"}]}},\"type\":\"policies\"}}" + "json": "{\"data\":{\"attributes\":{\"name\":\"Test-Create_On_Call_escalation_policy_returns_Created_response-1748494410\",\"resolve_page_on_policy_end\":true,\"retries\":2,\"steps\":[{\"assignment\":\"default\",\"escalate_after_seconds\":3600,\"targets\":[{\"id\":\"de86b01f-3c48-11f0-927d-aedf77869272\",\"type\":\"users\"},{\"id\":\"2e70ff45-cb63-4609-900b-cc9fe95e063b\",\"type\":\"schedules\"},{\"id\":\"fa4d082c-6733-4bd0-9083-f7bf2f8d4259\",\"type\":\"teams\"}]},{\"assignment\":\"round-robin\",\"escalate_after_seconds\":3600,\"targets\":[{\"id\":\"fa4d082c-6733-4bd0-9083-f7bf2f8d4259\",\"type\":\"teams\"}]}]},\"relationships\":{\"teams\":{\"data\":[{\"id\":\"fa4d082c-6733-4bd0-9083-f7bf2f8d4259\",\"type\":\"teams\"}]}},\"type\":\"policies\"}}" }, "headers": {}, "method": "POST", @@ -107,7 +107,7 @@ "secure": true }, "httpResponse": { - "body": "{\"data\":{\"id\":\"7c3eb6f9-15e8-4709-a2f9-21897597d44b\",\"type\":\"policies\",\"attributes\":{\"name\":\"Test-Create_On_Call_escalation_policy_returns_Created_response-1747898932\",\"resolve_page_on_policy_end\":true,\"retries\":2},\"relationships\":{\"steps\":{\"data\":[{\"id\":\"896e047c-2219-467b-a1ba-897ec456044e\",\"type\":\"steps\"},{\"id\":\"b405cc13-e555-4465-bb3f-7facb8ff8b4b\",\"type\":\"steps\"}]},\"teams\":{\"data\":[{\"id\":\"403df2c1-7163-494a-8f34-6b73a2e51893\",\"type\":\"teams\"}]}}},\"included\":[{\"id\":\"896e047c-2219-467b-a1ba-897ec456044e\",\"type\":\"steps\",\"attributes\":{\"assignment\":\"default\",\"escalate_after_seconds\":3600},\"relationships\":{\"targets\":{\"data\":[{\"id\":\"6a0710e3-36de-11f0-b303-0a167fbfaaab\",\"type\":\"users\"},{\"id\":\"b1732c80-9bb6-47e6-878d-9e672e4148a6\",\"type\":\"schedules\"},{\"id\":\"403df2c1-7163-494a-8f34-6b73a2e51893\",\"type\":\"teams\"}]}}},{\"id\":\"b405cc13-e555-4465-bb3f-7facb8ff8b4b\",\"type\":\"steps\",\"attributes\":{\"assignment\":\"round-robin\",\"escalate_after_seconds\":3600},\"relationships\":{\"targets\":{\"data\":[{\"id\":\"403df2c1-7163-494a-8f34-6b73a2e51893\",\"type\":\"teams\"}]}}},{\"id\":\"b1732c80-9bb6-47e6-878d-9e672e4148a6\",\"type\":\"schedules\",\"attributes\":{\"name\":\"Test-Create_On_Call_escalation_policy_returns_Created_response-1747898932\",\"time_zone\":\"America/New_York\"},\"relationships\":{\"layers\":{\"data\":[{\"id\":\"98d7c183-739e-4ef5-ae40-27e7612bf939\",\"type\":\"layers\"}]},\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}}},{\"id\":\"403df2c1-7163-494a-8f34-6b73a2e51893\",\"type\":\"teams\",\"attributes\":{\"avatar\":\"\",\"description\":\"\",\"handle\":\"test-handle-af3e241f3f3acc33\",\"name\":\"test-name-af3e241f3f3acc33\"}},{\"id\":\"6a0710e3-36de-11f0-b303-0a167fbfaaab\",\"type\":\"users\",\"attributes\":{\"email\":\"test-create_on_call_escalation_policy_returns_created_response-1747898932@datadoghq.com\",\"name\":\"\",\"status\":\"pending\"}}]}", + "body": "{\"data\":{\"id\":\"cf3a523c-3ca3-4ac4-aee2-7afaac13c6f7\",\"type\":\"policies\",\"attributes\":{\"name\":\"Test-Create_On_Call_escalation_policy_returns_Created_response-1748494410\",\"resolve_page_on_policy_end\":true,\"retries\":2},\"relationships\":{\"steps\":{\"data\":[{\"id\":\"ba22e9ae-1740-4522-b95c-26f601a37484\",\"type\":\"steps\"},{\"id\":\"335dc81f-929a-47e1-a8f8-cc7830c2d272\",\"type\":\"steps\"}]},\"teams\":{\"data\":[{\"id\":\"fa4d082c-6733-4bd0-9083-f7bf2f8d4259\",\"type\":\"teams\"}]}}},\"included\":[{\"id\":\"ba22e9ae-1740-4522-b95c-26f601a37484\",\"type\":\"steps\",\"attributes\":{\"assignment\":\"default\",\"escalate_after_seconds\":3600},\"relationships\":{\"targets\":{\"data\":[{\"id\":\"de86b01f-3c48-11f0-927d-aedf77869272\",\"type\":\"users\"},{\"id\":\"2e70ff45-cb63-4609-900b-cc9fe95e063b\",\"type\":\"schedules\"},{\"id\":\"fa4d082c-6733-4bd0-9083-f7bf2f8d4259\",\"type\":\"teams\"}]}}},{\"id\":\"335dc81f-929a-47e1-a8f8-cc7830c2d272\",\"type\":\"steps\",\"attributes\":{\"assignment\":\"round-robin\",\"escalate_after_seconds\":3600},\"relationships\":{\"targets\":{\"data\":[{\"id\":\"fa4d082c-6733-4bd0-9083-f7bf2f8d4259\",\"type\":\"teams\"}]}}},{\"id\":\"de86b01f-3c48-11f0-927d-aedf77869272\",\"type\":\"users\",\"attributes\":{\"email\":\"test-create_on_call_escalation_policy_returns_created_response-1748494410@datadoghq.com\",\"name\":\"\",\"status\":\"pending\"}},{\"id\":\"2e70ff45-cb63-4609-900b-cc9fe95e063b\",\"type\":\"schedules\",\"attributes\":{\"name\":\"Test-Create_On_Call_escalation_policy_returns_Created_response-1748494410\",\"time_zone\":\"America/New_York\"},\"relationships\":{\"layers\":{\"data\":[{\"id\":\"f1949bc4-1f01-4081-8002-d6029ace0bc9\",\"type\":\"layers\"}]},\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}}},{\"id\":\"fa4d082c-6733-4bd0-9083-f7bf2f8d4259\",\"type\":\"teams\",\"attributes\":{\"avatar\":\"\",\"description\":\"\",\"handle\":\"test-handle-cfbc9f18713005c6\",\"name\":\"test-name-cfbc9f18713005c6\"}}]}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -122,13 +122,13 @@ "timeToLive": { "unlimited": true }, - "id": "6c622326-aa52-285e-dd84-993561bd5ff8" + "id": "31d93675-205a-9869-61ef-cb9d9aeb5db6" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/on-call/escalation-policies/7c3eb6f9-15e8-4709-a2f9-21897597d44b", + "path": "/api/v2/on-call/escalation-policies/cf3a523c-3ca3-4ac4-aee2-7afaac13c6f7", "keepAlive": false, "secure": true }, @@ -143,13 +143,13 @@ "timeToLive": { "unlimited": true }, - "id": "93210378-80b9-9151-64fd-b1ccb28eea39" + "id": "58cb6307-0bb4-5055-e13a-fe6a31b89678" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/users/6a0710e3-36de-11f0-b303-0a167fbfaaab", + "path": "/api/v2/team/fa4d082c-6733-4bd0-9083-f7bf2f8d4259", "keepAlive": false, "secure": true }, @@ -164,13 +164,13 @@ "timeToLive": { "unlimited": true }, - "id": "74368f72-c9bb-6dee-6611-50faf2b6673d" + "id": "7d199b82-189c-7a1e-50dc-dbdf09b9b866" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/team/403df2c1-7163-494a-8f34-6b73a2e51893", + "path": "/api/v2/on-call/schedules/2e70ff45-cb63-4609-900b-cc9fe95e063b", "keepAlive": false, "secure": true }, @@ -185,13 +185,13 @@ "timeToLive": { "unlimited": true }, - "id": "fb4c5b56-c672-2500-7102-3445e97de557" + "id": "6a6d9afd-0771-08fa-bbe2-ca2c3649685f" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/on-call/schedules/b1732c80-9bb6-47e6-878d-9e672e4148a6", + "path": "/api/v2/users/de86b01f-3c48-11f0-927d-aedf77869272", "keepAlive": false, "secure": true }, @@ -206,6 +206,6 @@ "timeToLive": { "unlimited": true }, - "id": "48f15978-c8c3-65b9-2061-03a53b2641d3" + "id": "c0fbe80a-6b80-b2af-18ad-957e5f1ff683" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_On_Call_schedule_returns_Created_response.freeze b/src/test/resources/cassettes/features/v2/Create_On_Call_schedule_returns_Created_response.freeze index 435d9b833f2..47ee6d1da6f 100644 --- a/src/test/resources/cassettes/features/v2/Create_On_Call_schedule_returns_Created_response.freeze +++ b/src/test/resources/cassettes/features/v2/Create_On_Call_schedule_returns_Created_response.freeze @@ -1 +1 @@ -2025-05-21T11:01:51.393Z \ No newline at end of file +2025-05-29T04:53:37.175Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_On_Call_schedule_returns_Created_response.json b/src/test/resources/cassettes/features/v2/Create_On_Call_schedule_returns_Created_response.json index edd75ecc838..30e15defd75 100644 --- a/src/test/resources/cassettes/features/v2/Create_On_Call_schedule_returns_Created_response.json +++ b/src/test/resources/cassettes/features/v2/Create_On_Call_schedule_returns_Created_response.json @@ -3,7 +3,7 @@ "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"email\":\"Test-Create_On_Call_schedule_returns_Created_response-1747825311@datadoghq.com\",\"title\":\"user title\"},\"type\":\"users\"}}" + "json": "{\"data\":{\"attributes\":{\"email\":\"Test-Create_On_Call_schedule_returns_Created_response-1748494417@datadoghq.com\",\"title\":\"user title\"},\"type\":\"users\"}}" }, "headers": {}, "method": "POST", @@ -12,7 +12,7 @@ "secure": true }, "httpResponse": { - "body": "{\"data\":{\"type\":\"users\",\"id\":\"ffb657ae-3632-11f0-8139-36deebce65db\",\"attributes\":{\"name\":null,\"handle\":\"test-create_on_call_schedule_returns_created_response-1747825311@datadoghq.com\",\"created_at\":\"2025-05-21T11:01:51.489047+00:00\",\"modified_at\":\"2025-05-21T11:01:51.489047+00:00\",\"email\":\"test-create_on_call_schedule_returns_created_response-1747825311@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/fe3b4171de3845d28a158ca806834463?s=48&d=retro\",\"title\":\"user title\",\"verified\":false,\"service_account\":false,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Pending\"},\"relationships\":{\"roles\":{\"data\":[]},\"org\":{\"data\":{\"type\":\"orgs\",\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\"}}}}}\n", + "body": "{\"data\":{\"type\":\"users\",\"id\":\"e2438320-3c48-11f0-b6eb-6e406f40657f\",\"attributes\":{\"name\":null,\"handle\":\"test-create_on_call_schedule_returns_created_response-1748494417@datadoghq.com\",\"created_at\":\"2025-05-29T04:53:37.987288+00:00\",\"modified_at\":\"2025-05-29T04:53:37.987288+00:00\",\"email\":\"test-create_on_call_schedule_returns_created_response-1748494417@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/61f85c2f88e7f4fa078405eae231fb73?s=48&d=retro\",\"title\":\"user title\",\"verified\":false,\"service_account\":false,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Pending\"},\"relationships\":{\"roles\":{\"data\":[]},\"org\":{\"data\":{\"type\":\"orgs\",\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\"}}}}}\n", "headers": { "Content-Type": [ "application/json" @@ -27,13 +27,13 @@ "timeToLive": { "unlimited": true }, - "id": "4c9546fd-2b59-087e-59a2-608f89e20859" + "id": "723e1f70-93e5-dac8-8cba-526d8790b989" }, { "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"handle\":\"test-handle-74af482e94498992\",\"name\":\"test-name-74af482e94498992\"},\"type\":\"team\"}}" + "json": "{\"data\":{\"attributes\":{\"handle\":\"test-handle-0ed4255faa1a4de8\",\"name\":\"test-name-0ed4255faa1a4de8\"},\"type\":\"team\"}}" }, "headers": {}, "method": "POST", @@ -42,7 +42,7 @@ "secure": true }, "httpResponse": { - "body": "{\"data\":{\"type\":\"team\",\"id\":\"85d4d10d-ce4a-4bc6-91a4-2f391b4979db\",\"attributes\":{\"name\":\"test-name-74af482e94498992\",\"handle\":\"test-handle-74af482e94498992\",\"summary\":null,\"description\":null,\"avatar\":null,\"banner\":9,\"visible_modules\":[],\"hidden_modules\":[],\"created_at\":\"2025-05-21T11:01:51.607592+00:00\",\"modified_at\":\"2025-05-21T11:01:51.607602+00:00\",\"user_count\":0,\"link_count\":0},\"relationships\":{\"team_links\":{\"links\":{\"related\":\"/api/v2/team/85d4d10d-ce4a-4bc6-91a4-2f391b4979db/links\"}},\"user_team_permissions\":{\"links\":{\"related\":\"/api/v2/team/85d4d10d-ce4a-4bc6-91a4-2f391b4979db/permission-settings\"}}}}}\n", + "body": "{\"data\":{\"type\":\"team\",\"id\":\"8c44e5e8-f1f0-4e12-ada2-f91c9aeab153\",\"attributes\":{\"name\":\"test-name-0ed4255faa1a4de8\",\"handle\":\"test-handle-0ed4255faa1a4de8\",\"summary\":null,\"description\":null,\"avatar\":null,\"banner\":5,\"visible_modules\":[],\"hidden_modules\":[],\"created_at\":\"2025-05-29T04:53:38.641602+00:00\",\"modified_at\":\"2025-05-29T04:53:38.641612+00:00\",\"user_count\":0,\"link_count\":0},\"relationships\":{\"team_links\":{\"links\":{\"related\":\"/api/v2/team/8c44e5e8-f1f0-4e12-ada2-f91c9aeab153/links\"}},\"user_team_permissions\":{\"links\":{\"related\":\"/api/v2/team/8c44e5e8-f1f0-4e12-ada2-f91c9aeab153/permission-settings\"}}}}}\n", "headers": { "Content-Type": [ "application/json" @@ -57,13 +57,13 @@ "timeToLive": { "unlimited": true }, - "id": "51589af2-0c52-ac0c-78ff-5cc79800d931" + "id": "e2922c04-b630-9a62-6a75-933c3a298ba5" }, { "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"layers\":[{\"effective_date\":\"2025-05-11T11:01:51.393Z\",\"end_date\":\"2025-05-31T11:01:51.393Z\",\"interval\":{\"days\":1},\"members\":[{\"user\":{\"id\":\"ffb657ae-3632-11f0-8139-36deebce65db\"}}],\"name\":\"Layer 1\",\"restrictions\":[{\"end_day\":\"friday\",\"end_time\":\"17:00:00\",\"start_day\":\"monday\",\"start_time\":\"09:00:00\"}],\"rotation_start\":\"2025-05-16T11:01:51.393Z\"}],\"name\":\"Test-Create_On_Call_schedule_returns_Created_response-1747825311\",\"time_zone\":\"America/New_York\"},\"relationships\":{\"teams\":{\"data\":[{\"id\":\"85d4d10d-ce4a-4bc6-91a4-2f391b4979db\",\"type\":\"teams\"}]}},\"type\":\"schedules\"}}" + "json": "{\"data\":{\"attributes\":{\"layers\":[{\"effective_date\":\"2025-05-19T04:53:37.175Z\",\"end_date\":\"2025-06-08T04:53:37.175Z\",\"interval\":{\"days\":1},\"members\":[{\"user\":{\"id\":\"e2438320-3c48-11f0-b6eb-6e406f40657f\"}}],\"name\":\"Layer 1\",\"restrictions\":[{\"end_day\":\"friday\",\"end_time\":\"17:00:00\",\"start_day\":\"monday\",\"start_time\":\"09:00:00\"}],\"rotation_start\":\"2025-05-24T04:53:37.175Z\"}],\"name\":\"Test-Create_On_Call_schedule_returns_Created_response-1748494417\",\"time_zone\":\"America/New_York\"},\"relationships\":{\"teams\":{\"data\":[{\"id\":\"8c44e5e8-f1f0-4e12-ada2-f91c9aeab153\",\"type\":\"teams\"}]}},\"type\":\"schedules\"}}" }, "headers": {}, "method": "POST", @@ -72,7 +72,7 @@ "secure": true }, "httpResponse": { - "body": "{\"data\":{\"id\":\"4f083dc5-6d02-49ee-9f93-6937253db90b\",\"type\":\"schedules\",\"attributes\":{\"name\":\"Test-Create_On_Call_schedule_returns_Created_response-1747825311\",\"time_zone\":\"America/New_York\"},\"relationships\":{\"layers\":{\"data\":[{\"id\":\"dfa67783-0231-4672-80dc-7d1c634eb068\",\"type\":\"layers\"}]},\"teams\":{\"data\":[{\"id\":\"85d4d10d-ce4a-4bc6-91a4-2f391b4979db\",\"type\":\"teams\"}]}}}}", + "body": "{\"data\":{\"id\":\"e57f69cc-5f56-41bf-abd2-69196d0b4b41\",\"type\":\"schedules\",\"attributes\":{\"name\":\"Test-Create_On_Call_schedule_returns_Created_response-1748494417\",\"time_zone\":\"America/New_York\"},\"relationships\":{\"layers\":{\"data\":[{\"id\":\"7cb8837f-5ebd-46c7-914d-d017eae7f3fc\",\"type\":\"layers\"}]},\"teams\":{\"data\":[{\"id\":\"8c44e5e8-f1f0-4e12-ada2-f91c9aeab153\",\"type\":\"teams\"}]}}}}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -87,13 +87,13 @@ "timeToLive": { "unlimited": true }, - "id": "13b7f0dc-a35d-231e-e0db-4c4eafd26cb3" + "id": "117feb5e-36fe-3e75-7cd6-1dec4fd9f5eb" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/on-call/schedules/4f083dc5-6d02-49ee-9f93-6937253db90b", + "path": "/api/v2/on-call/schedules/e57f69cc-5f56-41bf-abd2-69196d0b4b41", "keepAlive": false, "secure": true }, @@ -108,13 +108,13 @@ "timeToLive": { "unlimited": true }, - "id": "44f3f5cf-9255-14c0-7eb3-4884c4836ad1" + "id": "edb35a4e-a31c-1c2c-f51c-f3590353dec4" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/team/85d4d10d-ce4a-4bc6-91a4-2f391b4979db", + "path": "/api/v2/team/8c44e5e8-f1f0-4e12-ada2-f91c9aeab153", "keepAlive": false, "secure": true }, @@ -129,13 +129,13 @@ "timeToLive": { "unlimited": true }, - "id": "8240f59f-2cbb-695d-f901-5ecd6b237f0f" + "id": "1c07bce8-d48d-5c6f-22d6-2c7b97c12e3a" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/users/ffb657ae-3632-11f0-8139-36deebce65db", + "path": "/api/v2/users/e2438320-3c48-11f0-b6eb-6e406f40657f", "keepAlive": false, "secure": true }, @@ -150,6 +150,6 @@ "timeToLive": { "unlimited": true }, - "id": "f046346e-9b76-98b3-751c-59326531fae8" + "id": "df1fcf51-ff40-3603-a80a-fe1e8f21bee1" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_On_Call_escalation_policy_returns_No_Content_response.freeze b/src/test/resources/cassettes/features/v2/Delete_On_Call_escalation_policy_returns_No_Content_response.freeze index 957b16f8641..c28891b940d 100644 --- a/src/test/resources/cassettes/features/v2/Delete_On_Call_escalation_policy_returns_No_Content_response.freeze +++ b/src/test/resources/cassettes/features/v2/Delete_On_Call_escalation_policy_returns_No_Content_response.freeze @@ -1 +1 @@ -2025-05-21T11:01:52.363Z \ No newline at end of file +2025-05-29T04:53:42.215Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_On_Call_escalation_policy_returns_No_Content_response.json b/src/test/resources/cassettes/features/v2/Delete_On_Call_escalation_policy_returns_No_Content_response.json index 7e759662a62..64ea7d0f980 100644 --- a/src/test/resources/cassettes/features/v2/Delete_On_Call_escalation_policy_returns_No_Content_response.json +++ b/src/test/resources/cassettes/features/v2/Delete_On_Call_escalation_policy_returns_No_Content_response.json @@ -3,7 +3,7 @@ "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"email\":\"Test-Delete_On_Call_escalation_policy_returns_No_Content_response-1747825312@datadoghq.com\",\"title\":\"user title\"},\"type\":\"users\"}}" + "json": "{\"data\":{\"attributes\":{\"email\":\"Test-Delete_On_Call_escalation_policy_returns_No_Content_response-1748494422@datadoghq.com\",\"title\":\"user title\"},\"type\":\"users\"}}" }, "headers": {}, "method": "POST", @@ -12,7 +12,7 @@ "secure": true }, "httpResponse": { - "body": "{\"data\":{\"type\":\"users\",\"id\":\"004c79ee-3633-11f0-a44d-32fc981820e1\",\"attributes\":{\"name\":null,\"handle\":\"test-delete_on_call_escalation_policy_returns_no_content_response-1747825312@datadoghq.com\",\"created_at\":\"2025-05-21T11:01:52.473018+00:00\",\"modified_at\":\"2025-05-21T11:01:52.473018+00:00\",\"email\":\"test-delete_on_call_escalation_policy_returns_no_content_response-1747825312@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/ad3c6a2c3812a95dae5fa21afd4d2431?s=48&d=retro\",\"title\":\"user title\",\"verified\":false,\"service_account\":false,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Pending\"},\"relationships\":{\"roles\":{\"data\":[]},\"org\":{\"data\":{\"type\":\"orgs\",\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\"}}}}}\n", + "body": "{\"data\":{\"type\":\"users\",\"id\":\"e524a559-3c48-11f0-b6eb-6e406f40657f\",\"attributes\":{\"name\":null,\"handle\":\"test-delete_on_call_escalation_policy_returns_no_content_response-1748494422@datadoghq.com\",\"created_at\":\"2025-05-29T04:53:42.818165+00:00\",\"modified_at\":\"2025-05-29T04:53:42.818165+00:00\",\"email\":\"test-delete_on_call_escalation_policy_returns_no_content_response-1748494422@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/89925b9919d7e93a599c4d49d51b35ee?s=48&d=retro\",\"title\":\"user title\",\"verified\":false,\"service_account\":false,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Pending\"},\"relationships\":{\"roles\":{\"data\":[]},\"org\":{\"data\":{\"type\":\"orgs\",\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\"}}}}}\n", "headers": { "Content-Type": [ "application/json" @@ -27,13 +27,13 @@ "timeToLive": { "unlimited": true }, - "id": "a5481ce5-4de2-190a-48d1-d4b574114c20" + "id": "9abf655f-fe20-3730-8332-024ef80145a0" }, { "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"handle\":\"test-handle-da5b39657e7d313b\",\"name\":\"test-name-da5b39657e7d313b\"},\"type\":\"team\"}}" + "json": "{\"data\":{\"attributes\":{\"handle\":\"test-handle-7311534a0fd625d8\",\"name\":\"test-name-7311534a0fd625d8\"},\"type\":\"team\"}}" }, "headers": {}, "method": "POST", @@ -42,7 +42,7 @@ "secure": true }, "httpResponse": { - "body": "{\"data\":{\"type\":\"team\",\"id\":\"9c6994c3-9ea3-44df-8321-0b83ceb1af69\",\"attributes\":{\"name\":\"test-name-da5b39657e7d313b\",\"handle\":\"test-handle-da5b39657e7d313b\",\"summary\":null,\"description\":null,\"avatar\":null,\"banner\":11,\"visible_modules\":[],\"hidden_modules\":[],\"created_at\":\"2025-05-21T11:01:52.600302+00:00\",\"modified_at\":\"2025-05-21T11:01:52.600311+00:00\",\"user_count\":0,\"link_count\":0},\"relationships\":{\"team_links\":{\"links\":{\"related\":\"/api/v2/team/9c6994c3-9ea3-44df-8321-0b83ceb1af69/links\"}},\"user_team_permissions\":{\"links\":{\"related\":\"/api/v2/team/9c6994c3-9ea3-44df-8321-0b83ceb1af69/permission-settings\"}}}}}\n", + "body": "{\"data\":{\"type\":\"team\",\"id\":\"5007e30b-5736-4abe-be9c-51cf508c9554\",\"attributes\":{\"name\":\"test-name-7311534a0fd625d8\",\"handle\":\"test-handle-7311534a0fd625d8\",\"summary\":null,\"description\":null,\"avatar\":null,\"banner\":10,\"visible_modules\":[],\"hidden_modules\":[],\"created_at\":\"2025-05-29T04:53:43.705893+00:00\",\"modified_at\":\"2025-05-29T04:53:43.705903+00:00\",\"user_count\":0,\"link_count\":0},\"relationships\":{\"team_links\":{\"links\":{\"related\":\"/api/v2/team/5007e30b-5736-4abe-be9c-51cf508c9554/links\"}},\"user_team_permissions\":{\"links\":{\"related\":\"/api/v2/team/5007e30b-5736-4abe-be9c-51cf508c9554/permission-settings\"}}}}}\n", "headers": { "Content-Type": [ "application/json" @@ -57,13 +57,13 @@ "timeToLive": { "unlimited": true }, - "id": "5f397445-ca8e-0382-e390-1da63a2ee1a2" + "id": "e90de209-6f1e-98c7-c578-abf7e4555e24" }, { "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"layers\":[{\"effective_date\":\"2025-05-11T11:01:52.363Z\",\"end_date\":\"2025-05-31T11:01:52.363Z\",\"interval\":{\"days\":1},\"members\":[{\"user\":{\"id\":\"890f29d4-0b7a-11f0-aeb2-760fcae4f596\"}}],\"name\":\"Layer 1\",\"restrictions\":[{\"end_day\":\"friday\",\"end_time\":\"17:00:00\",\"start_day\":\"monday\",\"start_time\":\"09:00:00\"}],\"rotation_start\":\"2025-05-16T11:01:52.363Z\"}],\"name\":\"Test-Delete_On_Call_escalation_policy_returns_No_Content_response-1747825312\",\"time_zone\":\"America/New_York\"},\"relationships\":{\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}},\"type\":\"schedules\"}}" + "json": "{\"data\":{\"attributes\":{\"layers\":[{\"effective_date\":\"2025-05-19T04:53:42.215Z\",\"end_date\":\"2025-06-08T04:53:42.215Z\",\"interval\":{\"days\":1},\"members\":[{\"user\":{\"id\":\"e524a559-3c48-11f0-b6eb-6e406f40657f\"}}],\"name\":\"Layer 1\",\"restrictions\":[{\"end_day\":\"friday\",\"end_time\":\"17:00:00\",\"start_day\":\"monday\",\"start_time\":\"09:00:00\"}],\"rotation_start\":\"2025-05-24T04:53:42.215Z\"}],\"name\":\"Test-Delete_On_Call_escalation_policy_returns_No_Content_response-1748494422\",\"time_zone\":\"America/New_York\"},\"relationships\":{\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}},\"type\":\"schedules\"}}" }, "headers": {}, "method": "POST", @@ -72,7 +72,7 @@ "secure": true }, "httpResponse": { - "body": "{\"data\":{\"id\":\"48c6b04f-1120-46b0-9600-b85a5253965c\",\"type\":\"schedules\",\"attributes\":{\"name\":\"Test-Delete_On_Call_escalation_policy_returns_No_Content_response-1747825312\",\"time_zone\":\"America/New_York\"},\"relationships\":{\"layers\":{\"data\":[{\"id\":\"3e17a286-28fa-4525-9336-94bb0d8fac37\",\"type\":\"layers\"}]},\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}}}}", + "body": "{\"data\":{\"id\":\"5bedf04a-b064-4748-861d-2f32970de31e\",\"type\":\"schedules\",\"attributes\":{\"name\":\"Test-Delete_On_Call_escalation_policy_returns_No_Content_response-1748494422\",\"time_zone\":\"America/New_York\"},\"relationships\":{\"layers\":{\"data\":[{\"id\":\"242425ed-6c98-4bda-b0eb-8eb0d66fc40f\",\"type\":\"layers\"}]},\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}}}}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -87,13 +87,13 @@ "timeToLive": { "unlimited": true }, - "id": "3c4f4363-5588-247e-e29f-d901cf2ca25f" + "id": "cdc8b374-224f-02e6-25b2-0fd681572fd9" }, { "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"name\":\"Test-Delete_On_Call_escalation_policy_returns_No_Content_response-1747825312\",\"resolve_page_on_policy_end\":true,\"retries\":2,\"steps\":[{\"assignment\":\"default\",\"escalate_after_seconds\":3600,\"targets\":[{\"id\":\"9c6994c3-9ea3-44df-8321-0b83ceb1af69\",\"type\":\"teams\"},{\"id\":\"48c6b04f-1120-46b0-9600-b85a5253965c\",\"type\":\"schedules\"},{\"id\":\"004c79ee-3633-11f0-a44d-32fc981820e1\",\"type\":\"users\"}]},{\"assignment\":\"round-robin\",\"escalate_after_seconds\":3600,\"targets\":[{\"id\":\"9c6994c3-9ea3-44df-8321-0b83ceb1af69\",\"type\":\"teams\"}]}]},\"relationships\":{\"teams\":{\"data\":[{\"id\":\"9c6994c3-9ea3-44df-8321-0b83ceb1af69\",\"type\":\"teams\"}]}},\"type\":\"policies\"}}" + "json": "{\"data\":{\"attributes\":{\"name\":\"Test-Delete_On_Call_escalation_policy_returns_No_Content_response-1748494422\",\"resolve_page_on_policy_end\":true,\"retries\":2,\"steps\":[{\"assignment\":\"default\",\"escalate_after_seconds\":3600,\"targets\":[{\"id\":\"5007e30b-5736-4abe-be9c-51cf508c9554\",\"type\":\"teams\"},{\"id\":\"5bedf04a-b064-4748-861d-2f32970de31e\",\"type\":\"schedules\"},{\"id\":\"e524a559-3c48-11f0-b6eb-6e406f40657f\",\"type\":\"users\"}]},{\"assignment\":\"round-robin\",\"escalate_after_seconds\":3600,\"targets\":[{\"id\":\"5007e30b-5736-4abe-be9c-51cf508c9554\",\"type\":\"teams\"}]}]},\"relationships\":{\"teams\":{\"data\":[{\"id\":\"5007e30b-5736-4abe-be9c-51cf508c9554\",\"type\":\"teams\"}]}},\"type\":\"policies\"}}" }, "headers": {}, "method": "POST", @@ -102,7 +102,7 @@ "secure": true }, "httpResponse": { - "body": "{\"data\":{\"id\":\"4b1100c9-814e-4444-9eab-7b42fa66865d\",\"type\":\"policies\",\"attributes\":{\"name\":\"Test-Delete_On_Call_escalation_policy_returns_No_Content_response-1747825312\",\"resolve_page_on_policy_end\":true,\"retries\":2},\"relationships\":{\"steps\":{\"data\":[{\"id\":\"4b81dc5d-0d54-4b9a-8864-0f5ed3591c14\",\"type\":\"steps\"},{\"id\":\"c0227ecd-8eb6-49ff-abb4-c7f9e22438df\",\"type\":\"steps\"}]},\"teams\":{\"data\":[{\"id\":\"9c6994c3-9ea3-44df-8321-0b83ceb1af69\",\"type\":\"teams\"}]}}}}", + "body": "{\"data\":{\"id\":\"897cc698-80ee-47cf-b59a-130323f2d483\",\"type\":\"policies\",\"attributes\":{\"name\":\"Test-Delete_On_Call_escalation_policy_returns_No_Content_response-1748494422\",\"resolve_page_on_policy_end\":true,\"retries\":2},\"relationships\":{\"steps\":{\"data\":[{\"id\":\"70f924ad-d57b-4b37-92b1-adc275a37923\",\"type\":\"steps\"},{\"id\":\"06639547-3fbf-431c-9719-c7211a3d34aa\",\"type\":\"steps\"}]},\"teams\":{\"data\":[{\"id\":\"5007e30b-5736-4abe-be9c-51cf508c9554\",\"type\":\"teams\"}]}}}}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -117,13 +117,13 @@ "timeToLive": { "unlimited": true }, - "id": "03b1571c-8ad9-b3e4-e090-c963aab6ef83" + "id": "6d83ce7f-bffa-81ad-c1fc-7ae2c7db3649" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/on-call/escalation-policies/4b1100c9-814e-4444-9eab-7b42fa66865d", + "path": "/api/v2/on-call/escalation-policies/897cc698-80ee-47cf-b59a-130323f2d483", "keepAlive": false, "secure": true }, @@ -138,18 +138,18 @@ "timeToLive": { "unlimited": true }, - "id": "6631c164-7744-ac4e-86f8-b0318a3aea54" + "id": "b827cef9-305b-0c85-ed91-ba220800bd58" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/on-call/escalation-policies/4b1100c9-814e-4444-9eab-7b42fa66865d", + "path": "/api/v2/on-call/escalation-policies/897cc698-80ee-47cf-b59a-130323f2d483", "keepAlive": false, "secure": true }, "httpResponse": { - "body": "{\"errors\":[{\"title\":\"Generic Error\",\"detail\":\"escalation_policy[4b1100c9-814e-4444-9eab-7b42fa66865d] not found\"}]}", + "body": "{\"errors\":[{\"title\":\"Generic Error\",\"detail\":\"escalation_policy[897cc698-80ee-47cf-b59a-130323f2d483] not found\"}]}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -164,13 +164,13 @@ "timeToLive": { "unlimited": true }, - "id": "6631c164-7744-ac4e-86f8-b0318a3aea55" + "id": "b827cef9-305b-0c85-ed91-ba220800bd59" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/on-call/schedules/48c6b04f-1120-46b0-9600-b85a5253965c", + "path": "/api/v2/on-call/schedules/5bedf04a-b064-4748-861d-2f32970de31e", "keepAlive": false, "secure": true }, @@ -185,13 +185,13 @@ "timeToLive": { "unlimited": true }, - "id": "b6eaa5cd-377a-cee9-96b1-276ddf4486fe" + "id": "4b46478b-dbcb-6445-e874-7dbfa2ab974b" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/team/9c6994c3-9ea3-44df-8321-0b83ceb1af69", + "path": "/api/v2/team/5007e30b-5736-4abe-be9c-51cf508c9554", "keepAlive": false, "secure": true }, @@ -206,13 +206,13 @@ "timeToLive": { "unlimited": true }, - "id": "d3299997-3b43-177a-a276-e12607f39a03" + "id": "83027bb9-37e8-cc7a-b05e-f8934dd4c612" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/users/004c79ee-3633-11f0-a44d-32fc981820e1", + "path": "/api/v2/users/e524a559-3c48-11f0-b6eb-6e406f40657f", "keepAlive": false, "secure": true }, @@ -227,6 +227,6 @@ "timeToLive": { "unlimited": true }, - "id": "3e8447c3-a6b6-9cc3-2e91-59b0c7b257c2" + "id": "df7fe0f1-5b62-367f-130f-0dd435b67244" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_On_Call_schedule_returns_No_Content_response.freeze b/src/test/resources/cassettes/features/v2/Delete_On_Call_schedule_returns_No_Content_response.freeze index 9d8615cb28d..faf03500664 100644 --- a/src/test/resources/cassettes/features/v2/Delete_On_Call_schedule_returns_No_Content_response.freeze +++ b/src/test/resources/cassettes/features/v2/Delete_On_Call_schedule_returns_No_Content_response.freeze @@ -1 +1 @@ -2025-05-21T11:01:53.526Z \ No newline at end of file +2025-05-29T04:53:48.818Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_On_Call_schedule_returns_No_Content_response.json b/src/test/resources/cassettes/features/v2/Delete_On_Call_schedule_returns_No_Content_response.json index 5dd1187a11a..5eaf680a902 100644 --- a/src/test/resources/cassettes/features/v2/Delete_On_Call_schedule_returns_No_Content_response.json +++ b/src/test/resources/cassettes/features/v2/Delete_On_Call_schedule_returns_No_Content_response.json @@ -3,7 +3,37 @@ "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"layers\":[{\"effective_date\":\"2025-05-11T11:01:53.526Z\",\"end_date\":\"2025-05-31T11:01:53.526Z\",\"interval\":{\"days\":1},\"members\":[{\"user\":{\"id\":\"890f29d4-0b7a-11f0-aeb2-760fcae4f596\"}}],\"name\":\"Layer 1\",\"restrictions\":[{\"end_day\":\"friday\",\"end_time\":\"17:00:00\",\"start_day\":\"monday\",\"start_time\":\"09:00:00\"}],\"rotation_start\":\"2025-05-16T11:01:53.526Z\"}],\"name\":\"Test-Delete_On_Call_schedule_returns_No_Content_response-1747825313\",\"time_zone\":\"America/New_York\"},\"relationships\":{\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}},\"type\":\"schedules\"}}" + "json": "{\"data\":{\"attributes\":{\"email\":\"Test-Delete_On_Call_schedule_returns_No_Content_response-1748494428@datadoghq.com\",\"title\":\"user title\"},\"type\":\"users\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/users", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"type\":\"users\",\"id\":\"e913c34d-3c48-11f0-b10e-2e2b611e1022\",\"attributes\":{\"name\":null,\"handle\":\"test-delete_on_call_schedule_returns_no_content_response-1748494428@datadoghq.com\",\"created_at\":\"2025-05-29T04:53:49.418406+00:00\",\"modified_at\":\"2025-05-29T04:53:49.418406+00:00\",\"email\":\"test-delete_on_call_schedule_returns_no_content_response-1748494428@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/97e38917640a0eb3c61f6e1219165929?s=48&d=retro\",\"title\":\"user title\",\"verified\":false,\"service_account\":false,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Pending\"},\"relationships\":{\"roles\":{\"data\":[]},\"org\":{\"data\":{\"type\":\"orgs\",\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\"}}}}}\n", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "183a7c8e-feae-b8bb-fafc-0f9771562005" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"layers\":[{\"effective_date\":\"2025-05-19T04:53:48.818Z\",\"end_date\":\"2025-06-08T04:53:48.818Z\",\"interval\":{\"days\":1},\"members\":[{\"user\":{\"id\":\"e913c34d-3c48-11f0-b10e-2e2b611e1022\"}}],\"name\":\"Layer 1\",\"restrictions\":[{\"end_day\":\"friday\",\"end_time\":\"17:00:00\",\"start_day\":\"monday\",\"start_time\":\"09:00:00\"}],\"rotation_start\":\"2025-05-24T04:53:48.818Z\"}],\"name\":\"Test-Delete_On_Call_schedule_returns_No_Content_response-1748494428\",\"time_zone\":\"America/New_York\"},\"relationships\":{\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}},\"type\":\"schedules\"}}" }, "headers": {}, "method": "POST", @@ -12,7 +42,7 @@ "secure": true }, "httpResponse": { - "body": "{\"data\":{\"id\":\"cb45fcec-a893-423f-94d1-a401bd31e09c\",\"type\":\"schedules\",\"attributes\":{\"name\":\"Test-Delete_On_Call_schedule_returns_No_Content_response-1747825313\",\"time_zone\":\"America/New_York\"},\"relationships\":{\"layers\":{\"data\":[{\"id\":\"56bdebe0-3f79-4571-a92f-c8fb422c7a3e\",\"type\":\"layers\"}]},\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}}}}", + "body": "{\"data\":{\"id\":\"4068aec3-24f3-41c6-8778-72f8754684c3\",\"type\":\"schedules\",\"attributes\":{\"name\":\"Test-Delete_On_Call_schedule_returns_No_Content_response-1748494428\",\"time_zone\":\"America/New_York\"},\"relationships\":{\"layers\":{\"data\":[{\"id\":\"671b7e9e-1bcf-4e7a-817e-3b825b7dd3e6\",\"type\":\"layers\"}]},\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}}}}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -27,13 +57,13 @@ "timeToLive": { "unlimited": true }, - "id": "ddcc67ac-4ec9-9c2f-c904-851d18a62b00" + "id": "2496dfd7-193e-d170-8062-ce67275716af" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/on-call/schedules/cb45fcec-a893-423f-94d1-a401bd31e09c", + "path": "/api/v2/on-call/schedules/4068aec3-24f3-41c6-8778-72f8754684c3", "keepAlive": false, "secure": true }, @@ -48,18 +78,18 @@ "timeToLive": { "unlimited": true }, - "id": "db503c54-8334-1811-d75e-439c4af46910" + "id": "0adcfd26-a01a-b7c7-d0cc-044c6497288d" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/on-call/schedules/cb45fcec-a893-423f-94d1-a401bd31e09c", + "path": "/api/v2/on-call/schedules/4068aec3-24f3-41c6-8778-72f8754684c3", "keepAlive": false, "secure": true }, "httpResponse": { - "body": "{\"errors\":[{\"title\":\"Generic Error\",\"detail\":\"schedule[cb45fcec-a893-423f-94d1-a401bd31e09c] not found\"}]}", + "body": "{\"errors\":[{\"title\":\"Generic Error\",\"detail\":\"schedule[4068aec3-24f3-41c6-8778-72f8754684c3] not found\"}]}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -74,6 +104,27 @@ "timeToLive": { "unlimited": true }, - "id": "db503c54-8334-1811-d75e-439c4af46911" + "id": "0adcfd26-a01a-b7c7-d0cc-044c6497288e" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/users/e913c34d-3c48-11f0-b10e-2e2b611e1022", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "cdbcd428-391a-00d0-6af1-3a431f75318f" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_On_Call_escalation_policy_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Get_On_Call_escalation_policy_returns_OK_response.freeze index 948876221d3..b08c0417dca 100644 --- a/src/test/resources/cassettes/features/v2/Get_On_Call_escalation_policy_returns_OK_response.freeze +++ b/src/test/resources/cassettes/features/v2/Get_On_Call_escalation_policy_returns_OK_response.freeze @@ -1 +1 @@ -2025-05-22T08:13:16.150Z \ No newline at end of file +2025-05-29T04:53:52.267Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_On_Call_escalation_policy_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Get_On_Call_escalation_policy_returns_OK_response.json index 732deb3b5eb..bdc57eae36c 100644 --- a/src/test/resources/cassettes/features/v2/Get_On_Call_escalation_policy_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Get_On_Call_escalation_policy_returns_OK_response.json @@ -3,7 +3,7 @@ "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"email\":\"Test-Get_On_Call_escalation_policy_returns_OK_response-1747901596@datadoghq.com\",\"title\":\"user title\"},\"type\":\"users\"}}" + "json": "{\"data\":{\"attributes\":{\"email\":\"Test-Get_On_Call_escalation_policy_returns_OK_response-1748494432@datadoghq.com\",\"title\":\"user title\"},\"type\":\"users\"}}" }, "headers": {}, "method": "POST", @@ -12,7 +12,7 @@ "secure": true }, "httpResponse": { - "body": "{\"data\":{\"type\":\"users\",\"id\":\"9d53cb80-36e4-11f0-a925-6205a5ac8b82\",\"attributes\":{\"name\":null,\"handle\":\"test-get_on_call_escalation_policy_returns_ok_response-1747901596@datadoghq.com\",\"created_at\":\"2025-05-22T08:13:16.844359+00:00\",\"modified_at\":\"2025-05-22T08:13:16.844359+00:00\",\"email\":\"test-get_on_call_escalation_policy_returns_ok_response-1747901596@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/e764229bedd0fcaaf713b8470d33ff30?s=48&d=retro\",\"title\":\"user title\",\"verified\":false,\"service_account\":false,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Pending\"},\"relationships\":{\"roles\":{\"data\":[]},\"org\":{\"data\":{\"type\":\"orgs\",\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\"}}}}}\n", + "body": "{\"data\":{\"type\":\"users\",\"id\":\"eb22c300-3c48-11f0-b6eb-6e406f40657f\",\"attributes\":{\"name\":null,\"handle\":\"test-get_on_call_escalation_policy_returns_ok_response-1748494432@datadoghq.com\",\"created_at\":\"2025-05-29T04:53:52.872150+00:00\",\"modified_at\":\"2025-05-29T04:53:52.872150+00:00\",\"email\":\"test-get_on_call_escalation_policy_returns_ok_response-1748494432@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/28954a95ef3e23c51599bc32b67118de?s=48&d=retro\",\"title\":\"user title\",\"verified\":false,\"service_account\":false,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Pending\"},\"relationships\":{\"roles\":{\"data\":[]},\"org\":{\"data\":{\"type\":\"orgs\",\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\"}}}}}\n", "headers": { "Content-Type": [ "application/json" @@ -27,13 +27,13 @@ "timeToLive": { "unlimited": true }, - "id": "e1f36e8f-18a0-e0e5-0fd9-7b5341781227" + "id": "4c2257ee-6227-23e1-958b-c614c9355bfc" }, { "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"handle\":\"test-handle-59a9a0ccb3d041ed\",\"name\":\"test-name-59a9a0ccb3d041ed\"},\"type\":\"team\"}}" + "json": "{\"data\":{\"attributes\":{\"handle\":\"test-handle-bbce2cc58d5af798\",\"name\":\"test-name-bbce2cc58d5af798\"},\"type\":\"team\"}}" }, "headers": {}, "method": "POST", @@ -42,7 +42,7 @@ "secure": true }, "httpResponse": { - "body": "{\"data\":{\"type\":\"team\",\"id\":\"11dfbd58-960b-4b61-b2ee-a1d754a0c968\",\"attributes\":{\"name\":\"test-name-59a9a0ccb3d041ed\",\"handle\":\"test-handle-59a9a0ccb3d041ed\",\"summary\":null,\"description\":null,\"avatar\":null,\"banner\":12,\"visible_modules\":[],\"hidden_modules\":[],\"created_at\":\"2025-05-22T08:13:17.120509+00:00\",\"modified_at\":\"2025-05-22T08:13:17.120518+00:00\",\"user_count\":0,\"link_count\":0},\"relationships\":{\"team_links\":{\"links\":{\"related\":\"/api/v2/team/11dfbd58-960b-4b61-b2ee-a1d754a0c968/links\"}},\"user_team_permissions\":{\"links\":{\"related\":\"/api/v2/team/11dfbd58-960b-4b61-b2ee-a1d754a0c968/permission-settings\"}}}}}\n", + "body": "{\"data\":{\"type\":\"team\",\"id\":\"dba59993-2c99-46f0-b91b-9e7936a4a78e\",\"attributes\":{\"name\":\"test-name-bbce2cc58d5af798\",\"handle\":\"test-handle-bbce2cc58d5af798\",\"summary\":null,\"description\":null,\"avatar\":null,\"banner\":9,\"visible_modules\":[],\"hidden_modules\":[],\"created_at\":\"2025-05-29T04:53:53.543425+00:00\",\"modified_at\":\"2025-05-29T04:53:53.543434+00:00\",\"user_count\":0,\"link_count\":0},\"relationships\":{\"team_links\":{\"links\":{\"related\":\"/api/v2/team/dba59993-2c99-46f0-b91b-9e7936a4a78e/links\"}},\"user_team_permissions\":{\"links\":{\"related\":\"/api/v2/team/dba59993-2c99-46f0-b91b-9e7936a4a78e/permission-settings\"}}}}}\n", "headers": { "Content-Type": [ "application/json" @@ -57,13 +57,13 @@ "timeToLive": { "unlimited": true }, - "id": "d7507709-316d-d4ca-d850-4dc941ce8aa9" + "id": "ca32b16e-9bb2-06d3-dcfd-58b3b717feb4" }, { "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"layers\":[{\"effective_date\":\"2025-05-12T08:13:16.150Z\",\"end_date\":\"2025-06-01T08:13:16.150Z\",\"interval\":{\"days\":1},\"members\":[{\"user\":{\"id\":\"890f29d4-0b7a-11f0-aeb2-760fcae4f596\"}}],\"name\":\"Layer 1\",\"restrictions\":[{\"end_day\":\"friday\",\"end_time\":\"17:00:00\",\"start_day\":\"monday\",\"start_time\":\"09:00:00\"}],\"rotation_start\":\"2025-05-17T08:13:16.150Z\"}],\"name\":\"Test-Get_On_Call_escalation_policy_returns_OK_response-1747901596\",\"time_zone\":\"America/New_York\"},\"relationships\":{\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}},\"type\":\"schedules\"}}" + "json": "{\"data\":{\"attributes\":{\"layers\":[{\"effective_date\":\"2025-05-19T04:53:52.267Z\",\"end_date\":\"2025-06-08T04:53:52.267Z\",\"interval\":{\"days\":1},\"members\":[{\"user\":{\"id\":\"eb22c300-3c48-11f0-b6eb-6e406f40657f\"}}],\"name\":\"Layer 1\",\"restrictions\":[{\"end_day\":\"friday\",\"end_time\":\"17:00:00\",\"start_day\":\"monday\",\"start_time\":\"09:00:00\"}],\"rotation_start\":\"2025-05-24T04:53:52.267Z\"}],\"name\":\"Test-Get_On_Call_escalation_policy_returns_OK_response-1748494432\",\"time_zone\":\"America/New_York\"},\"relationships\":{\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}},\"type\":\"schedules\"}}" }, "headers": {}, "method": "POST", @@ -72,7 +72,7 @@ "secure": true }, "httpResponse": { - "body": "{\"data\":{\"id\":\"f4321cbc-072d-49c7-9f2d-dd63e6b17604\",\"type\":\"schedules\",\"attributes\":{\"name\":\"Test-Get_On_Call_escalation_policy_returns_OK_response-1747901596\",\"time_zone\":\"America/New_York\"},\"relationships\":{\"layers\":{\"data\":[{\"id\":\"c0103435-9e63-49bc-b358-e3509d4538d9\",\"type\":\"layers\"}]},\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}}}}", + "body": "{\"data\":{\"id\":\"996bb88f-ddaf-491b-84df-b8c60c9c358a\",\"type\":\"schedules\",\"attributes\":{\"name\":\"Test-Get_On_Call_escalation_policy_returns_OK_response-1748494432\",\"time_zone\":\"America/New_York\"},\"relationships\":{\"layers\":{\"data\":[{\"id\":\"016cfd54-38ec-4d23-938b-f07e8643a3f7\",\"type\":\"layers\"}]},\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}}}}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -87,13 +87,13 @@ "timeToLive": { "unlimited": true }, - "id": "c66d6e1d-1b9d-855f-0951-b4eb9a5ef333" + "id": "5c6d881b-f0e8-a0d3-27c2-b75281fd4c00" }, { "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"name\":\"Test-Get_On_Call_escalation_policy_returns_OK_response-1747901596\",\"resolve_page_on_policy_end\":true,\"retries\":2,\"steps\":[{\"assignment\":\"default\",\"escalate_after_seconds\":3600,\"targets\":[{\"id\":\"11dfbd58-960b-4b61-b2ee-a1d754a0c968\",\"type\":\"teams\"},{\"id\":\"f4321cbc-072d-49c7-9f2d-dd63e6b17604\",\"type\":\"schedules\"},{\"id\":\"9d53cb80-36e4-11f0-a925-6205a5ac8b82\",\"type\":\"users\"}]},{\"assignment\":\"round-robin\",\"escalate_after_seconds\":3600,\"targets\":[{\"id\":\"11dfbd58-960b-4b61-b2ee-a1d754a0c968\",\"type\":\"teams\"}]}]},\"relationships\":{\"teams\":{\"data\":[{\"id\":\"11dfbd58-960b-4b61-b2ee-a1d754a0c968\",\"type\":\"teams\"}]}},\"type\":\"policies\"}}" + "json": "{\"data\":{\"attributes\":{\"name\":\"Test-Get_On_Call_escalation_policy_returns_OK_response-1748494432\",\"resolve_page_on_policy_end\":true,\"retries\":2,\"steps\":[{\"assignment\":\"default\",\"escalate_after_seconds\":3600,\"targets\":[{\"id\":\"dba59993-2c99-46f0-b91b-9e7936a4a78e\",\"type\":\"teams\"},{\"id\":\"996bb88f-ddaf-491b-84df-b8c60c9c358a\",\"type\":\"schedules\"},{\"id\":\"eb22c300-3c48-11f0-b6eb-6e406f40657f\",\"type\":\"users\"}]},{\"assignment\":\"round-robin\",\"escalate_after_seconds\":3600,\"targets\":[{\"id\":\"dba59993-2c99-46f0-b91b-9e7936a4a78e\",\"type\":\"teams\"}]}]},\"relationships\":{\"teams\":{\"data\":[{\"id\":\"dba59993-2c99-46f0-b91b-9e7936a4a78e\",\"type\":\"teams\"}]}},\"type\":\"policies\"}}" }, "headers": {}, "method": "POST", @@ -102,7 +102,7 @@ "secure": true }, "httpResponse": { - "body": "{\"data\":{\"id\":\"76c1a88a-9590-40a0-b848-b64a3acc3668\",\"type\":\"policies\",\"attributes\":{\"name\":\"Test-Get_On_Call_escalation_policy_returns_OK_response-1747901596\",\"resolve_page_on_policy_end\":true,\"retries\":2},\"relationships\":{\"steps\":{\"data\":[{\"id\":\"69b0a8d5-9706-49cd-92a1-2d5ddb96cbee\",\"type\":\"steps\"},{\"id\":\"aa2918d5-9024-4ca6-b214-69238907fdf9\",\"type\":\"steps\"}]},\"teams\":{\"data\":[{\"id\":\"11dfbd58-960b-4b61-b2ee-a1d754a0c968\",\"type\":\"teams\"}]}}}}", + "body": "{\"data\":{\"id\":\"e75b436d-cbb7-44d6-bf87-4f53073a5bb5\",\"type\":\"policies\",\"attributes\":{\"name\":\"Test-Get_On_Call_escalation_policy_returns_OK_response-1748494432\",\"resolve_page_on_policy_end\":true,\"retries\":2},\"relationships\":{\"steps\":{\"data\":[{\"id\":\"c4cd74b1-1eb4-48a7-9fc0-a66f4e12919b\",\"type\":\"steps\"},{\"id\":\"f11818e3-db9e-4601-b1e1-391fa54b6087\",\"type\":\"steps\"}]},\"teams\":{\"data\":[{\"id\":\"dba59993-2c99-46f0-b91b-9e7936a4a78e\",\"type\":\"teams\"}]}}}}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -117,13 +117,13 @@ "timeToLive": { "unlimited": true }, - "id": "6d9879d9-e003-c994-0a84-48e667bacf03" + "id": "de56e0f4-bd10-f7e2-fd44-aa07952c8a58" }, { "httpRequest": { "headers": {}, "method": "GET", - "path": "/api/v2/on-call/escalation-policies/76c1a88a-9590-40a0-b848-b64a3acc3668", + "path": "/api/v2/on-call/escalation-policies/e75b436d-cbb7-44d6-bf87-4f53073a5bb5", "queryStringParameters": { "include": [ "steps.targets" @@ -133,7 +133,7 @@ "secure": true }, "httpResponse": { - "body": "{\"data\":{\"id\":\"76c1a88a-9590-40a0-b848-b64a3acc3668\",\"type\":\"policies\",\"attributes\":{\"name\":\"Test-Get_On_Call_escalation_policy_returns_OK_response-1747901596\",\"resolve_page_on_policy_end\":true,\"retries\":2},\"relationships\":{\"steps\":{\"data\":[{\"id\":\"69b0a8d5-9706-49cd-92a1-2d5ddb96cbee\",\"type\":\"steps\"},{\"id\":\"aa2918d5-9024-4ca6-b214-69238907fdf9\",\"type\":\"steps\"}]},\"teams\":{\"data\":[{\"id\":\"11dfbd58-960b-4b61-b2ee-a1d754a0c968\",\"type\":\"teams\"}]}}},\"included\":[{\"id\":\"69b0a8d5-9706-49cd-92a1-2d5ddb96cbee\",\"type\":\"steps\",\"attributes\":{\"assignment\":\"default\",\"escalate_after_seconds\":3600},\"relationships\":{\"targets\":{\"data\":[{\"id\":\"11dfbd58-960b-4b61-b2ee-a1d754a0c968\",\"type\":\"teams\"},{\"id\":\"f4321cbc-072d-49c7-9f2d-dd63e6b17604\",\"type\":\"schedules\"},{\"id\":\"9d53cb80-36e4-11f0-a925-6205a5ac8b82\",\"type\":\"users\"}]}}},{\"id\":\"aa2918d5-9024-4ca6-b214-69238907fdf9\",\"type\":\"steps\",\"attributes\":{\"assignment\":\"round-robin\",\"escalate_after_seconds\":3600},\"relationships\":{\"targets\":{\"data\":[{\"id\":\"11dfbd58-960b-4b61-b2ee-a1d754a0c968\",\"type\":\"teams\"}]}}},{\"id\":\"11dfbd58-960b-4b61-b2ee-a1d754a0c968\",\"type\":\"teams\",\"attributes\":{\"avatar\":\"\",\"description\":\"\",\"handle\":\"test-handle-59a9a0ccb3d041ed\",\"name\":\"test-name-59a9a0ccb3d041ed\"}},{\"id\":\"f4321cbc-072d-49c7-9f2d-dd63e6b17604\",\"type\":\"schedules\",\"attributes\":{\"name\":\"Test-Get_On_Call_escalation_policy_returns_OK_response-1747901596\",\"time_zone\":\"America/New_York\"},\"relationships\":{\"layers\":{\"data\":[{\"id\":\"c0103435-9e63-49bc-b358-e3509d4538d9\",\"type\":\"layers\"}]},\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}}},{\"id\":\"9d53cb80-36e4-11f0-a925-6205a5ac8b82\",\"type\":\"users\",\"attributes\":{\"email\":\"test-get_on_call_escalation_policy_returns_ok_response-1747901596@datadoghq.com\",\"name\":\"\",\"status\":\"pending\"}}]}", + "body": "{\"data\":{\"id\":\"e75b436d-cbb7-44d6-bf87-4f53073a5bb5\",\"type\":\"policies\",\"attributes\":{\"name\":\"Test-Get_On_Call_escalation_policy_returns_OK_response-1748494432\",\"resolve_page_on_policy_end\":true,\"retries\":2},\"relationships\":{\"steps\":{\"data\":[{\"id\":\"c4cd74b1-1eb4-48a7-9fc0-a66f4e12919b\",\"type\":\"steps\"},{\"id\":\"f11818e3-db9e-4601-b1e1-391fa54b6087\",\"type\":\"steps\"}]},\"teams\":{\"data\":[{\"id\":\"dba59993-2c99-46f0-b91b-9e7936a4a78e\",\"type\":\"teams\"}]}}},\"included\":[{\"id\":\"c4cd74b1-1eb4-48a7-9fc0-a66f4e12919b\",\"type\":\"steps\",\"attributes\":{\"assignment\":\"default\",\"escalate_after_seconds\":3600},\"relationships\":{\"targets\":{\"data\":[{\"id\":\"dba59993-2c99-46f0-b91b-9e7936a4a78e\",\"type\":\"teams\"},{\"id\":\"996bb88f-ddaf-491b-84df-b8c60c9c358a\",\"type\":\"schedules\"},{\"id\":\"eb22c300-3c48-11f0-b6eb-6e406f40657f\",\"type\":\"users\"}]}}},{\"id\":\"f11818e3-db9e-4601-b1e1-391fa54b6087\",\"type\":\"steps\",\"attributes\":{\"assignment\":\"round-robin\",\"escalate_after_seconds\":3600},\"relationships\":{\"targets\":{\"data\":[{\"id\":\"dba59993-2c99-46f0-b91b-9e7936a4a78e\",\"type\":\"teams\"}]}}},{\"id\":\"996bb88f-ddaf-491b-84df-b8c60c9c358a\",\"type\":\"schedules\",\"attributes\":{\"name\":\"Test-Get_On_Call_escalation_policy_returns_OK_response-1748494432\",\"time_zone\":\"America/New_York\"},\"relationships\":{\"layers\":{\"data\":[{\"id\":\"016cfd54-38ec-4d23-938b-f07e8643a3f7\",\"type\":\"layers\"}]},\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}}},{\"id\":\"eb22c300-3c48-11f0-b6eb-6e406f40657f\",\"type\":\"users\",\"attributes\":{\"email\":\"test-get_on_call_escalation_policy_returns_ok_response-1748494432@datadoghq.com\",\"name\":\"\",\"status\":\"pending\"}},{\"id\":\"dba59993-2c99-46f0-b91b-9e7936a4a78e\",\"type\":\"teams\",\"attributes\":{\"avatar\":\"\",\"description\":\"\",\"handle\":\"test-handle-bbce2cc58d5af798\",\"name\":\"test-name-bbce2cc58d5af798\"}}]}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -148,13 +148,13 @@ "timeToLive": { "unlimited": true }, - "id": "b39480cd-657c-0103-d092-c7a8c78b1c7e" + "id": "e964874d-2293-e0ca-ed55-4bee66428d59" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/on-call/escalation-policies/76c1a88a-9590-40a0-b848-b64a3acc3668", + "path": "/api/v2/on-call/escalation-policies/e75b436d-cbb7-44d6-bf87-4f53073a5bb5", "keepAlive": false, "secure": true }, @@ -169,13 +169,13 @@ "timeToLive": { "unlimited": true }, - "id": "f9fb9f16-255f-cc2e-2f2b-71932c0f97ff" + "id": "2d911359-da46-7ae9-bc03-7795e6185324" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/on-call/schedules/f4321cbc-072d-49c7-9f2d-dd63e6b17604", + "path": "/api/v2/on-call/schedules/996bb88f-ddaf-491b-84df-b8c60c9c358a", "keepAlive": false, "secure": true }, @@ -190,13 +190,13 @@ "timeToLive": { "unlimited": true }, - "id": "46efae2e-f2e2-2c37-16f3-3351e840c083" + "id": "e6dc3dfc-339d-523e-6d11-d3d87e264b89" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/team/11dfbd58-960b-4b61-b2ee-a1d754a0c968", + "path": "/api/v2/team/dba59993-2c99-46f0-b91b-9e7936a4a78e", "keepAlive": false, "secure": true }, @@ -211,13 +211,13 @@ "timeToLive": { "unlimited": true }, - "id": "e014ac51-bced-61d4-5a8a-cdc65e4f61a1" + "id": "1a3c7760-51f3-08a1-32d0-7fc885bbbb70" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/users/9d53cb80-36e4-11f0-a925-6205a5ac8b82", + "path": "/api/v2/users/eb22c300-3c48-11f0-b6eb-6e406f40657f", "keepAlive": false, "secure": true }, @@ -232,6 +232,6 @@ "timeToLive": { "unlimited": true }, - "id": "b5c88d3c-3d07-9bfe-89be-c84dd3c7d88d" + "id": "bbeec54e-f17a-78a3-c0a7-d3dfa16f9402" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_On_Call_schedule_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Get_On_Call_schedule_returns_OK_response.freeze index e218d1ad69e..0279e1e8caf 100644 --- a/src/test/resources/cassettes/features/v2/Get_On_Call_schedule_returns_OK_response.freeze +++ b/src/test/resources/cassettes/features/v2/Get_On_Call_schedule_returns_OK_response.freeze @@ -1 +1 @@ -2025-05-21T11:01:55.033Z \ No newline at end of file +2025-05-29T04:53:58.508Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_On_Call_schedule_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Get_On_Call_schedule_returns_OK_response.json index 8028a9b3d5f..c036c00e86d 100644 --- a/src/test/resources/cassettes/features/v2/Get_On_Call_schedule_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Get_On_Call_schedule_returns_OK_response.json @@ -3,7 +3,37 @@ "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"layers\":[{\"effective_date\":\"2025-05-11T11:01:55.033Z\",\"end_date\":\"2025-05-31T11:01:55.033Z\",\"interval\":{\"days\":1},\"members\":[{\"user\":{\"id\":\"890f29d4-0b7a-11f0-aeb2-760fcae4f596\"}}],\"name\":\"Layer 1\",\"restrictions\":[{\"end_day\":\"friday\",\"end_time\":\"17:00:00\",\"start_day\":\"monday\",\"start_time\":\"09:00:00\"}],\"rotation_start\":\"2025-05-16T11:01:55.033Z\"}],\"name\":\"Test-Get_On_Call_schedule_returns_OK_response-1747825315\",\"time_zone\":\"America/New_York\"},\"relationships\":{\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}},\"type\":\"schedules\"}}" + "json": "{\"data\":{\"attributes\":{\"email\":\"Test-Get_On_Call_schedule_returns_OK_response-1748494438@datadoghq.com\",\"title\":\"user title\"},\"type\":\"users\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/users", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"type\":\"users\",\"id\":\"eedd114a-3c48-11f0-927d-aedf77869272\",\"attributes\":{\"name\":null,\"handle\":\"test-get_on_call_schedule_returns_ok_response-1748494438@datadoghq.com\",\"created_at\":\"2025-05-29T04:53:59.126285+00:00\",\"modified_at\":\"2025-05-29T04:53:59.126285+00:00\",\"email\":\"test-get_on_call_schedule_returns_ok_response-1748494438@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/0accc7b5a2e934dd438cd3b30841dcad?s=48&d=retro\",\"title\":\"user title\",\"verified\":false,\"service_account\":false,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Pending\"},\"relationships\":{\"roles\":{\"data\":[]},\"org\":{\"data\":{\"type\":\"orgs\",\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\"}}}}}\n", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "72b9a3b4-8ff5-8913-f1c2-1e355dcbc11b" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"layers\":[{\"effective_date\":\"2025-05-19T04:53:58.508Z\",\"end_date\":\"2025-06-08T04:53:58.508Z\",\"interval\":{\"days\":1},\"members\":[{\"user\":{\"id\":\"eedd114a-3c48-11f0-927d-aedf77869272\"}}],\"name\":\"Layer 1\",\"restrictions\":[{\"end_day\":\"friday\",\"end_time\":\"17:00:00\",\"start_day\":\"monday\",\"start_time\":\"09:00:00\"}],\"rotation_start\":\"2025-05-24T04:53:58.508Z\"}],\"name\":\"Test-Get_On_Call_schedule_returns_OK_response-1748494438\",\"time_zone\":\"America/New_York\"},\"relationships\":{\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}},\"type\":\"schedules\"}}" }, "headers": {}, "method": "POST", @@ -12,7 +42,7 @@ "secure": true }, "httpResponse": { - "body": "{\"data\":{\"id\":\"68403f49-4f50-4307-bdf2-663ebab53587\",\"type\":\"schedules\",\"attributes\":{\"name\":\"Test-Get_On_Call_schedule_returns_OK_response-1747825315\",\"time_zone\":\"America/New_York\"},\"relationships\":{\"layers\":{\"data\":[{\"id\":\"15bf3013-34f8-474c-925f-87f468e3eaff\",\"type\":\"layers\"}]},\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}}}}", + "body": "{\"data\":{\"id\":\"cec4edfd-3f99-4da9-bd71-75c80c5629f8\",\"type\":\"schedules\",\"attributes\":{\"name\":\"Test-Get_On_Call_schedule_returns_OK_response-1748494438\",\"time_zone\":\"America/New_York\"},\"relationships\":{\"layers\":{\"data\":[{\"id\":\"9f5d591e-e81b-4262-b0cd-145b52b9f23f\",\"type\":\"layers\"}]},\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}}}}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -27,18 +57,18 @@ "timeToLive": { "unlimited": true }, - "id": "cee8831b-d404-7133-bf73-f8273d58ba9c" + "id": "da807331-de09-b0fa-dbc3-ed9b0712728c" }, { "httpRequest": { "headers": {}, "method": "GET", - "path": "/api/v2/on-call/schedules/68403f49-4f50-4307-bdf2-663ebab53587", + "path": "/api/v2/on-call/schedules/cec4edfd-3f99-4da9-bd71-75c80c5629f8", "keepAlive": false, "secure": true }, "httpResponse": { - "body": "{\"data\":{\"id\":\"68403f49-4f50-4307-bdf2-663ebab53587\",\"type\":\"schedules\",\"attributes\":{\"name\":\"Test-Get_On_Call_schedule_returns_OK_response-1747825315\",\"time_zone\":\"America/New_York\"},\"relationships\":{\"layers\":{\"data\":[{\"id\":\"15bf3013-34f8-474c-925f-87f468e3eaff\",\"type\":\"layers\"}]},\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}}}}", + "body": "{\"data\":{\"id\":\"cec4edfd-3f99-4da9-bd71-75c80c5629f8\",\"type\":\"schedules\",\"attributes\":{\"name\":\"Test-Get_On_Call_schedule_returns_OK_response-1748494438\",\"time_zone\":\"America/New_York\"},\"relationships\":{\"layers\":{\"data\":[{\"id\":\"9f5d591e-e81b-4262-b0cd-145b52b9f23f\",\"type\":\"layers\"}]},\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}}}}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -53,13 +83,34 @@ "timeToLive": { "unlimited": true }, - "id": "66010346-21dd-3790-9342-dd7dc562e4ed" + "id": "6eea9c95-b989-6e3f-a0c7-f3ea9b6fb4c9" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/on-call/schedules/cec4edfd-3f99-4da9-bd71-75c80c5629f8", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "680d12b7-2d56-55ee-f4da-6e1f42eab632" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/on-call/schedules/68403f49-4f50-4307-bdf2-663ebab53587", + "path": "/api/v2/users/eedd114a-3c48-11f0-927d-aedf77869272", "keepAlive": false, "secure": true }, @@ -74,6 +125,6 @@ "timeToLive": { "unlimited": true }, - "id": "e5d95b66-b104-2f2c-42c1-4af9ed1a73fd" + "id": "6dddee96-a8ee-140d-a1b8-7a9f1f9b0cf3" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_team_on_call_users_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Get_team_on_call_users_returns_OK_response.freeze new file mode 100644 index 00000000000..852ceca5c64 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_team_on_call_users_returns_OK_response.freeze @@ -0,0 +1 @@ +2025-05-29T07:30:17.381Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_team_on_call_users_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Get_team_on_call_users_returns_OK_response.json new file mode 100644 index 00000000000..cb429d89123 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_team_on_call_users_returns_OK_response.json @@ -0,0 +1,277 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"email\":\"Test-Get_team_on_call_users_returns_OK_response-1748503817@datadoghq.com\",\"title\":\"user title\"},\"type\":\"users\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/users", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"type\":\"users\",\"id\":\"c534e9e3-3c5e-11f0-b6eb-6e406f40657f\",\"attributes\":{\"name\":null,\"handle\":\"test-get_team_on_call_users_returns_ok_response-1748503817@datadoghq.com\",\"created_at\":\"2025-05-29T07:30:18.165739+00:00\",\"modified_at\":\"2025-05-29T07:30:18.165739+00:00\",\"email\":\"test-get_team_on_call_users_returns_ok_response-1748503817@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/a9b817a05a2ad95be147030f20ff95fb?s=48&d=retro\",\"title\":\"user title\",\"verified\":false,\"service_account\":false,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Pending\"},\"relationships\":{\"roles\":{\"data\":[]},\"org\":{\"data\":{\"type\":\"orgs\",\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\"}}}}}\n", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "57e94619-50b1-1ac3-b718-d291ad6a0868" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"handle\":\"test-handle-aa0dbd3d9b27ea9e\",\"name\":\"test-name-aa0dbd3d9b27ea9e\"},\"type\":\"team\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"type\":\"team\",\"id\":\"6a8339f9-9d86-4948-a469-1b0cbef769bb\",\"attributes\":{\"name\":\"test-name-aa0dbd3d9b27ea9e\",\"handle\":\"test-handle-aa0dbd3d9b27ea9e\",\"summary\":null,\"description\":null,\"avatar\":null,\"banner\":1,\"visible_modules\":[],\"hidden_modules\":[],\"created_at\":\"2025-05-29T07:30:18.898463+00:00\",\"modified_at\":\"2025-05-29T07:30:18.898474+00:00\",\"user_count\":0,\"link_count\":0},\"relationships\":{\"team_links\":{\"links\":{\"related\":\"/api/v2/team/6a8339f9-9d86-4948-a469-1b0cbef769bb/links\"}},\"user_team_permissions\":{\"links\":{\"related\":\"/api/v2/team/6a8339f9-9d86-4948-a469-1b0cbef769bb/permission-settings\"}}}}}\n", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "442e8aa3-11a2-5be7-b79a-86cca2bdeece" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"layers\":[{\"effective_date\":\"2025-05-19T07:30:17.381Z\",\"end_date\":\"2025-06-08T07:30:17.381Z\",\"interval\":{\"days\":1},\"members\":[{\"user\":{\"id\":\"c534e9e3-3c5e-11f0-b6eb-6e406f40657f\"}}],\"name\":\"Layer 1\",\"restrictions\":[{\"end_day\":\"friday\",\"end_time\":\"17:00:00\",\"start_day\":\"monday\",\"start_time\":\"09:00:00\"}],\"rotation_start\":\"2025-05-24T07:30:17.381Z\"}],\"name\":\"Test-Get_team_on_call_users_returns_OK_response-1748503817\",\"time_zone\":\"America/New_York\"},\"relationships\":{\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}},\"type\":\"schedules\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/on-call/schedules", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"ba6c57a1-bb93-4f5a-a22b-174f84b0c5d6\",\"type\":\"schedules\",\"attributes\":{\"name\":\"Test-Get_team_on_call_users_returns_OK_response-1748503817\",\"time_zone\":\"America/New_York\"},\"relationships\":{\"layers\":{\"data\":[{\"id\":\"d12469b6-85d8-461a-89c6-61fc956c1446\",\"type\":\"layers\"}]},\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "75f6ef08-a8ca-4e05-0421-9b909786cba3" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"name\":\"Test-Get_team_on_call_users_returns_OK_response-1748503817\",\"resolve_page_on_policy_end\":true,\"retries\":2,\"steps\":[{\"assignment\":\"default\",\"escalate_after_seconds\":3600,\"targets\":[{\"id\":\"6a8339f9-9d86-4948-a469-1b0cbef769bb\",\"type\":\"teams\"},{\"id\":\"ba6c57a1-bb93-4f5a-a22b-174f84b0c5d6\",\"type\":\"schedules\"},{\"id\":\"c534e9e3-3c5e-11f0-b6eb-6e406f40657f\",\"type\":\"users\"}]},{\"assignment\":\"round-robin\",\"escalate_after_seconds\":3600,\"targets\":[{\"id\":\"6a8339f9-9d86-4948-a469-1b0cbef769bb\",\"type\":\"teams\"}]}]},\"relationships\":{\"teams\":{\"data\":[{\"id\":\"6a8339f9-9d86-4948-a469-1b0cbef769bb\",\"type\":\"teams\"}]}},\"type\":\"policies\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/on-call/escalation-policies", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"5cfa8139-510a-4965-8f10-dc79488fcd89\",\"type\":\"policies\",\"attributes\":{\"name\":\"Test-Get_team_on_call_users_returns_OK_response-1748503817\",\"resolve_page_on_policy_end\":true,\"retries\":2},\"relationships\":{\"steps\":{\"data\":[{\"id\":\"03c363ed-929e-4fa1-8397-e80a5b422648\",\"type\":\"steps\"},{\"id\":\"0c678f92-8639-4d72-ad5a-f40307c1d935\",\"type\":\"steps\"}]},\"teams\":{\"data\":[{\"id\":\"6a8339f9-9d86-4948-a469-1b0cbef769bb\",\"type\":\"teams\"}]}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "c9d496b9-e3c6-79e2-02cb-d3305aec6f0a" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"rules\":[{\"actions\":[],\"policy_id\":\"5cfa8139-510a-4965-8f10-dc79488fcd89\",\"query\":\"\",\"urgency\":\"low\"}]},\"id\":\"6a8339f9-9d86-4948-a469-1b0cbef769bb\",\"type\":\"team_routing_rules\"}}" + }, + "headers": {}, + "method": "PUT", + "path": "/api/v2/on-call/teams/6a8339f9-9d86-4948-a469-1b0cbef769bb/routing-rules", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"6a8339f9-9d86-4948-a469-1b0cbef769bb\",\"type\":\"team_routing_rules\",\"relationships\":{\"rules\":{\"data\":[{\"id\":\"virtual-6a8339f9-9d86-4948-a469-1b0cbef769bb-rule-0\",\"type\":\"team_routing_rules\"}]}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "6c9cc603-947c-8293-c800-eaeb14f5dd8a" + }, + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/on-call/teams/6a8339f9-9d86-4948-a469-1b0cbef769bb/on-call", + "queryStringParameters": { + "include": [ + "responders,escalations.responders" + ] + }, + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"6a8339f9-9d86-4948-a469-1b0cbef769bb-1748503821\",\"type\":\"team_oncall_responders\",\"relationships\":{\"escalations\":{\"data\":[]},\"responders\":{\"data\":[{\"id\":\"c534e9e3-3c5e-11f0-b6eb-6e406f40657f\",\"type\":\"users\"}]}}},\"included\":[{\"id\":\"c534e9e3-3c5e-11f0-b6eb-6e406f40657f\",\"type\":\"users\",\"attributes\":{\"email\":\"test-get_team_on_call_users_returns_ok_response-1748503817@datadoghq.com\",\"name\":\"\",\"status\":\"pending\"}}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "a5cc36d3-84be-8b3e-c178-570a8206f79b" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/on-call/escalation-policies/5cfa8139-510a-4965-8f10-dc79488fcd89", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"title\":\"Generic Error\",\"detail\":\"policy[5cfa8139-510a-4965-8f10-dc79488fcd89] is in use\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 409, + "reasonPhrase": "Conflict" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "03c06d2a-af94-76a0-624c-bd0454d700a0" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/on-call/schedules/ba6c57a1-bb93-4f5a-a22b-174f84b0c5d6", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"title\":\"Generic Error\",\"detail\":\"schedule[ba6c57a1-bb93-4f5a-a22b-174f84b0c5d6] is in use\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 409, + "reasonPhrase": "Conflict" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "2ade78d0-75dc-d33d-398b-2d1ff037d986" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team/6a8339f9-9d86-4948-a469-1b0cbef769bb", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "baaaeb21-7791-8769-04d2-4014ea195458" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/users/c534e9e3-3c5e-11f0-b6eb-6e406f40657f", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "fd63ffc7-c962-b119-bab1-e4b8311a7002" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_the_schedule_on_call_user_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Get_the_schedule_on_call_user_returns_OK_response.freeze index 6d73c6656d5..1a1c3b8e706 100644 --- a/src/test/resources/cassettes/features/v2/Get_the_schedule_on_call_user_returns_OK_response.freeze +++ b/src/test/resources/cassettes/features/v2/Get_the_schedule_on_call_user_returns_OK_response.freeze @@ -1 +1 @@ -2025-05-21T11:01:55.256Z \ No newline at end of file +2025-05-29T04:54:08.864Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_the_schedule_on_call_user_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Get_the_schedule_on_call_user_returns_OK_response.json index 5f178c98c0b..3b371c6dd90 100644 --- a/src/test/resources/cassettes/features/v2/Get_the_schedule_on_call_user_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Get_the_schedule_on_call_user_returns_OK_response.json @@ -3,7 +3,37 @@ "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"layers\":[{\"effective_date\":\"2025-05-11T11:01:55.256Z\",\"end_date\":\"2025-05-31T11:01:55.256Z\",\"interval\":{\"days\":1},\"members\":[{\"user\":{\"id\":\"890f29d4-0b7a-11f0-aeb2-760fcae4f596\"}}],\"name\":\"Layer 1\",\"restrictions\":[{\"end_day\":\"friday\",\"end_time\":\"17:00:00\",\"start_day\":\"monday\",\"start_time\":\"09:00:00\"}],\"rotation_start\":\"2025-05-16T11:01:55.256Z\"}],\"name\":\"Test-Get_the_schedule_on_call_user_returns_OK_response-1747825315\",\"time_zone\":\"America/New_York\"},\"relationships\":{\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}},\"type\":\"schedules\"}}" + "json": "{\"data\":{\"attributes\":{\"email\":\"Test-Get_the_schedule_on_call_user_returns_OK_response-1748494448@datadoghq.com\",\"title\":\"user title\"},\"type\":\"users\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/users", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"type\":\"users\",\"id\":\"f506d945-3c48-11f0-b6eb-6e406f40657f\",\"attributes\":{\"name\":null,\"handle\":\"test-get_the_schedule_on_call_user_returns_ok_response-1748494448@datadoghq.com\",\"created_at\":\"2025-05-29T04:54:09.466437+00:00\",\"modified_at\":\"2025-05-29T04:54:09.466437+00:00\",\"email\":\"test-get_the_schedule_on_call_user_returns_ok_response-1748494448@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/6c6e9988bfb6ab3c5c5ae2111d47fc54?s=48&d=retro\",\"title\":\"user title\",\"verified\":false,\"service_account\":false,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Pending\"},\"relationships\":{\"roles\":{\"data\":[]},\"org\":{\"data\":{\"type\":\"orgs\",\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\"}}}}}\n", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "1e12d530-76a5-c838-db22-b95700d937f7" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"layers\":[{\"effective_date\":\"2025-05-19T04:54:08.864Z\",\"end_date\":\"2025-06-08T04:54:08.864Z\",\"interval\":{\"days\":1},\"members\":[{\"user\":{\"id\":\"f506d945-3c48-11f0-b6eb-6e406f40657f\"}}],\"name\":\"Layer 1\",\"restrictions\":[{\"end_day\":\"friday\",\"end_time\":\"17:00:00\",\"start_day\":\"monday\",\"start_time\":\"09:00:00\"}],\"rotation_start\":\"2025-05-24T04:54:08.864Z\"}],\"name\":\"Test-Get_the_schedule_on_call_user_returns_OK_response-1748494448\",\"time_zone\":\"America/New_York\"},\"relationships\":{\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}},\"type\":\"schedules\"}}" }, "headers": {}, "method": "POST", @@ -12,7 +42,7 @@ "secure": true }, "httpResponse": { - "body": "{\"data\":{\"id\":\"253ef9a9-6ab9-4c53-9f16-abcf2942b39d\",\"type\":\"schedules\",\"attributes\":{\"name\":\"Test-Get_the_schedule_on_call_user_returns_OK_response-1747825315\",\"time_zone\":\"America/New_York\"},\"relationships\":{\"layers\":{\"data\":[{\"id\":\"d1f6d8a7-ad53-45c9-a226-ebd60587cc80\",\"type\":\"layers\"}]},\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}}}}", + "body": "{\"data\":{\"id\":\"3e8644f0-f579-4459-8cb3-e585cd817db1\",\"type\":\"schedules\",\"attributes\":{\"name\":\"Test-Get_the_schedule_on_call_user_returns_OK_response-1748494448\",\"time_zone\":\"America/New_York\"},\"relationships\":{\"layers\":{\"data\":[{\"id\":\"00847dac-89e7-4a60-8e72-9a5897a3a1e5\",\"type\":\"layers\"}]},\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}}}}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -27,18 +57,18 @@ "timeToLive": { "unlimited": true }, - "id": "bc5a1073-ee34-c21f-0d30-e0bd3dfe84ba" + "id": "5c1053da-a726-e11f-ba71-521d0b4e3906" }, { "httpRequest": { "headers": {}, "method": "GET", - "path": "/api/v2/on-call/schedules/253ef9a9-6ab9-4c53-9f16-abcf2942b39d/on-call", + "path": "/api/v2/on-call/schedules/3e8644f0-f579-4459-8cb3-e585cd817db1/on-call", "keepAlive": false, "secure": true }, "httpResponse": { - "body": "{\"data\":{\"id\":\"890f29d4-0b7a-11f0-aeb2-760fcae4f596-2025-05-21T07:01:55-04:00-2025-05-22T07:01:55-04:00\",\"type\":\"shifts\",\"attributes\":{\"end\":\"2025-05-22T07:01:55-04:00\",\"start\":\"2025-05-21T07:01:55.332323-04:00\"},\"relationships\":{\"user\":{\"data\":{\"id\":\"890f29d4-0b7a-11f0-aeb2-760fcae4f596\",\"type\":\"users\"}}}}}", + "body": "{\"data\":{\"id\":\"f506d945-3c48-11f0-b6eb-6e406f40657f-2025-05-29T00:54:10-04:00-2025-05-30T00:54:08-04:00\",\"type\":\"shifts\",\"attributes\":{\"end\":\"2025-05-30T00:54:08-04:00\",\"start\":\"2025-05-29T00:54:10.138754-04:00\"},\"relationships\":{\"user\":{\"data\":{\"id\":\"f506d945-3c48-11f0-b6eb-6e406f40657f\",\"type\":\"users\"}}}}}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -53,13 +83,34 @@ "timeToLive": { "unlimited": true }, - "id": "9dfb382d-c393-81be-6428-56317516a2a6" + "id": "1b5ef1b3-84c1-8605-bbdf-2716815acf6a" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/on-call/schedules/3e8644f0-f579-4459-8cb3-e585cd817db1", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "ff710b2e-63c2-ae3a-a16b-1b58c64e8a17" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/on-call/schedules/253ef9a9-6ab9-4c53-9f16-abcf2942b39d", + "path": "/api/v2/users/f506d945-3c48-11f0-b6eb-6e406f40657f", "keepAlive": false, "secure": true }, @@ -74,6 +125,6 @@ "timeToLive": { "unlimited": true }, - "id": "b5f93d15-49f0-ff27-a4cb-3e84db77874b" + "id": "d2b0367f-f598-fade-7825-d837d4b47de3" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Set_On_Call_team_routing_rules_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Set_On_Call_team_routing_rules_returns_OK_response.freeze index 72c349683bd..bdc2418a874 100644 --- a/src/test/resources/cassettes/features/v2/Set_On_Call_team_routing_rules_returns_OK_response.freeze +++ b/src/test/resources/cassettes/features/v2/Set_On_Call_team_routing_rules_returns_OK_response.freeze @@ -1 +1 @@ -2025-05-27T08:25:42.329Z \ No newline at end of file +2025-05-29T04:54:12.242Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Set_On_Call_team_routing_rules_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Set_On_Call_team_routing_rules_returns_OK_response.json index f707ec16d2b..acc51bcc203 100644 --- a/src/test/resources/cassettes/features/v2/Set_On_Call_team_routing_rules_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Set_On_Call_team_routing_rules_returns_OK_response.json @@ -3,7 +3,7 @@ "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"email\":\"Test-Set_On_Call_team_routing_rules_returns_OK_response-1748334342@datadoghq.com\",\"title\":\"user title\"},\"type\":\"users\"}}" + "json": "{\"data\":{\"attributes\":{\"email\":\"Test-Set_On_Call_team_routing_rules_returns_OK_response-1748494452@datadoghq.com\",\"title\":\"user title\"},\"type\":\"users\"}}" }, "headers": {}, "method": "POST", @@ -12,7 +12,7 @@ "secure": true }, "httpResponse": { - "body": "{\"data\":{\"type\":\"users\",\"id\":\"2e2a9a43-3ad4-11f0-a123-c6d5a6dabcf4\",\"attributes\":{\"name\":null,\"handle\":\"test-set_on_call_team_routing_rules_returns_ok_response-1748334342@datadoghq.com\",\"created_at\":\"2025-05-27T08:25:43.050742+00:00\",\"modified_at\":\"2025-05-27T08:25:43.050742+00:00\",\"email\":\"test-set_on_call_team_routing_rules_returns_ok_response-1748334342@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/7dc6399db1883a29b1a0022d05a3996c?s=48&d=retro\",\"title\":\"user title\",\"verified\":false,\"service_account\":false,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Pending\"},\"relationships\":{\"roles\":{\"data\":[]},\"org\":{\"data\":{\"type\":\"orgs\",\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\"}}}}}\n", + "body": "{\"data\":{\"type\":\"users\",\"id\":\"f70b5bc2-3c48-11f0-90c9-4ad2f0f8c382\",\"attributes\":{\"name\":null,\"handle\":\"test-set_on_call_team_routing_rules_returns_ok_response-1748494452@datadoghq.com\",\"created_at\":\"2025-05-29T04:54:12.851430+00:00\",\"modified_at\":\"2025-05-29T04:54:12.851430+00:00\",\"email\":\"test-set_on_call_team_routing_rules_returns_ok_response-1748494452@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/3ae763850f6602b2ade88b17b79b0c2f?s=48&d=retro\",\"title\":\"user title\",\"verified\":false,\"service_account\":false,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Pending\"},\"relationships\":{\"roles\":{\"data\":[]},\"org\":{\"data\":{\"type\":\"orgs\",\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\"}}}}}\n", "headers": { "Content-Type": [ "application/json" @@ -27,13 +27,13 @@ "timeToLive": { "unlimited": true }, - "id": "6a253359-e04a-e41a-4c8d-66c21274648d" + "id": "e9b5b61c-ed67-b2a8-7d42-d1e0159aac78" }, { "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"handle\":\"test-handle-1fd6c4543cf4cd88\",\"name\":\"test-name-1fd6c4543cf4cd88\"},\"type\":\"team\"}}" + "json": "{\"data\":{\"attributes\":{\"handle\":\"test-handle-617820e9690362e8\",\"name\":\"test-name-617820e9690362e8\"},\"type\":\"team\"}}" }, "headers": {}, "method": "POST", @@ -42,7 +42,7 @@ "secure": true }, "httpResponse": { - "body": "{\"data\":{\"type\":\"team\",\"id\":\"82aa87bd-fdf1-4683-aecd-706133165bb2\",\"attributes\":{\"name\":\"test-name-1fd6c4543cf4cd88\",\"handle\":\"test-handle-1fd6c4543cf4cd88\",\"summary\":null,\"description\":null,\"avatar\":null,\"banner\":1,\"visible_modules\":[],\"hidden_modules\":[],\"created_at\":\"2025-05-27T08:25:43.186129+00:00\",\"modified_at\":\"2025-05-27T08:25:43.186139+00:00\",\"user_count\":0,\"link_count\":0},\"relationships\":{\"team_links\":{\"links\":{\"related\":\"/api/v2/team/82aa87bd-fdf1-4683-aecd-706133165bb2/links\"}},\"user_team_permissions\":{\"links\":{\"related\":\"/api/v2/team/82aa87bd-fdf1-4683-aecd-706133165bb2/permission-settings\"}}}}}\n", + "body": "{\"data\":{\"type\":\"team\",\"id\":\"08b1cecb-154b-45ca-bafa-a7f0b3196b8d\",\"attributes\":{\"name\":\"test-name-617820e9690362e8\",\"handle\":\"test-handle-617820e9690362e8\",\"summary\":null,\"description\":null,\"avatar\":null,\"banner\":6,\"visible_modules\":[],\"hidden_modules\":[],\"created_at\":\"2025-05-29T04:54:13.517054+00:00\",\"modified_at\":\"2025-05-29T04:54:13.517063+00:00\",\"user_count\":0,\"link_count\":0},\"relationships\":{\"team_links\":{\"links\":{\"related\":\"/api/v2/team/08b1cecb-154b-45ca-bafa-a7f0b3196b8d/links\"}},\"user_team_permissions\":{\"links\":{\"related\":\"/api/v2/team/08b1cecb-154b-45ca-bafa-a7f0b3196b8d/permission-settings\"}}}}}\n", "headers": { "Content-Type": [ "application/json" @@ -57,13 +57,13 @@ "timeToLive": { "unlimited": true }, - "id": "ff1e7b45-1dbd-5a0a-78fa-75d423a4bd32" + "id": "11833563-a939-2dbe-0c10-b5f3aaf634ce" }, { "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"layers\":[{\"effective_date\":\"2025-05-17T08:25:42.329Z\",\"end_date\":\"2025-06-06T08:25:42.329Z\",\"interval\":{\"days\":1},\"members\":[{\"user\":{\"id\":\"890f29d4-0b7a-11f0-aeb2-760fcae4f596\"}}],\"name\":\"Layer 1\",\"restrictions\":[{\"end_day\":\"friday\",\"end_time\":\"17:00:00\",\"start_day\":\"monday\",\"start_time\":\"09:00:00\"}],\"rotation_start\":\"2025-05-22T08:25:42.329Z\"}],\"name\":\"Test-Set_On_Call_team_routing_rules_returns_OK_response-1748334342\",\"time_zone\":\"America/New_York\"},\"relationships\":{\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}},\"type\":\"schedules\"}}" + "json": "{\"data\":{\"attributes\":{\"layers\":[{\"effective_date\":\"2025-05-19T04:54:12.242Z\",\"end_date\":\"2025-06-08T04:54:12.242Z\",\"interval\":{\"days\":1},\"members\":[{\"user\":{\"id\":\"f70b5bc2-3c48-11f0-90c9-4ad2f0f8c382\"}}],\"name\":\"Layer 1\",\"restrictions\":[{\"end_day\":\"friday\",\"end_time\":\"17:00:00\",\"start_day\":\"monday\",\"start_time\":\"09:00:00\"}],\"rotation_start\":\"2025-05-24T04:54:12.242Z\"}],\"name\":\"Test-Set_On_Call_team_routing_rules_returns_OK_response-1748494452\",\"time_zone\":\"America/New_York\"},\"relationships\":{\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}},\"type\":\"schedules\"}}" }, "headers": {}, "method": "POST", @@ -72,7 +72,7 @@ "secure": true }, "httpResponse": { - "body": "{\"data\":{\"id\":\"2eb42c33-6304-4103-9814-25a2e8ce6d02\",\"type\":\"schedules\",\"attributes\":{\"name\":\"Test-Set_On_Call_team_routing_rules_returns_OK_response-1748334342\",\"time_zone\":\"America/New_York\"},\"relationships\":{\"layers\":{\"data\":[{\"id\":\"6f88a332-464d-42b2-94c2-ae9b1e9211eb\",\"type\":\"layers\"}]},\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}}}}", + "body": "{\"data\":{\"id\":\"60ddefa7-5b46-44e1-aabc-2c5b5b2e6fc1\",\"type\":\"schedules\",\"attributes\":{\"name\":\"Test-Set_On_Call_team_routing_rules_returns_OK_response-1748494452\",\"time_zone\":\"America/New_York\"},\"relationships\":{\"layers\":{\"data\":[{\"id\":\"4617f090-9118-4ce6-9b58-4432d311d4b4\",\"type\":\"layers\"}]},\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}}}}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -87,13 +87,13 @@ "timeToLive": { "unlimited": true }, - "id": "f0fa2280-ca40-7a64-cd75-fcd5fdbd2f92" + "id": "826565ae-ed74-b6ba-0a75-1b5f458f665d" }, { "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"name\":\"Test-Set_On_Call_team_routing_rules_returns_OK_response-1748334342\",\"resolve_page_on_policy_end\":true,\"retries\":2,\"steps\":[{\"assignment\":\"default\",\"escalate_after_seconds\":3600,\"targets\":[{\"id\":\"82aa87bd-fdf1-4683-aecd-706133165bb2\",\"type\":\"teams\"},{\"id\":\"2eb42c33-6304-4103-9814-25a2e8ce6d02\",\"type\":\"schedules\"},{\"id\":\"2e2a9a43-3ad4-11f0-a123-c6d5a6dabcf4\",\"type\":\"users\"}]},{\"assignment\":\"round-robin\",\"escalate_after_seconds\":3600,\"targets\":[{\"id\":\"82aa87bd-fdf1-4683-aecd-706133165bb2\",\"type\":\"teams\"}]}]},\"relationships\":{\"teams\":{\"data\":[{\"id\":\"82aa87bd-fdf1-4683-aecd-706133165bb2\",\"type\":\"teams\"}]}},\"type\":\"policies\"}}" + "json": "{\"data\":{\"attributes\":{\"name\":\"Test-Set_On_Call_team_routing_rules_returns_OK_response-1748494452\",\"resolve_page_on_policy_end\":true,\"retries\":2,\"steps\":[{\"assignment\":\"default\",\"escalate_after_seconds\":3600,\"targets\":[{\"id\":\"08b1cecb-154b-45ca-bafa-a7f0b3196b8d\",\"type\":\"teams\"},{\"id\":\"60ddefa7-5b46-44e1-aabc-2c5b5b2e6fc1\",\"type\":\"schedules\"},{\"id\":\"f70b5bc2-3c48-11f0-90c9-4ad2f0f8c382\",\"type\":\"users\"}]},{\"assignment\":\"round-robin\",\"escalate_after_seconds\":3600,\"targets\":[{\"id\":\"08b1cecb-154b-45ca-bafa-a7f0b3196b8d\",\"type\":\"teams\"}]}]},\"relationships\":{\"teams\":{\"data\":[{\"id\":\"08b1cecb-154b-45ca-bafa-a7f0b3196b8d\",\"type\":\"teams\"}]}},\"type\":\"policies\"}}" }, "headers": {}, "method": "POST", @@ -102,7 +102,7 @@ "secure": true }, "httpResponse": { - "body": "{\"data\":{\"id\":\"6a74ecd6-9640-4dde-9827-b00a89e0678d\",\"type\":\"policies\",\"attributes\":{\"name\":\"Test-Set_On_Call_team_routing_rules_returns_OK_response-1748334342\",\"resolve_page_on_policy_end\":true,\"retries\":2},\"relationships\":{\"steps\":{\"data\":[{\"id\":\"a03dc73f-ddba-4c46-bbe0-d7d3256a7133\",\"type\":\"steps\"},{\"id\":\"fead9a26-8f86-4419-8146-f9f2cf45200b\",\"type\":\"steps\"}]},\"teams\":{\"data\":[{\"id\":\"82aa87bd-fdf1-4683-aecd-706133165bb2\",\"type\":\"teams\"}]}}}}", + "body": "{\"data\":{\"id\":\"fc37a01c-221f-45e6-bc76-57ff1c182117\",\"type\":\"policies\",\"attributes\":{\"name\":\"Test-Set_On_Call_team_routing_rules_returns_OK_response-1748494452\",\"resolve_page_on_policy_end\":true,\"retries\":2},\"relationships\":{\"steps\":{\"data\":[{\"id\":\"46a2be27-34f0-4e0c-b1aa-a8141fbe64ed\",\"type\":\"steps\"},{\"id\":\"6ea28a95-8be6-4a8a-a5ca-c20ed36a8cf4\",\"type\":\"steps\"}]},\"teams\":{\"data\":[{\"id\":\"08b1cecb-154b-45ca-bafa-a7f0b3196b8d\",\"type\":\"teams\"}]}}}}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -117,17 +117,17 @@ "timeToLive": { "unlimited": true }, - "id": "6e9e0b3e-ce55-1f6f-96d5-89feaeaa337c" + "id": "4e18913f-f086-1f90-b5f6-2576874ae6bb" }, { "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"rules\":[{\"actions\":[{\"channel\":\"channel\",\"type\":\"send_slack_message\",\"workspace\":\"workspace\"}],\"query\":\"tags.service:test\",\"time_restriction\":{\"restrictions\":[{\"end_day\":\"monday\",\"end_time\":\"17:00:00\",\"start_day\":\"monday\",\"start_time\":\"09:00:00\"},{\"end_day\":\"tuesday\",\"end_time\":\"17:00:00\",\"start_day\":\"tuesday\",\"start_time\":\"09:00:00\"}],\"time_zone\":\"Europe/Paris\"}},{\"policy_id\":\"6a74ecd6-9640-4dde-9827-b00a89e0678d\",\"query\":\"\",\"urgency\":\"low\"}]},\"id\":\"82aa87bd-fdf1-4683-aecd-706133165bb2\",\"type\":\"team_routing_rules\"}}" + "json": "{\"data\":{\"attributes\":{\"rules\":[{\"actions\":[{\"channel\":\"channel\",\"type\":\"send_slack_message\",\"workspace\":\"workspace\"}],\"query\":\"tags.service:test\",\"time_restriction\":{\"restrictions\":[{\"end_day\":\"monday\",\"end_time\":\"17:00:00\",\"start_day\":\"monday\",\"start_time\":\"09:00:00\"},{\"end_day\":\"tuesday\",\"end_time\":\"17:00:00\",\"start_day\":\"tuesday\",\"start_time\":\"09:00:00\"}],\"time_zone\":\"Europe/Paris\"}},{\"policy_id\":\"fc37a01c-221f-45e6-bc76-57ff1c182117\",\"query\":\"\",\"urgency\":\"low\"}]},\"id\":\"08b1cecb-154b-45ca-bafa-a7f0b3196b8d\",\"type\":\"team_routing_rules\"}}" }, "headers": {}, "method": "PUT", - "path": "/api/v2/on-call/teams/82aa87bd-fdf1-4683-aecd-706133165bb2/routing-rules", + "path": "/api/v2/on-call/teams/08b1cecb-154b-45ca-bafa-a7f0b3196b8d/routing-rules", "queryStringParameters": { "include": [ "rules" @@ -137,7 +137,7 @@ "secure": true }, "httpResponse": { - "body": "{\"data\":{\"id\":\"82aa87bd-fdf1-4683-aecd-706133165bb2\",\"type\":\"team_routing_rules\",\"relationships\":{\"rules\":{\"data\":[{\"id\":\"virtual-82aa87bd-fdf1-4683-aecd-706133165bb2-rule-0\",\"type\":\"team_routing_rules\"},{\"id\":\"virtual-82aa87bd-fdf1-4683-aecd-706133165bb2-rule-1\",\"type\":\"team_routing_rules\"}]}}},\"included\":[{\"id\":\"virtual-82aa87bd-fdf1-4683-aecd-706133165bb2-rule-0\",\"type\":\"team_routing_rules\",\"attributes\":{\"actions\":[{\"type\":\"send_slack_message\",\"channel\":\"channel\",\"workspace\":\"workspace\"}],\"query\":\"tags.service:test\",\"time_restriction\":{\"time_zone\":\"Europe/Paris\",\"restrictions\":[{\"start_time\":\"09:00:00\",\"start_day\":\"monday\",\"end_time\":\"17:00:00\",\"end_day\":\"monday\"},{\"start_time\":\"09:00:00\",\"start_day\":\"tuesday\",\"end_time\":\"17:00:00\",\"end_day\":\"tuesday\"}]}},\"relationships\":{\"policy\":{\"data\":null}}},{\"id\":\"virtual-82aa87bd-fdf1-4683-aecd-706133165bb2-rule-1\",\"type\":\"team_routing_rules\",\"attributes\":{\"actions\":[],\"query\":\"\",\"urgency\":\"low\"},\"relationships\":{\"policy\":{\"data\":{\"id\":\"6a74ecd6-9640-4dde-9827-b00a89e0678d\",\"type\":\"policies\"}}}}]}", + "body": "{\"data\":{\"id\":\"08b1cecb-154b-45ca-bafa-a7f0b3196b8d\",\"type\":\"team_routing_rules\",\"relationships\":{\"rules\":{\"data\":[{\"id\":\"virtual-08b1cecb-154b-45ca-bafa-a7f0b3196b8d-rule-0\",\"type\":\"team_routing_rules\"},{\"id\":\"virtual-08b1cecb-154b-45ca-bafa-a7f0b3196b8d-rule-1\",\"type\":\"team_routing_rules\"}]}}},\"included\":[{\"id\":\"virtual-08b1cecb-154b-45ca-bafa-a7f0b3196b8d-rule-0\",\"type\":\"team_routing_rules\",\"attributes\":{\"actions\":[{\"type\":\"send_slack_message\",\"channel\":\"channel\",\"workspace\":\"workspace\"}],\"query\":\"tags.service:test\",\"time_restriction\":{\"time_zone\":\"Europe/Paris\",\"restrictions\":[{\"start_time\":\"09:00:00\",\"start_day\":\"monday\",\"end_time\":\"17:00:00\",\"end_day\":\"monday\"},{\"start_time\":\"09:00:00\",\"start_day\":\"tuesday\",\"end_time\":\"17:00:00\",\"end_day\":\"tuesday\"}]}},\"relationships\":{\"policy\":{\"data\":null}}},{\"id\":\"virtual-08b1cecb-154b-45ca-bafa-a7f0b3196b8d-rule-1\",\"type\":\"team_routing_rules\",\"attributes\":{\"actions\":[],\"query\":\"\",\"urgency\":\"low\"},\"relationships\":{\"policy\":{\"data\":{\"id\":\"fc37a01c-221f-45e6-bc76-57ff1c182117\",\"type\":\"policies\"}}}}]}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -152,18 +152,18 @@ "timeToLive": { "unlimited": true }, - "id": "6c28fa5e-57a5-fa63-2c8b-b13fdd0bc722" + "id": "ee9ce8e8-0181-b8e0-cc99-808712b43659" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/on-call/escalation-policies/6a74ecd6-9640-4dde-9827-b00a89e0678d", + "path": "/api/v2/on-call/escalation-policies/fc37a01c-221f-45e6-bc76-57ff1c182117", "keepAlive": false, "secure": true }, "httpResponse": { - "body": "{\"errors\":[{\"title\":\"Generic Error\",\"detail\":\"policy[6a74ecd6-9640-4dde-9827-b00a89e0678d] is in use\"}]}", + "body": "{\"errors\":[{\"title\":\"Generic Error\",\"detail\":\"policy[fc37a01c-221f-45e6-bc76-57ff1c182117] is in use\"}]}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -178,18 +178,18 @@ "timeToLive": { "unlimited": true }, - "id": "80f579c6-b02c-b2e8-ad1c-08c8603c2e80" + "id": "560d1328-da1d-b909-0e18-870763c062ed" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/on-call/schedules/2eb42c33-6304-4103-9814-25a2e8ce6d02", + "path": "/api/v2/on-call/schedules/60ddefa7-5b46-44e1-aabc-2c5b5b2e6fc1", "keepAlive": false, "secure": true }, "httpResponse": { - "body": "{\"errors\":[{\"title\":\"Generic Error\",\"detail\":\"schedule[2eb42c33-6304-4103-9814-25a2e8ce6d02] is in use\"}]}", + "body": "{\"errors\":[{\"title\":\"Generic Error\",\"detail\":\"schedule[60ddefa7-5b46-44e1-aabc-2c5b5b2e6fc1] is in use\"}]}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -204,13 +204,13 @@ "timeToLive": { "unlimited": true }, - "id": "1331bb2a-57e5-b930-616b-88fe0575fde2" + "id": "ba882655-77b6-8d0b-cb2f-86b561c18f62" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/team/82aa87bd-fdf1-4683-aecd-706133165bb2", + "path": "/api/v2/team/08b1cecb-154b-45ca-bafa-a7f0b3196b8d", "keepAlive": false, "secure": true }, @@ -225,13 +225,13 @@ "timeToLive": { "unlimited": true }, - "id": "701ee978-2a67-8671-1e74-97c9a9f65dd0" + "id": "b2714d90-0e25-979a-79e9-6500f2da3b9d" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/users/2e2a9a43-3ad4-11f0-a123-c6d5a6dabcf4", + "path": "/api/v2/users/f70b5bc2-3c48-11f0-90c9-4ad2f0f8c382", "keepAlive": false, "secure": true }, @@ -246,6 +246,6 @@ "timeToLive": { "unlimited": true }, - "id": "81b02722-94fc-0041-293e-a911a60e6091" + "id": "cb936542-180b-3473-1a26-340e3ca4ea10" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_On_Call_escalation_policy_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Update_On_Call_escalation_policy_returns_OK_response.freeze index 58d9762aacd..dcfe9e95351 100644 --- a/src/test/resources/cassettes/features/v2/Update_On_Call_escalation_policy_returns_OK_response.freeze +++ b/src/test/resources/cassettes/features/v2/Update_On_Call_escalation_policy_returns_OK_response.freeze @@ -1 +1 @@ -2025-05-21T11:01:56.877Z \ No newline at end of file +2025-05-29T04:54:18.437Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_On_Call_escalation_policy_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Update_On_Call_escalation_policy_returns_OK_response.json index 38be49e86eb..1ba88ed1d0d 100644 --- a/src/test/resources/cassettes/features/v2/Update_On_Call_escalation_policy_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Update_On_Call_escalation_policy_returns_OK_response.json @@ -3,7 +3,7 @@ "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"email\":\"Test-Update_On_Call_escalation_policy_returns_OK_response-1747825316@datadoghq.com\",\"title\":\"user title\"},\"type\":\"users\"}}" + "json": "{\"data\":{\"attributes\":{\"email\":\"Test-Update_On_Call_escalation_policy_returns_OK_response-1748494458@datadoghq.com\",\"title\":\"user title\"},\"type\":\"users\"}}" }, "headers": {}, "method": "POST", @@ -12,7 +12,7 @@ "secure": true }, "httpResponse": { - "body": "{\"data\":{\"type\":\"users\",\"id\":\"02f97155-3633-11f0-8139-36deebce65db\",\"attributes\":{\"name\":null,\"handle\":\"test-update_on_call_escalation_policy_returns_ok_response-1747825316@datadoghq.com\",\"created_at\":\"2025-05-21T11:01:56.961957+00:00\",\"modified_at\":\"2025-05-21T11:01:56.961957+00:00\",\"email\":\"test-update_on_call_escalation_policy_returns_ok_response-1747825316@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/58d047300afed96db7357b8216864a2b?s=48&d=retro\",\"title\":\"user title\",\"verified\":false,\"service_account\":false,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Pending\"},\"relationships\":{\"roles\":{\"data\":[]},\"org\":{\"data\":{\"type\":\"orgs\",\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\"}}}}}\n", + "body": "{\"data\":{\"type\":\"users\",\"id\":\"fabd9ae0-3c48-11f0-b407-16d8dc894a02\",\"attributes\":{\"name\":null,\"handle\":\"test-update_on_call_escalation_policy_returns_ok_response-1748494458@datadoghq.com\",\"created_at\":\"2025-05-29T04:54:19.052756+00:00\",\"modified_at\":\"2025-05-29T04:54:19.052756+00:00\",\"email\":\"test-update_on_call_escalation_policy_returns_ok_response-1748494458@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/cf87c53bf68b572610145962e6965e0c?s=48&d=retro\",\"title\":\"user title\",\"verified\":false,\"service_account\":false,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Pending\"},\"relationships\":{\"roles\":{\"data\":[]},\"org\":{\"data\":{\"type\":\"orgs\",\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\"}}}}}\n", "headers": { "Content-Type": [ "application/json" @@ -27,13 +27,13 @@ "timeToLive": { "unlimited": true }, - "id": "45081304-9810-30dd-bced-45f6516d58dc" + "id": "d054a8c7-20a3-5354-6b08-06bf869d885b" }, { "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"handle\":\"test-handle-7e1038d48a039cbc\",\"name\":\"test-name-7e1038d48a039cbc\"},\"type\":\"team\"}}" + "json": "{\"data\":{\"attributes\":{\"handle\":\"test-handle-e987bfc60cf27d84\",\"name\":\"test-name-e987bfc60cf27d84\"},\"type\":\"team\"}}" }, "headers": {}, "method": "POST", @@ -42,7 +42,7 @@ "secure": true }, "httpResponse": { - "body": "{\"data\":{\"type\":\"team\",\"id\":\"593274dc-43a7-4281-930c-58cb572b5004\",\"attributes\":{\"name\":\"test-name-7e1038d48a039cbc\",\"handle\":\"test-handle-7e1038d48a039cbc\",\"summary\":null,\"description\":null,\"avatar\":null,\"banner\":2,\"visible_modules\":[],\"hidden_modules\":[],\"created_at\":\"2025-05-21T11:01:57.059563+00:00\",\"modified_at\":\"2025-05-21T11:01:57.059594+00:00\",\"user_count\":0,\"link_count\":0},\"relationships\":{\"team_links\":{\"links\":{\"related\":\"/api/v2/team/593274dc-43a7-4281-930c-58cb572b5004/links\"}},\"user_team_permissions\":{\"links\":{\"related\":\"/api/v2/team/593274dc-43a7-4281-930c-58cb572b5004/permission-settings\"}}}}}\n", + "body": "{\"data\":{\"type\":\"team\",\"id\":\"37ea8c60-77bd-4154-ba2e-ac59d25541c6\",\"attributes\":{\"name\":\"test-name-e987bfc60cf27d84\",\"handle\":\"test-handle-e987bfc60cf27d84\",\"summary\":null,\"description\":null,\"avatar\":null,\"banner\":3,\"visible_modules\":[],\"hidden_modules\":[],\"created_at\":\"2025-05-29T04:54:19.729870+00:00\",\"modified_at\":\"2025-05-29T04:54:19.729879+00:00\",\"user_count\":0,\"link_count\":0},\"relationships\":{\"team_links\":{\"links\":{\"related\":\"/api/v2/team/37ea8c60-77bd-4154-ba2e-ac59d25541c6/links\"}},\"user_team_permissions\":{\"links\":{\"related\":\"/api/v2/team/37ea8c60-77bd-4154-ba2e-ac59d25541c6/permission-settings\"}}}}}\n", "headers": { "Content-Type": [ "application/json" @@ -57,13 +57,13 @@ "timeToLive": { "unlimited": true }, - "id": "9d8e3acd-e120-b4d7-af3d-c0ba5a62de06" + "id": "d7c84ec2-74c4-84c8-1c45-21c56064732b" }, { "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"layers\":[{\"effective_date\":\"2025-05-11T11:01:56.877Z\",\"end_date\":\"2025-05-31T11:01:56.877Z\",\"interval\":{\"days\":1},\"members\":[{\"user\":{\"id\":\"890f29d4-0b7a-11f0-aeb2-760fcae4f596\"}}],\"name\":\"Layer 1\",\"restrictions\":[{\"end_day\":\"friday\",\"end_time\":\"17:00:00\",\"start_day\":\"monday\",\"start_time\":\"09:00:00\"}],\"rotation_start\":\"2025-05-16T11:01:56.877Z\"}],\"name\":\"Test-Update_On_Call_escalation_policy_returns_OK_response-1747825316\",\"time_zone\":\"America/New_York\"},\"relationships\":{\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}},\"type\":\"schedules\"}}" + "json": "{\"data\":{\"attributes\":{\"layers\":[{\"effective_date\":\"2025-05-19T04:54:18.437Z\",\"end_date\":\"2025-06-08T04:54:18.437Z\",\"interval\":{\"days\":1},\"members\":[{\"user\":{\"id\":\"fabd9ae0-3c48-11f0-b407-16d8dc894a02\"}}],\"name\":\"Layer 1\",\"restrictions\":[{\"end_day\":\"friday\",\"end_time\":\"17:00:00\",\"start_day\":\"monday\",\"start_time\":\"09:00:00\"}],\"rotation_start\":\"2025-05-24T04:54:18.437Z\"}],\"name\":\"Test-Update_On_Call_escalation_policy_returns_OK_response-1748494458\",\"time_zone\":\"America/New_York\"},\"relationships\":{\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}},\"type\":\"schedules\"}}" }, "headers": {}, "method": "POST", @@ -72,7 +72,7 @@ "secure": true }, "httpResponse": { - "body": "{\"data\":{\"id\":\"6c875bbd-947b-44bd-bad5-e0da7c69db5c\",\"type\":\"schedules\",\"attributes\":{\"name\":\"Test-Update_On_Call_escalation_policy_returns_OK_response-1747825316\",\"time_zone\":\"America/New_York\"},\"relationships\":{\"layers\":{\"data\":[{\"id\":\"0fa01fe6-c072-42ca-a7ed-5923dca7f0b8\",\"type\":\"layers\"}]},\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}}}}", + "body": "{\"data\":{\"id\":\"f8a9543a-dc0f-4d81-bb16-7054201fa099\",\"type\":\"schedules\",\"attributes\":{\"name\":\"Test-Update_On_Call_escalation_policy_returns_OK_response-1748494458\",\"time_zone\":\"America/New_York\"},\"relationships\":{\"layers\":{\"data\":[{\"id\":\"f2cc2a31-c4f9-40bf-9820-93af15c77625\",\"type\":\"layers\"}]},\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}}}}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -87,13 +87,13 @@ "timeToLive": { "unlimited": true }, - "id": "ddea90b2-ccd7-9f2a-b31a-316b1a4353df" + "id": "83824c49-6fbf-2d64-b606-c2098dcf8bbf" }, { "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"name\":\"Test-Update_On_Call_escalation_policy_returns_OK_response-1747825316\",\"resolve_page_on_policy_end\":true,\"retries\":2,\"steps\":[{\"assignment\":\"default\",\"escalate_after_seconds\":3600,\"targets\":[{\"id\":\"593274dc-43a7-4281-930c-58cb572b5004\",\"type\":\"teams\"},{\"id\":\"6c875bbd-947b-44bd-bad5-e0da7c69db5c\",\"type\":\"schedules\"},{\"id\":\"02f97155-3633-11f0-8139-36deebce65db\",\"type\":\"users\"}]},{\"assignment\":\"round-robin\",\"escalate_after_seconds\":3600,\"targets\":[{\"id\":\"593274dc-43a7-4281-930c-58cb572b5004\",\"type\":\"teams\"}]}]},\"relationships\":{\"teams\":{\"data\":[{\"id\":\"593274dc-43a7-4281-930c-58cb572b5004\",\"type\":\"teams\"}]}},\"type\":\"policies\"}}" + "json": "{\"data\":{\"attributes\":{\"name\":\"Test-Update_On_Call_escalation_policy_returns_OK_response-1748494458\",\"resolve_page_on_policy_end\":true,\"retries\":2,\"steps\":[{\"assignment\":\"default\",\"escalate_after_seconds\":3600,\"targets\":[{\"id\":\"37ea8c60-77bd-4154-ba2e-ac59d25541c6\",\"type\":\"teams\"},{\"id\":\"f8a9543a-dc0f-4d81-bb16-7054201fa099\",\"type\":\"schedules\"},{\"id\":\"fabd9ae0-3c48-11f0-b407-16d8dc894a02\",\"type\":\"users\"}]},{\"assignment\":\"round-robin\",\"escalate_after_seconds\":3600,\"targets\":[{\"id\":\"37ea8c60-77bd-4154-ba2e-ac59d25541c6\",\"type\":\"teams\"}]}]},\"relationships\":{\"teams\":{\"data\":[{\"id\":\"37ea8c60-77bd-4154-ba2e-ac59d25541c6\",\"type\":\"teams\"}]}},\"type\":\"policies\"}}" }, "headers": {}, "method": "POST", @@ -102,7 +102,7 @@ "secure": true }, "httpResponse": { - "body": "{\"data\":{\"id\":\"b41d541f-8f83-49f9-9661-0a5ee93bd3be\",\"type\":\"policies\",\"attributes\":{\"name\":\"Test-Update_On_Call_escalation_policy_returns_OK_response-1747825316\",\"resolve_page_on_policy_end\":true,\"retries\":2},\"relationships\":{\"steps\":{\"data\":[{\"id\":\"b84eeb10-55be-461c-8e0f-c60dfd0fbfd6\",\"type\":\"steps\"},{\"id\":\"7cbf9415-79ef-4ce3-acef-5fce960278b7\",\"type\":\"steps\"}]},\"teams\":{\"data\":[{\"id\":\"593274dc-43a7-4281-930c-58cb572b5004\",\"type\":\"teams\"}]}}}}", + "body": "{\"data\":{\"id\":\"05ee91ac-c049-4e7c-b43b-3f673a7ce96d\",\"type\":\"policies\",\"attributes\":{\"name\":\"Test-Update_On_Call_escalation_policy_returns_OK_response-1748494458\",\"resolve_page_on_policy_end\":true,\"retries\":2},\"relationships\":{\"steps\":{\"data\":[{\"id\":\"6a0d2106-0430-4211-af70-54ea18031d0d\",\"type\":\"steps\"},{\"id\":\"f4c4d70e-72e5-4f5c-89fb-bf7aea612c1b\",\"type\":\"steps\"}]},\"teams\":{\"data\":[{\"id\":\"37ea8c60-77bd-4154-ba2e-ac59d25541c6\",\"type\":\"teams\"}]}}}}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -117,22 +117,22 @@ "timeToLive": { "unlimited": true }, - "id": "6453e26f-db66-0f31-dbc2-25f46ae67551" + "id": "bb29ffa9-7fb3-4e84-e85c-4d6e6ca1ebfd" }, { "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"name\":\"Test-Update_On_Call_escalation_policy_returns_OK_response-1747825316-updated\",\"resolve_page_on_policy_end\":false,\"retries\":0,\"steps\":[{\"assignment\":\"default\",\"escalate_after_seconds\":3600,\"id\":\"b84eeb10-55be-461c-8e0f-c60dfd0fbfd6\",\"targets\":[{\"id\":\"02f97155-3633-11f0-8139-36deebce65db\",\"type\":\"users\"}]}]},\"id\":\"b41d541f-8f83-49f9-9661-0a5ee93bd3be\",\"relationships\":{\"teams\":{\"data\":[{\"id\":\"593274dc-43a7-4281-930c-58cb572b5004\",\"type\":\"teams\"}]}},\"type\":\"policies\"}}" + "json": "{\"data\":{\"attributes\":{\"name\":\"Test-Update_On_Call_escalation_policy_returns_OK_response-1748494458-updated\",\"resolve_page_on_policy_end\":false,\"retries\":0,\"steps\":[{\"assignment\":\"default\",\"escalate_after_seconds\":3600,\"id\":\"6a0d2106-0430-4211-af70-54ea18031d0d\",\"targets\":[{\"id\":\"fabd9ae0-3c48-11f0-b407-16d8dc894a02\",\"type\":\"users\"}]}]},\"id\":\"05ee91ac-c049-4e7c-b43b-3f673a7ce96d\",\"relationships\":{\"teams\":{\"data\":[{\"id\":\"37ea8c60-77bd-4154-ba2e-ac59d25541c6\",\"type\":\"teams\"}]}},\"type\":\"policies\"}}" }, "headers": {}, "method": "PUT", - "path": "/api/v2/on-call/escalation-policies/b41d541f-8f83-49f9-9661-0a5ee93bd3be", + "path": "/api/v2/on-call/escalation-policies/05ee91ac-c049-4e7c-b43b-3f673a7ce96d", "keepAlive": false, "secure": true }, "httpResponse": { - "body": "{\"data\":{\"id\":\"b41d541f-8f83-49f9-9661-0a5ee93bd3be\",\"type\":\"policies\",\"attributes\":{\"name\":\"Test-Update_On_Call_escalation_policy_returns_OK_response-1747825316-updated\",\"resolve_page_on_policy_end\":false,\"retries\":0},\"relationships\":{\"steps\":{\"data\":[{\"id\":\"b84eeb10-55be-461c-8e0f-c60dfd0fbfd6\",\"type\":\"steps\"}]},\"teams\":{\"data\":[{\"id\":\"593274dc-43a7-4281-930c-58cb572b5004\",\"type\":\"teams\"}]}}}}", + "body": "{\"data\":{\"id\":\"05ee91ac-c049-4e7c-b43b-3f673a7ce96d\",\"type\":\"policies\",\"attributes\":{\"name\":\"Test-Update_On_Call_escalation_policy_returns_OK_response-1748494458-updated\",\"resolve_page_on_policy_end\":false,\"retries\":0},\"relationships\":{\"steps\":{\"data\":[{\"id\":\"6a0d2106-0430-4211-af70-54ea18031d0d\",\"type\":\"steps\"}]},\"teams\":{\"data\":[{\"id\":\"37ea8c60-77bd-4154-ba2e-ac59d25541c6\",\"type\":\"teams\"}]}}}}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -147,13 +147,13 @@ "timeToLive": { "unlimited": true }, - "id": "4d58612d-b8c8-cd2b-662b-60735c998afa" + "id": "b8254827-a73f-6243-7528-3bc455d68973" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/on-call/escalation-policies/b41d541f-8f83-49f9-9661-0a5ee93bd3be", + "path": "/api/v2/on-call/escalation-policies/05ee91ac-c049-4e7c-b43b-3f673a7ce96d", "keepAlive": false, "secure": true }, @@ -168,13 +168,13 @@ "timeToLive": { "unlimited": true }, - "id": "4f8e1845-4b01-acde-224b-f624c58f0e8f" + "id": "3f5ca272-8dd8-f634-c4d1-e90271196a52" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/on-call/schedules/6c875bbd-947b-44bd-bad5-e0da7c69db5c", + "path": "/api/v2/on-call/schedules/f8a9543a-dc0f-4d81-bb16-7054201fa099", "keepAlive": false, "secure": true }, @@ -189,13 +189,13 @@ "timeToLive": { "unlimited": true }, - "id": "c9a5d47a-4aff-7098-7eb1-4577b997a7b8" + "id": "592eb78e-35d1-05a0-d154-962fff969d63" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/team/593274dc-43a7-4281-930c-58cb572b5004", + "path": "/api/v2/team/37ea8c60-77bd-4154-ba2e-ac59d25541c6", "keepAlive": false, "secure": true }, @@ -210,13 +210,13 @@ "timeToLive": { "unlimited": true }, - "id": "5652b480-092a-7f84-aac3-e498493e9d0d" + "id": "a8759645-273c-d16d-b3c7-37a4ca719e6f" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/users/02f97155-3633-11f0-8139-36deebce65db", + "path": "/api/v2/users/fabd9ae0-3c48-11f0-b407-16d8dc894a02", "keepAlive": false, "secure": true }, @@ -231,6 +231,6 @@ "timeToLive": { "unlimited": true }, - "id": "d2ccdbd4-f606-db51-4eaa-fb67f9718660" + "id": "9d38d5d2-1d19-026d-fd85-1627712c4319" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_On_Call_schedule_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Update_On_Call_schedule_returns_OK_response.freeze index 20f2c228550..48d671dd7db 100644 --- a/src/test/resources/cassettes/features/v2/Update_On_Call_schedule_returns_OK_response.freeze +++ b/src/test/resources/cassettes/features/v2/Update_On_Call_schedule_returns_OK_response.freeze @@ -1 +1 @@ -2025-05-21T11:01:58.116Z \ No newline at end of file +2025-05-29T04:54:24.605Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_On_Call_schedule_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Update_On_Call_schedule_returns_OK_response.json index 98af3ebd08f..66657ac56f1 100644 --- a/src/test/resources/cassettes/features/v2/Update_On_Call_schedule_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Update_On_Call_schedule_returns_OK_response.json @@ -3,19 +3,19 @@ "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"layers\":[{\"effective_date\":\"2025-05-11T11:01:58.116Z\",\"end_date\":\"2025-05-31T11:01:58.116Z\",\"interval\":{\"days\":1},\"members\":[{\"user\":{\"id\":\"890f29d4-0b7a-11f0-aeb2-760fcae4f596\"}}],\"name\":\"Layer 1\",\"restrictions\":[{\"end_day\":\"friday\",\"end_time\":\"17:00:00\",\"start_day\":\"monday\",\"start_time\":\"09:00:00\"}],\"rotation_start\":\"2025-05-16T11:01:58.116Z\"}],\"name\":\"Test-Update_On_Call_schedule_returns_OK_response-1747825318\",\"time_zone\":\"America/New_York\"},\"relationships\":{\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}},\"type\":\"schedules\"}}" + "json": "{\"data\":{\"attributes\":{\"email\":\"Test-Update_On_Call_schedule_returns_OK_response-1748494464@datadoghq.com\",\"title\":\"user title\"},\"type\":\"users\"}}" }, "headers": {}, "method": "POST", - "path": "/api/v2/on-call/schedules", + "path": "/api/v2/users", "keepAlive": false, "secure": true }, "httpResponse": { - "body": "{\"data\":{\"id\":\"65e112fe-2c12-4a2b-8406-522b07cccd1c\",\"type\":\"schedules\",\"attributes\":{\"name\":\"Test-Update_On_Call_schedule_returns_OK_response-1747825318\",\"time_zone\":\"America/New_York\"},\"relationships\":{\"layers\":{\"data\":[{\"id\":\"7f8a6ed7-bc86-48ef-872b-f68b05b28f6b\",\"type\":\"layers\"}]},\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}}}}", + "body": "{\"data\":{\"type\":\"users\",\"id\":\"fe6b1fbd-3c48-11f0-90c9-4ad2f0f8c382\",\"attributes\":{\"name\":null,\"handle\":\"test-update_on_call_schedule_returns_ok_response-1748494464@datadoghq.com\",\"created_at\":\"2025-05-29T04:54:25.223093+00:00\",\"modified_at\":\"2025-05-29T04:54:25.223093+00:00\",\"email\":\"test-update_on_call_schedule_returns_ok_response-1748494464@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/6bc23e301121dc7a0a2d1adc71bbbc54?s=48&d=retro\",\"title\":\"user title\",\"verified\":false,\"service_account\":false,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Pending\"},\"relationships\":{\"roles\":{\"data\":[]},\"org\":{\"data\":{\"type\":\"orgs\",\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\"}}}}}\n", "headers": { "Content-Type": [ - "application/vnd.api+json" + "application/json" ] }, "statusCode": 201, @@ -27,25 +27,25 @@ "timeToLive": { "unlimited": true }, - "id": "4bbdc4b2-b26b-3006-ddc2-2fa0644c9b37" + "id": "3dfc52a4-3481-6e93-eef6-f7a0b8e7f737" }, { "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"email\":\"Test-Update_On_Call_schedule_returns_OK_response-1747825318@datadoghq.com\",\"title\":\"user title\"},\"type\":\"users\"}}" + "json": "{\"data\":{\"attributes\":{\"layers\":[{\"effective_date\":\"2025-05-19T04:54:24.605Z\",\"end_date\":\"2025-06-08T04:54:24.605Z\",\"interval\":{\"days\":1},\"members\":[{\"user\":{\"id\":\"fe6b1fbd-3c48-11f0-90c9-4ad2f0f8c382\"}}],\"name\":\"Layer 1\",\"restrictions\":[{\"end_day\":\"friday\",\"end_time\":\"17:00:00\",\"start_day\":\"monday\",\"start_time\":\"09:00:00\"}],\"rotation_start\":\"2025-05-24T04:54:24.605Z\"}],\"name\":\"Test-Update_On_Call_schedule_returns_OK_response-1748494464\",\"time_zone\":\"America/New_York\"},\"relationships\":{\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}},\"type\":\"schedules\"}}" }, "headers": {}, "method": "POST", - "path": "/api/v2/users", + "path": "/api/v2/on-call/schedules", "keepAlive": false, "secure": true }, "httpResponse": { - "body": "{\"data\":{\"type\":\"users\",\"id\":\"03c4b5bd-3633-11f0-8139-36deebce65db\",\"attributes\":{\"name\":null,\"handle\":\"test-update_on_call_schedule_returns_ok_response-1747825318@datadoghq.com\",\"created_at\":\"2025-05-21T11:01:58.294092+00:00\",\"modified_at\":\"2025-05-21T11:01:58.294092+00:00\",\"email\":\"test-update_on_call_schedule_returns_ok_response-1747825318@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/e928709686b830ca3733b32dcf0e20e6?s=48&d=retro\",\"title\":\"user title\",\"verified\":false,\"service_account\":false,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Pending\"},\"relationships\":{\"roles\":{\"data\":[]},\"org\":{\"data\":{\"type\":\"orgs\",\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\"}}}}}\n", + "body": "{\"data\":{\"id\":\"f12650c6-beae-40fd-a686-7e57d72216c6\",\"type\":\"schedules\",\"attributes\":{\"name\":\"Test-Update_On_Call_schedule_returns_OK_response-1748494464\",\"time_zone\":\"America/New_York\"},\"relationships\":{\"layers\":{\"data\":[{\"id\":\"b9dca7b6-b083-44d3-9971-6c2c796fb352\",\"type\":\"layers\"}]},\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}}}}", "headers": { "Content-Type": [ - "application/json" + "application/vnd.api+json" ] }, "statusCode": 201, @@ -57,13 +57,13 @@ "timeToLive": { "unlimited": true }, - "id": "c87be681-aa6b-bf03-699b-4afc6b0a8c9e" + "id": "b1a4eb5b-8ba3-5920-f3aa-28a98ae8704e" }, { "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"handle\":\"test-handle-190dee1bd22c94a1\",\"name\":\"test-name-190dee1bd22c94a1\"},\"type\":\"team\"}}" + "json": "{\"data\":{\"attributes\":{\"handle\":\"test-handle-ed2e958dacae5dbc\",\"name\":\"test-name-ed2e958dacae5dbc\"},\"type\":\"team\"}}" }, "headers": {}, "method": "POST", @@ -72,7 +72,7 @@ "secure": true }, "httpResponse": { - "body": "{\"data\":{\"type\":\"team\",\"id\":\"72687222-d9aa-4f6a-8af2-1f1811c66378\",\"attributes\":{\"name\":\"test-name-190dee1bd22c94a1\",\"handle\":\"test-handle-190dee1bd22c94a1\",\"summary\":null,\"description\":null,\"avatar\":null,\"banner\":7,\"visible_modules\":[],\"hidden_modules\":[],\"created_at\":\"2025-05-21T11:01:58.429935+00:00\",\"modified_at\":\"2025-05-21T11:01:58.429944+00:00\",\"user_count\":0,\"link_count\":0},\"relationships\":{\"team_links\":{\"links\":{\"related\":\"/api/v2/team/72687222-d9aa-4f6a-8af2-1f1811c66378/links\"}},\"user_team_permissions\":{\"links\":{\"related\":\"/api/v2/team/72687222-d9aa-4f6a-8af2-1f1811c66378/permission-settings\"}}}}}\n", + "body": "{\"data\":{\"type\":\"team\",\"id\":\"522c3ff2-76b4-41db-8cfa-9bb9876145e4\",\"attributes\":{\"name\":\"test-name-ed2e958dacae5dbc\",\"handle\":\"test-handle-ed2e958dacae5dbc\",\"summary\":null,\"description\":null,\"avatar\":null,\"banner\":13,\"visible_modules\":[],\"hidden_modules\":[],\"created_at\":\"2025-05-29T04:54:26.535052+00:00\",\"modified_at\":\"2025-05-29T04:54:26.535061+00:00\",\"user_count\":0,\"link_count\":0},\"relationships\":{\"team_links\":{\"links\":{\"related\":\"/api/v2/team/522c3ff2-76b4-41db-8cfa-9bb9876145e4/links\"}},\"user_team_permissions\":{\"links\":{\"related\":\"/api/v2/team/522c3ff2-76b4-41db-8cfa-9bb9876145e4/permission-settings\"}}}}}\n", "headers": { "Content-Type": [ "application/json" @@ -87,22 +87,22 @@ "timeToLive": { "unlimited": true }, - "id": "5957d0f5-859b-a70c-9b95-76f56c3cd867" + "id": "f81af878-7e5d-3dca-59c1-05a2db811a71" }, { "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"layers\":[{\"effective_date\":\"2025-05-11T11:01:58.116Z\",\"end_date\":\"2025-05-31T11:01:58.116Z\",\"id\":\"7f8a6ed7-bc86-48ef-872b-f68b05b28f6b\",\"interval\":{\"seconds\":300},\"members\":[{\"user\":{\"id\":\"03c4b5bd-3633-11f0-8139-36deebce65db\"}}],\"name\":\"Layer 1\",\"restrictions\":[{\"end_day\":\"friday\",\"end_time\":\"17:00:00\",\"start_day\":\"monday\",\"start_time\":\"09:00:00\"}],\"rotation_start\":\"2025-05-16T11:01:58.116Z\"}],\"name\":\"Test-Update_On_Call_schedule_returns_OK_response-1747825318\",\"time_zone\":\"America/New_York\"},\"id\":\"65e112fe-2c12-4a2b-8406-522b07cccd1c\",\"relationships\":{\"teams\":{\"data\":[{\"id\":\"72687222-d9aa-4f6a-8af2-1f1811c66378\",\"type\":\"teams\"}]}},\"type\":\"schedules\"}}" + "json": "{\"data\":{\"attributes\":{\"layers\":[{\"effective_date\":\"2025-05-19T04:54:24.605Z\",\"end_date\":\"2025-06-08T04:54:24.605Z\",\"id\":\"b9dca7b6-b083-44d3-9971-6c2c796fb352\",\"interval\":{\"seconds\":300},\"members\":[{\"user\":{\"id\":\"fe6b1fbd-3c48-11f0-90c9-4ad2f0f8c382\"}}],\"name\":\"Layer 1\",\"restrictions\":[{\"end_day\":\"friday\",\"end_time\":\"17:00:00\",\"start_day\":\"monday\",\"start_time\":\"09:00:00\"}],\"rotation_start\":\"2025-05-24T04:54:24.605Z\"}],\"name\":\"Test-Update_On_Call_schedule_returns_OK_response-1748494464\",\"time_zone\":\"America/New_York\"},\"id\":\"f12650c6-beae-40fd-a686-7e57d72216c6\",\"relationships\":{\"teams\":{\"data\":[{\"id\":\"522c3ff2-76b4-41db-8cfa-9bb9876145e4\",\"type\":\"teams\"}]}},\"type\":\"schedules\"}}" }, "headers": {}, "method": "PUT", - "path": "/api/v2/on-call/schedules/65e112fe-2c12-4a2b-8406-522b07cccd1c", + "path": "/api/v2/on-call/schedules/f12650c6-beae-40fd-a686-7e57d72216c6", "keepAlive": false, "secure": true }, "httpResponse": { - "body": "{\"data\":{\"id\":\"65e112fe-2c12-4a2b-8406-522b07cccd1c\",\"type\":\"schedules\",\"attributes\":{\"name\":\"Test-Update_On_Call_schedule_returns_OK_response-1747825318\",\"time_zone\":\"America/New_York\"},\"relationships\":{\"layers\":{\"data\":[{\"id\":\"7f8a6ed7-bc86-48ef-872b-f68b05b28f6b\",\"type\":\"layers\"}]},\"teams\":{\"data\":[{\"id\":\"72687222-d9aa-4f6a-8af2-1f1811c66378\",\"type\":\"teams\"}]}}}}", + "body": "{\"data\":{\"id\":\"f12650c6-beae-40fd-a686-7e57d72216c6\",\"type\":\"schedules\",\"attributes\":{\"name\":\"Test-Update_On_Call_schedule_returns_OK_response-1748494464\",\"time_zone\":\"America/New_York\"},\"relationships\":{\"layers\":{\"data\":[{\"id\":\"b9dca7b6-b083-44d3-9971-6c2c796fb352\",\"type\":\"layers\"}]},\"teams\":{\"data\":[{\"id\":\"522c3ff2-76b4-41db-8cfa-9bb9876145e4\",\"type\":\"teams\"}]}}}}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -117,13 +117,13 @@ "timeToLive": { "unlimited": true }, - "id": "a396a16a-4047-1816-9651-ec2c1f736658" + "id": "57417837-6494-49bf-fc24-806ec352e923" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/team/72687222-d9aa-4f6a-8af2-1f1811c66378", + "path": "/api/v2/team/522c3ff2-76b4-41db-8cfa-9bb9876145e4", "keepAlive": false, "secure": true }, @@ -138,13 +138,13 @@ "timeToLive": { "unlimited": true }, - "id": "0d4a8e39-56a5-dcfe-41be-f83eb53a9bae" + "id": "524bfd86-c3a2-55f6-aac5-5c75b9594611" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/users/03c4b5bd-3633-11f0-8139-36deebce65db", + "path": "/api/v2/on-call/schedules/f12650c6-beae-40fd-a686-7e57d72216c6", "keepAlive": false, "secure": true }, @@ -159,13 +159,13 @@ "timeToLive": { "unlimited": true }, - "id": "c65430c9-e3a7-b60c-a8f4-dd3ca0165478" + "id": "f82cfa04-ac52-3400-073a-dc3acc5b676f" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/on-call/schedules/65e112fe-2c12-4a2b-8406-522b07cccd1c", + "path": "/api/v2/users/fe6b1fbd-3c48-11f0-90c9-4ad2f0f8c382", "keepAlive": false, "secure": true }, @@ -180,6 +180,6 @@ "timeToLive": { "unlimited": true }, - "id": "3325aba1-a2b7-5b2f-5aed-16a1bc5465c6" + "id": "55faab6d-00cb-54aa-8835-da815c33db09" } ] \ No newline at end of file diff --git a/src/test/resources/com/datadog/api/client/v2/api/given.json b/src/test/resources/com/datadog/api/client/v2/api/given.json index e1fb06078fb..794ed14f84f 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/given.json +++ b/src/test/resources/com/datadog/api/client/v2/api/given.json @@ -488,7 +488,7 @@ "parameters": [ { "name": "body", - "value": "{\n \"data\": {\n \"attributes\": {\n \"layers\": [\n {\n \"effective_date\": \"{{ timeISO('now - 10d') }}\",\n \"end_date\": \"{{ timeISO('now + 10d') }}\",\n \"interval\": {\n \"days\": 1\n },\n \"members\": [\n {\n \"user\": {\n \"id\": \"890f29d4-0b7a-11f0-aeb2-760fcae4f596\"\n }\n }\n ],\n \"name\": \"Layer 1\",\n \"restrictions\": [\n {\n \"end_day\": \"friday\",\n \"end_time\": \"17:00:00\",\n \"start_day\": \"monday\",\n \"start_time\": \"09:00:00\"\n }\n ],\n \"rotation_start\": \"{{ timeISO('now - 5d') }}\"\n }\n ],\n \"name\": \"{{ unique }}\",\n \"time_zone\": \"America/New_York\"\n },\n \"relationships\": {\n \"teams\": {\n \"data\": [\n {\n \"id\": \"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\n \"type\": \"teams\"\n }\n ]\n }\n },\n \"type\": \"schedules\"\n }\n}" + "value": "{\n \"data\": {\n \"attributes\": {\n \"layers\": [\n {\n \"effective_date\": \"{{ timeISO('now - 10d') }}\",\n \"end_date\": \"{{ timeISO('now + 10d') }}\",\n \"interval\": {\n \"days\": 1\n },\n \"members\": [\n {\n \"user\": {\n \"id\": \"{{ user.data.id }}\"\n }\n }\n ],\n \"name\": \"Layer 1\",\n \"restrictions\": [\n {\n \"end_day\": \"friday\",\n \"end_time\": \"17:00:00\",\n \"start_day\": \"monday\",\n \"start_time\": \"09:00:00\"\n }\n ],\n \"rotation_start\": \"{{ timeISO('now - 5d') }}\"\n }\n ],\n \"name\": \"{{ unique }}\",\n \"time_zone\": \"America/New_York\"\n },\n \"relationships\": {\n \"teams\": {\n \"data\": [\n {\n \"id\": \"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\n \"type\": \"teams\"\n }\n ]\n }\n },\n \"type\": \"schedules\"\n }\n}" } ], "step": "there is a valid \"schedule\" in the system", @@ -498,9 +498,13 @@ }, { "parameters": [ + { + "name": "team_id", + "source": "dd_team.data.id" + }, { "name": "body", - "value": "{\n \"data\": {\n \"attributes\": {\n \"rules\": [\n {\n \"query\": \"\",\n \"policy_id\": \"{{ escalation_policy.data.id }}\",\n \"urgency\": \"low\",\n \"time_restriction\": null,\n \"actions\": []\n }\n ]\n }\n }\n}" + "value": "{\n \"data\": {\n \"type\": \"team_routing_rules\",\n \"id\": \"{{ dd_team.data.id }}\",\n \"attributes\": {\n \"rules\": [\n {\n \"query\": \"\",\n \"policy_id\": \"{{ escalation_policy.data.id }}\",\n \"urgency\": \"low\",\n \"actions\": []\n }\n ]\n }\n }\n}" } ], "step": "there are valid \"routing_rules\" in the system", 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 7072fd61c55..2e612c6bf76 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 @@ -19,9 +19,9 @@ Feature: On-Call @team:DataDog/bugle Scenario: Create On-Call escalation policy returns "Created" response Given new "CreateOnCallEscalationPolicy" request + And there is a valid "user" in the system And there is a valid "schedule" in the system And there is a valid "dd_team" in the system - And there is a valid "user" in the system And body with value {"data": {"attributes": {"name": "{{ unique }}", "resolve_page_on_policy_end": true, "retries": 2, "steps": [{"assignment": "default", "escalate_after_seconds": 3600, "targets": [{"id": "{{ user.data.id }}", "type": "users"}, {"id": "{{ schedule.data.id }}", "type": "schedules"}, {"id": "{{ dd_team.data.id }}", "type": "teams"}]}, {"assignment": "round-robin", "escalate_after_seconds": 3600, "targets": [{"id": "{{ dd_team.data.id }}", "type": "teams"}]}]}, "relationships": {"teams": {"data": [{"id": "{{ dd_team.data.id }}", "type": "teams"}]}}, "type": "policies"}} And request contains "include" parameter with value "steps.targets" When the request is sent @@ -64,6 +64,7 @@ Feature: On-Call @team:DataDog/bugle Scenario: Delete On-Call schedule returns "No Content" response Given new "DeleteOnCallSchedule" request + And there is a valid "user" in the system And there is a valid "schedule" in the system And request contains "schedule_id" parameter from "schedule.data.id" When the request is sent @@ -112,6 +113,7 @@ Feature: On-Call @team:DataDog/bugle Scenario: Get On-Call schedule returns "OK" response Given new "GetOnCallSchedule" request + And there is a valid "user" in the system And there is a valid "schedule" in the system And request contains "schedule_id" parameter from "schedule.data.id" When the request is sent @@ -124,6 +126,33 @@ Feature: On-Call When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/bugle + Scenario: Get team on-call users returns "Bad Request" response + Given new "GetTeamOnCallUsers" request + And request contains "team_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/bugle + Scenario: Get team on-call users returns "Not Found" response + Given new "GetTeamOnCallUsers" request + And request contains "team_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/bugle + Scenario: Get team on-call users returns "OK" response + Given new "GetTeamOnCallUsers" 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 there are valid "routing_rules" in the system + And request contains "team_id" parameter from "routing_rules.data.id" + And request contains "include" parameter with value "responders,escalations.responders" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/bugle Scenario: Get the schedule on-call user returns "Bad Request" response Given new "GetScheduleOnCallUser" request @@ -141,6 +170,7 @@ Feature: On-Call @team:DataDog/bugle Scenario: Get the schedule on-call user returns "OK" response Given new "GetScheduleOnCallUser" request + And there is a valid "user" in the system And there is a valid "schedule" in the system And request contains "schedule_id" parameter from "schedule.data.id" When the request is sent @@ -206,8 +236,8 @@ Feature: On-Call @team:DataDog/bugle Scenario: Update On-Call schedule returns "OK" response Given new "UpdateOnCallSchedule" request - And there is a valid "schedule" in the system And there is a valid "user" in the system + And there is a valid "schedule" in the system And there is a valid "dd_team" in the system And request contains "schedule_id" parameter from "schedule.data.id" And body with value {"data": { "id": "{{ schedule.data.id }}", "attributes": {"layers": [{"id": "{{ schedule.data.relationships.layers.data[0].id }}" , "effective_date": "{{ timeISO('now - 10d') }}", "end_date": "{{ timeISO('now + 10d') }}", "interval": {"seconds": 300}, "members": [{"user": {"id": "{{user.data.id}}"}}], "name": "Layer 1", "restrictions": [{"end_day": "friday", "end_time": "17:00:00", "start_day": "monday", "start_time": "09:00:00"}], "rotation_start": "{{ timeISO('now - 5d') }}"}], "name": "{{ unique }}", "time_zone": "America/New_York"}, "relationships": {"teams": {"data": [{"id": "{{dd_team.data.id}}", "type": "teams"}]}}, "type": "schedules"}} 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 69af02feb69..fabe7a4db8d 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 @@ -1991,6 +1991,12 @@ "type": "safe" } }, + "GetTeamOnCallUsers": { + "tag": "On-Call", + "undo": { + "type": "safe" + } + }, "GetOnCallTeamRoutingRules": { "tag": "On-Call", "undo": {