Skip to content

Commit 4f7bf30

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit d715d08 of spec repo
1 parent ca2f510 commit 4f7bf30

20 files changed

+1158
-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
@@ -71896,6 +71982,189 @@ paths:
7189671982
operator: AND
7189771983
permissions:
7189871984
- on_call_write
71985+
/api/v2/on-call/users/{user_id}/notification-channels/emails:
71986+
post:
71987+
description: Create a new email notification channel for an on-call user
71988+
operationId: CreateUserEmailNotificationChannel
71989+
parameters:
71990+
- description: The user ID
71991+
in: path
71992+
name: user_id
71993+
required: true
71994+
schema:
71995+
example: 00000000-0000-0000-0000-000000000000
71996+
type: string
71997+
requestBody:
71998+
content:
71999+
application/json:
72000+
schema:
72001+
$ref: '#/components/schemas/EmailCreateRequest'
72002+
required: true
72003+
responses:
72004+
'201':
72005+
description: Created
72006+
'400':
72007+
$ref: '#/components/responses/BadRequestResponse'
72008+
'401':
72009+
$ref: '#/components/responses/UnauthorizedResponse'
72010+
'403':
72011+
$ref: '#/components/responses/ForbiddenResponse'
72012+
'404':
72013+
$ref: '#/components/responses/NotFoundResponse'
72014+
'429':
72015+
$ref: '#/components/responses/TooManyRequestsResponse'
72016+
security:
72017+
- apiKeyAuth: []
72018+
appKeyAuth: []
72019+
- AuthZ: []
72020+
summary: Create an On-Call email for a user
72021+
tags:
72022+
- On-Call
72023+
x-permission:
72024+
operator: AND
72025+
permissions:
72026+
- on_call_admin
72027+
/api/v2/on-call/users/{user_id}/notification-channels/emails/{email_id}:
72028+
delete:
72029+
description: Delete an email notification channel for an on-call user
72030+
operationId: DeleteUserEmailNotificationChannel
72031+
parameters:
72032+
- description: The user ID
72033+
in: path
72034+
name: user_id
72035+
required: true
72036+
schema:
72037+
example: 00000000-0000-0000-0000-000000000000
72038+
type: string
72039+
- description: The email ID
72040+
in: path
72041+
name: email_id
72042+
required: true
72043+
schema:
72044+
example: 45bb8fe5-dd96-42ad-83de-2241ea9f6ffc
72045+
type: string
72046+
responses:
72047+
'204':
72048+
description: No Content
72049+
'400':
72050+
$ref: '#/components/responses/BadRequestResponse'
72051+
'401':
72052+
$ref: '#/components/responses/UnauthorizedResponse'
72053+
'403':
72054+
$ref: '#/components/responses/ForbiddenResponse'
72055+
'404':
72056+
$ref: '#/components/responses/NotFoundResponse'
72057+
'429':
72058+
$ref: '#/components/responses/TooManyRequestsResponse'
72059+
security:
72060+
- apiKeyAuth: []
72061+
appKeyAuth: []
72062+
- AuthZ: []
72063+
summary: Delete an On-Call email for a user
72064+
tags:
72065+
- On-Call
72066+
x-permission:
72067+
operator: AND
72068+
permissions:
72069+
- on_call_admin
72070+
get:
72071+
description: Get an email notification channel for an on-call user
72072+
operationId: GetUserEmailNotificationChannel
72073+
parameters:
72074+
- description: The user ID
72075+
in: path
72076+
name: user_id
72077+
required: true
72078+
schema:
72079+
example: 00000000-0000-0000-0000-000000000000
72080+
type: string
72081+
- description: The email ID
72082+
in: path
72083+
name: email_id
72084+
required: true
72085+
schema:
72086+
example: 45bb8fe5-dd96-42ad-83de-2241ea9f6ffc
72087+
type: string
72088+
responses:
72089+
'200':
72090+
content:
72091+
application/json:
72092+
schema:
72093+
$ref: '#/components/schemas/Email'
72094+
description: OK
72095+
'400':
72096+
$ref: '#/components/responses/BadRequestResponse'
72097+
'401':
72098+
$ref: '#/components/responses/UnauthorizedResponse'
72099+
'403':
72100+
$ref: '#/components/responses/ForbiddenResponse'
72101+
'404':
72102+
$ref: '#/components/responses/NotFoundResponse'
72103+
'429':
72104+
$ref: '#/components/responses/TooManyRequestsResponse'
72105+
security:
72106+
- apiKeyAuth: []
72107+
appKeyAuth: []
72108+
- AuthZ: []
72109+
summary: Get an On-Call email for a user
72110+
tags:
72111+
- On-Call
72112+
x-permission:
72113+
operator: AND
72114+
permissions:
72115+
- on_call_admin
72116+
put:
72117+
description: Update an email notification channel for an on-call user
72118+
operationId: UpdateUserEmailNotificationChannel
72119+
parameters:
72120+
- description: The user ID
72121+
in: path
72122+
name: user_id
72123+
required: true
72124+
schema:
72125+
example: 00000000-0000-0000-0000-000000000000
72126+
type: string
72127+
- description: The email ID
72128+
in: path
72129+
name: email_id
72130+
required: true
72131+
schema:
72132+
example: 45bb8fe5-dd96-42ad-83de-2241ea9f6ffc
72133+
type: string
72134+
requestBody:
72135+
content:
72136+
application/json:
72137+
schema:
72138+
$ref: '#/components/schemas/EmailUpdateRequest'
72139+
required: true
72140+
responses:
72141+
'200':
72142+
content:
72143+
application/json:
72144+
schema:
72145+
$ref: '#/components/schemas/Email'
72146+
description: OK
72147+
'400':
72148+
$ref: '#/components/responses/BadRequestResponse'
72149+
'401':
72150+
$ref: '#/components/responses/UnauthorizedResponse'
72151+
'403':
72152+
$ref: '#/components/responses/ForbiddenResponse'
72153+
'404':
72154+
$ref: '#/components/responses/NotFoundResponse'
72155+
'429':
72156+
$ref: '#/components/responses/TooManyRequestsResponse'
72157+
security:
72158+
- apiKeyAuth: []
72159+
appKeyAuth: []
72160+
- AuthZ: []
72161+
summary: Update an On-Call email for a user
72162+
tags:
72163+
- On-Call
72164+
x-permission:
72165+
operator: AND
72166+
permissions:
72167+
- on_call_admin
7189972168
/api/v2/org_configs:
7190072169
get:
7190172170
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)