Skip to content
Open
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
10 changes: 9 additions & 1 deletion .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72918,9 +72918,13 @@ paths:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ: []
summary: Get the schedule on-call user
summary: Get the scheduled on-call user
tags:
- On-Call
x-permission:
operator: AND
permissions:
- on_call_read
/api/v2/on-call/teams/{team_id}/on-call:
get:
description: Get a team's on-call users at a given time
Expand Down Expand Up @@ -72963,6 +72967,10 @@ paths:
summary: Get team on-call users
tags:
- On-Call
x-permission:
operator: AND
permissions:
- on_call_read
/api/v2/on-call/teams/{team_id}/routing-rules:
get:
description: Get a team's On-Call routing rules
Expand Down
7 changes: 2 additions & 5 deletions examples/v2/on-call/GetScheduleOnCallUser.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Get the schedule on-call user returns "OK" response
// Get the scheduled on-call user returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
Expand All @@ -10,11 +10,8 @@ public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
OnCallApi apiInstance = new OnCallApi(defaultClient);

// there is a valid "schedule" in the system
String SCHEDULE_DATA_ID = System.getenv("SCHEDULE_DATA_ID");

try {
Shift result = apiInstance.getScheduleOnCallUser(SCHEDULE_DATA_ID);
Shift result = apiInstance.getScheduleOnCallUser("3653d3c6-0c75-11ea-ad28-fb5701eabc7d");
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling OnCallApi#getScheduleOnCallUser");
Expand Down
27 changes: 27 additions & 0 deletions examples/v2/on-call/GetScheduleOnCallUser_3672445524.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Get the schedule on-call user returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.OnCallApi;
import com.datadog.api.client.v2.model.Shift;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
OnCallApi apiInstance = new OnCallApi(defaultClient);

// there is a valid "schedule" in the system
String SCHEDULE_DATA_ID = System.getenv("SCHEDULE_DATA_ID");

try {
Shift result = apiInstance.getScheduleOnCallUser(SCHEDULE_DATA_ID);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling OnCallApi#getScheduleOnCallUser");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
10 changes: 5 additions & 5 deletions src/main/java/com/datadog/api/client/v2/api/OnCallApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -1358,7 +1358,7 @@ public GetScheduleOnCallUserOptionalParameters filterAtTs(String filterAtTs) {
}

/**
* Get the schedule on-call user.
* Get the scheduled on-call user.
*
* <p>See {@link #getScheduleOnCallUserWithHttpInfo}.
*
Expand All @@ -1373,7 +1373,7 @@ scheduleId, new GetScheduleOnCallUserOptionalParameters())
}

/**
* Get the schedule on-call user.
* Get the scheduled on-call user.
*
* <p>See {@link #getScheduleOnCallUserWithHttpInfoAsync}.
*
Expand All @@ -1390,7 +1390,7 @@ scheduleId, new GetScheduleOnCallUserOptionalParameters())
}

/**
* Get the schedule on-call user.
* Get the scheduled on-call user.
*
* <p>See {@link #getScheduleOnCallUserWithHttpInfo}.
*
Expand All @@ -1405,7 +1405,7 @@ public Shift getScheduleOnCallUser(
}

/**
* Get the schedule on-call user.
* Get the scheduled on-call user.
*
* <p>See {@link #getScheduleOnCallUserWithHttpInfoAsync}.
*
Expand Down Expand Up @@ -1485,7 +1485,7 @@ public ApiResponse<Shift> getScheduleOnCallUserWithHttpInfo(
}

/**
* Get the schedule on-call user.
* Get the scheduled on-call user.
*
* <p>See {@link #getScheduleOnCallUserWithHttpInfo}.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,26 +153,33 @@ Feature: On-Call
When the request is sent
Then the response status is 200 OK

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

@generated @skip @team:DataDog/on-call
Scenario: Get the schedule on-call user returns "Bad Request" response
Scenario: Get the scheduled on-call user returns "Bad Request" response
Given new "GetScheduleOnCallUser" 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 the schedule on-call user returns "Not Found" response
Scenario: Get the scheduled on-call user returns "Not Found" response
Given new "GetScheduleOnCallUser" 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 the schedule on-call user returns "OK" response
@generated @skip @team:DataDog/on-call
Scenario: Get the scheduled on-call user returns "OK" response
Given new "GetScheduleOnCallUser" request
And there is a valid "user" in the system
And there is a valid "schedule" in the system
And request contains "schedule_id" parameter from "schedule.data.id"
And request contains "schedule_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 200 OK

Expand Down
Loading