Skip to content

Commit db71121

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit a49529f of spec repo
1 parent 21f6345 commit db71121

22 files changed

+1180
-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+
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+
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+
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).

docs/datadog_api_client.v2.model.rst

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7039,6 +7039,48 @@ datadog\_api\_client.v2.model.downtime\_update\_request\_data module
70397039
:members:
70407040
:show-inheritance:
70417041

7042+
datadog\_api\_client.v2.model.email module
7043+
------------------------------------------
7044+
7045+
.. automodule:: datadog_api_client.v2.model.email
7046+
:members:
7047+
:show-inheritance:
7048+
7049+
datadog\_api\_client.v2.model.email\_attributes module
7050+
------------------------------------------------------
7051+
7052+
.. automodule:: datadog_api_client.v2.model.email_attributes
7053+
:members:
7054+
:show-inheritance:
7055+
7056+
datadog\_api\_client.v2.model.email\_create\_request module
7057+
-----------------------------------------------------------
7058+
7059+
.. automodule:: datadog_api_client.v2.model.email_create_request
7060+
:members:
7061+
:show-inheritance:
7062+
7063+
datadog\_api\_client.v2.model.email\_data module
7064+
------------------------------------------------
7065+
7066+
.. automodule:: datadog_api_client.v2.model.email_data
7067+
:members:
7068+
:show-inheritance:
7069+
7070+
datadog\_api\_client.v2.model.email\_type module
7071+
------------------------------------------------
7072+
7073+
.. automodule:: datadog_api_client.v2.model.email_type
7074+
:members:
7075+
:show-inheritance:
7076+
7077+
datadog\_api\_client.v2.model.email\_update\_request module
7078+
-----------------------------------------------------------
7079+
7080+
.. automodule:: datadog_api_client.v2.model.email_update_request
7081+
:members:
7082+
:show-inheritance:
7083+
70427084
datadog\_api\_client.v2.model.entity\_attributes module
70437085
-------------------------------------------------------
70447086

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
"""
2+
Create an On-Call email for a user returns "Created" response
3+
"""
4+
5+
from os import environ
6+
from datadog_api_client import ApiClient, Configuration
7+
from datadog_api_client.v2.api.on_call_api import OnCallApi
8+
from datadog_api_client.v2.model.email_attributes import EmailAttributes
9+
from datadog_api_client.v2.model.email_create_request import EmailCreateRequest
10+
from datadog_api_client.v2.model.email_data import EmailData
11+
from datadog_api_client.v2.model.email_type import EmailType
12+
13+
# there is a valid "user" in the system
14+
USER_DATA_ID = environ["USER_DATA_ID"]
15+
16+
body = EmailCreateRequest(
17+
data=EmailData(
18+
attributes=EmailAttributes(
19+
active=True,
20+
address="[email protected]",
21+
alias="",
22+
formats=[
23+
"html",
24+
],
25+
),
26+
type=EmailType.EMAILS,
27+
),
28+
)
29+
30+
configuration = Configuration()
31+
with ApiClient(configuration) as api_client:
32+
api_instance = OnCallApi(api_client)
33+
api_instance.create_user_email_notification_channel(user_id=USER_DATA_ID, body=body)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
"""
2+
Delete an On-Call email for a user returns "No Content" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v2.api.on_call_api import OnCallApi
7+
8+
configuration = Configuration()
9+
with ApiClient(configuration) as api_client:
10+
api_instance = OnCallApi(api_client)
11+
api_instance.delete_user_email_notification_channel(
12+
user_id="00000000-0000-0000-0000-000000000000",
13+
email_id="45bb8fe5-dd96-42ad-83de-2241ea9f6ffc",
14+
)
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"""
2+
Get an On-Call email for a user returns "OK" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v2.api.on_call_api import OnCallApi
7+
8+
configuration = Configuration()
9+
with ApiClient(configuration) as api_client:
10+
api_instance = OnCallApi(api_client)
11+
response = api_instance.get_user_email_notification_channel(
12+
user_id="00000000-0000-0000-0000-000000000000",
13+
email_id="45bb8fe5-dd96-42ad-83de-2241ea9f6ffc",
14+
)
15+
16+
print(response)

0 commit comments

Comments
 (0)