Skip to content

Commit 8407c22

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit a49529f of spec repo
1 parent 2dd9810 commit 8407c22

20 files changed

+2311
-0
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 269 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17295,6 +17295,92 @@ components:
1729517295
- score
1729617296
- severity
1729717297
type: object
17298+
Email:
17299+
description: On-Call User Email.
17300+
example:
17301+
data:
17302+
attributes:
17303+
active: true
17304+
address: john.doe@datadoghq.com
17305+
alias: ''
17306+
formats:
17307+
- html
17308+
id: 45cd9fe5-dd96-42ad-83de-2242ea9f6efd
17309+
type: emails
17310+
properties:
17311+
data:
17312+
$ref: '#/components/schemas/EmailData'
17313+
type: object
17314+
EmailAttributes:
17315+
description: Attributes for an on-call email.
17316+
properties:
17317+
active:
17318+
description: Whether the email is currently active.
17319+
type: boolean
17320+
address:
17321+
description: Email address.
17322+
type: string
17323+
alias:
17324+
description: Optional display alias for the email.
17325+
type: string
17326+
formats:
17327+
description: Preferred content formats for notifications.
17328+
items:
17329+
type: string
17330+
type: array
17331+
type: object
17332+
EmailCreateRequest:
17333+
description: Request body for creating an On-Call email notification channel.
17334+
example:
17335+
data:
17336+
attributes:
17337+
active: true
17338+
address: john.doe@datadoghq.com
17339+
alias: ''
17340+
formats:
17341+
- html
17342+
type: emails
17343+
properties:
17344+
data:
17345+
$ref: '#/components/schemas/EmailData'
17346+
type: object
17347+
EmailData:
17348+
description: Data for an on-call email resource.
17349+
properties:
17350+
attributes:
17351+
$ref: '#/components/schemas/EmailAttributes'
17352+
id:
17353+
description: The email's unique identifier.
17354+
type: string
17355+
type:
17356+
$ref: '#/components/schemas/EmailType'
17357+
required:
17358+
- type
17359+
type: object
17360+
EmailType:
17361+
default: emails
17362+
description: Indicates that the resource is of type 'emails'.
17363+
enum:
17364+
- emails
17365+
example: emails
17366+
type: string
17367+
x-enum-varnames:
17368+
- EMAILS
17369+
EmailUpdateRequest:
17370+
description: Request body for updating an On-Call email notification channel.
17371+
example:
17372+
data:
17373+
attributes:
17374+
active: true
17375+
address: john.doe@datadoghq.com
17376+
alias: ''
17377+
formats:
17378+
- html
17379+
type: emails
17380+
properties:
17381+
data:
17382+
$ref: '#/components/schemas/EmailData'
17383+
type: object
1729817384
Enabled:
1729917385
description: Field used to enable or disable the rule.
1730017386
example: true
@@ -71902,6 +71988,189 @@ paths:
7190271988
operator: AND
7190371989
permissions:
7190471990
- on_call_write
71991+
/api/v2/on-call/users/{user_id}/notification-channels/emails:
71992+
post:
71993+
description: Create a new email notification channel for an on-call user
71994+
operationId: CreateUserEmailNotificationChannel
71995+
parameters:
71996+
- description: The user ID
71997+
in: path
71998+
name: user_id
71999+
required: true
72000+
schema:
72001+
example: 00000000-0000-0000-0000-000000000000
72002+
type: string
72003+
requestBody:
72004+
content:
72005+
application/json:
72006+
schema:
72007+
$ref: '#/components/schemas/EmailCreateRequest'
72008+
required: true
72009+
responses:
72010+
'201':
72011+
description: Created
72012+
'400':
72013+
$ref: '#/components/responses/BadRequestResponse'
72014+
'401':
72015+
$ref: '#/components/responses/UnauthorizedResponse'
72016+
'403':
72017+
$ref: '#/components/responses/ForbiddenResponse'
72018+
'404':
72019+
$ref: '#/components/responses/NotFoundResponse'
72020+
'429':
72021+
$ref: '#/components/responses/TooManyRequestsResponse'
72022+
security:
72023+
- apiKeyAuth: []
72024+
appKeyAuth: []
72025+
- AuthZ: []
72026+
summary: Create an On-Call email for a user
72027+
tags:
72028+
- On-Call
72029+
x-permission:
72030+
operator: AND
72031+
permissions:
72032+
- on_call_admin
72033+
/api/v2/on-call/users/{user_id}/notification-channels/emails/{email_id}:
72034+
delete:
72035+
description: Delete an email notification channel for an on-call user
72036+
operationId: DeleteUserEmailNotificationChannel
72037+
parameters:
72038+
- description: The user ID
72039+
in: path
72040+
name: user_id
72041+
required: true
72042+
schema:
72043+
example: 00000000-0000-0000-0000-000000000000
72044+
type: string
72045+
- description: The email ID
72046+
in: path
72047+
name: email_id
72048+
required: true
72049+
schema:
72050+
example: 45bb8fe5-dd96-42ad-83de-2241ea9f6ffc
72051+
type: string
72052+
responses:
72053+
'204':
72054+
description: No Content
72055+
'400':
72056+
$ref: '#/components/responses/BadRequestResponse'
72057+
'401':
72058+
$ref: '#/components/responses/UnauthorizedResponse'
72059+
'403':
72060+
$ref: '#/components/responses/ForbiddenResponse'
72061+
'404':
72062+
$ref: '#/components/responses/NotFoundResponse'
72063+
'429':
72064+
$ref: '#/components/responses/TooManyRequestsResponse'
72065+
security:
72066+
- apiKeyAuth: []
72067+
appKeyAuth: []
72068+
- AuthZ: []
72069+
summary: Delete an On-Call email for a user
72070+
tags:
72071+
- On-Call
72072+
x-permission:
72073+
operator: AND
72074+
permissions:
72075+
- on_call_admin
72076+
get:
72077+
description: Get an email notification channel for an on-call user
72078+
operationId: GetUserEmailNotificationChannel
72079+
parameters:
72080+
- description: The user ID
72081+
in: path
72082+
name: user_id
72083+
required: true
72084+
schema:
72085+
example: 00000000-0000-0000-0000-000000000000
72086+
type: string
72087+
- description: The email ID
72088+
in: path
72089+
name: email_id
72090+
required: true
72091+
schema:
72092+
example: 45bb8fe5-dd96-42ad-83de-2241ea9f6ffc
72093+
type: string
72094+
responses:
72095+
'200':
72096+
content:
72097+
application/json:
72098+
schema:
72099+
$ref: '#/components/schemas/Email'
72100+
description: OK
72101+
'400':
72102+
$ref: '#/components/responses/BadRequestResponse'
72103+
'401':
72104+
$ref: '#/components/responses/UnauthorizedResponse'
72105+
'403':
72106+
$ref: '#/components/responses/ForbiddenResponse'
72107+
'404':
72108+
$ref: '#/components/responses/NotFoundResponse'
72109+
'429':
72110+
$ref: '#/components/responses/TooManyRequestsResponse'
72111+
security:
72112+
- apiKeyAuth: []
72113+
appKeyAuth: []
72114+
- AuthZ: []
72115+
summary: Get an On-Call email for a user
72116+
tags:
72117+
- On-Call
72118+
x-permission:
72119+
operator: AND
72120+
permissions:
72121+
- on_call_admin
72122+
put:
72123+
description: Update an email notification channel for an on-call user
72124+
operationId: UpdateUserEmailNotificationChannel
72125+
parameters:
72126+
- description: The user ID
72127+
in: path
72128+
name: user_id
72129+
required: true
72130+
schema:
72131+
example: 00000000-0000-0000-0000-000000000000
72132+
type: string
72133+
- description: The email ID
72134+
in: path
72135+
name: email_id
72136+
required: true
72137+
schema:
72138+
example: 45bb8fe5-dd96-42ad-83de-2241ea9f6ffc
72139+
type: string
72140+
requestBody:
72141+
content:
72142+
application/json:
72143+
schema:
72144+
$ref: '#/components/schemas/EmailUpdateRequest'
72145+
required: true
72146+
responses:
72147+
'200':
72148+
content:
72149+
application/json:
72150+
schema:
72151+
$ref: '#/components/schemas/Email'
72152+
description: OK
72153+
'400':
72154+
$ref: '#/components/responses/BadRequestResponse'
72155+
'401':
72156+
$ref: '#/components/responses/UnauthorizedResponse'
72157+
'403':
72158+
$ref: '#/components/responses/ForbiddenResponse'
72159+
'404':
72160+
$ref: '#/components/responses/NotFoundResponse'
72161+
'429':
72162+
$ref: '#/components/responses/TooManyRequestsResponse'
72163+
security:
72164+
- apiKeyAuth: []
72165+
appKeyAuth: []
72166+
- AuthZ: []
72167+
summary: Update an On-Call email for a user
72168+
tags:
72169+
- On-Call
72170+
x-permission:
72171+
operator: AND
72172+
permissions:
72173+
- on_call_admin
7190572174
/api/v2/org_configs:
7190672175
get:
7190772176
description: Returns all Org Configs (name, description, and value).
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// Create an On-Call email for a user returns "Created" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.OnCallApi;
6+
import com.datadog.api.client.v2.model.EmailAttributes;
7+
import com.datadog.api.client.v2.model.EmailCreateRequest;
8+
import com.datadog.api.client.v2.model.EmailData;
9+
import com.datadog.api.client.v2.model.EmailType;
10+
import java.util.Collections;
11+
12+
public class Example {
13+
public static void main(String[] args) {
14+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
15+
OnCallApi apiInstance = new OnCallApi(defaultClient);
16+
17+
// there is a valid "user" in the system
18+
String USER_DATA_ID = System.getenv("USER_DATA_ID");
19+
20+
EmailCreateRequest body =
21+
new EmailCreateRequest()
22+
.data(
23+
new EmailData()
24+
.attributes(
25+
new EmailAttributes()
26+
.active(true)
27+
.address("john.doe@datadoghq.com")
28+
.alias("")
29+
.formats(Collections.singletonList("html")))
30+
.type(EmailType.EMAILS));
31+
32+
try {
33+
apiInstance.createUserEmailNotificationChannel(USER_DATA_ID, body);
34+
} catch (ApiException e) {
35+
System.err.println("Exception when calling OnCallApi#createUserEmailNotificationChannel");
36+
System.err.println("Status code: " + e.getCode());
37+
System.err.println("Reason: " + e.getResponseBody());
38+
System.err.println("Response headers: " + e.getResponseHeaders());
39+
e.printStackTrace();
40+
}
41+
}
42+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Delete an On-Call email for a user returns "No Content" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.OnCallApi;
6+
7+
public class Example {
8+
public static void main(String[] args) {
9+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
10+
OnCallApi apiInstance = new OnCallApi(defaultClient);
11+
12+
try {
13+
apiInstance.deleteUserEmailNotificationChannel(
14+
"00000000-0000-0000-0000-000000000000", "45bb8fe5-dd96-42ad-83de-2241ea9f6ffc");
15+
} catch (ApiException e) {
16+
System.err.println("Exception when calling OnCallApi#deleteUserEmailNotificationChannel");
17+
System.err.println("Status code: " + e.getCode());
18+
System.err.println("Reason: " + e.getResponseBody());
19+
System.err.println("Response headers: " + e.getResponseHeaders());
20+
e.printStackTrace();
21+
}
22+
}
23+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Get an On-Call email for a user returns "OK" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.OnCallApi;
6+
import com.datadog.api.client.v2.model.Email;
7+
8+
public class Example {
9+
public static void main(String[] args) {
10+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
11+
OnCallApi apiInstance = new OnCallApi(defaultClient);
12+
13+
try {
14+
Email result =
15+
apiInstance.getUserEmailNotificationChannel(
16+
"00000000-0000-0000-0000-000000000000", "45bb8fe5-dd96-42ad-83de-2241ea9f6ffc");
17+
System.out.println(result);
18+
} catch (ApiException e) {
19+
System.err.println("Exception when calling OnCallApi#getUserEmailNotificationChannel");
20+
System.err.println("Status code: " + e.getCode());
21+
System.err.println("Reason: " + e.getResponseBody());
22+
System.err.println("Response headers: " + e.getResponseHeaders());
23+
e.printStackTrace();
24+
}
25+
}
26+
}

0 commit comments

Comments
 (0)