Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
344 changes: 343 additions & 1 deletion .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2026-07-10T09:31:37.503Z

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions examples/v2/on-call/GetScheduleOnCallResponders.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Get on-call responders 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.get_schedule_on_call_responders(SCHEDULE_DATA_ID)
6 changes: 6 additions & 0 deletions features/scenarios_model_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4494,6 +4494,12 @@
"schedule_id" => "String",
"filter_at_ts" => "String",
},
"v2.GetScheduleOnCallResponders" => {
"include" => "String",
"schedule_id" => "String",
"filter_position" => "String",
"filter_at_ts" => "String",
},
"v2.GetTeamOnCallUsers" => {
"include" => "String",
"team_id" => "String",
Expand Down
23 changes: 23 additions & 0 deletions features/v2/on-call.feature
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,29 @@ Feature: On-Call
And the response "data.attributes.category" is equal to "high_urgency"
And the response "included" has length 1

@generated @skip @team:DataDog/on-call
Scenario: Get on-call responders for a schedule returns "Bad Request" response
Given new "GetScheduleOnCallResponders" request
And request contains "schedule_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/on-call
Scenario: Get on-call responders for a schedule returns "Not Found" response
Given new "GetScheduleOnCallResponders" request
And request contains "schedule_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found

@team:DataDog/on-call
Scenario: Get on-call responders for a schedule returns "OK" response
Given new "GetScheduleOnCallResponders" request
And there is a valid "user" in the system
And there is a valid "schedule" in the system
And request contains "schedule_id" parameter from "schedule.data.id"
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/on-call
Scenario: Get scheduled on-call user returns "Bad Request" response
Given new "GetScheduleOnCallUser" request
Expand Down
32 changes: 32 additions & 0 deletions features/v2/reference_tables.feature
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,14 @@ Feature: Reference Tables
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/redapl-experiences
Scenario: Delete rows returns "Conflict" response
Given new "DeleteRows" request
And request contains "id" parameter from "REPLACE.ME"
And body with value {"data": [{"id": "primary_key_value", "type": "row"}]}
When the request is sent
Then the response status is 409 Conflict

@generated @skip @team:DataDog/redapl-experiences
Scenario: Delete rows returns "Not Found" response
Given new "DeleteRows" request
Expand All @@ -90,6 +98,14 @@ Feature: Reference Tables
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/redapl-experiences
Scenario: Delete rows returns "Precondition Failed" response
Given new "DeleteRows" request
And request contains "id" parameter from "REPLACE.ME"
And body with value {"data": [{"id": "primary_key_value", "type": "row"}]}
When the request is sent
Then the response status is 412 Precondition Failed

@generated @skip @team:DataDog/redapl-experiences
Scenario: Delete rows returns "Rows deleted successfully" response
Given new "DeleteRows" request
Expand Down Expand Up @@ -208,6 +224,14 @@ Feature: Reference Tables
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/redapl-experiences
Scenario: Upsert rows returns "Conflict" response
Given new "UpsertRows" request
And request contains "id" parameter from "REPLACE.ME"
And body with value {"data": [{"attributes": {"values": {}}, "id": "primary_key_value", "type": "row"}]}
When the request is sent
Then the response status is 409 Conflict

@generated @skip @team:DataDog/redapl-experiences
Scenario: Upsert rows returns "Not Found" response
Given new "UpsertRows" request
Expand All @@ -216,6 +240,14 @@ Feature: Reference Tables
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/redapl-experiences
Scenario: Upsert rows returns "Precondition Failed" response
Given new "UpsertRows" request
And request contains "id" parameter from "REPLACE.ME"
And body with value {"data": [{"attributes": {"values": {}}, "id": "primary_key_value", "type": "row"}]}
When the request is sent
Then the response status is 412 Precondition Failed

@generated @skip @team:DataDog/redapl-experiences
Scenario: Upsert rows returns "Rows created or updated successfully" response
Given new "UpsertRows" request
Expand Down
6 changes: 6 additions & 0 deletions features/v2/undo.json
Original file line number Diff line number Diff line change
Expand Up @@ -5618,6 +5618,12 @@
"type": "safe"
}
},
"GetScheduleOnCallResponders": {
"tag": "On-Call",
"undo": {
"type": "safe"
}
},
"GetTeamOnCallUsers": {
"tag": "On-Call",
"undo": {
Expand Down
19 changes: 19 additions & 0 deletions lib/datadog_api_client/inflector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6349,6 +6349,25 @@ def overrides
"v2.schedule_member_relationships_user_data" => "ScheduleMemberRelationshipsUserData",
"v2.schedule_member_relationships_user_data_type" => "ScheduleMemberRelationshipsUserDataType",
"v2.schedule_member_type" => "ScheduleMemberType",
"v2.schedule_on_call_responder_data" => "ScheduleOnCallResponderData",
"v2.schedule_on_call_responder_data_attributes" => "ScheduleOnCallResponderDataAttributes",
"v2.schedule_on_call_responder_data_relationships" => "ScheduleOnCallResponderDataRelationships",
"v2.schedule_on_call_responder_data_relationships_shifts" => "ScheduleOnCallResponderDataRelationshipsShifts",
"v2.schedule_on_call_responder_data_relationships_shifts_data_items" => "ScheduleOnCallResponderDataRelationshipsShiftsDataItems",
"v2.schedule_on_call_responder_data_relationships_shifts_data_items_type" => "ScheduleOnCallResponderDataRelationshipsShiftsDataItemsType",
"v2.schedule_on_call_responder_data_type" => "ScheduleOnCallResponderDataType",
"v2.schedule_on_call_responders" => "ScheduleOnCallResponders",
"v2.schedule_on_call_responders_data" => "ScheduleOnCallRespondersData",
"v2.schedule_on_call_responders_data_attributes" => "ScheduleOnCallRespondersDataAttributes",
"v2.schedule_on_call_responders_data_relationships" => "ScheduleOnCallRespondersDataRelationships",
"v2.schedule_on_call_responders_data_relationships_responders" => "ScheduleOnCallRespondersDataRelationshipsResponders",
"v2.schedule_on_call_responders_data_relationships_responders_data_items" => "ScheduleOnCallRespondersDataRelationshipsRespondersDataItems",
"v2.schedule_on_call_responders_data_relationships_responders_data_items_type" => "ScheduleOnCallRespondersDataRelationshipsRespondersDataItemsType",
"v2.schedule_on_call_responders_data_relationships_schedule" => "ScheduleOnCallRespondersDataRelationshipsSchedule",
"v2.schedule_on_call_responders_data_relationships_schedule_data" => "ScheduleOnCallRespondersDataRelationshipsScheduleData",
"v2.schedule_on_call_responders_data_relationships_schedule_data_type" => "ScheduleOnCallRespondersDataRelationshipsScheduleDataType",
"v2.schedule_on_call_responders_data_type" => "ScheduleOnCallRespondersDataType",
"v2.schedule_on_call_responders_included" => "ScheduleOnCallRespondersIncluded",
"v2.schedule_request_data_attributes_layers_items_members_items" => "ScheduleRequestDataAttributesLayersItemsMembersItems",
"v2.schedule_request_data_attributes_layers_items_members_items_user" => "ScheduleRequestDataAttributesLayersItemsMembersItemsUser",
"v2.schedule_target" => "ScheduleTarget",
Expand Down
76 changes: 75 additions & 1 deletion lib/datadog_api_client/v2/api/on_call_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -776,6 +776,77 @@ def get_on_call_team_routing_rules_with_http_info(team_id, opts = {})
return data, status_code, headers
end

# Get on-call responders for a schedule.
#
# @see #get_schedule_on_call_responders_with_http_info
def get_schedule_on_call_responders(schedule_id, opts = {})
data, _status_code, _headers = get_schedule_on_call_responders_with_http_info(schedule_id, opts)
data
end

# Get on-call responders for a schedule.
#
# Retrieves the on-call responders for the specified schedule, grouped by position (previous, current, next), at a given time. Supports schedules with multiple concurrent on-call responders at a position, by returning a list of shifts per position.
#
# @param schedule_id [String] The ID of the schedule.
# @param opts [Hash] the optional parameters
# @option opts [String] :include Comma-separated list of included relationships to be returned. Allowed values: `schedule`, `responders`, `responders.shifts`, `responders.shifts.user`.
# @option opts [String] :filter_position Comma-separated list of positions to retrieve. Allowed values: `previous`, `current`, `next`. Defaults to `current` if omitted.
# @option opts [String] :filter_at_ts Retrieves the on-call responders at the given timestamp in RFC3339 format (for example, `2025-05-07T02:53:01Z` or `2025-05-07T02:53:01+00:00`). When using timezone offsets with `+` or `-`, ensure proper URL encoding (`+` should be encoded as `%2B`). Defaults to the current time if omitted.
# @return [Array<(ScheduleOnCallResponders, Integer, Hash)>] ScheduleOnCallResponders data, response status code and response headers
def get_schedule_on_call_responders_with_http_info(schedule_id, opts = {})

if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: OnCallAPI.get_schedule_on_call_responders ...'
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.get_schedule_on_call_responders"
end
# resource path
local_var_path = '/api/v2/on-call/schedules/{schedule_id}/responders'.sub('{schedule_id}', CGI.escape(schedule_id.to_s).gsub('%2F', '/'))

# query parameters
query_params = opts[:query_params] || {}
query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil?
query_params[:'filter[position]'] = opts[:'filter_position'] if !opts[:'filter_position'].nil?
query_params[:'filter[at_ts]'] = opts[:'filter_at_ts'] if !opts[:'filter_at_ts'].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] || 'ScheduleOnCallResponders'

# auth_names
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

new_options = opts.merge(
:operation => :get_schedule_on_call_responders,
: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#get_schedule_on_call_responders\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end

# Get scheduled on-call user.
#
# @see #get_schedule_on_call_user_with_http_info
Expand All @@ -786,14 +857,17 @@ def get_schedule_on_call_user(schedule_id, opts = {})

# Get scheduled on-call user.
#
# Retrieves the user who is on-call for the specified schedule at a given time.
# Retrieves the user who is on-call for the specified schedule at a given time. This endpoint does not support schedules with multiple concurrent on-call responders at a position. Deprecated. Use `Get on-call responders for a schedule` instead.
#
# @deprecated This API is deprecated.
#
# @param schedule_id [String] The ID of the schedule.
# @param opts [Hash] the optional parameters
# @option opts [String] :include Specifies related resources to include in the response as a comma-separated list. Allowed value: `user`.
# @option opts [String] :filter_at_ts Retrieves the on-call user at the given timestamp in RFC3339 format (for example, `2025-05-07T02:53:01Z` or `2025-05-07T02:53:01+00:00`). When using timezone offsets with `+` or `-`, ensure proper URL encoding (`+` should be encoded as `%2B`). Defaults to the current time if omitted.
# @return [Array<(Shift, Integer, Hash)>] Shift data, response status code and response headers
def get_schedule_on_call_user_with_http_info(schedule_id, opts = {})
warn "[DEPRECATION] `GetScheduleOnCallUser` is deprecated."

if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: OnCallAPI.get_schedule_on_call_user ...'
Expand Down
Loading
Loading