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
253 changes: 253 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17289,6 +17289,76 @@ components:
- score
- severity
type: object
Email:
description: On-Call User Email.
example:
data:
attributes:
active: true
address: [email protected]
alias: ''
blocked: false
created_at: '2024-04-16T23:38:50.388642Z'
formats:
- html
modified_at: '2024-04-16T23:38:50.388642Z'
id: 45cd9fe5-dd96-42ad-83de-2242ea9f6efd
type: emails
properties:
data:
$ref: '#/components/schemas/EmailData'
type: object
EmailAttributes:
description: Attributes for an on-call email.
properties:
active:
description: Whether the email is currently active.
type: boolean
address:
description: Email address.
type: string
alias:
description: Optional display alias for the email.
type: string
blocked:
description: Whether the email is blocked.
type: boolean
created_at:
description: Creation time of the email resource.
format: date-time
type: string
formats:
description: Preferred content formats for notifications.
items:
type: string
type: array
modified_at:
description: Last modification time of the email resource.
format: date-time
type: string
type: object
EmailData:
description: Data for an on-call email resource.
properties:
attributes:
$ref: '#/components/schemas/EmailAttributes'
id:
description: The email's unique identifier.
type: string
type:
$ref: '#/components/schemas/EmailType'
required:
- type
type: object
EmailType:
default: emails
description: Indicates that the resource is of type 'emails'.
enum:
- emails
example: emails
type: string
x-enum-varnames:
- EMAILS
Enabled:
description: Field used to enable or disable the rule.
example: true
Expand Down Expand Up @@ -70837,6 +70907,189 @@ paths:
operator: AND
permissions:
- on_call_write
/api/v2/on-call/users/{user_id}/notification-channels/emails:
post:
description: Create a new email notification channel for an on-call user
operationId: CreateUserEmailNotificationChannel
parameters:
- description: The user ID
in: path
name: user_id
required: true
schema:
example: 00000000-0000-0000-0000-000000000000
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Email'
required: true
responses:
'201':
description: Created
'400':
$ref: '#/components/responses/BadRequestResponse'
'401':
$ref: '#/components/responses/UnauthorizedResponse'
'403':
$ref: '#/components/responses/ForbiddenResponse'
'404':
$ref: '#/components/responses/NotFoundResponse'
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ: []
summary: Create email notification channel for user
tags:
- On-Call
x-permission:
operator: AND
permissions:
- on_call_admin
/api/v2/on-call/users/{user_id}/notification-channels/emails/{email_id}:
delete:
description: Delete an email notification channel for an on-call user
operationId: DeleteUserEmailNotificationChannel
parameters:
- description: The user ID
in: path
name: user_id
required: true
schema:
example: 00000000-0000-0000-0000-000000000000
type: string
- description: The email ID
in: path
name: email_id
required: true
schema:
example: 45bb8fe5-dd96-42ad-83de-2241ea9f6ffc
type: string
responses:
'204':
description: No Content
'400':
$ref: '#/components/responses/BadRequestResponse'
'401':
$ref: '#/components/responses/UnauthorizedResponse'
'403':
$ref: '#/components/responses/ForbiddenResponse'
'404':
$ref: '#/components/responses/NotFoundResponse'
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ: []
summary: Delete email notification channel
tags:
- On-Call
x-permission:
operator: AND
permissions:
- on_call_admin
get:
description: Get an email notification channel for an on-call user
operationId: GetUserEmailNotificationChannel
parameters:
- description: The user ID
in: path
name: user_id
required: true
schema:
example: 00000000-0000-0000-0000-000000000000
type: string
- description: The email ID
in: path
name: email_id
required: true
schema:
example: 45bb8fe5-dd96-42ad-83de-2241ea9f6ffc
type: string
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/Email'
description: OK
'400':
$ref: '#/components/responses/BadRequestResponse'
'401':
$ref: '#/components/responses/UnauthorizedResponse'
'403':
$ref: '#/components/responses/ForbiddenResponse'
'404':
$ref: '#/components/responses/NotFoundResponse'
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ: []
summary: Get email notification channel
tags:
- On-Call
x-permission:
operator: AND
permissions:
- on_call_admin
put:
description: Update an email notification channel for an on-call user
operationId: UpdateUserEmailNotificationChannel
parameters:
- description: The user ID
in: path
name: user_id
required: true
schema:
example: 00000000-0000-0000-0000-000000000000
type: string
- description: The email ID
in: path
name: email_id
required: true
schema:
example: 45bb8fe5-dd96-42ad-83de-2241ea9f6ffc
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Email'
required: true
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/Email'
description: OK
'400':
$ref: '#/components/responses/BadRequestResponse'
'401':
$ref: '#/components/responses/UnauthorizedResponse'
'403':
$ref: '#/components/responses/ForbiddenResponse'
'404':
$ref: '#/components/responses/NotFoundResponse'
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ: []
summary: Update email notification channel
tags:
- On-Call
x-permission:
operator: AND
permissions:
- on_call_admin
/api/v2/org_configs:
get:
description: Returns all Org Configs (name, description, and value).
Expand Down
23 changes: 23 additions & 0 deletions examples/v2/on-call/CreateUserEmailNotificationChannel.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Create email notification channel for user returns "Created" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::OnCallAPI.new

body = DatadogAPIClient::V2::Email.new({
data: DatadogAPIClient::V2::EmailData.new({
attributes: DatadogAPIClient::V2::EmailAttributes.new({
active: true,
address: "[email protected]",
_alias: "",
blocked: false,
created_at: "2024-04-16T23:38:50.388642Z",
formats: [
"html",
],
modified_at: "2024-04-16T23:38:50.388642Z",
}),
id: "45cd9fe5-dd96-42ad-83de-2242ea9f6efd",
type: DatadogAPIClient::V2::EmailType::EMAILS,
}),
})
p api_instance.create_user_email_notification_channel("00000000-0000-0000-0000-000000000000", body)
5 changes: 5 additions & 0 deletions examples/v2/on-call/DeleteUserEmailNotificationChannel.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Delete email notification channel returns "No Content" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::OnCallAPI.new
api_instance.delete_user_email_notification_channel("00000000-0000-0000-0000-000000000000", "45bb8fe5-dd96-42ad-83de-2241ea9f6ffc")
5 changes: 5 additions & 0 deletions examples/v2/on-call/GetUserEmailNotificationChannel.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Get email notification channel returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::OnCallAPI.new
p api_instance.get_user_email_notification_channel("00000000-0000-0000-0000-000000000000", "45bb8fe5-dd96-42ad-83de-2241ea9f6ffc")
23 changes: 23 additions & 0 deletions examples/v2/on-call/UpdateUserEmailNotificationChannel.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Update email notification channel returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::OnCallAPI.new

body = DatadogAPIClient::V2::Email.new({
data: DatadogAPIClient::V2::EmailData.new({
attributes: DatadogAPIClient::V2::EmailAttributes.new({
active: true,
address: "[email protected]",
_alias: "",
blocked: false,
created_at: "2024-04-16T23:38:50.388642Z",
formats: [
"html",
],
modified_at: "2024-04-16T23:38:50.388642Z",
}),
id: "45cd9fe5-dd96-42ad-83de-2242ea9f6efd",
type: DatadogAPIClient::V2::EmailType::EMAILS,
}),
})
p api_instance.update_user_email_notification_channel("00000000-0000-0000-0000-000000000000", "45bb8fe5-dd96-42ad-83de-2241ea9f6ffc", body)
17 changes: 17 additions & 0 deletions features/scenarios_model_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2534,6 +2534,23 @@
"include" => "String",
"body" => "TeamRoutingRulesRequest",
},
"v2.CreateUserEmailNotificationChannel" => {
"user_id" => "String",
"body" => "Email",
},
"v2.DeleteUserEmailNotificationChannel" => {
"user_id" => "String",
"email_id" => "String",
},
"v2.GetUserEmailNotificationChannel" => {
"user_id" => "String",
"email_id" => "String",
},
"v2.UpdateUserEmailNotificationChannel" => {
"user_id" => "String",
"email_id" => "String",
"body" => "Email",
},
"v2.CreateOnCallPage" => {
"body" => "CreatePageRequest",
},
Expand Down
Loading
Loading