diff --git a/.apigentools-info b/.apigentools-info index 06d2bad7249e..1e9fb99e1091 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:40.045577", - "spec_repo_commit": "79e7c933" + "regenerated": "2025-06-10 00:08:53.221089", + "spec_repo_commit": "4fe79cde" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2025-06-09 14:45:40.062384", - "spec_repo_commit": "79e7c933" + "regenerated": "2025-06-10 00:08:53.237043", + "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/features/v2/on-call/Create-an-override-returns-Created-response.frozen b/cassettes/features/v2/on-call/Create-an-override-returns-Created-response.frozen new file mode 100644 index 000000000000..e5dca6e90b4f --- /dev/null +++ b/cassettes/features/v2/on-call/Create-an-override-returns-Created-response.frozen @@ -0,0 +1 @@ +2025-06-09T23:29:57.648Z \ No newline at end of file diff --git a/cassettes/features/v2/on-call/Create-an-override-returns-Created-response.yml b/cassettes/features/v2/on-call/Create-an-override-returns-Created-response.yml new file mode 100644 index 000000000000..5d8f01c36211 --- /dev/null +++ b/cassettes/features/v2/on-call/Create-an-override-returns-Created-response.yml @@ -0,0 +1,124 @@ +http_interactions: +- recorded_at: Mon, 09 Jun 2025 23:29:57 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"email":"Test-Create_an_override_returns_Created_response-1749511797@datadoghq.com","title":"user + title"},"type":"users"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/users + response: + body: + encoding: UTF-8 + string: '{"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"}}}}} + + ' + headers: + Content-Type: + - application/json + status: + code: 201 + message: Created +- recorded_at: Mon, 09 Jun 2025 23:29:57 GMT + request: + body: + encoding: UTF-8 + string: '{"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"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/on-call/schedules + response: + body: + encoding: UTF-8 + string: '{"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"}]}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Mon, 09 Jun 2025 23:29:57 GMT + request: + body: + encoding: UTF-8 + string: '{"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"}]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/on-call/schedules/72f3a655-502c-491e-adb4-1e67a7aef424/overrides + response: + body: + encoding: UTF-8 + string: '{"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"}}}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Mon, 09 Jun 2025 23:29:57 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/on-call/schedules/%7Bschedule_id%7D/overrides/c19f68f9-e22d-424b-8ee2-74068a2d41f4 + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"attribute + \"uuid\" [{schedule_id}] is not a valid UUID"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +- recorded_at: Mon, 09 Jun 2025 23:29:57 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/on-call/schedules/72f3a655-502c-491e-adb4-1e67a7aef424 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +- recorded_at: Mon, 09 Jun 2025 23:29:57 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/users/a8378345-4589-11f0-8c93-d6008d2166ed + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/on-call/Delete-an-override-returns-No-Content-response.frozen b/cassettes/features/v2/on-call/Delete-an-override-returns-No-Content-response.frozen new file mode 100644 index 000000000000..5bfc4c770b86 --- /dev/null +++ b/cassettes/features/v2/on-call/Delete-an-override-returns-No-Content-response.frozen @@ -0,0 +1 @@ +2025-06-09T23:30:15.221Z \ No newline at end of file diff --git a/cassettes/features/v2/on-call/Delete-an-override-returns-No-Content-response.yml b/cassettes/features/v2/on-call/Delete-an-override-returns-No-Content-response.yml new file mode 100644 index 000000000000..dcc424f21415 --- /dev/null +++ b/cassettes/features/v2/on-call/Delete-an-override-returns-No-Content-response.yml @@ -0,0 +1,140 @@ +http_interactions: +- recorded_at: Mon, 09 Jun 2025 23:30:15 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"email":"Test-Delete_an_override_returns_No_Content_response-1749511815@datadoghq.com","title":"user + title"},"type":"users"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/users + response: + body: + encoding: UTF-8 + string: '{"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"}}}}} + + ' + headers: + Content-Type: + - application/json + status: + code: 201 + message: Created +- recorded_at: Mon, 09 Jun 2025 23:30:15 GMT + request: + body: + encoding: UTF-8 + string: '{"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"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/on-call/schedules + response: + body: + encoding: UTF-8 + string: '{"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"}]}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Mon, 09 Jun 2025 23:30:15 GMT + request: + body: + encoding: UTF-8 + string: '{"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"}]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/on-call/schedules/bc5808ac-2b71-4213-8f8d-b9bcdb59b605/overrides + response: + body: + encoding: UTF-8 + string: '{"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"}}}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Mon, 09 Jun 2025 23:30:15 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/on-call/schedules/bc5808ac-2b71-4213-8f8d-b9bcdb59b605/overrides/b289bd65-d407-4dc8-b606-d7dedcffc88e + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +- recorded_at: Mon, 09 Jun 2025 23:30:15 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/on-call/schedules/%7Bschedule_id%7D/overrides/b289bd65-d407-4dc8-b606-d7dedcffc88e + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"attribute + \"uuid\" [{schedule_id}] is not a valid UUID"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +- recorded_at: Mon, 09 Jun 2025 23:30:15 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/on-call/schedules/bc5808ac-2b71-4213-8f8d-b9bcdb59b605 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +- recorded_at: Mon, 09 Jun 2025 23:30:15 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/users/b2a8c8e6-4589-11f0-8c93-d6008d2166ed + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/on-call/Get-On-Call-team-routing-rules-returns-OK-response.frozen b/cassettes/features/v2/on-call/Get-On-Call-team-routing-rules-returns-OK-response.frozen new file mode 100644 index 000000000000..3b1ca99f909c --- /dev/null +++ b/cassettes/features/v2/on-call/Get-On-Call-team-routing-rules-returns-OK-response.frozen @@ -0,0 +1 @@ +2025-06-09T23:30:31.779Z \ No newline at end of file diff --git a/cassettes/features/v2/on-call/Get-On-Call-team-routing-rules-returns-OK-response.yml b/cassettes/features/v2/on-call/Get-On-Call-team-routing-rules-returns-OK-response.yml new file mode 100644 index 000000000000..f693d96d2fe1 --- /dev/null +++ b/cassettes/features/v2/on-call/Get-On-Call-team-routing-rules-returns-OK-response.yml @@ -0,0 +1,207 @@ +http_interactions: +- recorded_at: Mon, 09 Jun 2025 23:30:31 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"email":"Test-Get_On_Call_team_routing_rules_returns_OK_response-1749511831@datadoghq.com","title":"user + title"},"type":"users"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/users + response: + body: + encoding: UTF-8 + string: '{"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"}}}}} + + ' + headers: + Content-Type: + - application/json + status: + code: 201 + message: Created +- recorded_at: Mon, 09 Jun 2025 23:30:31 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"handle":"test-handle-437ab09a446c969f","name":"test-name-437ab09a446c969f"},"type":"team"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/team + response: + body: + encoding: UTF-8 + string: '{"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"}}}}} + + ' + headers: + Content-Type: + - application/json + status: + code: 201 + message: Created +- recorded_at: Mon, 09 Jun 2025 23:30:31 GMT + request: + body: + encoding: UTF-8 + string: '{"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"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/on-call/schedules + response: + body: + encoding: UTF-8 + string: '{"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"}]}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Mon, 09 Jun 2025 23:30:31 GMT + request: + body: + encoding: UTF-8 + string: '{"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"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/on-call/escalation-policies + response: + body: + encoding: UTF-8 + string: '{"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"}]}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Mon, 09 Jun 2025 23:30:31 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"rules":[{"actions":[],"policy_id":"ba689dcc-6308-4988-beef-6bff469062e0","query":"","urgency":"low"}]},"id":"2c5640af-2bbe-4fa7-9912-ffb41692f45a","type":"team_routing_rules"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PUT + uri: https://api.datadoghq.com/api/v2/on-call/teams/2c5640af-2bbe-4fa7-9912-ffb41692f45a/routing-rules + response: + body: + encoding: UTF-8 + string: '{"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"}]}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Mon, 09 Jun 2025 23:30:31 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/on-call/teams/2c5640af-2bbe-4fa7-9912-ffb41692f45a/routing-rules + response: + body: + encoding: UTF-8 + string: '{"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"}]}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Mon, 09 Jun 2025 23:30:31 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/on-call/escalation-policies/ba689dcc-6308-4988-beef-6bff469062e0 + response: + body: + encoding: UTF-8 + string: '{"errors":[{"title":"Generic Error","detail":"policy[ba689dcc-6308-4988-beef-6bff469062e0] + is in use"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 409 + message: Conflict +- recorded_at: Mon, 09 Jun 2025 23:30:31 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/on-call/schedules/5577a3fa-b188-4de6-974b-15f85012d023 + response: + body: + encoding: UTF-8 + string: '{"errors":[{"title":"Generic Error","detail":"schedule[5577a3fa-b188-4de6-974b-15f85012d023] + is in use"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 409 + message: Conflict +- recorded_at: Mon, 09 Jun 2025 23:30:31 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team/2c5640af-2bbe-4fa7-9912-ffb41692f45a + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +- recorded_at: Mon, 09 Jun 2025 23:30:31 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/users/bc907b9d-4589-11f0-90a5-c6be27f34b35 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/on-call/Get-a-list-of-all-escalation-policies-returns-OK-response.frozen b/cassettes/features/v2/on-call/Get-a-list-of-all-escalation-policies-returns-OK-response.frozen new file mode 100644 index 000000000000..6af0451d3ec6 --- /dev/null +++ b/cassettes/features/v2/on-call/Get-a-list-of-all-escalation-policies-returns-OK-response.frozen @@ -0,0 +1 @@ +2025-06-09T23:30:40.718Z \ No newline at end of file diff --git a/cassettes/features/v2/on-call/Get-a-list-of-all-escalation-policies-returns-OK-response.yml b/cassettes/features/v2/on-call/Get-a-list-of-all-escalation-policies-returns-OK-response.yml new file mode 100644 index 000000000000..e10caf8e58cf --- /dev/null +++ b/cassettes/features/v2/on-call/Get-a-list-of-all-escalation-policies-returns-OK-response.yml @@ -0,0 +1,20 @@ +http_interactions: +- recorded_at: Mon, 09 Jun 2025 23:30:40 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/on-call/escalation-policies + response: + body: + encoding: UTF-8 + string: '{"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"}]}}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/on-call/Get-a-list-of-all-on-call-schedules-returns-OK-response.frozen b/cassettes/features/v2/on-call/Get-a-list-of-all-on-call-schedules-returns-OK-response.frozen new file mode 100644 index 000000000000..e499279bb6d1 --- /dev/null +++ b/cassettes/features/v2/on-call/Get-a-list-of-all-on-call-schedules-returns-OK-response.frozen @@ -0,0 +1 @@ +2025-06-09T23:30:41.370Z \ No newline at end of file diff --git a/cassettes/features/v2/on-call/Get-a-list-of-all-on-call-schedules-returns-OK-response.yml b/cassettes/features/v2/on-call/Get-a-list-of-all-on-call-schedules-returns-OK-response.yml new file mode 100644 index 000000000000..1720b8f68774 --- /dev/null +++ b/cassettes/features/v2/on-call/Get-a-list-of-all-on-call-schedules-returns-OK-response.yml @@ -0,0 +1,30 @@ +http_interactions: +- recorded_at: Mon, 09 Jun 2025 23:30:41 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/on-call/schedules + response: + body: + encoding: UTF-8 + string: '{"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"}]}}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/on-call/Get-a-list-of-all-overrides-for-a-schedule-returns-OK-response.frozen b/cassettes/features/v2/on-call/Get-a-list-of-all-overrides-for-a-schedule-returns-OK-response.frozen new file mode 100644 index 000000000000..4de290ec637f --- /dev/null +++ b/cassettes/features/v2/on-call/Get-a-list-of-all-overrides-for-a-schedule-returns-OK-response.frozen @@ -0,0 +1 @@ +2025-06-09T23:37:07.887Z \ No newline at end of file diff --git a/cassettes/features/v2/on-call/Get-a-list-of-all-overrides-for-a-schedule-returns-OK-response.yml b/cassettes/features/v2/on-call/Get-a-list-of-all-overrides-for-a-schedule-returns-OK-response.yml new file mode 100644 index 000000000000..eafc9afb4692 --- /dev/null +++ b/cassettes/features/v2/on-call/Get-a-list-of-all-overrides-for-a-schedule-returns-OK-response.yml @@ -0,0 +1,142 @@ +http_interactions: +- recorded_at: Mon, 09 Jun 2025 23:37:07 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"email":"Test-Get_a_list_of_all_overrides_for_a_schedule_returns_OK_response-1749512227@datadoghq.com","title":"user + title"},"type":"users"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/users + response: + body: + encoding: UTF-8 + string: '{"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"}}}}} + + ' + headers: + Content-Type: + - application/json + status: + code: 201 + message: Created +- recorded_at: Mon, 09 Jun 2025 23:37:07 GMT + request: + body: + encoding: UTF-8 + string: '{"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"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/on-call/schedules + response: + body: + encoding: UTF-8 + string: '{"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"}]}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Mon, 09 Jun 2025 23:37:07 GMT + request: + body: + encoding: UTF-8 + string: '{"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"}]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/on-call/schedules/f6b4026c-2306-4f1c-a5f7-87af6ce59d46/overrides + response: + body: + encoding: UTF-8 + string: '{"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"}}}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Mon, 09 Jun 2025 23:37:07 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: 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: + body: + encoding: UTF-8 + string: '{"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"}}}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Mon, 09 Jun 2025 23:37:07 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/on-call/schedules/%7Bschedule_id%7D/overrides/e132c48c-af33-42c2-9355-aeeedef6381d + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"attribute + \"uuid\" [{schedule_id}] is not a valid UUID"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +- recorded_at: Mon, 09 Jun 2025 23:37:07 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/on-call/schedules/f6b4026c-2306-4f1c-a5f7-87af6ce59d46 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +- recorded_at: Mon, 09 Jun 2025 23:37:07 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/users/a8c6f210-458a-11f0-8c93-d6008d2166ed + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/examples/v2/on-call/CreateOnCallScheduleOverride.rb b/examples/v2/on-call/CreateOnCallScheduleOverride.rb new file mode 100644 index 000000000000..dc086ebc5e72 --- /dev/null +++ b/examples/v2/on-call/CreateOnCallScheduleOverride.rb @@ -0,0 +1,31 @@ +# Create an override returns "Created" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::OnCallAPI.new + +# there is a valid "schedule" in the system +SCHEDULE_DATA_ID = ENV["SCHEDULE_DATA_ID"] + +# there is a valid "user" in the system +USER_DATA_ID = ENV["USER_DATA_ID"] + +body = DatadogAPIClient::V2::OverrideRequest.new({ + data: [ + DatadogAPIClient::V2::OverrideCreateData.new({ + attributes: DatadogAPIClient::V2::OverrideCreateDataAttributes.new({ + start: Time.now, + _end: (Time.now + 1 * 3600), + }), + relationships: DatadogAPIClient::V2::OverrideCreateDataRelationships.new({ + user: DatadogAPIClient::V2::OnCallUserRelationship.new({ + data: DatadogAPIClient::V2::OnCallUserRelationshipData.new({ + id: USER_DATA_ID, + type: DatadogAPIClient::V2::OnCallUserRelationshipType::USERS, + }), + }), + }), + type: DatadogAPIClient::V2::OverrideCreateDataType::OVERRIDES, + }), + ], +}) +p api_instance.create_on_call_schedule_override(SCHEDULE_DATA_ID, body) diff --git a/examples/v2/on-call/DeleteOnCallScheduleOverride.rb b/examples/v2/on-call/DeleteOnCallScheduleOverride.rb new file mode 100644 index 000000000000..75b96b62e91c --- /dev/null +++ b/examples/v2/on-call/DeleteOnCallScheduleOverride.rb @@ -0,0 +1,11 @@ +# Delete an override returns "No Content" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::OnCallAPI.new + +# there is a valid "schedule" in the system +SCHEDULE_DATA_ID = ENV["SCHEDULE_DATA_ID"] + +# there is a valid "override" in the system +OVERRIDE_DATA_0_ID = ENV["OVERRIDE_DATA_0_ID"] +api_instance.delete_on_call_schedule_override(SCHEDULE_DATA_ID, OVERRIDE_DATA_0_ID) diff --git a/examples/v2/on-call/GetOnCallTeamRoutingRules.rb b/examples/v2/on-call/GetOnCallTeamRoutingRules.rb index 93a4317fd62b..3b18ad562dab 100644 --- a/examples/v2/on-call/GetOnCallTeamRoutingRules.rb +++ b/examples/v2/on-call/GetOnCallTeamRoutingRules.rb @@ -2,4 +2,7 @@ require "datadog_api_client" api_instance = DatadogAPIClient::V2::OnCallAPI.new -p api_instance.get_on_call_team_routing_rules("27590dae-47be-4a7d-9abf-8f4e45124020") + +# there is a valid "dd_team" in the system +DD_TEAM_DATA_ID = ENV["DD_TEAM_DATA_ID"] +p api_instance.get_on_call_team_routing_rules(DD_TEAM_DATA_ID) diff --git a/examples/v2/on-call/ListOnCallEscalationPolicies.rb b/examples/v2/on-call/ListOnCallEscalationPolicies.rb new file mode 100644 index 000000000000..a5d36f0b1d10 --- /dev/null +++ b/examples/v2/on-call/ListOnCallEscalationPolicies.rb @@ -0,0 +1,5 @@ +# Get a list of all escalation policies returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::OnCallAPI.new +p api_instance.list_on_call_escalation_policies() diff --git a/examples/v2/on-call/ListOnCallScheduleOverrides.rb b/examples/v2/on-call/ListOnCallScheduleOverrides.rb new file mode 100644 index 000000000000..d41fa031ed7f --- /dev/null +++ b/examples/v2/on-call/ListOnCallScheduleOverrides.rb @@ -0,0 +1,8 @@ +# Get a list of all overrides for a schedule returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::OnCallAPI.new + +# there is a valid "schedule" in the system +SCHEDULE_DATA_ID = ENV["SCHEDULE_DATA_ID"] +p api_instance.list_on_call_schedule_overrides(SCHEDULE_DATA_ID, (Time.now + -1 * 3600), (Time.now + 1 * 3600)) diff --git a/examples/v2/on-call/ListOnCallSchedules.rb b/examples/v2/on-call/ListOnCallSchedules.rb new file mode 100644 index 000000000000..defb65c1768a --- /dev/null +++ b/examples/v2/on-call/ListOnCallSchedules.rb @@ -0,0 +1,5 @@ +# Get a list of all on-call schedules returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::OnCallAPI.new +p api_instance.list_on_call_schedules() diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index cb1596f29af8..b56f52eda1db 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -2083,6 +2083,10 @@ "tags" => "String", "limit" => "Integer", }, + "v2.ListOnCallEscalationPolicies" => { + "page_size" => "Integer", + "page_number" => "Integer", + }, "v2.CreateOnCallEscalationPolicy" => { "include" => "String", "body" => "EscalationPolicyCreateRequest", @@ -2099,6 +2103,10 @@ "include" => "String", "body" => "EscalationPolicyUpdateRequest", }, + "v2.ListOnCallSchedules" => { + "page_size" => "Integer", + "page_number" => "Integer", + }, "v2.CreateOnCallSchedule" => { "include" => "String", "body" => "ScheduleCreateRequest", @@ -2120,6 +2128,21 @@ "schedule_id" => "String", "filter_at_ts" => "String", }, + "v2.ListOnCallScheduleOverrides" => { + "schedule_id" => "String", + "page_size" => "Integer", + "page_number" => "Integer", + "filter_start" => "String", + "filter_end" => "String", + }, + "v2.CreateOnCallScheduleOverride" => { + "schedule_id" => "String", + "body" => "OverrideRequest", + }, + "v2.DeleteOnCallScheduleOverride" => { + "schedule_id" => "String", + "override_id" => "String", + }, "v2.GetTeamOnCallUsers" => { "include" => "String", "team_id" => "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/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 03749959c2c8..c8716072c372 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -1725,6 +1725,7 @@ def overrides "v2.epss" => "EPSS", "v2.error_handler" => "ErrorHandler", "v2.escalation" => "Escalation", + "v2.escalation_policies_response" => "EscalationPoliciesResponse", "v2.escalation_policy" => "EscalationPolicy", "v2.escalation_policy_create_request" => "EscalationPolicyCreateRequest", "v2.escalation_policy_create_request_data" => "EscalationPolicyCreateRequestData", @@ -2561,6 +2562,9 @@ def overrides "v2.okta_account_update_request_attributes" => "OktaAccountUpdateRequestAttributes", "v2.okta_account_update_request_data" => "OktaAccountUpdateRequestData", "v2.on_call_page_target_type" => "OnCallPageTargetType", + "v2.on_call_user_relationship" => "OnCallUserRelationship", + "v2.on_call_user_relationship_data" => "OnCallUserRelationshipData", + "v2.on_call_user_relationship_type" => "OnCallUserRelationshipType", "v2.on_demand_concurrency_cap" => "OnDemandConcurrencyCap", "v2.on_demand_concurrency_cap_attributes" => "OnDemandConcurrencyCapAttributes", "v2.on_demand_concurrency_cap_response" => "OnDemandConcurrencyCapResponse", @@ -2609,6 +2613,17 @@ def overrides "v2.output_schema" => "OutputSchema", "v2.output_schema_parameters" => "OutputSchemaParameters", "v2.output_schema_parameters_type" => "OutputSchemaParametersType", + "v2.override" => "Override", + "v2.override_attributes" => "OverrideAttributes", + "v2.override_create_data" => "OverrideCreateData", + "v2.override_create_data_attributes" => "OverrideCreateDataAttributes", + "v2.override_create_data_relationships" => "OverrideCreateDataRelationships", + "v2.override_create_data_type" => "OverrideCreateDataType", + "v2.override_relationships" => "OverrideRelationships", + "v2.override_request" => "OverrideRequest", + "v2.override_response" => "OverrideResponse", + "v2.overrides_response" => "OverridesResponse", + "v2.override_type" => "OverrideType", "v2.page_urgency" => "PageUrgency", "v2.pagination" => "Pagination", "v2.parameter" => "Parameter", @@ -2920,6 +2935,7 @@ def overrides "v2.schedule_member_type" => "ScheduleMemberType", "v2.schedule_request_data_attributes_layers_items_members_items" => "ScheduleRequestDataAttributesLayersItemsMembersItems", "v2.schedule_request_data_attributes_layers_items_members_items_user" => "ScheduleRequestDataAttributesLayersItemsMembersItemsUser", + "v2.schedules_response" => "SchedulesResponse", "v2.schedule_target" => "ScheduleTarget", "v2.schedule_target_type" => "ScheduleTargetType", "v2.schedule_trigger" => "ScheduleTrigger", diff --git a/lib/datadog_api_client/v2/api/on_call_api.rb b/lib/datadog_api_client/v2/api/on_call_api.rb index 87628c506a0a..0f8442aea688 100644 --- a/lib/datadog_api_client/v2/api/on_call_api.rb +++ b/lib/datadog_api_client/v2/api/on_call_api.rb @@ -161,6 +161,78 @@ def create_on_call_schedule_with_http_info(body, opts = {}) return data, status_code, headers end + # Create an override. + # + # @see #create_on_call_schedule_override_with_http_info + def create_on_call_schedule_override(schedule_id, body, opts = {}) + data, _status_code, _headers = create_on_call_schedule_override_with_http_info(schedule_id, body, opts) + data + end + + # Create an override. + # + # Create an override for a given schedule. + # + # @param schedule_id [String] The ID of the on-call schedule. + # @param body [OverrideRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(OverrideResponse, Integer, Hash)>] OverrideResponse data, response status code and response headers + def create_on_call_schedule_override_with_http_info(schedule_id, body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: OnCallAPI.create_on_call_schedule_override ...' + end + # verify the required parameter 'schedule_id' is set + if @api_client.config.client_side_validation && schedule_id.nil? + fail ArgumentError, "Missing the required parameter 'schedule_id' when calling OnCallAPI.create_on_call_schedule_override" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling OnCallAPI.create_on_call_schedule_override" + end + # resource path + local_var_path = '/api/v2/on-call/schedules/{schedule_id}/overrides'.sub('{schedule_id}', CGI.escape(schedule_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'OverrideResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :create_on_call_schedule_override, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: OnCallAPI#create_on_call_schedule_override\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Delete On-Call escalation policy. # # @see #delete_on_call_escalation_policy_with_http_info @@ -291,6 +363,76 @@ def delete_on_call_schedule_with_http_info(schedule_id, opts = {}) return data, status_code, headers end + # Delete an override. + # + # @see #delete_on_call_schedule_override_with_http_info + def delete_on_call_schedule_override(schedule_id, override_id, opts = {}) + delete_on_call_schedule_override_with_http_info(schedule_id, override_id, opts) + nil + end + + # Delete an override. + # + # Delete an override for a given schedule. + # + # @param schedule_id [String] The ID of the on-call schedule. + # @param override_id [String] The ID of the override. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_on_call_schedule_override_with_http_info(schedule_id, override_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: OnCallAPI.delete_on_call_schedule_override ...' + end + # verify the required parameter 'schedule_id' is set + if @api_client.config.client_side_validation && schedule_id.nil? + fail ArgumentError, "Missing the required parameter 'schedule_id' when calling OnCallAPI.delete_on_call_schedule_override" + end + # verify the required parameter 'override_id' is set + if @api_client.config.client_side_validation && override_id.nil? + fail ArgumentError, "Missing the required parameter 'override_id' when calling OnCallAPI.delete_on_call_schedule_override" + end + # resource path + local_var_path = '/api/v2/on-call/schedules/{schedule_id}/overrides/{override_id}'.sub('{schedule_id}', CGI.escape(schedule_id.to_s).gsub('%2F', '/')).sub('{override_id}', CGI.escape(override_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :delete_on_call_schedule_override, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: OnCallAPI#delete_on_call_schedule_override\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Get On-Call escalation policy. # # @see #get_on_call_escalation_policy_with_http_info @@ -628,6 +770,215 @@ def get_team_on_call_users_with_http_info(team_id, opts = {}) return data, status_code, headers end + # Get a list of all escalation policies. + # + # @see #list_on_call_escalation_policies_with_http_info + def list_on_call_escalation_policies(opts = {}) + data, _status_code, _headers = list_on_call_escalation_policies_with_http_info(opts) + data + end + + # Get a list of all escalation policies. + # + # Get a list of all escalation policies. + # + # @param opts [Hash] the optional parameters + # @option opts [Integer] :page_size Size for a given page. The maximum allowed value is 100. + # @option opts [Integer] :page_number Specific page number to return. + # @return [Array<(EscalationPoliciesResponse, Integer, Hash)>] EscalationPoliciesResponse data, response status code and response headers + def list_on_call_escalation_policies_with_http_info(opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: OnCallAPI.list_on_call_escalation_policies ...' + end + # resource path + local_var_path = '/api/v2/on-call/escalation-policies' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? + query_params[:'page[number]'] = opts[:'page_number'] if !opts[:'page_number'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'EscalationPoliciesResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :list_on_call_escalation_policies, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: OnCallAPI#list_on_call_escalation_policies\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get a list of all overrides for a schedule. + # + # @see #list_on_call_schedule_overrides_with_http_info + def list_on_call_schedule_overrides(schedule_id, filter_start, filter_end, opts = {}) + data, _status_code, _headers = list_on_call_schedule_overrides_with_http_info(schedule_id, filter_start, filter_end, opts) + data + end + + # Get a list of all overrides for a schedule. + # + # Get a list of all overrides for a given schedule. + # + # @param schedule_id [String] The ID of the on-call schedule. + # @param filter_start [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. + # @param filter_end [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. + # @param opts [Hash] the optional parameters + # @option opts [Integer] :page_size Size for a given page. The maximum allowed value is 100. + # @option opts [Integer] :page_number Specific page number to return. + # @return [Array<(OverridesResponse, Integer, Hash)>] OverridesResponse data, response status code and response headers + def list_on_call_schedule_overrides_with_http_info(schedule_id, filter_start, filter_end, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: OnCallAPI.list_on_call_schedule_overrides ...' + end + # verify the required parameter 'schedule_id' is set + if @api_client.config.client_side_validation && schedule_id.nil? + fail ArgumentError, "Missing the required parameter 'schedule_id' when calling OnCallAPI.list_on_call_schedule_overrides" + end + # verify the required parameter 'filter_start' is set + if @api_client.config.client_side_validation && filter_start.nil? + fail ArgumentError, "Missing the required parameter 'filter_start' when calling OnCallAPI.list_on_call_schedule_overrides" + end + # verify the required parameter 'filter_end' is set + if @api_client.config.client_side_validation && filter_end.nil? + fail ArgumentError, "Missing the required parameter 'filter_end' when calling OnCallAPI.list_on_call_schedule_overrides" + end + # resource path + local_var_path = '/api/v2/on-call/schedules/{schedule_id}/overrides'.sub('{schedule_id}', CGI.escape(schedule_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'filter[start]'] = filter_start + query_params[:'filter[end]'] = filter_end + query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? + query_params[:'page[number]'] = opts[:'page_number'] if !opts[:'page_number'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'OverridesResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :list_on_call_schedule_overrides, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: OnCallAPI#list_on_call_schedule_overrides\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get a list of all on-call schedules. + # + # @see #list_on_call_schedules_with_http_info + def list_on_call_schedules(opts = {}) + data, _status_code, _headers = list_on_call_schedules_with_http_info(opts) + data + end + + # Get a list of all on-call schedules. + # + # Get a list of all on-call schedules. + # + # @param opts [Hash] the optional parameters + # @option opts [Integer] :page_size Size for a given page. The maximum allowed value is 100. + # @option opts [Integer] :page_number Specific page number to return. + # @return [Array<(SchedulesResponse, Integer, Hash)>] SchedulesResponse data, response status code and response headers + def list_on_call_schedules_with_http_info(opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: OnCallAPI.list_on_call_schedules ...' + end + # resource path + local_var_path = '/api/v2/on-call/schedules' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? + query_params[:'page[number]'] = opts[:'page_number'] if !opts[:'page_number'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'SchedulesResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :list_on_call_schedules, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: OnCallAPI#list_on_call_schedules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Set On-Call team routing rules. # # @see #set_on_call_team_routing_rules_with_http_info diff --git a/lib/datadog_api_client/v2/models/escalation_policies_response.rb b/lib/datadog_api_client/v2/models/escalation_policies_response.rb new file mode 100644 index 000000000000..20c3b81398a8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/escalation_policies_response.rb @@ -0,0 +1,119 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response with a list of escalation policies. + class EscalationPoliciesResponse + include BaseGenericModel + + # A list of escalation policies. + attr_accessor :data + + # Provides any included related resources, such as steps or targets, returned with the policy. + attr_accessor :included + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'included' => :'included' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array', + :'included' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::EscalationPoliciesResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + + if attributes.key?(:'included') + if (value = attributes[:'included']).is_a?(Array) + self.included = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + included == o.included && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, included, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/on_call_user_relationship.rb b/lib/datadog_api_client/v2/models/on_call_user_relationship.rb new file mode 100644 index 000000000000..a3fa6b45e056 --- /dev/null +++ b/lib/datadog_api_client/v2/models/on_call_user_relationship.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The definition of `OnCallUserRelationship` object. + class OnCallUserRelationship + include BaseGenericModel + + # The definition of `OnCallUserRelationshipData` object. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'OnCallUserRelationshipData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::OnCallUserRelationship` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/on_call_user_relationship_data.rb b/lib/datadog_api_client/v2/models/on_call_user_relationship_data.rb new file mode 100644 index 000000000000..a6c1bfdaf318 --- /dev/null +++ b/lib/datadog_api_client/v2/models/on_call_user_relationship_data.rb @@ -0,0 +1,115 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The definition of `OnCallUserRelationshipData` object. + class OnCallUserRelationshipData + include BaseGenericModel + + # The ID of the user. + attr_accessor :id + + # The definition of `OnCallUserRelationshipType` object. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'String', + :'type' => :'OnCallUserRelationshipType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::OnCallUserRelationshipData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/on_call_user_relationship_type.rb b/lib/datadog_api_client/v2/models/on_call_user_relationship_type.rb new file mode 100644 index 000000000000..5ddcf5964d18 --- /dev/null +++ b/lib/datadog_api_client/v2/models/on_call_user_relationship_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The definition of `OnCallUserRelationshipType` object. + class OnCallUserRelationshipType + include BaseEnumModel + + USERS = "users".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/override.rb b/lib/datadog_api_client/v2/models/override.rb new file mode 100644 index 000000000000..c6e3aca452a4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/override.rb @@ -0,0 +1,135 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The definition of `Override` object. + class Override + include BaseGenericModel + + # The definition of `OverrideAttributes` object. + attr_accessor :attributes + + # The ID of the override. + attr_accessor :id + + # The definition of `OverrideRelationships` object. + attr_accessor :relationships + + # The definition of `OverrideType` object. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'relationships' => :'relationships', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'OverrideAttributes', + :'id' => :'String', + :'relationships' => :'OverrideRelationships', + :'type' => :'OverrideType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::Override` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'relationships') + self.relationships = attributes[:'relationships'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + relationships == o.relationships && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, relationships, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/override_attributes.rb b/lib/datadog_api_client/v2/models/override_attributes.rb new file mode 100644 index 000000000000..33f92a0491c5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/override_attributes.rb @@ -0,0 +1,115 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The definition of `OverrideAttributes` object. + class OverrideAttributes + include BaseGenericModel + + # The end time of the override. + attr_accessor :_end + + # The start time of the override. + attr_accessor :start + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'_end' => :'end', + :'start' => :'start' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'_end' => :'Time', + :'start' => :'Time' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::OverrideAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'_end') + self._end = attributes[:'_end'] + end + + if attributes.key?(:'start') + self.start = attributes[:'start'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + _end == o._end && + start == o.start && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [_end, start, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/override_create_data.rb b/lib/datadog_api_client/v2/models/override_create_data.rb new file mode 100644 index 000000000000..dd524b24e84f --- /dev/null +++ b/lib/datadog_api_client/v2/models/override_create_data.rb @@ -0,0 +1,154 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The definition of `OverrideCreateData` object. + class OverrideCreateData + include BaseGenericModel + + # The definition of `OverrideCreateDataAttributes` object. + attr_reader :attributes + + # The definition of `OverrideCreateDataRelationships` object. + attr_accessor :relationships + + # The definition of `OverrideCreateDataType` object. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'relationships' => :'relationships', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'OverrideCreateDataAttributes', + :'relationships' => :'OverrideCreateDataRelationships', + :'type' => :'OverrideCreateDataType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::OverrideCreateData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'relationships') + self.relationships = attributes[:'relationships'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + relationships == o.relationships && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, relationships, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/override_create_data_attributes.rb b/lib/datadog_api_client/v2/models/override_create_data_attributes.rb new file mode 100644 index 000000000000..b12e85226f39 --- /dev/null +++ b/lib/datadog_api_client/v2/models/override_create_data_attributes.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The definition of `OverrideCreateDataAttributes` object. + class OverrideCreateDataAttributes + include BaseGenericModel + + # The end time of the override. + attr_reader :_end + + # The start time of the override. + attr_reader :start + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'_end' => :'end', + :'start' => :'start' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'_end' => :'Time', + :'start' => :'Time' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::OverrideCreateDataAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'_end') + self._end = attributes[:'_end'] + end + + if attributes.key?(:'start') + self.start = attributes[:'start'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @_end.nil? + return false if @start.nil? + true + end + + # Custom attribute writer method with validation + # @param _end [Object] Object to be assigned + # @!visibility private + def _end=(_end) + if _end.nil? + fail ArgumentError, 'invalid value for "_end", _end cannot be nil.' + end + @_end = _end + end + + # Custom attribute writer method with validation + # @param start [Object] Object to be assigned + # @!visibility private + def start=(start) + if start.nil? + fail ArgumentError, 'invalid value for "start", start cannot be nil.' + end + @start = start + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + _end == o._end && + start == o.start && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [_end, start, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/override_create_data_relationships.rb b/lib/datadog_api_client/v2/models/override_create_data_relationships.rb new file mode 100644 index 000000000000..d4729a04a485 --- /dev/null +++ b/lib/datadog_api_client/v2/models/override_create_data_relationships.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The definition of `OverrideCreateDataRelationships` object. + class OverrideCreateDataRelationships + include BaseGenericModel + + # The definition of `OnCallUserRelationship` object. + attr_accessor :user + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'user' => :'user' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'user' => :'OnCallUserRelationship' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::OverrideCreateDataRelationships` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'user') + self.user = attributes[:'user'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user == o.user && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [user, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/override_create_data_type.rb b/lib/datadog_api_client/v2/models/override_create_data_type.rb new file mode 100644 index 000000000000..f3bfebb0fb06 --- /dev/null +++ b/lib/datadog_api_client/v2/models/override_create_data_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The definition of `OverrideCreateDataType` object. + class OverrideCreateDataType + include BaseEnumModel + + OVERRIDES = "overrides".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/override_relationships.rb b/lib/datadog_api_client/v2/models/override_relationships.rb new file mode 100644 index 000000000000..c2adec55ba4f --- /dev/null +++ b/lib/datadog_api_client/v2/models/override_relationships.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The definition of `OverrideRelationships` object. + class OverrideRelationships + include BaseGenericModel + + # The definition of `OnCallUserRelationship` object. + attr_accessor :user + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'user' => :'user' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'user' => :'OnCallUserRelationship' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::OverrideRelationships` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'user') + self.user = attributes[:'user'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user == o.user && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [user, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/override_request.rb b/lib/datadog_api_client/v2/models/override_request.rb new file mode 100644 index 000000000000..960aa099d2d4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/override_request.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The definition of `OverrideRequest` object. + class OverrideRequest + include BaseGenericModel + + # The `OverrideRequest` `data`. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::OverrideRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/override_response.rb b/lib/datadog_api_client/v2/models/override_response.rb new file mode 100644 index 000000000000..cf2550a2956c --- /dev/null +++ b/lib/datadog_api_client/v2/models/override_response.rb @@ -0,0 +1,107 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The definition of `OverrideResponse` object. + class OverrideResponse + include BaseGenericModel + + # The `OverrideResponse` `data`. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::OverrideResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/override_type.rb b/lib/datadog_api_client/v2/models/override_type.rb new file mode 100644 index 000000000000..64ca04a66342 --- /dev/null +++ b/lib/datadog_api_client/v2/models/override_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The definition of `OverrideType` object. + class OverrideType + include BaseEnumModel + + OVERRIDES = "overrides".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/overrides_response.rb b/lib/datadog_api_client/v2/models/overrides_response.rb new file mode 100644 index 000000000000..2719c86bfea7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/overrides_response.rb @@ -0,0 +1,107 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The definition of `OverridesResponse` object. + class OverridesResponse + include BaseGenericModel + + # The `OverridesResponse` `data`. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::OverridesResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/schedules_response.rb b/lib/datadog_api_client/v2/models/schedules_response.rb new file mode 100644 index 000000000000..6106359991b7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/schedules_response.rb @@ -0,0 +1,119 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response with a list of on-call schedules. + class SchedulesResponse + include BaseGenericModel + + # A list of on-call schedules. + attr_accessor :data + + # Any additional resources related to this schedule, such as teams and layers. + attr_accessor :included + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'included' => :'included' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array', + :'included' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SchedulesResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + + if attributes.key?(:'included') + if (value = attributes[:'included']).is_a?(Array) + self.included = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + included == o.included && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, included, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/team_on_call_responders.rb b/lib/datadog_api_client/v2/models/team_on_call_responders.rb index 1f344b4c8c3c..cd4ed16476f8 100644 --- a/lib/datadog_api_client/v2/models/team_on_call_responders.rb +++ b/lib/datadog_api_client/v2/models/team_on_call_responders.rb @@ -21,7 +21,7 @@ module DatadogAPIClient::V2 class TeamOnCallResponders include BaseGenericModel - # 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. attr_accessor :data # The `TeamOnCallResponders` `included`. diff --git a/lib/datadog_api_client/v2/models/team_on_call_responders_data.rb b/lib/datadog_api_client/v2/models/team_on_call_responders_data.rb index 91122b3b4e5f..7f32e01c07bf 100644 --- a/lib/datadog_api_client/v2/models/team_on_call_responders_data.rb +++ b/lib/datadog_api_client/v2/models/team_on_call_responders_data.rb @@ -17,7 +17,7 @@ require 'time' module DatadogAPIClient::V2 - # 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. class TeamOnCallRespondersData include BaseGenericModel