Skip to content

Commit af2d3fe

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 21e977f1 of spec repo
1 parent 391561c commit af2d3fe

19 files changed

+1200
-4
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2025-05-06 15:05:59.808713",
8-
"spec_repo_commit": "d0ee626b"
7+
"regenerated": "2025-05-07 07:45:05.864094",
8+
"spec_repo_commit": "21e977f1"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-05-06 15:05:59.824618",
13-
"spec_repo_commit": "d0ee626b"
12+
"regenerated": "2025-05-07 07:45:05.879714",
13+
"spec_repo_commit": "21e977f1"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35847,6 +35847,114 @@ components:
3584735847
description: Link to the Incident created on ServiceNow
3584835848
type: string
3584935849
type: object
35850+
Shift:
35851+
description: The definition of `Shift` object.
35852+
example:
35853+
data:
35854+
attributes:
35855+
end: '2025-05-07T03:53:01.206662873Z'
35856+
start: '2025-05-07T02:53:01.206662814Z'
35857+
id: 00000000-0000-0000-0000-000000000000
35858+
relationships:
35859+
user:
35860+
data:
35861+
id: 00000000-aba1-0000-0000-000000000000
35862+
type: users
35863+
type: shifts
35864+
included:
35865+
- attributes:
35866+
35867+
name: User 1
35868+
status: ''
35869+
id: 00000000-aba1-0000-0000-000000000000
35870+
type: users
35871+
properties:
35872+
data:
35873+
$ref: '#/components/schemas/ShiftData'
35874+
included:
35875+
description: The `Shift` `included`.
35876+
items:
35877+
$ref: '#/components/schemas/ShiftIncluded'
35878+
type: array
35879+
type: object
35880+
ShiftData:
35881+
description: The definition of `ShiftData` object.
35882+
properties:
35883+
attributes:
35884+
$ref: '#/components/schemas/ShiftDataAttributes'
35885+
id:
35886+
description: The `ShiftData` `id`.
35887+
type: string
35888+
relationships:
35889+
$ref: '#/components/schemas/ShiftDataRelationships'
35890+
type:
35891+
$ref: '#/components/schemas/ShiftDataType'
35892+
required:
35893+
- type
35894+
type: object
35895+
ShiftDataAttributes:
35896+
description: The definition of `ShiftDataAttributes` object.
35897+
properties:
35898+
end:
35899+
description: The end time of the shift.
35900+
format: date-time
35901+
type: string
35902+
start:
35903+
description: The start time of the shift.
35904+
format: date-time
35905+
type: string
35906+
type: object
35907+
ShiftDataRelationships:
35908+
description: The definition of `ShiftDataRelationships` object.
35909+
properties:
35910+
user:
35911+
$ref: '#/components/schemas/ShiftDataRelationshipsUser'
35912+
type: object
35913+
ShiftDataRelationshipsUser:
35914+
description: Defines the relationship between a shift and the user who is working
35915+
that shift.
35916+
properties:
35917+
data:
35918+
$ref: '#/components/schemas/ShiftDataRelationshipsUserData'
35919+
required:
35920+
- data
35921+
type: object
35922+
ShiftDataRelationshipsUserData:
35923+
description: Represents a reference to the user assigned to this shift, containing
35924+
the user's ID and resource type.
35925+
properties:
35926+
id:
35927+
description: Specifies the unique identifier of the user.
35928+
example: 00000000-0000-0000-0000-000000000000
35929+
type: string
35930+
type:
35931+
$ref: '#/components/schemas/ShiftDataRelationshipsUserDataType'
35932+
required:
35933+
- type
35934+
- id
35935+
type: object
35936+
ShiftDataRelationshipsUserDataType:
35937+
default: users
35938+
description: Indicates that the related resource is of type 'users'.
35939+
enum:
35940+
- users
35941+
example: users
35942+
type: string
35943+
x-enum-varnames:
35944+
- USERS
35945+
ShiftDataType:
35946+
default: shifts
35947+
description: Indicates that the resource is of type 'shifts'.
35948+
enum:
35949+
- shifts
35950+
example: shifts
35951+
type: string
35952+
x-enum-varnames:
35953+
- SHIFTS
35954+
ShiftIncluded:
35955+
description: The definition of `ShiftIncluded` object.
35956+
oneOf:
35957+
- $ref: '#/components/schemas/ScheduleUser'
3585035958
SingleAggregatedConnectionResponseArray:
3585135959
description: List of aggregated connections.
3585235960
example:
@@ -51464,6 +51572,50 @@ paths:
5146451572
summary: Update on-call schedule
5146551573
tags:
5146651574
- On-Call
51575+
/api/v2/on-call/schedules/{schedule_id}/on-call:
51576+
get:
51577+
description: Retrieves the user who is on call for the specified schedule at
51578+
a given time.
51579+
operationId: GetScheduleOnCallUser
51580+
parameters:
51581+
- description: 'Specifies related resources to include in the response as a
51582+
comma-separated list. Allowed value: `user`.'
51583+
in: query
51584+
name: include
51585+
schema:
51586+
type: string
51587+
- description: The UUID of the schedule
51588+
in: path
51589+
name: schedule_id
51590+
required: true
51591+
schema:
51592+
example: 3653d3c6-0c75-11ea-ad28-fb5701eabc7d
51593+
type: string
51594+
- description: Retrieves the on-call user at the given timestamp (ISO-8601).
51595+
Defaults to the current time if omitted."
51596+
in: query
51597+
name: filter[at_ts]
51598+
schema:
51599+
example: '2025-05-07T02:53:01Z'
51600+
type: string
51601+
responses:
51602+
'200':
51603+
content:
51604+
application/json:
51605+
schema:
51606+
$ref: '#/components/schemas/Shift'
51607+
description: OK
51608+
'204':
51609+
description: No Content
51610+
'429':
51611+
$ref: '#/components/responses/TooManyRequestsResponse'
51612+
security:
51613+
- apiKeyAuth: []
51614+
appKeyAuth: []
51615+
- AuthZ: []
51616+
summary: Get schedule on call user
51617+
tags:
51618+
- On-Call
5146751619
/api/v2/on-call/teams/{team_id}/routing-rules:
5146851620
get:
5146951621
description: Get a team's on-call routing rules
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2025-05-07T05:32:35.193Z

cassettes/features/v2/on-call/Get-schedule-on-call-user-returns-OK-response.yml

Lines changed: 59 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Get schedule on call user returns "OK" response
2+
3+
require "datadog_api_client"
4+
api_instance = DatadogAPIClient::V2::On - CallAPI.new
5+
6+
# there is a valid "schedule" in the system
7+
SCHEDULE_DATA_ID = ENV["SCHEDULE_DATA_ID"]
8+
p api_instance.get_schedule_on_call_user(SCHEDULE_DATA_ID)

features/scenarios_model_mapping.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2071,6 +2071,11 @@
20712071
"schedule_id" => "String",
20722072
"body" => "ScheduleUpdateRequest",
20732073
},
2074+
"v2.GetScheduleOnCallUser" => {
2075+
"include" => "String",
2076+
"schedule_id" => "String",
2077+
"filter_at_ts" => "String",
2078+
},
20742079
"v2.GetOnCallTeamRoutingRules" => {
20752080
"team_id" => "String",
20762081
"include" => "String",

features/v2/on-call.feature

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,22 @@ Feature: On-Call
122122
When the request is sent
123123
Then the response status is 200 OK
124124

125+
@skip @team:DataDog/bugle
126+
Scenario: Get schedule on call user returns "No Content" response
127+
Given new "GetScheduleOnCallUser" request
128+
And there is a valid "schedule" in the system
129+
And request contains "schedule_id" parameter from "schedule.data.id"
130+
When the request is sent
131+
Then the response status is 204 No Content
132+
133+
@team:DataDog/bugle
134+
Scenario: Get schedule on call user returns "OK" response
135+
Given new "GetScheduleOnCallUser" request
136+
And there is a valid "schedule" in the system
137+
And request contains "schedule_id" parameter from "schedule.data.id"
138+
When the request is sent
139+
Then the response status is 200 OK
140+
125141
@skip-python @team:DataDog/bugle
126142
Scenario: Set on-call team routing rules returns "OK" response
127143
Given new "SetOnCallTeamRoutingRules" request

features/v2/undo.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1915,6 +1915,12 @@
19151915
"type": "idempotent"
19161916
}
19171917
},
1918+
"GetScheduleOnCallUser": {
1919+
"tag": "On-Call",
1920+
"undo": {
1921+
"type": "safe"
1922+
}
1923+
},
19181924
"GetOnCallTeamRoutingRules": {
19191925
"tag": "On-Call",
19201926
"undo": {

lib/datadog_api_client/inflector.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3127,6 +3127,15 @@ def overrides
31273127
"v2.service_definition_v2_version" => "ServiceDefinitionV2Version",
31283128
"v2.service_now_ticket" => "ServiceNowTicket",
31293129
"v2.service_now_ticket_result" => "ServiceNowTicketResult",
3130+
"v2.shift" => "Shift",
3131+
"v2.shift_data" => "ShiftData",
3132+
"v2.shift_data_attributes" => "ShiftDataAttributes",
3133+
"v2.shift_data_relationships" => "ShiftDataRelationships",
3134+
"v2.shift_data_relationships_user" => "ShiftDataRelationshipsUser",
3135+
"v2.shift_data_relationships_user_data" => "ShiftDataRelationshipsUserData",
3136+
"v2.shift_data_relationships_user_data_type" => "ShiftDataRelationshipsUserDataType",
3137+
"v2.shift_data_type" => "ShiftDataType",
3138+
"v2.shift_included" => "ShiftIncluded",
31303139
"v2.single_aggregated_connection_response_array" => "SingleAggregatedConnectionResponseArray",
31313140
"v2.single_aggregated_connection_response_data" => "SingleAggregatedConnectionResponseData",
31323141
"v2.single_aggregated_connection_response_data_attributes" => "SingleAggregatedConnectionResponseDataAttributes",

lib/datadog_api_client/v2/api/on_call_api.rb

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,75 @@ def get_on_call_team_routing_rules_with_http_info(team_id, opts = {})
492492
return data, status_code, headers
493493
end
494494

495+
# Get schedule on call user.
496+
#
497+
# @see #get_schedule_on_call_user_with_http_info
498+
def get_schedule_on_call_user(schedule_id, opts = {})
499+
data, _status_code, _headers = get_schedule_on_call_user_with_http_info(schedule_id, opts)
500+
data
501+
end
502+
503+
# Get schedule on call user.
504+
#
505+
# Retrieves the user who is on call for the specified schedule at a given time.
506+
#
507+
# @param schedule_id [String] The UUID of the schedule
508+
# @param opts [Hash] the optional parameters
509+
# @option opts [String] :include Specifies related resources to include in the response as a comma-separated list. Allowed value: `user`.
510+
# @option opts [String] :filter_at_ts Retrieves the on-call user at the given timestamp (ISO-8601). Defaults to the current time if omitted."
511+
# @return [Array<(Shift, Integer, Hash)>] Shift data, response status code and response headers
512+
def get_schedule_on_call_user_with_http_info(schedule_id, opts = {})
513+
514+
if @api_client.config.debugging
515+
@api_client.config.logger.debug 'Calling API: OnCallAPI.get_schedule_on_call_user ...'
516+
end
517+
# verify the required parameter 'schedule_id' is set
518+
if @api_client.config.client_side_validation && schedule_id.nil?
519+
fail ArgumentError, "Missing the required parameter 'schedule_id' when calling OnCallAPI.get_schedule_on_call_user"
520+
end
521+
# resource path
522+
local_var_path = '/api/v2/on-call/schedules/{schedule_id}/on-call'.sub('{schedule_id}', CGI.escape(schedule_id.to_s).gsub('%2F', '/'))
523+
524+
# query parameters
525+
query_params = opts[:query_params] || {}
526+
query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil?
527+
query_params[:'filter[at_ts]'] = opts[:'filter_at_ts'] if !opts[:'filter_at_ts'].nil?
528+
529+
# header parameters
530+
header_params = opts[:header_params] || {}
531+
# HTTP header 'Accept' (if needed)
532+
header_params['Accept'] = @api_client.select_header_accept(['*/*'])
533+
534+
# form parameters
535+
form_params = opts[:form_params] || {}
536+
537+
# http body (model)
538+
post_body = opts[:debug_body]
539+
540+
# return_type
541+
return_type = opts[:debug_return_type] || 'Shift'
542+
543+
# auth_names
544+
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
545+
546+
new_options = opts.merge(
547+
:operation => :get_schedule_on_call_user,
548+
:header_params => header_params,
549+
:query_params => query_params,
550+
:form_params => form_params,
551+
:body => post_body,
552+
:auth_names => auth_names,
553+
:return_type => return_type,
554+
:api_version => "V2"
555+
)
556+
557+
data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
558+
if @api_client.config.debugging
559+
@api_client.config.logger.debug "API called: OnCallAPI#get_schedule_on_call_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
560+
end
561+
return data, status_code, headers
562+
end
563+
495564
# Set on-call team routing rules.
496565
#
497566
# @see #set_on_call_team_routing_rules_with_http_info

0 commit comments

Comments
 (0)