diff --git a/.apigentools-info b/.apigentools-info index f4f5788f9a4f..3f0710840d66 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2025-06-09 14:45:35.193886", - "spec_repo_commit": "79e7c933" + "regenerated": "2025-06-10 00:08:51.009931", + "spec_repo_commit": "4fe79cde" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2025-06-09 14:45:35.210362", - "spec_repo_commit": "79e7c933" + "regenerated": "2025-06-10 00:08:51.025981", + "spec_repo_commit": "4fe79cde" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index d093ae5abd7a..031da1339867 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -13865,6 +13865,21 @@ components: required: - type type: object + EscalationPoliciesResponse: + description: Response with a list of escalation policies. + properties: + data: + description: A list of escalation policies. + items: + $ref: '#/components/schemas/EscalationPolicyData' + type: array + included: + description: Provides any included related resources, such as steps or targets, + returned with the policy. + items: + $ref: '#/components/schemas/EscalationPolicyIncluded' + type: array + type: object EscalationPolicy: description: Represents a complete escalation policy response, including policy data and optionally included related resources. @@ -26994,6 +27009,28 @@ components: - TEAM_ID - TEAM_HANDLE - USER_ID + OnCallUserRelationship: + description: The definition of `OnCallUserRelationship` object. + properties: + data: + $ref: '#/components/schemas/OnCallUserRelationshipData' + type: object + OnCallUserRelationshipData: + description: The definition of `OnCallUserRelationshipData` object. + properties: + id: + description: The ID of the user. + type: string + type: + $ref: '#/components/schemas/OnCallUserRelationshipType' + type: object + OnCallUserRelationshipType: + description: The definition of `OnCallUserRelationshipType` object. + enum: + - users + type: string + x-enum-varnames: + - USERS OnDemandConcurrencyCap: description: On-demand concurrency cap. properties: @@ -27624,6 +27661,118 @@ components: - ARRAY_NUMBER - ARRAY_BOOLEAN - ARRAY_OBJECT + Override: + description: The definition of `Override` object. + properties: + attributes: + $ref: '#/components/schemas/OverrideAttributes' + id: + description: The ID of the override. + type: string + relationships: + $ref: '#/components/schemas/OverrideRelationships' + type: + $ref: '#/components/schemas/OverrideType' + type: object + OverrideAttributes: + description: The definition of `OverrideAttributes` object. + properties: + end: + description: The end time of the override. + format: date-time + type: string + start: + description: The start time of the override. + format: date-time + type: string + type: object + OverrideCreateData: + description: The definition of `OverrideCreateData` object. + properties: + attributes: + $ref: '#/components/schemas/OverrideCreateDataAttributes' + relationships: + $ref: '#/components/schemas/OverrideCreateDataRelationships' + type: + $ref: '#/components/schemas/OverrideCreateDataType' + required: + - attributes + - type + type: object + OverrideCreateDataAttributes: + description: The definition of `OverrideCreateDataAttributes` object. + properties: + end: + description: The end time of the override. + example: '' + format: date-time + type: string + start: + description: The start time of the override. + example: '' + format: date-time + type: string + required: + - start + - end + type: object + OverrideCreateDataRelationships: + description: The definition of `OverrideCreateDataRelationships` object. + properties: + user: + $ref: '#/components/schemas/OnCallUserRelationship' + type: object + OverrideCreateDataType: + description: The definition of `OverrideCreateDataType` object. + enum: + - overrides + example: overrides + type: string + x-enum-varnames: + - OVERRIDES + OverrideRelationships: + description: The definition of `OverrideRelationships` object. + properties: + user: + $ref: '#/components/schemas/OnCallUserRelationship' + type: object + OverrideRequest: + description: The definition of `OverrideRequest` object. + properties: + data: + description: The `OverrideRequest` `data`. + items: + $ref: '#/components/schemas/OverrideCreateData' + type: array + required: + - data + type: object + OverrideResponse: + description: The definition of `OverrideResponse` object. + properties: + data: + description: The `OverrideResponse` `data`. + items: + $ref: '#/components/schemas/Override' + type: array + type: object + OverrideType: + default: overrides + description: The definition of `OverrideType` object. + enum: + - overrides + type: string + x-enum-varnames: + - OVERRIDES + OverridesResponse: + description: The definition of `OverridesResponse` object. + properties: + data: + description: The `OverridesResponse` `data`. + items: + $ref: '#/components/schemas/Override' + type: array + type: object PageUrgency: default: high description: On-Call Page urgency level. @@ -32421,6 +32570,21 @@ components: type: string x-enum-varnames: - USERS + SchedulesResponse: + description: Response with a list of on-call schedules. + properties: + data: + description: A list of on-call schedules. + items: + $ref: '#/components/schemas/ScheduleData' + type: array + included: + description: Any additional resources related to this schedule, such as + teams and layers. + items: + $ref: '#/components/schemas/ScheduleDataIncludedItem' + type: array + type: object ScorecardType: default: scorecard description: The JSON:API type for scorecard. @@ -38209,7 +38373,7 @@ components: type: object TeamOnCallRespondersData: description: Defines the main on-call responder object for a team, including - relationships and metadata. + relationships. properties: id: description: Unique identifier of the on-call responder configuration. @@ -52439,6 +52603,36 @@ paths: contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/on-call/escalation-policies: + get: + description: Get a list of all escalation policies. + operationId: ListOnCallEscalationPolicies + parameters: + - $ref: '#/components/parameters/PageSize' + - $ref: '#/components/parameters/PageNumber' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EscalationPoliciesResponse' + 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 a list of all escalation policies + tags: + - On-Call post: description: Create a new On-Call escalation policy operationId: CreateOnCallEscalationPolicy @@ -52833,6 +53027,36 @@ paths: tags: - On-Call Paging /api/v2/on-call/schedules: + get: + description: Get a list of all on-call schedules. + operationId: ListOnCallSchedules + parameters: + - $ref: '#/components/parameters/PageSize' + - $ref: '#/components/parameters/PageNumber' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/SchedulesResponse' + 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 a list of all on-call schedules + tags: + - On-Call post: description: Create a new On-Call schedule operationId: CreateOnCallSchedule @@ -53053,6 +53277,134 @@ paths: summary: Get the schedule on-call user tags: - On-Call + /api/v2/on-call/schedules/{schedule_id}/overrides: + get: + description: Get a list of all overrides for a given schedule. + operationId: ListOnCallScheduleOverrides + parameters: + - description: The ID of the on-call schedule. + in: path + name: schedule_id + required: true + schema: + type: string + - $ref: '#/components/parameters/PageSize' + - $ref: '#/components/parameters/PageNumber' + - description: The start time (in ISO-8601 format) of the time range to filter + overrides by. Only overrides that overlap with this time range will be returned. + in: query + name: filter[start] + required: true + schema: + type: string + - description: The end time (in ISO-8601 format) of the time range to filter + overrides by. Only overrides that overlap with this time range will be returned. + in: query + name: filter[end] + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/OverridesResponse' + 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 a list of all overrides for a schedule + tags: + - On-Call + post: + description: Create an override for a given schedule. + operationId: CreateOnCallScheduleOverride + parameters: + - description: The ID of the on-call schedule. + in: path + name: schedule_id + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OverrideRequest' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/OverrideResponse' + description: Created + '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: Create an override + tags: + - On-Call + /api/v2/on-call/schedules/{schedule_id}/overrides/{override_id}: + delete: + description: Delete an override for a given schedule. + operationId: DeleteOnCallScheduleOverride + parameters: + - description: The ID of the on-call schedule. + in: path + name: schedule_id + required: true + schema: + type: string + - description: The ID of the override. + in: path + name: override_id + required: true + schema: + type: string + responses: + '204': + description: No Content + '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: Delete an override + 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 diff --git a/cassettes/v2/On-Call_446749911/Create-an-override-returns-Created-response_3070823806/frozen.json b/cassettes/v2/On-Call_446749911/Create-an-override-returns-Created-response_3070823806/frozen.json new file mode 100644 index 000000000000..4bb521a23b40 --- /dev/null +++ b/cassettes/v2/On-Call_446749911/Create-an-override-returns-Created-response_3070823806/frozen.json @@ -0,0 +1 @@ +"2025-06-09T23:29:57.648Z" diff --git a/cassettes/v2/On-Call_446749911/Create-an-override-returns-Created-response_3070823806/recording.har b/cassettes/v2/On-Call_446749911/Create-an-override-returns-Created-response_3070823806/recording.har new file mode 100644 index 000000000000..b4ec3976c426 --- /dev/null +++ b/cassettes/v2/On-Call_446749911/Create-an-override-returns-Created-response_3070823806/recording.har @@ -0,0 +1,290 @@ +{ + "log": { + "_recordingName": "On-Call/Create an override returns \"Created\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "d4faa114576b4536281bbbdf80b21a13", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 145, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 550, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"email\":\"Test-Create_an_override_returns_Created_response-1749511797@datadoghq.com\",\"title\":\"user title\"},\"type\":\"users\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/users" + }, + "response": { + "bodySize": 691, + "content": { + "mimeType": "application/json", + "size": 691, + "text": "{\"data\":{\"type\":\"users\",\"id\":\"a8378345-4589-11f0-8c93-d6008d2166ed\",\"attributes\":{\"name\":null,\"handle\":\"test-create_an_override_returns_created_response-1749511797@datadoghq.com\",\"created_at\":\"2025-06-09T23:29:58.353218+00:00\",\"modified_at\":\"2025-06-09T23:29:58.353218+00:00\",\"email\":\"test-create_an_override_returns_created_response-1749511797@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/7995727f01e644529125dadf775bd0e7?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" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 680, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 201, + "statusText": "Created" + }, + "startedDateTime": "2025-06-09T23:29:57.651Z", + "time": 812 + }, + { + "_id": "48a80e3b078c5d05480499672f6a4938", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 592, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 572, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"layers\":[{\"effective_date\":\"2025-05-30T23:29:57.648Z\",\"end_date\":\"2025-06-19T23:29:57.648Z\",\"interval\":{\"days\":1},\"members\":[{\"user\":{\"id\":\"a8378345-4589-11f0-8c93-d6008d2166ed\"}}],\"name\":\"Layer 1\",\"restrictions\":[{\"end_day\":\"friday\",\"end_time\":\"17:00:00\",\"start_day\":\"monday\",\"start_time\":\"09:00:00\"}],\"rotation_start\":\"2025-06-04T23:29:57.648Z\"}],\"name\":\"Test-Create_an_override_returns_Created_response-1749511797\",\"time_zone\":\"America/New_York\"},\"relationships\":{\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}},\"type\":\"schedules\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/on-call/schedules" + }, + "response": { + "bodySize": 368, + "content": { + "mimeType": "application/vnd.api+json", + "size": 368, + "text": "{\"data\":{\"id\":\"72f3a655-502c-491e-adb4-1e67a7aef424\",\"type\":\"schedules\",\"attributes\":{\"name\":\"Test-Create_an_override_returns_Created_response-1749511797\",\"time_zone\":\"America/New_York\"},\"relationships\":{\"layers\":{\"data\":[{\"id\":\"314f8781-e48b-4dad-a86d-0d85ee7e34f5\",\"type\":\"layers\"}]},\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 525, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 201, + "statusText": "Created" + }, + "startedDateTime": "2025-06-09T23:29:58.467Z", + "time": 738 + }, + { + "_id": "26f5fcff7410388e5bf1b24147582691", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 209, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 627, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":[{\"attributes\":{\"end\":\"2025-06-10T00:29:57.648Z\",\"start\":\"2025-06-09T23:29:57.648Z\"},\"relationships\":{\"user\":{\"data\":{\"id\":\"a8378345-4589-11f0-8c93-d6008d2166ed\",\"type\":\"users\"}}},\"type\":\"overrides\"}]}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/on-call/schedules/72f3a655-502c-491e-adb4-1e67a7aef424/overrides" + }, + "response": { + "bodySize": 253, + "content": { + "mimeType": "application/vnd.api+json", + "size": 253, + "text": "{\"data\":[{\"id\":\"c19f68f9-e22d-424b-8ee2-74068a2d41f4\",\"type\":\"overrides\",\"attributes\":{\"end\":\"2025-06-10T00:29:57.648Z\",\"start\":\"2025-06-09T23:29:57.648Z\"},\"relationships\":{\"user\":{\"data\":{\"id\":\"a8378345-4589-11f0-8c93-d6008d2166ed\",\"type\":\"users\"}}}}]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 525, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 201, + "statusText": "Created" + }, + "startedDateTime": "2025-06-09T23:29:59.215Z", + "time": 735 + }, + { + "_id": "e901772efef39e261b34ff88e77cb30d", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 581, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/on-call/schedules/%7Bschedule_id%7D/overrides/c19f68f9-e22d-424b-8ee2-74068a2d41f4" + }, + "response": { + "bodySize": 117, + "content": { + "mimeType": "application/vnd.api+json", + "size": 117, + "text": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"attribute \\\"uuid\\\" [{schedule_id}] is not a valid UUID\"}]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 525, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 400, + "statusText": "Bad Request" + }, + "startedDateTime": "2025-06-09T23:29:59.958Z", + "time": 731 + }, + { + "_id": "8922b8f69ac4503f230c760acb418580", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 545, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/on-call/schedules/72f3a655-502c-491e-adb4-1e67a7aef424" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [], + "headers": [], + "headersSize": 464, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-06-09T23:30:00.696Z", + "time": 681 + }, + { + "_id": "b94125d759316de9c2816b52c0bac0d4", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 524, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/users/a8378345-4589-11f0-8c93-d6008d2166ed" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [], + "headers": [], + "headersSize": 495, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-06-09T23:30:01.381Z", + "time": 948 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/On-Call_446749911/Delete-an-override-returns-No-Content-response_1818178701/frozen.json b/cassettes/v2/On-Call_446749911/Delete-an-override-returns-No-Content-response_1818178701/frozen.json new file mode 100644 index 000000000000..327377cc00fd --- /dev/null +++ b/cassettes/v2/On-Call_446749911/Delete-an-override-returns-No-Content-response_1818178701/frozen.json @@ -0,0 +1 @@ +"2025-06-09T23:30:15.221Z" diff --git a/cassettes/v2/On-Call_446749911/Delete-an-override-returns-No-Content-response_1818178701/recording.har b/cassettes/v2/On-Call_446749911/Delete-an-override-returns-No-Content-response_1818178701/recording.har new file mode 100644 index 000000000000..724011cc0724 --- /dev/null +++ b/cassettes/v2/On-Call_446749911/Delete-an-override-returns-No-Content-response_1818178701/recording.har @@ -0,0 +1,327 @@ +{ + "log": { + "_recordingName": "On-Call/Delete an override returns \"No Content\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "c07b94e8584322466c8fab58ef87dc79", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 148, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 550, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"email\":\"Test-Delete_an_override_returns_No_Content_response-1749511815@datadoghq.com\",\"title\":\"user title\"},\"type\":\"users\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/users" + }, + "response": { + "bodySize": 697, + "content": { + "mimeType": "application/json", + "size": 697, + "text": "{\"data\":{\"type\":\"users\",\"id\":\"b2a8c8e6-4589-11f0-8c93-d6008d2166ed\",\"attributes\":{\"name\":null,\"handle\":\"test-delete_an_override_returns_no_content_response-1749511815@datadoghq.com\",\"created_at\":\"2025-06-09T23:30:15.872777+00:00\",\"modified_at\":\"2025-06-09T23:30:15.872777+00:00\",\"email\":\"test-delete_an_override_returns_no_content_response-1749511815@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/49f12a88e1d0d2808f4ad18cf228a08c?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" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 681, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 201, + "statusText": "Created" + }, + "startedDateTime": "2025-06-09T23:30:15.223Z", + "time": 729 + }, + { + "_id": "c346993952dc93b4998ec8da129bdbba", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 595, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 572, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"layers\":[{\"effective_date\":\"2025-05-30T23:30:15.221Z\",\"end_date\":\"2025-06-19T23:30:15.221Z\",\"interval\":{\"days\":1},\"members\":[{\"user\":{\"id\":\"b2a8c8e6-4589-11f0-8c93-d6008d2166ed\"}}],\"name\":\"Layer 1\",\"restrictions\":[{\"end_day\":\"friday\",\"end_time\":\"17:00:00\",\"start_day\":\"monday\",\"start_time\":\"09:00:00\"}],\"rotation_start\":\"2025-06-04T23:30:15.221Z\"}],\"name\":\"Test-Delete_an_override_returns_No_Content_response-1749511815\",\"time_zone\":\"America/New_York\"},\"relationships\":{\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}},\"type\":\"schedules\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/on-call/schedules" + }, + "response": { + "bodySize": 371, + "content": { + "mimeType": "application/vnd.api+json", + "size": 371, + "text": "{\"data\":{\"id\":\"bc5808ac-2b71-4213-8f8d-b9bcdb59b605\",\"type\":\"schedules\",\"attributes\":{\"name\":\"Test-Delete_an_override_returns_No_Content_response-1749511815\",\"time_zone\":\"America/New_York\"},\"relationships\":{\"layers\":{\"data\":[{\"id\":\"af7496af-5a70-4599-8c90-aa4a6a9fc8b7\",\"type\":\"layers\"}]},\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 525, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 201, + "statusText": "Created" + }, + "startedDateTime": "2025-06-09T23:30:15.955Z", + "time": 663 + }, + { + "_id": "af41941d469936d24a56d2b68cab41b5", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 209, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 627, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":[{\"attributes\":{\"end\":\"2025-06-10T00:30:15.221Z\",\"start\":\"2025-06-09T23:30:15.221Z\"},\"relationships\":{\"user\":{\"data\":{\"id\":\"b2a8c8e6-4589-11f0-8c93-d6008d2166ed\",\"type\":\"users\"}}},\"type\":\"overrides\"}]}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/on-call/schedules/bc5808ac-2b71-4213-8f8d-b9bcdb59b605/overrides" + }, + "response": { + "bodySize": 253, + "content": { + "mimeType": "application/vnd.api+json", + "size": 253, + "text": "{\"data\":[{\"id\":\"b289bd65-d407-4dc8-b606-d7dedcffc88e\",\"type\":\"overrides\",\"attributes\":{\"end\":\"2025-06-10T00:30:15.221Z\",\"start\":\"2025-06-09T23:30:15.221Z\"},\"relationships\":{\"user\":{\"data\":{\"id\":\"b2a8c8e6-4589-11f0-8c93-d6008d2166ed\",\"type\":\"users\"}}}}]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 525, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 201, + "statusText": "Created" + }, + "startedDateTime": "2025-06-09T23:30:16.626Z", + "time": 672 + }, + { + "_id": "4c6e089e9abd383e724355d7b6449edc", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 600, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/on-call/schedules/bc5808ac-2b71-4213-8f8d-b9bcdb59b605/overrides/b289bd65-d407-4dc8-b606-d7dedcffc88e" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [], + "headers": [], + "headersSize": 464, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-06-09T23:30:17.305Z", + "time": 790 + }, + { + "_id": "04307be89315f2f10553d166691fffb1", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 581, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/on-call/schedules/%7Bschedule_id%7D/overrides/b289bd65-d407-4dc8-b606-d7dedcffc88e" + }, + "response": { + "bodySize": 117, + "content": { + "mimeType": "application/vnd.api+json", + "size": 117, + "text": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"attribute \\\"uuid\\\" [{schedule_id}] is not a valid UUID\"}]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 525, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 400, + "statusText": "Bad Request" + }, + "startedDateTime": "2025-06-09T23:30:18.100Z", + "time": 722 + }, + { + "_id": "a49ca8e8bc3c8e9c2d643ca7de13303f", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 545, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/on-call/schedules/bc5808ac-2b71-4213-8f8d-b9bcdb59b605" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [], + "headers": [], + "headersSize": 464, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-06-09T23:30:18.826Z", + "time": 806 + }, + { + "_id": "1c01e1d1c1a9309ca5871997e1145e56", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 524, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/users/b2a8c8e6-4589-11f0-8c93-d6008d2166ed" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [], + "headers": [], + "headersSize": 495, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-06-09T23:30:19.635Z", + "time": 1567 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/On-Call_446749911/Get-On-Call-team-routing-rules-returns-OK-response_1436100991/frozen.json b/cassettes/v2/On-Call_446749911/Get-On-Call-team-routing-rules-returns-OK-response_1436100991/frozen.json new file mode 100644 index 000000000000..2a9af8ec9c28 --- /dev/null +++ b/cassettes/v2/On-Call_446749911/Get-On-Call-team-routing-rules-returns-OK-response_1436100991/frozen.json @@ -0,0 +1 @@ +"2025-06-09T23:30:31.779Z" diff --git a/cassettes/v2/On-Call_446749911/Get-On-Call-team-routing-rules-returns-OK-response_1436100991/recording.har b/cassettes/v2/On-Call_446749911/Get-On-Call-team-routing-rules-returns-OK-response_1436100991/recording.har new file mode 100644 index 000000000000..183fa46b2fb6 --- /dev/null +++ b/cassettes/v2/On-Call_446749911/Get-On-Call-team-routing-rules-returns-OK-response_1436100991/recording.har @@ -0,0 +1,482 @@ +{ + "log": { + "_recordingName": "On-Call/Get On-Call team routing rules returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "b3c3f4cb7ee091e5e85d9b9f183ae6f4", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 152, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 550, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"email\":\"Test-Get_On_Call_team_routing_rules_returns_OK_response-1749511831@datadoghq.com\",\"title\":\"user title\"},\"type\":\"users\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/users" + }, + "response": { + "bodySize": 705, + "content": { + "mimeType": "application/json", + "size": 705, + "text": "{\"data\":{\"type\":\"users\",\"id\":\"bc907b9d-4589-11f0-90a5-c6be27f34b35\",\"attributes\":{\"name\":null,\"handle\":\"test-get_on_call_team_routing_rules_returns_ok_response-1749511831@datadoghq.com\",\"created_at\":\"2025-06-09T23:30:32.490724+00:00\",\"modified_at\":\"2025-06-09T23:30:32.490724+00:00\",\"email\":\"test-get_on_call_team_routing_rules_returns_ok_response-1749511831@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/282e20cbe2179ced95eabd4f0895be11?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" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 681, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 201, + "statusText": "Created" + }, + "startedDateTime": "2025-06-09T23:30:31.785Z", + "time": 809 + }, + { + "_id": "bbae0de6badc32283f329a7f442d41a6", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 115, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 549, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"handle\":\"test-handle-437ab09a446c969f\",\"name\":\"test-name-437ab09a446c969f\"},\"type\":\"team\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/team" + }, + "response": { + "bodySize": 636, + "content": { + "mimeType": "application/json", + "size": 636, + "text": "{\"data\":{\"type\":\"team\",\"id\":\"2c5640af-2bbe-4fa7-9912-ffb41692f45a\",\"attributes\":{\"name\":\"test-name-437ab09a446c969f\",\"handle\":\"test-handle-437ab09a446c969f\",\"summary\":null,\"description\":null,\"avatar\":null,\"banner\":13,\"visible_modules\":[],\"hidden_modules\":[],\"created_at\":\"2025-06-09T23:30:33.256609+00:00\",\"modified_at\":\"2025-06-09T23:30:33.256619+00:00\",\"user_count\":0,\"link_count\":0},\"relationships\":{\"team_links\":{\"links\":{\"related\":\"/api/v2/team/2c5640af-2bbe-4fa7-9912-ffb41692f45a/links\"}},\"user_team_permissions\":{\"links\":{\"related\":\"/api/v2/team/2c5640af-2bbe-4fa7-9912-ffb41692f45a/permission-settings\"}}}}}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 685, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 201, + "statusText": "Created" + }, + "startedDateTime": "2025-06-09T23:30:32.601Z", + "time": 849 + }, + { + "_id": "24ee355a6103f3007eac2614c069b37b", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 599, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 572, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"layers\":[{\"effective_date\":\"2025-05-30T23:30:31.779Z\",\"end_date\":\"2025-06-19T23:30:31.779Z\",\"interval\":{\"days\":1},\"members\":[{\"user\":{\"id\":\"bc907b9d-4589-11f0-90a5-c6be27f34b35\"}}],\"name\":\"Layer 1\",\"restrictions\":[{\"end_day\":\"friday\",\"end_time\":\"17:00:00\",\"start_day\":\"monday\",\"start_time\":\"09:00:00\"}],\"rotation_start\":\"2025-06-04T23:30:31.779Z\"}],\"name\":\"Test-Get_On_Call_team_routing_rules_returns_OK_response-1749511831\",\"time_zone\":\"America/New_York\"},\"relationships\":{\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}},\"type\":\"schedules\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/on-call/schedules" + }, + "response": { + "bodySize": 375, + "content": { + "mimeType": "application/vnd.api+json", + "size": 375, + "text": "{\"data\":{\"id\":\"5577a3fa-b188-4de6-974b-15f85012d023\",\"type\":\"schedules\",\"attributes\":{\"name\":\"Test-Get_On_Call_team_routing_rules_returns_OK_response-1749511831\",\"time_zone\":\"America/New_York\"},\"relationships\":{\"layers\":{\"data\":[{\"id\":\"10797d12-72b5-42a5-9419-c443041a40d9\",\"type\":\"layers\"}]},\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 525, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 201, + "statusText": "Created" + }, + "startedDateTime": "2025-06-09T23:30:33.456Z", + "time": 898 + }, + { + "_id": "57aaa2ef1685df3945b7d5b8e9c50877", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 659, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 590, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"name\":\"Test-Get_On_Call_team_routing_rules_returns_OK_response-1749511831\",\"resolve_page_on_policy_end\":true,\"retries\":2,\"steps\":[{\"assignment\":\"default\",\"escalate_after_seconds\":3600,\"targets\":[{\"id\":\"2c5640af-2bbe-4fa7-9912-ffb41692f45a\",\"type\":\"teams\"},{\"id\":\"5577a3fa-b188-4de6-974b-15f85012d023\",\"type\":\"schedules\"},{\"id\":\"bc907b9d-4589-11f0-90a5-c6be27f34b35\",\"type\":\"users\"}]},{\"assignment\":\"round-robin\",\"escalate_after_seconds\":3600,\"targets\":[{\"id\":\"2c5640af-2bbe-4fa7-9912-ffb41692f45a\",\"type\":\"teams\"}]}]},\"relationships\":{\"teams\":{\"data\":[{\"id\":\"2c5640af-2bbe-4fa7-9912-ffb41692f45a\",\"type\":\"teams\"}]}},\"type\":\"policies\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/on-call/escalation-policies" + }, + "response": { + "bodySize": 448, + "content": { + "mimeType": "application/vnd.api+json", + "size": 448, + "text": "{\"data\":{\"id\":\"ba689dcc-6308-4988-beef-6bff469062e0\",\"type\":\"policies\",\"attributes\":{\"name\":\"Test-Get_On_Call_team_routing_rules_returns_OK_response-1749511831\",\"resolve_page_on_policy_end\":true,\"retries\":2},\"relationships\":{\"steps\":{\"data\":[{\"id\":\"7a46faac-d206-4583-b04b-739811011b6e\",\"type\":\"steps\"},{\"id\":\"421f115d-86cc-4aa0-b855-99a6670de8a0\",\"type\":\"steps\"}]},\"teams\":{\"data\":[{\"id\":\"2c5640af-2bbe-4fa7-9912-ffb41692f45a\",\"type\":\"teams\"}]}}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 525, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 201, + "statusText": "Created" + }, + "startedDateTime": "2025-06-09T23:30:34.362Z", + "time": 761 + }, + { + "_id": "32c9238a1f8b347f6ee9a9d9660c371e", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 200, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 623, + "httpVersion": "HTTP/1.1", + "method": "PUT", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"rules\":[{\"actions\":[],\"policy_id\":\"ba689dcc-6308-4988-beef-6bff469062e0\",\"query\":\"\",\"urgency\":\"low\"}]},\"id\":\"2c5640af-2bbe-4fa7-9912-ffb41692f45a\",\"type\":\"team_routing_rules\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/on-call/teams/2c5640af-2bbe-4fa7-9912-ffb41692f45a/routing-rules" + }, + "response": { + "bodySize": 208, + "content": { + "mimeType": "application/vnd.api+json", + "size": 208, + "text": "{\"data\":{\"id\":\"2c5640af-2bbe-4fa7-9912-ffb41692f45a\",\"type\":\"team_routing_rules\",\"relationships\":{\"rules\":{\"data\":[{\"id\":\"virtual-2c5640af-2bbe-4fa7-9912-ffb41692f45a-rule-0\",\"type\":\"team_routing_rules\"}]}}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 525, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-06-09T23:30:35.130Z", + "time": 1065 + }, + { + "_id": "d97b5c9c2ac402056ea4948a9d6c86f4", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 570, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/on-call/teams/2c5640af-2bbe-4fa7-9912-ffb41692f45a/routing-rules" + }, + "response": { + "bodySize": 208, + "content": { + "mimeType": "application/vnd.api+json", + "size": 208, + "text": "{\"data\":{\"id\":\"2c5640af-2bbe-4fa7-9912-ffb41692f45a\",\"type\":\"team_routing_rules\",\"relationships\":{\"rules\":{\"data\":[{\"id\":\"virtual-2c5640af-2bbe-4fa7-9912-ffb41692f45a-rule-0\",\"type\":\"team_routing_rules\"}]}}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 525, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-06-09T23:30:36.203Z", + "time": 1012 + }, + { + "_id": "6b1796d6e18d4ed1b05c135f11ebc302", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 563, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/on-call/escalation-policies/ba689dcc-6308-4988-beef-6bff469062e0" + }, + "response": { + "bodySize": 104, + "content": { + "mimeType": "application/vnd.api+json", + "size": 104, + "text": "{\"errors\":[{\"title\":\"Generic Error\",\"detail\":\"policy[ba689dcc-6308-4988-beef-6bff469062e0] is in use\"}]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 525, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 409, + "statusText": "Conflict" + }, + "startedDateTime": "2025-06-09T23:30:37.222Z", + "time": 885 + }, + { + "_id": "6d1a0a5adf81a26e80f1ab71384b3652", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 545, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/on-call/schedules/5577a3fa-b188-4de6-974b-15f85012d023" + }, + "response": { + "bodySize": 106, + "content": { + "mimeType": "application/vnd.api+json", + "size": 106, + "text": "{\"errors\":[{\"title\":\"Generic Error\",\"detail\":\"schedule[5577a3fa-b188-4de6-974b-15f85012d023] is in use\"}]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 525, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 409, + "statusText": "Conflict" + }, + "startedDateTime": "2025-06-09T23:30:38.112Z", + "time": 715 + }, + { + "_id": "0e63e23cfc60ce5da08d2bb064c48e75", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 522, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/team/2c5640af-2bbe-4fa7-9912-ffb41692f45a" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [], + "headers": [], + "headersSize": 632, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-06-09T23:30:38.832Z", + "time": 838 + }, + { + "_id": "598f8ab39b149077d23a84157cf9a880", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 524, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/users/bc907b9d-4589-11f0-90a5-c6be27f34b35" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [], + "headers": [], + "headersSize": 495, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-06-09T23:30:39.677Z", + "time": 1027 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/On-Call_446749911/Get-a-list-of-all-escalation-policies-returns-OK-response_1771156229/frozen.json b/cassettes/v2/On-Call_446749911/Get-a-list-of-all-escalation-policies-returns-OK-response_1771156229/frozen.json new file mode 100644 index 000000000000..1eabf505ef6d --- /dev/null +++ b/cassettes/v2/On-Call_446749911/Get-a-list-of-all-escalation-policies-returns-OK-response_1771156229/frozen.json @@ -0,0 +1 @@ +"2025-06-09T23:30:40.718Z" diff --git a/cassettes/v2/On-Call_446749911/Get-a-list-of-all-escalation-policies-returns-OK-response_1771156229/recording.har b/cassettes/v2/On-Call_446749911/Get-a-list-of-all-escalation-policies-returns-OK-response_1771156229/recording.har new file mode 100644 index 000000000000..5c3f56c70bed --- /dev/null +++ b/cassettes/v2/On-Call_446749911/Get-a-list-of-all-escalation-policies-returns-OK-response_1771156229/recording.har @@ -0,0 +1,57 @@ +{ + "log": { + "_recordingName": "On-Call/Get a list of all escalation policies returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "58cc69e7782f7c0d899816e8248a257c", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 536, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/on-call/escalation-policies" + }, + "response": { + "bodySize": 8806, + "content": { + "mimeType": "application/vnd.api+json", + "size": 8806, + "text": "{\"data\":[{\"id\":\"9e6a4f8a-38c8-4d53-b84a-7362507ac67a\",\"type\":\"policies\",\"attributes\":{\"name\":\"Example-Get_team_on_call_users_returns_OK_response_1749118317\",\"resolve_page_on_policy_end\":true,\"retries\":2},\"relationships\":{\"steps\":{\"data\":[{\"id\":\"1499c12c-51e8-4b6b-9c40-e6965291652b\",\"type\":\"steps\"},{\"id\":\"6c1aa92d-07fe-4181-be84-6e1bfc727c39\",\"type\":\"steps\"}]},\"teams\":{\"data\":[{\"id\":\"092bfdbb-f088-4937-b74f-48e6ce64fd96\",\"type\":\"teams\"}]}}},{\"id\":\"7603f4f8-fce7-49e4-afea-7de0da5dd8b7\",\"type\":\"policies\",\"attributes\":{\"name\":\"Example-Get_team_on_call_users_returns_OK_response_1749132717\",\"resolve_page_on_policy_end\":true,\"retries\":2},\"relationships\":{\"steps\":{\"data\":[{\"id\":\"0f4e62cd-84f7-43f5-a84f-8d66452ff36b\",\"type\":\"steps\"},{\"id\":\"b533a8bf-f2b1-4ed3-ac96-814ea111e2c5\",\"type\":\"steps\"}]},\"teams\":{\"data\":[{\"id\":\"98024b06-8bd0-47ae-920d-3203ce3b5127\",\"type\":\"teams\"}]}}},{\"id\":\"ab8a9bde-19c8-4df4-ac35-f95003fd3712\",\"type\":\"policies\",\"attributes\":{\"name\":\"Example-Get_team_on_call_users_returns_OK_response_1749363117\",\"resolve_page_on_policy_end\":true,\"retries\":2},\"relationships\":{\"steps\":{\"data\":[{\"id\":\"1a23f433-5197-48eb-9281-feac6fea5f6b\",\"type\":\"steps\"},{\"id\":\"e832663d-dbe5-4120-abf5-7a9d9c0dd45f\",\"type\":\"steps\"}]},\"teams\":{\"data\":[{\"id\":\"43fb5743-68fe-451d-9adc-56a4ff53b14e\",\"type\":\"teams\"}]}}},{\"id\":\"33349f9f-c668-4af6-8cec-6613c292d5f6\",\"type\":\"policies\",\"attributes\":{\"name\":\"Example-Get_team_on_call_users_returns_OK_response_1749420717\",\"resolve_page_on_policy_end\":true,\"retries\":2},\"relationships\":{\"steps\":{\"data\":[{\"id\":\"3ee94972-d592-4d9e-80f2-16fb907a13fd\",\"type\":\"steps\"},{\"id\":\"3a964219-88e0-4e98-ae3b-6be149da2a93\",\"type\":\"steps\"}]},\"teams\":{\"data\":[{\"id\":\"70cf2e63-99bd-496c-9918-e2afb58d0d48\",\"type\":\"teams\"}]}}},{\"id\":\"b7963110-a1f6-4bb9-bf1f-9a3c46f9f24e\",\"type\":\"policies\",\"attributes\":{\"name\":\"Example-Get_team_on_call_users_returns_OK_response_1749449517\",\"resolve_page_on_policy_end\":true,\"retries\":2},\"relationships\":{\"steps\":{\"data\":[{\"id\":\"341185ff-1caa-4b67-8012-3472f12db184\",\"type\":\"steps\"},{\"id\":\"56e2e892-95d0-4da0-82e3-e16d878baabc\",\"type\":\"steps\"}]},\"teams\":{\"data\":[{\"id\":\"67b9410d-2eeb-443b-9514-525bf64816fb\",\"type\":\"teams\"}]}}},{\"id\":\"87ac03ad-824d-4b1f-acc1-1aa609c42677\",\"type\":\"policies\",\"attributes\":{\"name\":\"Example-Get_team_on_call_users_returns_OK_response_1749463917\",\"resolve_page_on_policy_end\":true,\"retries\":2},\"relationships\":{\"steps\":{\"data\":[{\"id\":\"b21b351f-dd89-4be4-b34a-09154911303e\",\"type\":\"steps\"},{\"id\":\"394399ec-8749-4f51-96e9-7dc566dc9901\",\"type\":\"steps\"}]},\"teams\":{\"data\":[{\"id\":\"492ba665-e23a-4260-a1fe-3963ba1d2f69\",\"type\":\"teams\"}]}}},{\"id\":\"7bb2cd11-e5d5-4523-b063-6118e9bb9bd4\",\"type\":\"policies\",\"attributes\":{\"name\":\"Example-Get_team_on_call_users_returns_OK_response_1749478317\",\"resolve_page_on_policy_end\":true,\"retries\":2},\"relationships\":{\"steps\":{\"data\":[{\"id\":\"ea35814d-bd58-4d81-b19b-fcbcbe26d055\",\"type\":\"steps\"},{\"id\":\"ac8020d4-29b9-41e6-b775-f8d29869a6f6\",\"type\":\"steps\"}]},\"teams\":{\"data\":[{\"id\":\"e44c2257-edc1-45ef-8c76-1788c7d17ccb\",\"type\":\"teams\"}]}}},{\"id\":\"20d2ad2a-bb6b-4ba4-bb50-bc2f3bd393b4\",\"type\":\"policies\",\"attributes\":{\"name\":\"Example-Get_team_on_call_users_returns_OK_response_1749507117\",\"resolve_page_on_policy_end\":true,\"retries\":2},\"relationships\":{\"steps\":{\"data\":[{\"id\":\"aa0c1ebd-d9e5-49a6-ad85-79d7b91037ca\",\"type\":\"steps\"},{\"id\":\"dd2cebbc-9c10-4fae-8f7f-209ca0e336c4\",\"type\":\"steps\"}]},\"teams\":{\"data\":[{\"id\":\"a088484c-cc12-44b6-87e2-3dcfb389efcc\",\"type\":\"teams\"}]}}},{\"id\":\"0991013e-3bbb-48e5-b6d0-7cc8fa10ba74\",\"type\":\"policies\",\"attributes\":{\"name\":\"Example-Set_on_call_team_routing_rules_returns_OK_response_1746828011\",\"resolve_page_on_policy_end\":true,\"retries\":2},\"relationships\":{\"steps\":{\"data\":[{\"id\":\"da85b66b-5ea0-490a-a8d0-93c75b5f7b07\",\"type\":\"steps\"},{\"id\":\"ebb2f627-64b7-46e3-8938-c7cdcd6554ef\",\"type\":\"steps\"}]},\"teams\":{\"data\":[{\"id\":\"6f2a747e-9f8c-4695-a6b2-b2860e4d4fc0\",\"type\":\"teams\"}]}}},{\"id\":\"2ff311aa-0b5e-48cc-bb2a-be6152222dd3\",\"type\":\"policies\",\"attributes\":{\"name\":\"Example-Set_on_call_team_routing_rules_returns_OK_response_1746856811\",\"resolve_page_on_policy_end\":true,\"retries\":2},\"relationships\":{\"steps\":{\"data\":[{\"id\":\"7462f209-e54f-44cf-807f-184757fa5b4e\",\"type\":\"steps\"},{\"id\":\"9414ada0-738a-4efc-9d81-f40827b13a56\",\"type\":\"steps\"}]},\"teams\":{\"data\":[{\"id\":\"92075ea4-a4fd-48d9-a4ed-e6667b25cb4f\",\"type\":\"teams\"}]}}},{\"id\":\"57239328-7c48-4b42-b2f9-056b4d22de8e\",\"type\":\"policies\",\"attributes\":{\"name\":\"Example-Set_on_call_team_routing_rules_returns_OK_response_1746871211\",\"resolve_page_on_policy_end\":true,\"retries\":2},\"relationships\":{\"steps\":{\"data\":[{\"id\":\"2252e135-ef1f-4152-bc0c-b823cb45aa43\",\"type\":\"steps\"},{\"id\":\"69700d34-d03d-4852-a4f3-e50888a79639\",\"type\":\"steps\"}]},\"teams\":{\"data\":[{\"id\":\"85c22af6-eacf-476e-860d-d02b5cadae3d\",\"type\":\"teams\"}]}}},{\"id\":\"0e0ea7ba-81f5-4e8f-ade5-36842e3a0ff7\",\"type\":\"policies\",\"attributes\":{\"name\":\"Example-Set_on_call_team_routing_rules_returns_OK_response_1747784317\",\"resolve_page_on_policy_end\":true,\"retries\":2},\"relationships\":{\"steps\":{\"data\":[{\"id\":\"da7518e3-3770-4a0f-ab85-e33c988f309d\",\"type\":\"steps\"},{\"id\":\"ef6671d5-b97d-42f7-afc7-b5d9f68e7bf8\",\"type\":\"steps\"}]},\"teams\":{\"data\":[{\"id\":\"04d308e7-5afd-46db-be62-292edd22d68e\",\"type\":\"teams\"}]}}},{\"id\":\"d8c7be7d-2369-4302-b429-4f2145ab4c69\",\"type\":\"policies\",\"attributes\":{\"name\":\"Example-Set_on_call_team_routing_rules_returns_OK_response_1747913917\",\"resolve_page_on_policy_end\":true,\"retries\":2},\"relationships\":{\"steps\":{\"data\":[{\"id\":\"ea43717f-300f-491a-ae8d-7741546ea49b\",\"type\":\"steps\"},{\"id\":\"9244a679-ffab-4e64-a685-55eb8885493c\",\"type\":\"steps\"}]},\"teams\":{\"data\":[{\"id\":\"ed071279-c7c8-42e3-80fa-e5387659a2bb\",\"type\":\"teams\"}]}}},{\"id\":\"2ab3cc83-71e1-4120-b617-531034ab8cb7\",\"type\":\"policies\",\"attributes\":{\"name\":\"Example-Set_on_call_team_routing_rules_returns_OK_response_1747928317\",\"resolve_page_on_policy_end\":true,\"retries\":2},\"relationships\":{\"steps\":{\"data\":[{\"id\":\"9e01cdf1-9508-42d0-a2a0-9055c9294f15\",\"type\":\"steps\"},{\"id\":\"e177f81e-e349-4bb1-b1c9-b25c9b6c93b3\",\"type\":\"steps\"}]},\"teams\":{\"data\":[{\"id\":\"48533ff1-261a-4334-b153-51cafdc1e827\",\"type\":\"teams\"}]}}},{\"id\":\"40dcec8f-f96a-4684-b889-d09421797c82\",\"type\":\"policies\",\"attributes\":{\"name\":\"Example-Set_on_call_team_routing_rules_returns_OK_response_1748000317\",\"resolve_page_on_policy_end\":true,\"retries\":2},\"relationships\":{\"steps\":{\"data\":[{\"id\":\"b20b0a32-219c-426f-bf5e-3c06da071e90\",\"type\":\"steps\"},{\"id\":\"77f3333c-5c00-4d27-8bec-9c654cb85658\",\"type\":\"steps\"}]},\"teams\":{\"data\":[{\"id\":\"2d044b70-3bfe-4be7-893d-d8d845f7c43a\",\"type\":\"teams\"}]}}},{\"id\":\"181d2236-ab90-4035-a7bd-d1b812eb00a1\",\"type\":\"policies\",\"attributes\":{\"name\":\"Example-Set_on_call_team_routing_rules_returns_OK_response_1748086717\",\"resolve_page_on_policy_end\":true,\"retries\":2},\"relationships\":{\"steps\":{\"data\":[{\"id\":\"d58ed7f5-b9d3-4e8a-bc29-fa2a85254005\",\"type\":\"steps\"},{\"id\":\"ba092ae4-ce21-462a-b5a6-1bfc9c105b31\",\"type\":\"steps\"}]},\"teams\":{\"data\":[{\"id\":\"66809f57-b5c5-4308-99d5-aec66d1256c4\",\"type\":\"teams\"}]}}},{\"id\":\"93ba2d28-788d-421e-8525-7926932bf594\",\"type\":\"policies\",\"attributes\":{\"name\":\"Example-Set_on_call_team_routing_rules_returns_OK_response_1748187517\",\"resolve_page_on_policy_end\":true,\"retries\":2},\"relationships\":{\"steps\":{\"data\":[{\"id\":\"576d53cb-e341-4f7d-91ad-5f7c751ad449\",\"type\":\"steps\"},{\"id\":\"383b175a-8396-44f1-8378-467f8ff8038e\",\"type\":\"steps\"}]},\"teams\":{\"data\":[{\"id\":\"d563c9e0-1301-41c9-b3f0-8aaadabd2f36\",\"type\":\"teams\"}]}}},{\"id\":\"1806ab18-43ae-429d-8ba3-5e53d7ff4b4c\",\"type\":\"policies\",\"attributes\":{\"name\":\"Example-Set_on_call_team_routing_rules_returns_OK_response_1748216317\",\"resolve_page_on_policy_end\":true,\"retries\":2},\"relationships\":{\"steps\":{\"data\":[{\"id\":\"c59bb49b-9f2b-4677-94b4-22c87c0a4f75\",\"type\":\"steps\"},{\"id\":\"94a6bd87-c332-4391-9bd7-be1f3ca65a61\",\"type\":\"steps\"}]},\"teams\":{\"data\":[{\"id\":\"5154559d-3e7b-4268-ad93-744a5017a042\",\"type\":\"teams\"}]}}},{\"id\":\"85942d6c-5f15-48bb-ad41-075d9dffca29\",\"type\":\"policies\",\"attributes\":{\"name\":\"Example-Set_On_Call_team_routing_rules_returns_OK_response_1748289248\",\"resolve_page_on_policy_end\":true,\"retries\":2},\"relationships\":{\"steps\":{\"data\":[{\"id\":\"e6d0a20a-c3f1-4a03-ba61-155c313120aa\",\"type\":\"steps\"},{\"id\":\"7c4b9961-d86a-46bf-bfef-2634daf0515d\",\"type\":\"steps\"}]},\"teams\":{\"data\":[{\"id\":\"15579af2-0fc0-43e9-b052-348453b55353\",\"type\":\"teams\"}]}}},{\"id\":\"7096bd54-e0cf-4279-b44e-24b312720bc5\",\"type\":\"policies\",\"attributes\":{\"name\":\"Example-Set_On_Call_team_routing_rules_returns_OK_response_1748303647\",\"resolve_page_on_policy_end\":true,\"retries\":2},\"relationships\":{\"steps\":{\"data\":[{\"id\":\"de0e4a0e-b2da-48f2-b1cd-afbf98b79a48\",\"type\":\"steps\"},{\"id\":\"a76fade4-12b5-4f8b-9bf1-14a3b148e733\",\"type\":\"steps\"}]},\"teams\":{\"data\":[{\"id\":\"bddb40f8-4674-46e5-bd4e-d8c66368f25d\",\"type\":\"teams\"}]}}}]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 532, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-06-09T23:30:40.720Z", + "time": 641 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/On-Call_446749911/Get-a-list-of-all-on-call-schedules-returns-OK-response_4150831686/frozen.json b/cassettes/v2/On-Call_446749911/Get-a-list-of-all-on-call-schedules-returns-OK-response_4150831686/frozen.json new file mode 100644 index 000000000000..fd0fe22fcd2c --- /dev/null +++ b/cassettes/v2/On-Call_446749911/Get-a-list-of-all-on-call-schedules-returns-OK-response_4150831686/frozen.json @@ -0,0 +1 @@ +"2025-06-09T23:30:41.370Z" diff --git a/cassettes/v2/On-Call_446749911/Get-a-list-of-all-on-call-schedules-returns-OK-response_4150831686/recording.har b/cassettes/v2/On-Call_446749911/Get-a-list-of-all-on-call-schedules-returns-OK-response_4150831686/recording.har new file mode 100644 index 000000000000..0fb29032c9d8 --- /dev/null +++ b/cassettes/v2/On-Call_446749911/Get-a-list-of-all-on-call-schedules-returns-OK-response_4150831686/recording.har @@ -0,0 +1,57 @@ +{ + "log": { + "_recordingName": "On-Call/Get a list of all on-call schedules returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "9e887880afd24474b26282cbbd1a53ad", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 517, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/on-call/schedules" + }, + "response": { + "bodySize": 3095, + "content": { + "mimeType": "application/vnd.api+json", + "size": 3095, + "text": "{\"data\":[{\"id\":\"35bb154a-c72c-4229-9fc0-04e07488af4f\",\"type\":\"schedules\",\"attributes\":{\"name\":\"Escalation Policy Test Schedule\",\"time_zone\":\"America/New_York\"},\"relationships\":{\"teams\":{\"data\":[{\"id\":\"e53202ff-ace0-48b9-94cc-02fd7cc4db19\",\"type\":\"teams\"}]}}},{\"id\":\"671c7d3f-9587-42fa-8c7e-8755930bbdac\",\"type\":\"schedules\",\"attributes\":{\"name\":\"Escalation Policy Test Schedule tf-testacconcallescalationpolicycreateandupdate-local-1747734855\",\"time_zone\":\"America/New_York\"},\"relationships\":{\"teams\":{\"data\":[{\"id\":\"74e02075-633b-44c4-abac-614efb1d8536\",\"type\":\"teams\"}]}}},{\"id\":\"2dab1cc6-fd41-471a-9012-ddd61aaa1efd\",\"type\":\"schedules\",\"attributes\":{\"name\":\"Escalation Policy Test Schedule tf-testacconcallescalationpolicycreateandupdate-local-1747735035\",\"time_zone\":\"America/New_York\"},\"relationships\":{\"teams\":{\"data\":[{\"id\":\"50238947-4947-4d29-acf4-a5a0af3c71dc\",\"type\":\"teams\"}]}}},{\"id\":\"e0fe19e8-b263-4737-901d-949665a6a8b9\",\"type\":\"schedules\",\"attributes\":{\"name\":\"Escalation Policy Test Schedule tf-testacconcallteamroutingrulescreateandupdate-local-1748264615\",\"time_zone\":\"America/New_York\"},\"relationships\":{\"teams\":{\"data\":[{\"id\":\"d093df59-ea15-49d7-a826-cf39241268a7\",\"type\":\"teams\"}]}}},{\"id\":\"1ec1cf5a-34fe-4287-be5f-6624b26eea21\",\"type\":\"schedules\",\"attributes\":{\"name\":\"Escalation Policy Test Schedule tf-testacconcallteamroutingrulescreateandupdate-local-1748264794\",\"time_zone\":\"America/New_York\"},\"relationships\":{\"teams\":{\"data\":[{\"id\":\"24081181-e2e6-4979-b1c4-3186f3bbb1c3\",\"type\":\"teams\"}]}}},{\"id\":\"08429594-1286-407e-b915-9b08127abc8b\",\"type\":\"schedules\",\"attributes\":{\"name\":\"Escalation Policy Test Schedule tf-testacconcallteamroutingrulescreateandupdate-local-1748264832\",\"time_zone\":\"America/New_York\"},\"relationships\":{\"teams\":{\"data\":[{\"id\":\"35554fbf-0d9d-46b2-958d-c770abba0ea7\",\"type\":\"teams\"}]}}},{\"id\":\"dadf713e-540d-4387-8e0a-a172d453ebfa\",\"type\":\"schedules\",\"attributes\":{\"name\":\"Escalation Policy Test Schedule tf-testacconcallteamroutingrulescreateandupdate-local-1748264900\",\"time_zone\":\"America/New_York\"},\"relationships\":{\"teams\":{\"data\":[{\"id\":\"14e0b9be-eb14-4031-9f20-c5fa79d5a61c\",\"type\":\"teams\"}]}}},{\"id\":\"d6714916-109d-4422-99b7-a4b59f98c9c1\",\"type\":\"schedules\",\"attributes\":{\"name\":\"Escalation Policy Test Schedule tf-testacconcallteamroutingrulescreateandupdate-local-1748264953\",\"time_zone\":\"America/New_York\"},\"relationships\":{\"teams\":{\"data\":[{\"id\":\"190b0a25-e77f-46b1-b0c6-31d3170becfa\",\"type\":\"teams\"}]}}},{\"id\":\"3d2695af-1c25-4510-8829-44d961a18ded\",\"type\":\"schedules\",\"attributes\":{\"name\":\"Escalation Policy Test Schedule tf-testacconcallteamroutingrulescreateandupdate-local-1748264975\",\"time_zone\":\"America/New_York\"},\"relationships\":{\"teams\":{\"data\":[{\"id\":\"a840a585-6d24-4c3a-8fd7-11c707411fa3\",\"type\":\"teams\"}]}}},{\"id\":\"a5be0ef7-c2b5-464b-8b21-4399f0a96378\",\"type\":\"schedules\",\"attributes\":{\"name\":\"Escalation Policy Test Schedule tf-testacconcallteamroutingrulescreateandupdate-local-1748265056\",\"time_zone\":\"America/New_York\"},\"relationships\":{\"teams\":{\"data\":[{\"id\":\"a70c7ad7-db1a-4f6d-8365-18459aa9ee2d\",\"type\":\"teams\"}]}}}]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 526, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-06-09T23:30:41.375Z", + "time": 664 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/On-Call_446749911/Get-a-list-of-all-overrides-for-a-schedule-returns-OK-response_2196631902/frozen.json b/cassettes/v2/On-Call_446749911/Get-a-list-of-all-overrides-for-a-schedule-returns-OK-response_2196631902/frozen.json new file mode 100644 index 000000000000..75f967ddb84a --- /dev/null +++ b/cassettes/v2/On-Call_446749911/Get-a-list-of-all-overrides-for-a-schedule-returns-OK-response_2196631902/frozen.json @@ -0,0 +1 @@ +"2025-06-09T23:37:07.887Z" diff --git a/cassettes/v2/On-Call_446749911/Get-a-list-of-all-overrides-for-a-schedule-returns-OK-response_2196631902/recording.har b/cassettes/v2/On-Call_446749911/Get-a-list-of-all-overrides-for-a-schedule-returns-OK-response_2196631902/recording.har new file mode 100644 index 000000000000..9deb93051b0c --- /dev/null +++ b/cassettes/v2/On-Call_446749911/Get-a-list-of-all-overrides-for-a-schedule-returns-OK-response_2196631902/recording.har @@ -0,0 +1,341 @@ +{ + "log": { + "_recordingName": "On-Call/Get a list of all overrides for a schedule returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "832b80887b60d37d200010afb760f28d", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 164, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 550, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"email\":\"Test-Get_a_list_of_all_overrides_for_a_schedule_returns_OK_response-1749512227@datadoghq.com\",\"title\":\"user title\"},\"type\":\"users\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/users" + }, + "response": { + "bodySize": 729, + "content": { + "mimeType": "application/json", + "size": 729, + "text": "{\"data\":{\"type\":\"users\",\"id\":\"a8c6f210-458a-11f0-8c93-d6008d2166ed\",\"attributes\":{\"name\":null,\"handle\":\"test-get_a_list_of_all_overrides_for_a_schedule_returns_ok_response-1749512227@datadoghq.com\",\"created_at\":\"2025-06-09T23:37:08.789947+00:00\",\"modified_at\":\"2025-06-09T23:37:08.789947+00:00\",\"email\":\"test-get_a_list_of_all_overrides_for_a_schedule_returns_ok_response-1749512227@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/d258e3db456139b683f980ed2d272d47?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" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 681, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 201, + "statusText": "Created" + }, + "startedDateTime": "2025-06-09T23:37:07.891Z", + "time": 982 + }, + { + "_id": "183a804389d2380bf74f57c121fb1037", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 611, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 572, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"layers\":[{\"effective_date\":\"2025-05-30T23:37:07.887Z\",\"end_date\":\"2025-06-19T23:37:07.887Z\",\"interval\":{\"days\":1},\"members\":[{\"user\":{\"id\":\"a8c6f210-458a-11f0-8c93-d6008d2166ed\"}}],\"name\":\"Layer 1\",\"restrictions\":[{\"end_day\":\"friday\",\"end_time\":\"17:00:00\",\"start_day\":\"monday\",\"start_time\":\"09:00:00\"}],\"rotation_start\":\"2025-06-04T23:37:07.887Z\"}],\"name\":\"Test-Get_a_list_of_all_overrides_for_a_schedule_returns_OK_response-1749512227\",\"time_zone\":\"America/New_York\"},\"relationships\":{\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}},\"type\":\"schedules\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/on-call/schedules" + }, + "response": { + "bodySize": 387, + "content": { + "mimeType": "application/vnd.api+json", + "size": 387, + "text": "{\"data\":{\"id\":\"f6b4026c-2306-4f1c-a5f7-87af6ce59d46\",\"type\":\"schedules\",\"attributes\":{\"name\":\"Test-Get_a_list_of_all_overrides_for_a_schedule_returns_OK_response-1749512227\",\"time_zone\":\"America/New_York\"},\"relationships\":{\"layers\":{\"data\":[{\"id\":\"b90bdf1d-1926-4099-abb7-0c37a39b68ce\",\"type\":\"layers\"}]},\"teams\":{\"data\":[{\"id\":\"65aea9d0-941c-4607-bf8a-14fc0dac2820\",\"type\":\"teams\"}]}}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 525, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 201, + "statusText": "Created" + }, + "startedDateTime": "2025-06-09T23:37:08.885Z", + "time": 745 + }, + { + "_id": "00602c3ba725b9b05dce3d781aaeedc5", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 209, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 627, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":[{\"attributes\":{\"end\":\"2025-06-10T00:37:07.887Z\",\"start\":\"2025-06-09T23:37:07.887Z\"},\"relationships\":{\"user\":{\"data\":{\"id\":\"a8c6f210-458a-11f0-8c93-d6008d2166ed\",\"type\":\"users\"}}},\"type\":\"overrides\"}]}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/on-call/schedules/f6b4026c-2306-4f1c-a5f7-87af6ce59d46/overrides" + }, + "response": { + "bodySize": 253, + "content": { + "mimeType": "application/vnd.api+json", + "size": 253, + "text": "{\"data\":[{\"id\":\"e132c48c-af33-42c2-9355-aeeedef6381d\",\"type\":\"overrides\",\"attributes\":{\"end\":\"2025-06-10T00:37:07.887Z\",\"start\":\"2025-06-09T23:37:07.887Z\"},\"relationships\":{\"user\":{\"data\":{\"id\":\"a8c6f210-458a-11f0-8c93-d6008d2166ed\",\"type\":\"users\"}}}}]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 525, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 201, + "statusText": "Created" + }, + "startedDateTime": "2025-06-09T23:37:09.640Z", + "time": 270 + }, + { + "_id": "5936c37ebd513b0da90364dea52dd56f", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 664, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "filter", + "value": { + "end": "2025-06-10T00:37:07.887Z", + "start": "2025-06-09T22:37:07.887Z" + } + } + ], + "url": "https://api.datadoghq.com/api/v2/on-call/schedules/f6b4026c-2306-4f1c-a5f7-87af6ce59d46/overrides?filter%5Bstart%5D=2025-06-09T22%3A37%3A07.887Z&filter%5Bend%5D=2025-06-10T00%3A37%3A07.887Z" + }, + "response": { + "bodySize": 253, + "content": { + "mimeType": "application/vnd.api+json", + "size": 253, + "text": "{\"data\":[{\"id\":\"e132c48c-af33-42c2-9355-aeeedef6381d\",\"type\":\"overrides\",\"attributes\":{\"end\":\"2025-06-10T00:37:07.887Z\",\"start\":\"2025-06-09T23:37:07.887Z\"},\"relationships\":{\"user\":{\"data\":{\"id\":\"a8c6f210-458a-11f0-8c93-d6008d2166ed\",\"type\":\"users\"}}}}]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 525, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-06-09T23:37:09.918Z", + "time": 974 + }, + { + "_id": "2ff176445e4c6e29110ae277735c1efb", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 581, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/on-call/schedules/%7Bschedule_id%7D/overrides/e132c48c-af33-42c2-9355-aeeedef6381d" + }, + "response": { + "bodySize": 117, + "content": { + "mimeType": "application/vnd.api+json", + "size": 117, + "text": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"attribute \\\"uuid\\\" [{schedule_id}] is not a valid UUID\"}]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 525, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 400, + "statusText": "Bad Request" + }, + "startedDateTime": "2025-06-09T23:37:10.903Z", + "time": 675 + }, + { + "_id": "f97054c63da54b7f4e2c34262923fa63", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 545, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/on-call/schedules/f6b4026c-2306-4f1c-a5f7-87af6ce59d46" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [], + "headers": [], + "headersSize": 464, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-06-09T23:37:11.583Z", + "time": 983 + }, + { + "_id": "b1848b351b472502775b2e0f5047b635", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 524, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/users/a8c6f210-458a-11f0-8c93-d6008d2166ed" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [], + "headers": [], + "headersSize": 495, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-06-09T23:37:12.572Z", + "time": 975 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/examples/v2/on-call/CreateOnCallScheduleOverride.ts b/examples/v2/on-call/CreateOnCallScheduleOverride.ts new file mode 100644 index 000000000000..f5ecddb0e302 --- /dev/null +++ b/examples/v2/on-call/CreateOnCallScheduleOverride.ts @@ -0,0 +1,46 @@ +/** + * Create an override returns "Created" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.OnCallApi(configuration); + +// there is a valid "schedule" in the system +const SCHEDULE_DATA_ID = process.env.SCHEDULE_DATA_ID as string; + +// there is a valid "user" in the system +const USER_DATA_ID = process.env.USER_DATA_ID as string; + +const params: v2.OnCallApiCreateOnCallScheduleOverrideRequest = { + body: { + data: [ + { + attributes: { + start: new Date(), + end: new Date(new Date().getTime() + 1 * 3600 * 1000), + }, + relationships: { + user: { + data: { + id: USER_DATA_ID, + type: "users", + }, + }, + }, + type: "overrides", + }, + ], + }, + scheduleId: SCHEDULE_DATA_ID, +}; + +apiInstance + .createOnCallScheduleOverride(params) + .then((data: v2.OverrideResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/on-call/DeleteOnCallScheduleOverride.ts b/examples/v2/on-call/DeleteOnCallScheduleOverride.ts new file mode 100644 index 000000000000..0a4bf028c80b --- /dev/null +++ b/examples/v2/on-call/DeleteOnCallScheduleOverride.ts @@ -0,0 +1,28 @@ +/** + * Delete an override returns "No Content" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.OnCallApi(configuration); + +// there is a valid "schedule" in the system +const SCHEDULE_DATA_ID = process.env.SCHEDULE_DATA_ID as string; + +// there is a valid "override" in the system +const OVERRIDE_DATA_0_ID = process.env.OVERRIDE_DATA_0_ID as string; + +const params: v2.OnCallApiDeleteOnCallScheduleOverrideRequest = { + scheduleId: SCHEDULE_DATA_ID, + overrideId: OVERRIDE_DATA_0_ID, +}; + +apiInstance + .deleteOnCallScheduleOverride(params) + .then((data: any) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/on-call/GetOnCallTeamRoutingRules.ts b/examples/v2/on-call/GetOnCallTeamRoutingRules.ts index fc6640c909d3..acc60a275417 100644 --- a/examples/v2/on-call/GetOnCallTeamRoutingRules.ts +++ b/examples/v2/on-call/GetOnCallTeamRoutingRules.ts @@ -7,8 +7,11 @@ import { client, v2 } from "@datadog/datadog-api-client"; const configuration = client.createConfiguration(); const apiInstance = new v2.OnCallApi(configuration); +// there is a valid "dd_team" in the system +const DD_TEAM_DATA_ID = process.env.DD_TEAM_DATA_ID as string; + const params: v2.OnCallApiGetOnCallTeamRoutingRulesRequest = { - teamId: "27590dae-47be-4a7d-9abf-8f4e45124020", + teamId: DD_TEAM_DATA_ID, }; apiInstance diff --git a/examples/v2/on-call/ListOnCallEscalationPolicies.ts b/examples/v2/on-call/ListOnCallEscalationPolicies.ts new file mode 100644 index 000000000000..2c4a124b2b99 --- /dev/null +++ b/examples/v2/on-call/ListOnCallEscalationPolicies.ts @@ -0,0 +1,17 @@ +/** + * Get a list of all escalation policies returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.OnCallApi(configuration); + +apiInstance + .listOnCallEscalationPolicies() + .then((data: v2.EscalationPoliciesResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/on-call/ListOnCallScheduleOverrides.ts b/examples/v2/on-call/ListOnCallScheduleOverrides.ts new file mode 100644 index 000000000000..cc6a48d1bb31 --- /dev/null +++ b/examples/v2/on-call/ListOnCallScheduleOverrides.ts @@ -0,0 +1,26 @@ +/** + * Get a list of all overrides for a schedule returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.OnCallApi(configuration); + +// there is a valid "schedule" in the system +const SCHEDULE_DATA_ID = process.env.SCHEDULE_DATA_ID as string; + +const params: v2.OnCallApiListOnCallScheduleOverridesRequest = { + scheduleId: SCHEDULE_DATA_ID, + filterStart: new Date(new Date().getTime() + -1 * 3600 * 1000), + filterEnd: new Date(new Date().getTime() + 1 * 3600 * 1000), +}; + +apiInstance + .listOnCallScheduleOverrides(params) + .then((data: v2.OverridesResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/on-call/ListOnCallSchedules.ts b/examples/v2/on-call/ListOnCallSchedules.ts new file mode 100644 index 000000000000..c3c00065676a --- /dev/null +++ b/examples/v2/on-call/ListOnCallSchedules.ts @@ -0,0 +1,17 @@ +/** + * Get a list of all on-call schedules returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.OnCallApi(configuration); + +apiInstance + .listOnCallSchedules() + .then((data: v2.SchedulesResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/features/support/scenarios_model_mapping.ts b/features/support/scenarios_model_mapping.ts index f1d1efd029ea..4d5edbd55df1 100644 --- a/features/support/scenarios_model_mapping.ts +++ b/features/support/scenarios_model_mapping.ts @@ -5912,6 +5912,17 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = { }, "operationResponseType": "SingleAggregatedConnectionResponseArray", }, + "v2.ListOnCallEscalationPolicies": { + "pageSize": { + "type": "number", + "format": "int64", + }, + "pageNumber": { + "type": "number", + "format": "int64", + }, + "operationResponseType": "EscalationPoliciesResponse", + }, "v2.CreateOnCallEscalationPolicy": { "include": { "type": "string", @@ -5956,6 +5967,17 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = { }, "operationResponseType": "EscalationPolicy", }, + "v2.ListOnCallSchedules": { + "pageSize": { + "type": "number", + "format": "int64", + }, + "pageNumber": { + "type": "number", + "format": "int64", + }, + "operationResponseType": "SchedulesResponse", + }, "v2.CreateOnCallSchedule": { "include": { "type": "string", @@ -6015,6 +6037,51 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = { }, "operationResponseType": "Shift", }, + "v2.ListOnCallScheduleOverrides": { + "scheduleId": { + "type": "string", + "format": "", + }, + "pageSize": { + "type": "number", + "format": "int64", + }, + "pageNumber": { + "type": "number", + "format": "int64", + }, + "filterStart": { + "type": "string", + "format": "", + }, + "filterEnd": { + "type": "string", + "format": "", + }, + "operationResponseType": "OverridesResponse", + }, + "v2.CreateOnCallScheduleOverride": { + "scheduleId": { + "type": "string", + "format": "", + }, + "body": { + "type": "OverrideRequest", + "format": "", + }, + "operationResponseType": "OverrideResponse", + }, + "v2.DeleteOnCallScheduleOverride": { + "scheduleId": { + "type": "string", + "format": "", + }, + "overrideId": { + "type": "string", + "format": "", + }, + "operationResponseType": "void", + }, "v2.GetTeamOnCallUsers": { "include": { "type": "string", diff --git a/features/v2/given.json b/features/v2/given.json index dd414a687e94..2e671684d81b 100644 --- a/features/v2/given.json +++ b/features/v2/given.json @@ -508,6 +508,22 @@ "tag": "On-Call", "operationId": "CreateOnCallSchedule" }, + { + "parameters": [ + { + "name": "schedule_id", + "source": "schedule.data.id" + }, + { + "name": "body", + "value": "{\n \"data\": [\n {\n \"attributes\": {\n \"start\": \"{{ timeISO('now') }}\",\n \"end\": \"{{ timeISO('now + 1h') }}\"\n },\n \"relationships\": {\n \"user\": {\n \"data\": {\n \"id\": \"{{ user.data.id }}\",\n \"type\": \"users\"\n }\n }\n },\n \"type\": \"overrides\"\n }\n ]\n}" + } + ], + "step": "there is a valid \"override\" in the system", + "key": "override", + "tag": "On-Call", + "operationId": "CreateOnCallScheduleOverride" + }, { "parameters": [ { diff --git a/features/v2/on-call.feature b/features/v2/on-call.feature index 2e612c6bf765..d0ec634a2f49 100644 --- a/features/v2/on-call.feature +++ b/features/v2/on-call.feature @@ -43,6 +43,32 @@ Feature: On-Call When the request is sent Then the response status is 201 Created + @generated @skip @team:DataDog/bugle + Scenario: Create an override returns "Bad Request" response + Given new "CreateOnCallScheduleOverride" request + And request contains "schedule_id" parameter from "REPLACE.ME" + And body with value {"data": [{"attributes": {"end": "", "start": ""}, "relationships": {"user": {"data": {"type": "users"}}}, "type": "overrides"}]} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/bugle + Scenario: Create an override returns "Created" response + Given new "CreateOnCallScheduleOverride" 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" + And body with value {"data": [{"attributes": {"start": "{{ timeISO('now') }}", "end": "{{ timeISO('now + 1h') }}"}, "relationships": {"user": {"data": {"id": "{{ user.data.id }}", "type": "users"}}}, "type": "overrides"}]} + When the request is sent + Then the response status is 201 Created + + @generated @skip @team:DataDog/bugle + Scenario: Create an override returns "Not Found" response + Given new "CreateOnCallScheduleOverride" request + And request contains "schedule_id" parameter from "REPLACE.ME" + And body with value {"data": [{"attributes": {"end": "", "start": ""}, "relationships": {"user": {"data": {"type": "users"}}}, "type": "overrides"}]} + When the request is sent + Then the response status is 404 Not Found + @team:DataDog/bugle Scenario: Delete On-Call escalation policy returns "No Content" response Given new "DeleteOnCallEscalationPolicy" request @@ -77,6 +103,33 @@ Feature: On-Call When the request is sent Then the response status is 404 Not Found + @generated @skip @team:DataDog/bugle + Scenario: Delete an override returns "Bad Request" response + Given new "DeleteOnCallScheduleOverride" request + And request contains "schedule_id" parameter from "REPLACE.ME" + And request contains "override_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/bugle + Scenario: Delete an override returns "No Content" response + Given new "DeleteOnCallScheduleOverride" request + And there is a valid "user" in the system + And there is a valid "schedule" in the system + And there is a valid "override" in the system + And request contains "schedule_id" parameter from "schedule.data.id" + And request contains "override_id" parameter from "override.data[0].id" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/bugle + Scenario: Delete an override returns "Not Found" response + Given new "DeleteOnCallScheduleOverride" request + And request contains "schedule_id" parameter from "REPLACE.ME" + And request contains "override_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + @generated @skip @team:DataDog/bugle Scenario: Get On-Call escalation policy returns "Bad Request" response Given new "GetOnCallEscalationPolicy" request @@ -119,10 +172,81 @@ Feature: On-Call When the request is sent Then the response status is 200 OK - @generated @skip @team:DataDog/bugle + @team:DataDog/bugle Scenario: Get On-Call team routing rules returns "OK" response Given new "GetOnCallTeamRoutingRules" request - And request contains "team_id" parameter from "REPLACE.ME" + 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 "dd_team.data.id" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/bugle + Scenario: Get a list of all escalation policies returns "Bad Request" response + Given new "ListOnCallEscalationPolicies" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/bugle + Scenario: Get a list of all escalation policies returns "Not Found" response + Given new "ListOnCallEscalationPolicies" request + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/bugle + Scenario: Get a list of all escalation policies returns "OK" response + Given new "ListOnCallEscalationPolicies" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/bugle + Scenario: Get a list of all on-call schedules returns "Bad Request" response + Given new "ListOnCallSchedules" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/bugle + Scenario: Get a list of all on-call schedules returns "Not Found" response + Given new "ListOnCallSchedules" request + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/bugle + Scenario: Get a list of all on-call schedules returns "OK" response + Given new "ListOnCallSchedules" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/bugle + Scenario: Get a list of all overrides for a schedule returns "Bad Request" response + Given new "ListOnCallScheduleOverrides" request + And request contains "schedule_id" parameter from "REPLACE.ME" + And request contains "filter[start]" parameter from "REPLACE.ME" + And request contains "filter[end]" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/bugle + Scenario: Get a list of all overrides for a schedule returns "Not Found" response + Given new "ListOnCallScheduleOverrides" request + And request contains "schedule_id" parameter from "REPLACE.ME" + And request contains "filter[start]" parameter from "REPLACE.ME" + And request contains "filter[end]" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/bugle + Scenario: Get a list of all overrides for a schedule returns "OK" response + Given new "ListOnCallScheduleOverrides" request + And there is a valid "user" in the system + And there is a valid "schedule" in the system + And there is a valid "override" in the system + And request contains "schedule_id" parameter from "schedule.data.id" + And request contains "filter[start]" parameter with value "{{ timeISO('now - 1h') }}" + And request contains "filter[end]" parameter with value "{{ timeISO('now + 1h') }}" When the request is sent Then the response status is 200 OK @@ -176,7 +300,7 @@ Feature: On-Call When the request is sent Then the response status is 200 OK - @skip-python @team:DataDog/bugle + @team:DataDog/bugle Scenario: Set On-Call team routing rules returns "OK" response Given new "SetOnCallTeamRoutingRules" request And there is a valid "user" in the system diff --git a/features/v2/undo.json b/features/v2/undo.json index 2d33b5cd7166..bdc1233b37e4 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -1926,6 +1926,12 @@ "type": "safe" } }, + "ListOnCallEscalationPolicies": { + "tag": "On-Call", + "undo": { + "type": "safe" + } + }, "CreateOnCallEscalationPolicy": { "tag": "On-Call", "undo": { @@ -1985,6 +1991,12 @@ "type": "unsafe" } }, + "ListOnCallSchedules": { + "tag": "On-Call", + "undo": { + "type": "safe" + } + }, "CreateOnCallSchedule": { "tag": "On-Call", "undo": { @@ -2022,6 +2034,31 @@ "type": "safe" } }, + "ListOnCallScheduleOverrides": { + "tag": "On-Call", + "undo": { + "type": "safe" + } + }, + "CreateOnCallScheduleOverride": { + "tag": "On-Call", + "undo": { + "operationId": "DeleteOnCallScheduleOverride", + "parameters": [ + { + "name": "override_id", + "source": "data[0].id" + } + ], + "type": "unsafe" + } + }, + "DeleteOnCallScheduleOverride": { + "tag": "On-Call", + "undo": { + "type": "idempotent" + } + }, "GetTeamOnCallUsers": { "tag": "On-Call", "undo": { diff --git a/packages/datadog-api-client-v2/apis/OnCallApi.ts b/packages/datadog-api-client-v2/apis/OnCallApi.ts index c36bfa7bb2c0..cdd52b3f83b2 100644 --- a/packages/datadog-api-client-v2/apis/OnCallApi.ts +++ b/packages/datadog-api-client-v2/apis/OnCallApi.ts @@ -17,11 +17,16 @@ import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; import { APIErrorResponse } from "../models/APIErrorResponse"; +import { EscalationPoliciesResponse } from "../models/EscalationPoliciesResponse"; import { EscalationPolicy } from "../models/EscalationPolicy"; import { EscalationPolicyCreateRequest } from "../models/EscalationPolicyCreateRequest"; import { EscalationPolicyUpdateRequest } from "../models/EscalationPolicyUpdateRequest"; +import { OverrideRequest } from "../models/OverrideRequest"; +import { OverrideResponse } from "../models/OverrideResponse"; +import { OverridesResponse } from "../models/OverridesResponse"; import { Schedule } from "../models/Schedule"; import { ScheduleCreateRequest } from "../models/ScheduleCreateRequest"; +import { SchedulesResponse } from "../models/SchedulesResponse"; import { ScheduleUpdateRequest } from "../models/ScheduleUpdateRequest"; import { Shift } from "../models/Shift"; import { TeamOnCallResponders } from "../models/TeamOnCallResponders"; @@ -133,6 +138,58 @@ export class OnCallApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } + public async createOnCallScheduleOverride( + scheduleId: string, + body: OverrideRequest, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + // verify required parameter 'scheduleId' is not null or undefined + if (scheduleId === null || scheduleId === undefined) { + throw new RequiredError("scheduleId", "createOnCallScheduleOverride"); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "createOnCallScheduleOverride"); + } + + // Path Params + const localVarPath = + "/api/v2/on-call/schedules/{schedule_id}/overrides".replace( + "{schedule_id}", + encodeURIComponent(String(scheduleId)) + ); + + // Make Request Context + const requestContext = _config + .getServer("v2.OnCallApi.createOnCallScheduleOverride") + .makeRequestContext(localVarPath, HttpMethod.POST); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json", + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize(body, "OverrideRequest", ""), + contentType + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "AuthZ", + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + public async deleteOnCallEscalationPolicy( policyId: string, _options?: Configuration @@ -202,6 +259,46 @@ export class OnCallApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } + public async deleteOnCallScheduleOverride( + scheduleId: string, + overrideId: string, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + // verify required parameter 'scheduleId' is not null or undefined + if (scheduleId === null || scheduleId === undefined) { + throw new RequiredError("scheduleId", "deleteOnCallScheduleOverride"); + } + + // verify required parameter 'overrideId' is not null or undefined + if (overrideId === null || overrideId === undefined) { + throw new RequiredError("overrideId", "deleteOnCallScheduleOverride"); + } + + // Path Params + const localVarPath = + "/api/v2/on-call/schedules/{schedule_id}/overrides/{override_id}" + .replace("{schedule_id}", encodeURIComponent(String(scheduleId))) + .replace("{override_id}", encodeURIComponent(String(overrideId))); + + // Make Request Context + const requestContext = _config + .getServer("v2.OnCallApi.deleteOnCallScheduleOverride") + .makeRequestContext(localVarPath, HttpMethod.DELETE); + requestContext.setHeaderParam("Accept", "*/*"); + requestContext.setHttpConfig(_config.httpConfig); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "AuthZ", + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + public async getOnCallEscalationPolicy( policyId: string, include?: string, @@ -433,6 +530,171 @@ export class OnCallApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } + public async listOnCallEscalationPolicies( + pageSize?: number, + pageNumber?: number, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + // Path Params + const localVarPath = "/api/v2/on-call/escalation-policies"; + + // Make Request Context + const requestContext = _config + .getServer("v2.OnCallApi.listOnCallEscalationPolicies") + .makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Query Params + if (pageSize !== undefined) { + requestContext.setQueryParam( + "page[size]", + ObjectSerializer.serialize(pageSize, "number", "int64"), + "" + ); + } + if (pageNumber !== undefined) { + requestContext.setQueryParam( + "page[number]", + ObjectSerializer.serialize(pageNumber, "number", "int64"), + "" + ); + } + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "AuthZ", + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async listOnCallScheduleOverrides( + scheduleId: string, + filterStart: string, + filterEnd: string, + pageSize?: number, + pageNumber?: number, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + // verify required parameter 'scheduleId' is not null or undefined + if (scheduleId === null || scheduleId === undefined) { + throw new RequiredError("scheduleId", "listOnCallScheduleOverrides"); + } + + // verify required parameter 'filterStart' is not null or undefined + if (filterStart === null || filterStart === undefined) { + throw new RequiredError("filterStart", "listOnCallScheduleOverrides"); + } + + // verify required parameter 'filterEnd' is not null or undefined + if (filterEnd === null || filterEnd === undefined) { + throw new RequiredError("filterEnd", "listOnCallScheduleOverrides"); + } + + // Path Params + const localVarPath = + "/api/v2/on-call/schedules/{schedule_id}/overrides".replace( + "{schedule_id}", + encodeURIComponent(String(scheduleId)) + ); + + // Make Request Context + const requestContext = _config + .getServer("v2.OnCallApi.listOnCallScheduleOverrides") + .makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Query Params + if (pageSize !== undefined) { + requestContext.setQueryParam( + "page[size]", + ObjectSerializer.serialize(pageSize, "number", "int64"), + "" + ); + } + if (pageNumber !== undefined) { + requestContext.setQueryParam( + "page[number]", + ObjectSerializer.serialize(pageNumber, "number", "int64"), + "" + ); + } + if (filterStart !== undefined) { + requestContext.setQueryParam( + "filter[start]", + ObjectSerializer.serialize(filterStart, "string", ""), + "" + ); + } + if (filterEnd !== undefined) { + requestContext.setQueryParam( + "filter[end]", + ObjectSerializer.serialize(filterEnd, "string", ""), + "" + ); + } + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "AuthZ", + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async listOnCallSchedules( + pageSize?: number, + pageNumber?: number, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + // Path Params + const localVarPath = "/api/v2/on-call/schedules"; + + // Make Request Context + const requestContext = _config + .getServer("v2.OnCallApi.listOnCallSchedules") + .makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Query Params + if (pageSize !== undefined) { + requestContext.setQueryParam( + "page[size]", + ObjectSerializer.serialize(pageSize, "number", "int64"), + "" + ); + } + if (pageNumber !== undefined) { + requestContext.setQueryParam( + "page[number]", + ObjectSerializer.serialize(pageNumber, "number", "int64"), + "" + ); + } + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "AuthZ", + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + public async setOnCallTeamRoutingRules( teamId: string, body: TeamRoutingRulesRequest, @@ -731,11 +993,315 @@ export class OnCallApiResponseProcessor { // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { - const body: Schedule = ObjectSerializer.deserialize( + const body: Schedule = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "Schedule", + "" + ) as Schedule; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to createOnCallScheduleOverride + * @throws ApiException if the response code was not in [200, 299] + */ + public async createOnCallScheduleOverride( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 201) { + const body: OverrideResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "OverrideResponse" + ) as OverrideResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 401 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 429 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: OverrideResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "OverrideResponse", + "" + ) as OverrideResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to deleteOnCallEscalationPolicy + * @throws ApiException if the response code was not in [200, 299] + */ + public async deleteOnCallEscalationPolicy( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 204) { + return; + } + if ( + response.httpStatusCode === 401 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 429 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: void = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "void", + "" + ) as void; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to deleteOnCallSchedule + * @throws ApiException if the response code was not in [200, 299] + */ + public async deleteOnCallSchedule(response: ResponseContext): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 204) { + return; + } + if ( + response.httpStatusCode === 401 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 429 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: void = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "void", + "" + ) as void; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to deleteOnCallScheduleOverride + * @throws ApiException if the response code was not in [200, 299] + */ + public async deleteOnCallScheduleOverride( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 204) { + return; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 401 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 429 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: void = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "void", + "" + ) as void; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to getOnCallEscalationPolicy + * @throws ApiException if the response code was not in [200, 299] + */ + public async getOnCallEscalationPolicy( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: EscalationPolicy = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "EscalationPolicy" + ) as EscalationPolicy; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 401 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 429 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: EscalationPolicy = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "Schedule", + "EscalationPolicy", "" - ) as Schedule; + ) as EscalationPolicy; return body; } @@ -750,17 +1316,19 @@ export class OnCallApiResponseProcessor { * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * - * @params response Response returned by the server for a request to deleteOnCallEscalationPolicy + * @params response Response returned by the server for a request to getOnCallSchedule * @throws ApiException if the response code was not in [200, 299] */ - public async deleteOnCallEscalationPolicy( - response: ResponseContext - ): Promise { + public async getOnCallSchedule(response: ResponseContext): Promise { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (response.httpStatusCode === 204) { - return; + if (response.httpStatusCode === 200) { + const body: Schedule = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "Schedule" + ) as Schedule; + return body; } if ( response.httpStatusCode === 401 || @@ -790,11 +1358,11 @@ export class OnCallApiResponseProcessor { // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { - const body: void = ObjectSerializer.deserialize( + const body: Schedule = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "void", + "Schedule", "" - ) as void; + ) as Schedule; return body; } @@ -809,22 +1377,23 @@ export class OnCallApiResponseProcessor { * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * - * @params response Response returned by the server for a request to deleteOnCallSchedule + * @params response Response returned by the server for a request to getOnCallTeamRoutingRules * @throws ApiException if the response code was not in [200, 299] */ - public async deleteOnCallSchedule(response: ResponseContext): Promise { + public async getOnCallTeamRoutingRules( + response: ResponseContext + ): Promise { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (response.httpStatusCode === 204) { - return; + if (response.httpStatusCode === 200) { + const body: TeamRoutingRules = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "TeamRoutingRules" + ) as TeamRoutingRules; + return body; } - if ( - response.httpStatusCode === 401 || - response.httpStatusCode === 403 || - response.httpStatusCode === 404 || - response.httpStatusCode === 429 - ) { + if (response.httpStatusCode === 429) { const bodyText = ObjectSerializer.parse( await response.body.text(), contentType @@ -847,11 +1416,11 @@ export class OnCallApiResponseProcessor { // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { - const body: void = ObjectSerializer.deserialize( + const body: TeamRoutingRules = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "void", + "TeamRoutingRules", "" - ) as void; + ) as TeamRoutingRules; return body; } @@ -866,20 +1435,20 @@ export class OnCallApiResponseProcessor { * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * - * @params response Response returned by the server for a request to getOnCallEscalationPolicy + * @params response Response returned by the server for a request to getScheduleOnCallUser * @throws ApiException if the response code was not in [200, 299] */ - public async getOnCallEscalationPolicy( + public async getScheduleOnCallUser( response: ResponseContext - ): Promise { + ): Promise { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); if (response.httpStatusCode === 200) { - const body: EscalationPolicy = ObjectSerializer.deserialize( + const body: Shift = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "EscalationPolicy" - ) as EscalationPolicy; + "Shift" + ) as Shift; return body; } if ( @@ -911,11 +1480,11 @@ export class OnCallApiResponseProcessor { // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { - const body: EscalationPolicy = ObjectSerializer.deserialize( + const body: Shift = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "EscalationPolicy", + "Shift", "" - ) as EscalationPolicy; + ) as Shift; return body; } @@ -930,21 +1499,24 @@ export class OnCallApiResponseProcessor { * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * - * @params response Response returned by the server for a request to getOnCallSchedule + * @params response Response returned by the server for a request to getTeamOnCallUsers * @throws ApiException if the response code was not in [200, 299] */ - public async getOnCallSchedule(response: ResponseContext): Promise { + public async getTeamOnCallUsers( + response: ResponseContext + ): Promise { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); if (response.httpStatusCode === 200) { - const body: Schedule = ObjectSerializer.deserialize( + const body: TeamOnCallResponders = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "Schedule" - ) as Schedule; + "TeamOnCallResponders" + ) as TeamOnCallResponders; return body; } if ( + response.httpStatusCode === 400 || response.httpStatusCode === 401 || response.httpStatusCode === 403 || response.httpStatusCode === 404 || @@ -972,11 +1544,11 @@ export class OnCallApiResponseProcessor { // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { - const body: Schedule = ObjectSerializer.deserialize( + const body: TeamOnCallResponders = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "Schedule", + "TeamOnCallResponders", "" - ) as Schedule; + ) as TeamOnCallResponders; return body; } @@ -991,23 +1563,29 @@ export class OnCallApiResponseProcessor { * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * - * @params response Response returned by the server for a request to getOnCallTeamRoutingRules + * @params response Response returned by the server for a request to listOnCallEscalationPolicies * @throws ApiException if the response code was not in [200, 299] */ - public async getOnCallTeamRoutingRules( + public async listOnCallEscalationPolicies( response: ResponseContext - ): Promise { + ): Promise { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); if (response.httpStatusCode === 200) { - const body: TeamRoutingRules = ObjectSerializer.deserialize( + const body: EscalationPoliciesResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "TeamRoutingRules" - ) as TeamRoutingRules; + "EscalationPoliciesResponse" + ) as EscalationPoliciesResponse; return body; } - if (response.httpStatusCode === 429) { + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 401 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 429 + ) { const bodyText = ObjectSerializer.parse( await response.body.text(), contentType @@ -1030,11 +1608,11 @@ export class OnCallApiResponseProcessor { // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { - const body: TeamRoutingRules = ObjectSerializer.deserialize( + const body: EscalationPoliciesResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "TeamRoutingRules", + "EscalationPoliciesResponse", "" - ) as TeamRoutingRules; + ) as EscalationPoliciesResponse; return body; } @@ -1049,20 +1627,20 @@ export class OnCallApiResponseProcessor { * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * - * @params response Response returned by the server for a request to getScheduleOnCallUser + * @params response Response returned by the server for a request to listOnCallScheduleOverrides * @throws ApiException if the response code was not in [200, 299] */ - public async getScheduleOnCallUser( + public async listOnCallScheduleOverrides( response: ResponseContext - ): Promise { + ): Promise { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); if (response.httpStatusCode === 200) { - const body: Shift = ObjectSerializer.deserialize( + const body: OverridesResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "Shift" - ) as Shift; + "OverridesResponse" + ) as OverridesResponse; return body; } if ( @@ -1094,11 +1672,11 @@ export class OnCallApiResponseProcessor { // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { - const body: Shift = ObjectSerializer.deserialize( + const body: OverridesResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "Shift", + "OverridesResponse", "" - ) as Shift; + ) as OverridesResponse; return body; } @@ -1113,20 +1691,20 @@ export class OnCallApiResponseProcessor { * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * - * @params response Response returned by the server for a request to getTeamOnCallUsers + * @params response Response returned by the server for a request to listOnCallSchedules * @throws ApiException if the response code was not in [200, 299] */ - public async getTeamOnCallUsers( + public async listOnCallSchedules( response: ResponseContext - ): Promise { + ): Promise { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); if (response.httpStatusCode === 200) { - const body: TeamOnCallResponders = ObjectSerializer.deserialize( + const body: SchedulesResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "TeamOnCallResponders" - ) as TeamOnCallResponders; + "SchedulesResponse" + ) as SchedulesResponse; return body; } if ( @@ -1158,11 +1736,11 @@ export class OnCallApiResponseProcessor { // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { - const body: TeamOnCallResponders = ObjectSerializer.deserialize( + const body: SchedulesResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "TeamOnCallResponders", + "SchedulesResponse", "" - ) as TeamOnCallResponders; + ) as SchedulesResponse; return body; } @@ -1384,6 +1962,18 @@ export interface OnCallApiCreateOnCallScheduleRequest { include?: string; } +export interface OnCallApiCreateOnCallScheduleOverrideRequest { + /** + * The ID of the on-call schedule. + * @type string + */ + scheduleId: string; + /** + * @type OverrideRequest + */ + body: OverrideRequest; +} + export interface OnCallApiDeleteOnCallEscalationPolicyRequest { /** * The ID of the escalation policy @@ -1400,6 +1990,19 @@ export interface OnCallApiDeleteOnCallScheduleRequest { scheduleId: string; } +export interface OnCallApiDeleteOnCallScheduleOverrideRequest { + /** + * The ID of the on-call schedule. + * @type string + */ + scheduleId: string; + /** + * The ID of the override. + * @type string + */ + overrideId: string; +} + export interface OnCallApiGetOnCallEscalationPolicyRequest { /** * The ID of the escalation policy @@ -1470,6 +2073,60 @@ export interface OnCallApiGetTeamOnCallUsersRequest { include?: string; } +export interface OnCallApiListOnCallEscalationPoliciesRequest { + /** + * Size for a given page. The maximum allowed value is 100. + * @type number + */ + pageSize?: number; + /** + * Specific page number to return. + * @type number + */ + pageNumber?: number; +} + +export interface OnCallApiListOnCallScheduleOverridesRequest { + /** + * The ID of the on-call schedule. + * @type string + */ + scheduleId: string; + /** + * The start time (in ISO-8601 format) of the time range to filter overrides by. Only overrides that overlap with this time range will be returned. + * @type string + */ + filterStart: string; + /** + * The end time (in ISO-8601 format) of the time range to filter overrides by. Only overrides that overlap with this time range will be returned. + * @type string + */ + filterEnd: string; + /** + * Size for a given page. The maximum allowed value is 100. + * @type number + */ + pageSize?: number; + /** + * Specific page number to return. + * @type number + */ + pageNumber?: number; +} + +export interface OnCallApiListOnCallSchedulesRequest { + /** + * Size for a given page. The maximum allowed value is 100. + * @type number + */ + pageSize?: number; + /** + * Specific page number to return. + * @type number + */ + pageNumber?: number; +} + export interface OnCallApiSetOnCallTeamRoutingRulesRequest { /** * The team ID @@ -1585,6 +2242,31 @@ export class OnCallApi { }); } + /** + * Create an override for a given schedule. + * @param param The request object + */ + public createOnCallScheduleOverride( + param: OnCallApiCreateOnCallScheduleOverrideRequest, + options?: Configuration + ): Promise { + const requestContextPromise = + this.requestFactory.createOnCallScheduleOverride( + param.scheduleId, + param.body, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.createOnCallScheduleOverride( + responseContext + ); + }); + }); + } + /** * Delete an On-Call escalation policy * @param param The request object @@ -1627,6 +2309,31 @@ export class OnCallApi { }); } + /** + * Delete an override for a given schedule. + * @param param The request object + */ + public deleteOnCallScheduleOverride( + param: OnCallApiDeleteOnCallScheduleOverrideRequest, + options?: Configuration + ): Promise { + const requestContextPromise = + this.requestFactory.deleteOnCallScheduleOverride( + param.scheduleId, + param.overrideId, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.deleteOnCallScheduleOverride( + responseContext + ); + }); + }); + } + /** * Get an On-Call escalation policy * @param param The request object @@ -1742,6 +2449,81 @@ export class OnCallApi { }); } + /** + * Get a list of all escalation policies. + * @param param The request object + */ + public listOnCallEscalationPolicies( + param: OnCallApiListOnCallEscalationPoliciesRequest = {}, + options?: Configuration + ): Promise { + const requestContextPromise = + this.requestFactory.listOnCallEscalationPolicies( + param.pageSize, + param.pageNumber, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.listOnCallEscalationPolicies( + responseContext + ); + }); + }); + } + + /** + * Get a list of all overrides for a given schedule. + * @param param The request object + */ + public listOnCallScheduleOverrides( + param: OnCallApiListOnCallScheduleOverridesRequest, + options?: Configuration + ): Promise { + const requestContextPromise = + this.requestFactory.listOnCallScheduleOverrides( + param.scheduleId, + param.filterStart, + param.filterEnd, + param.pageSize, + param.pageNumber, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.listOnCallScheduleOverrides( + responseContext + ); + }); + }); + } + + /** + * Get a list of all on-call schedules. + * @param param The request object + */ + public listOnCallSchedules( + param: OnCallApiListOnCallSchedulesRequest = {}, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.listOnCallSchedules( + param.pageSize, + param.pageNumber, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.listOnCallSchedules(responseContext); + }); + }); + } + /** * Set a team's On-Call routing rules * @param param The request object diff --git a/packages/datadog-api-client-v2/index.ts b/packages/datadog-api-client-v2/index.ts index 6032adb352df..e34c9e52b99d 100644 --- a/packages/datadog-api-client-v2/index.ts +++ b/packages/datadog-api-client-v2/index.ts @@ -441,13 +441,18 @@ export { export { OnCallApiCreateOnCallEscalationPolicyRequest, OnCallApiCreateOnCallScheduleRequest, + OnCallApiCreateOnCallScheduleOverrideRequest, OnCallApiDeleteOnCallEscalationPolicyRequest, OnCallApiDeleteOnCallScheduleRequest, + OnCallApiDeleteOnCallScheduleOverrideRequest, OnCallApiGetOnCallEscalationPolicyRequest, OnCallApiGetOnCallScheduleRequest, OnCallApiGetOnCallTeamRoutingRulesRequest, OnCallApiGetScheduleOnCallUserRequest, OnCallApiGetTeamOnCallUsersRequest, + OnCallApiListOnCallEscalationPoliciesRequest, + OnCallApiListOnCallScheduleOverridesRequest, + OnCallApiListOnCallSchedulesRequest, OnCallApiSetOnCallTeamRoutingRulesRequest, OnCallApiUpdateOnCallEscalationPolicyRequest, OnCallApiUpdateOnCallScheduleRequest, @@ -1534,6 +1539,7 @@ export { EntityV3SystemSpec } from "./models/EntityV3SystemSpec"; export { EPSS } from "./models/EPSS"; export { ErrorHandler } from "./models/ErrorHandler"; export { Escalation } from "./models/Escalation"; +export { EscalationPoliciesResponse } from "./models/EscalationPoliciesResponse"; export { EscalationPolicy } from "./models/EscalationPolicy"; export { EscalationPolicyCreateRequest } from "./models/EscalationPolicyCreateRequest"; export { EscalationPolicyCreateRequestData } from "./models/EscalationPolicyCreateRequestData"; @@ -2370,6 +2376,9 @@ export { OktaAccountUpdateRequest } from "./models/OktaAccountUpdateRequest"; export { OktaAccountUpdateRequestAttributes } from "./models/OktaAccountUpdateRequestAttributes"; export { OktaAccountUpdateRequestData } from "./models/OktaAccountUpdateRequestData"; export { OnCallPageTargetType } from "./models/OnCallPageTargetType"; +export { OnCallUserRelationship } from "./models/OnCallUserRelationship"; +export { OnCallUserRelationshipData } from "./models/OnCallUserRelationshipData"; +export { OnCallUserRelationshipType } from "./models/OnCallUserRelationshipType"; export { OnDemandConcurrencyCap } from "./models/OnDemandConcurrencyCap"; export { OnDemandConcurrencyCapAttributes } from "./models/OnDemandConcurrencyCapAttributes"; export { OnDemandConcurrencyCapResponse } from "./models/OnDemandConcurrencyCapResponse"; @@ -2418,6 +2427,17 @@ export { OutcomeType } from "./models/OutcomeType"; export { OutputSchema } from "./models/OutputSchema"; export { OutputSchemaParameters } from "./models/OutputSchemaParameters"; export { OutputSchemaParametersType } from "./models/OutputSchemaParametersType"; +export { Override } from "./models/Override"; +export { OverrideAttributes } from "./models/OverrideAttributes"; +export { OverrideCreateData } from "./models/OverrideCreateData"; +export { OverrideCreateDataAttributes } from "./models/OverrideCreateDataAttributes"; +export { OverrideCreateDataRelationships } from "./models/OverrideCreateDataRelationships"; +export { OverrideCreateDataType } from "./models/OverrideCreateDataType"; +export { OverrideRelationships } from "./models/OverrideRelationships"; +export { OverrideRequest } from "./models/OverrideRequest"; +export { OverrideResponse } from "./models/OverrideResponse"; +export { OverridesResponse } from "./models/OverridesResponse"; +export { OverrideType } from "./models/OverrideType"; export { PageUrgency } from "./models/PageUrgency"; export { Pagination } from "./models/Pagination"; export { Parameter } from "./models/Parameter"; @@ -2729,6 +2749,7 @@ export { ScheduleMemberRelationshipsUserDataType } from "./models/ScheduleMember export { ScheduleMemberType } from "./models/ScheduleMemberType"; export { ScheduleRequestDataAttributesLayersItemsMembersItems } from "./models/ScheduleRequestDataAttributesLayersItemsMembersItems"; export { ScheduleRequestDataAttributesLayersItemsMembersItemsUser } from "./models/ScheduleRequestDataAttributesLayersItemsMembersItemsUser"; +export { SchedulesResponse } from "./models/SchedulesResponse"; export { ScheduleTarget } from "./models/ScheduleTarget"; export { ScheduleTargetType } from "./models/ScheduleTargetType"; export { ScheduleTrigger } from "./models/ScheduleTrigger"; diff --git a/packages/datadog-api-client-v2/models/EscalationPoliciesResponse.ts b/packages/datadog-api-client-v2/models/EscalationPoliciesResponse.ts new file mode 100644 index 000000000000..9c9dfca3af55 --- /dev/null +++ b/packages/datadog-api-client-v2/models/EscalationPoliciesResponse.ts @@ -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 2020-Present Datadog, Inc. + */ +import { EscalationPolicyData } from "./EscalationPolicyData"; +import { EscalationPolicyIncluded } from "./EscalationPolicyIncluded"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Response with a list of escalation policies. + */ +export class EscalationPoliciesResponse { + /** + * A list of escalation policies. + */ + "data"?: Array; + /** + * Provides any included related resources, such as steps or targets, returned with the policy. + */ + "included"?: Array; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "Array", + }, + included: { + baseName: "included", + type: "Array", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return EscalationPoliciesResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ObjectSerializer.ts b/packages/datadog-api-client-v2/models/ObjectSerializer.ts index 2f4f8995ae07..b715b2e60236 100644 --- a/packages/datadog-api-client-v2/models/ObjectSerializer.ts +++ b/packages/datadog-api-client-v2/models/ObjectSerializer.ts @@ -617,6 +617,7 @@ import { EntityV3SystemDatadog } from "./EntityV3SystemDatadog"; import { EntityV3SystemSpec } from "./EntityV3SystemSpec"; import { ErrorHandler } from "./ErrorHandler"; import { Escalation } from "./Escalation"; +import { EscalationPoliciesResponse } from "./EscalationPoliciesResponse"; import { EscalationPolicy } from "./EscalationPolicy"; import { EscalationPolicyCreateRequest } from "./EscalationPolicyCreateRequest"; import { EscalationPolicyCreateRequestData } from "./EscalationPolicyCreateRequestData"; @@ -1218,6 +1219,8 @@ import { OktaAccountUpdateRequest } from "./OktaAccountUpdateRequest"; import { OktaAccountUpdateRequestAttributes } from "./OktaAccountUpdateRequestAttributes"; import { OktaAccountUpdateRequestData } from "./OktaAccountUpdateRequestData"; import { OktaAccountsResponse } from "./OktaAccountsResponse"; +import { OnCallUserRelationship } from "./OnCallUserRelationship"; +import { OnCallUserRelationshipData } from "./OnCallUserRelationshipData"; import { OnDemandConcurrencyCap } from "./OnDemandConcurrencyCap"; import { OnDemandConcurrencyCapAttributes } from "./OnDemandConcurrencyCapAttributes"; import { OnDemandConcurrencyCapResponse } from "./OnDemandConcurrencyCapResponse"; @@ -1257,6 +1260,15 @@ import { OutcomesResponseIncludedRuleAttributes } from "./OutcomesResponseInclud import { OutcomesResponseLinks } from "./OutcomesResponseLinks"; import { OutputSchema } from "./OutputSchema"; import { OutputSchemaParameters } from "./OutputSchemaParameters"; +import { Override } from "./Override"; +import { OverrideAttributes } from "./OverrideAttributes"; +import { OverrideCreateData } from "./OverrideCreateData"; +import { OverrideCreateDataAttributes } from "./OverrideCreateDataAttributes"; +import { OverrideCreateDataRelationships } from "./OverrideCreateDataRelationships"; +import { OverrideRelationships } from "./OverrideRelationships"; +import { OverrideRequest } from "./OverrideRequest"; +import { OverrideResponse } from "./OverrideResponse"; +import { OverridesResponse } from "./OverridesResponse"; import { Pagination } from "./Pagination"; import { Parameter } from "./Parameter"; import { PartialAPIKey } from "./PartialAPIKey"; @@ -1522,6 +1534,7 @@ import { ScheduleUpdateRequestDataAttributesLayersItems } from "./ScheduleUpdate import { ScheduleUpdateRequestDataRelationships } from "./ScheduleUpdateRequestDataRelationships"; import { ScheduleUser } from "./ScheduleUser"; import { ScheduleUserAttributes } from "./ScheduleUserAttributes"; +import { SchedulesResponse } from "./SchedulesResponse"; import { SecurityFilter } from "./SecurityFilter"; import { SecurityFilterAttributes } from "./SecurityFilterAttributes"; import { SecurityFilterCreateAttributes } from "./SecurityFilterCreateAttributes"; @@ -2674,6 +2687,7 @@ const enumsMap: { [key: string]: any[] } = { ObservabilityPipelineThrottleProcessorType: ["throttle"], OktaAccountType: ["okta-accounts"], OnCallPageTargetType: ["team_id", "team_handle", "user_id"], + OnCallUserRelationshipType: ["users"], OnDemandConcurrencyCapType: ["on_demand_concurrency_cap"], OpsgenieServiceRegionType: ["us", "eu", "custom"], OpsgenieServiceType: ["opsgenie-service"], @@ -2692,6 +2706,8 @@ const enumsMap: { [key: string]: any[] } = { "ARRAY_BOOLEAN", "ARRAY_OBJECT", ], + OverrideCreateDataType: ["overrides"], + OverrideType: ["overrides"], PageUrgency: ["low", "high"], PermissionsType: ["permissions"], ProcessSummaryType: ["process"], @@ -3890,6 +3906,7 @@ const typeMap: { [index: string]: any } = { EntityV3SystemSpec: EntityV3SystemSpec, ErrorHandler: ErrorHandler, Escalation: Escalation, + EscalationPoliciesResponse: EscalationPoliciesResponse, EscalationPolicy: EscalationPolicy, EscalationPolicyCreateRequest: EscalationPolicyCreateRequest, EscalationPolicyCreateRequestData: EscalationPolicyCreateRequestData, @@ -4614,6 +4631,8 @@ const typeMap: { [index: string]: any } = { OktaAccountUpdateRequestAttributes: OktaAccountUpdateRequestAttributes, OktaAccountUpdateRequestData: OktaAccountUpdateRequestData, OktaAccountsResponse: OktaAccountsResponse, + OnCallUserRelationship: OnCallUserRelationship, + OnCallUserRelationshipData: OnCallUserRelationshipData, OnDemandConcurrencyCap: OnDemandConcurrencyCap, OnDemandConcurrencyCapAttributes: OnDemandConcurrencyCapAttributes, OnDemandConcurrencyCapResponse: OnDemandConcurrencyCapResponse, @@ -4654,6 +4673,15 @@ const typeMap: { [index: string]: any } = { OutcomesResponseLinks: OutcomesResponseLinks, OutputSchema: OutputSchema, OutputSchemaParameters: OutputSchemaParameters, + Override: Override, + OverrideAttributes: OverrideAttributes, + OverrideCreateData: OverrideCreateData, + OverrideCreateDataAttributes: OverrideCreateDataAttributes, + OverrideCreateDataRelationships: OverrideCreateDataRelationships, + OverrideRelationships: OverrideRelationships, + OverrideRequest: OverrideRequest, + OverrideResponse: OverrideResponse, + OverridesResponse: OverridesResponse, Pagination: Pagination, Parameter: Parameter, PartialAPIKey: PartialAPIKey, @@ -4933,6 +4961,7 @@ const typeMap: { [index: string]: any } = { ScheduleUpdateRequestDataRelationships, ScheduleUser: ScheduleUser, ScheduleUserAttributes: ScheduleUserAttributes, + SchedulesResponse: SchedulesResponse, SecurityFilter: SecurityFilter, SecurityFilterAttributes: SecurityFilterAttributes, SecurityFilterCreateAttributes: SecurityFilterCreateAttributes, diff --git a/packages/datadog-api-client-v2/models/OnCallUserRelationship.ts b/packages/datadog-api-client-v2/models/OnCallUserRelationship.ts new file mode 100644 index 000000000000..db7c4e8b4d6a --- /dev/null +++ b/packages/datadog-api-client-v2/models/OnCallUserRelationship.ts @@ -0,0 +1,53 @@ +/** + * 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 2020-Present Datadog, Inc. + */ +import { OnCallUserRelationshipData } from "./OnCallUserRelationshipData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The definition of `OnCallUserRelationship` object. + */ +export class OnCallUserRelationship { + /** + * The definition of `OnCallUserRelationshipData` object. + */ + "data"?: OnCallUserRelationshipData; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "OnCallUserRelationshipData", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return OnCallUserRelationship.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/OnCallUserRelationshipData.ts b/packages/datadog-api-client-v2/models/OnCallUserRelationshipData.ts new file mode 100644 index 000000000000..c84806e6488e --- /dev/null +++ b/packages/datadog-api-client-v2/models/OnCallUserRelationshipData.ts @@ -0,0 +1,61 @@ +/** + * 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 2020-Present Datadog, Inc. + */ +import { OnCallUserRelationshipType } from "./OnCallUserRelationshipType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The definition of `OnCallUserRelationshipData` object. + */ +export class OnCallUserRelationshipData { + /** + * The ID of the user. + */ + "id"?: string; + /** + * The definition of `OnCallUserRelationshipType` object. + */ + "type"?: OnCallUserRelationshipType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + id: { + baseName: "id", + type: "string", + }, + type: { + baseName: "type", + type: "OnCallUserRelationshipType", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return OnCallUserRelationshipData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/OnCallUserRelationshipType.ts b/packages/datadog-api-client-v2/models/OnCallUserRelationshipType.ts new file mode 100644 index 000000000000..6f883648e978 --- /dev/null +++ b/packages/datadog-api-client-v2/models/OnCallUserRelationshipType.ts @@ -0,0 +1,14 @@ +/** + * 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 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * The definition of `OnCallUserRelationshipType` object. + */ + +export type OnCallUserRelationshipType = typeof USERS | UnparsedObject; +export const USERS = "users"; diff --git a/packages/datadog-api-client-v2/models/Override.ts b/packages/datadog-api-client-v2/models/Override.ts new file mode 100644 index 000000000000..a27beeb4117a --- /dev/null +++ b/packages/datadog-api-client-v2/models/Override.ts @@ -0,0 +1,79 @@ +/** + * 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 2020-Present Datadog, Inc. + */ +import { OverrideAttributes } from "./OverrideAttributes"; +import { OverrideRelationships } from "./OverrideRelationships"; +import { OverrideType } from "./OverrideType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The definition of `Override` object. + */ +export class Override { + /** + * The definition of `OverrideAttributes` object. + */ + "attributes"?: OverrideAttributes; + /** + * The ID of the override. + */ + "id"?: string; + /** + * The definition of `OverrideRelationships` object. + */ + "relationships"?: OverrideRelationships; + /** + * The definition of `OverrideType` object. + */ + "type"?: OverrideType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "OverrideAttributes", + }, + id: { + baseName: "id", + type: "string", + }, + relationships: { + baseName: "relationships", + type: "OverrideRelationships", + }, + type: { + baseName: "type", + type: "OverrideType", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return Override.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/OverrideAttributes.ts b/packages/datadog-api-client-v2/models/OverrideAttributes.ts new file mode 100644 index 000000000000..323c29db84c2 --- /dev/null +++ b/packages/datadog-api-client-v2/models/OverrideAttributes.ts @@ -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 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The definition of `OverrideAttributes` object. + */ +export class OverrideAttributes { + /** + * The end time of the override. + */ + "end"?: Date; + /** + * The start time of the override. + */ + "start"?: Date; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + end: { + baseName: "end", + type: "Date", + format: "date-time", + }, + start: { + baseName: "start", + type: "Date", + format: "date-time", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return OverrideAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/OverrideCreateData.ts b/packages/datadog-api-client-v2/models/OverrideCreateData.ts new file mode 100644 index 000000000000..d35a531da8bb --- /dev/null +++ b/packages/datadog-api-client-v2/models/OverrideCreateData.ts @@ -0,0 +1,73 @@ +/** + * 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 2020-Present Datadog, Inc. + */ +import { OverrideCreateDataAttributes } from "./OverrideCreateDataAttributes"; +import { OverrideCreateDataRelationships } from "./OverrideCreateDataRelationships"; +import { OverrideCreateDataType } from "./OverrideCreateDataType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The definition of `OverrideCreateData` object. + */ +export class OverrideCreateData { + /** + * The definition of `OverrideCreateDataAttributes` object. + */ + "attributes": OverrideCreateDataAttributes; + /** + * The definition of `OverrideCreateDataRelationships` object. + */ + "relationships"?: OverrideCreateDataRelationships; + /** + * The definition of `OverrideCreateDataType` object. + */ + "type": OverrideCreateDataType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "OverrideCreateDataAttributes", + required: true, + }, + relationships: { + baseName: "relationships", + type: "OverrideCreateDataRelationships", + }, + type: { + baseName: "type", + type: "OverrideCreateDataType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return OverrideCreateData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/OverrideCreateDataAttributes.ts b/packages/datadog-api-client-v2/models/OverrideCreateDataAttributes.ts new file mode 100644 index 000000000000..79f848c94ce7 --- /dev/null +++ b/packages/datadog-api-client-v2/models/OverrideCreateDataAttributes.ts @@ -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 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The definition of `OverrideCreateDataAttributes` object. + */ +export class OverrideCreateDataAttributes { + /** + * The end time of the override. + */ + "end": Date; + /** + * The start time of the override. + */ + "start": Date; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + end: { + baseName: "end", + type: "Date", + required: true, + format: "date-time", + }, + start: { + baseName: "start", + type: "Date", + required: true, + format: "date-time", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return OverrideCreateDataAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/OverrideCreateDataRelationships.ts b/packages/datadog-api-client-v2/models/OverrideCreateDataRelationships.ts new file mode 100644 index 000000000000..22017425d7ff --- /dev/null +++ b/packages/datadog-api-client-v2/models/OverrideCreateDataRelationships.ts @@ -0,0 +1,53 @@ +/** + * 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 2020-Present Datadog, Inc. + */ +import { OnCallUserRelationship } from "./OnCallUserRelationship"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The definition of `OverrideCreateDataRelationships` object. + */ +export class OverrideCreateDataRelationships { + /** + * The definition of `OnCallUserRelationship` object. + */ + "user"?: OnCallUserRelationship; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + user: { + baseName: "user", + type: "OnCallUserRelationship", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return OverrideCreateDataRelationships.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/OverrideCreateDataType.ts b/packages/datadog-api-client-v2/models/OverrideCreateDataType.ts new file mode 100644 index 000000000000..834d2b340790 --- /dev/null +++ b/packages/datadog-api-client-v2/models/OverrideCreateDataType.ts @@ -0,0 +1,14 @@ +/** + * 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 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * The definition of `OverrideCreateDataType` object. + */ + +export type OverrideCreateDataType = typeof OVERRIDES | UnparsedObject; +export const OVERRIDES = "overrides"; diff --git a/packages/datadog-api-client-v2/models/OverrideRelationships.ts b/packages/datadog-api-client-v2/models/OverrideRelationships.ts new file mode 100644 index 000000000000..bc536ce29288 --- /dev/null +++ b/packages/datadog-api-client-v2/models/OverrideRelationships.ts @@ -0,0 +1,53 @@ +/** + * 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 2020-Present Datadog, Inc. + */ +import { OnCallUserRelationship } from "./OnCallUserRelationship"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The definition of `OverrideRelationships` object. + */ +export class OverrideRelationships { + /** + * The definition of `OnCallUserRelationship` object. + */ + "user"?: OnCallUserRelationship; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + user: { + baseName: "user", + type: "OnCallUserRelationship", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return OverrideRelationships.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/OverrideRequest.ts b/packages/datadog-api-client-v2/models/OverrideRequest.ts new file mode 100644 index 000000000000..dde768e33d24 --- /dev/null +++ b/packages/datadog-api-client-v2/models/OverrideRequest.ts @@ -0,0 +1,54 @@ +/** + * 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 2020-Present Datadog, Inc. + */ +import { OverrideCreateData } from "./OverrideCreateData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The definition of `OverrideRequest` object. + */ +export class OverrideRequest { + /** + * The `OverrideRequest` `data`. + */ + "data": Array; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "Array", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return OverrideRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/OverrideResponse.ts b/packages/datadog-api-client-v2/models/OverrideResponse.ts new file mode 100644 index 000000000000..92e23dbcd8b5 --- /dev/null +++ b/packages/datadog-api-client-v2/models/OverrideResponse.ts @@ -0,0 +1,53 @@ +/** + * 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 2020-Present Datadog, Inc. + */ +import { Override } from "./Override"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The definition of `OverrideResponse` object. + */ +export class OverrideResponse { + /** + * The `OverrideResponse` `data`. + */ + "data"?: Array; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "Array", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return OverrideResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/OverrideType.ts b/packages/datadog-api-client-v2/models/OverrideType.ts new file mode 100644 index 000000000000..85c0d202673c --- /dev/null +++ b/packages/datadog-api-client-v2/models/OverrideType.ts @@ -0,0 +1,14 @@ +/** + * 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 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * The definition of `OverrideType` object. + */ + +export type OverrideType = typeof OVERRIDES | UnparsedObject; +export const OVERRIDES = "overrides"; diff --git a/packages/datadog-api-client-v2/models/OverridesResponse.ts b/packages/datadog-api-client-v2/models/OverridesResponse.ts new file mode 100644 index 000000000000..7b5fe237faea --- /dev/null +++ b/packages/datadog-api-client-v2/models/OverridesResponse.ts @@ -0,0 +1,53 @@ +/** + * 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 2020-Present Datadog, Inc. + */ +import { Override } from "./Override"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The definition of `OverridesResponse` object. + */ +export class OverridesResponse { + /** + * The `OverridesResponse` `data`. + */ + "data"?: Array; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "Array", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return OverridesResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SchedulesResponse.ts b/packages/datadog-api-client-v2/models/SchedulesResponse.ts new file mode 100644 index 000000000000..a1a083cef588 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SchedulesResponse.ts @@ -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 2020-Present Datadog, Inc. + */ +import { ScheduleData } from "./ScheduleData"; +import { ScheduleDataIncludedItem } from "./ScheduleDataIncludedItem"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Response with a list of on-call schedules. + */ +export class SchedulesResponse { + /** + * A list of on-call schedules. + */ + "data"?: Array; + /** + * Any additional resources related to this schedule, such as teams and layers. + */ + "included"?: Array; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "Array", + }, + included: { + baseName: "included", + type: "Array", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SchedulesResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/TeamOnCallResponders.ts b/packages/datadog-api-client-v2/models/TeamOnCallResponders.ts index 1e21f16ba3ed..a43b6920dc64 100644 --- a/packages/datadog-api-client-v2/models/TeamOnCallResponders.ts +++ b/packages/datadog-api-client-v2/models/TeamOnCallResponders.ts @@ -13,7 +13,7 @@ import { AttributeTypeMap } from "../../datadog-api-client-common/util"; */ export class TeamOnCallResponders { /** - * Defines the main on-call responder object for a team, including relationships and metadata. + * Defines the main on-call responder object for a team, including relationships. */ "data"?: TeamOnCallRespondersData; /** diff --git a/packages/datadog-api-client-v2/models/TeamOnCallRespondersData.ts b/packages/datadog-api-client-v2/models/TeamOnCallRespondersData.ts index aaa9ff195fc3..cd1a6d6f1444 100644 --- a/packages/datadog-api-client-v2/models/TeamOnCallRespondersData.ts +++ b/packages/datadog-api-client-v2/models/TeamOnCallRespondersData.ts @@ -9,7 +9,7 @@ import { TeamOnCallRespondersDataType } from "./TeamOnCallRespondersDataType"; import { AttributeTypeMap } from "../../datadog-api-client-common/util"; /** - * Defines the main on-call responder object for a team, including relationships and metadata. + * Defines the main on-call responder object for a team, including relationships. */ export class TeamOnCallRespondersData { /**