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
19 changes: 19 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120947,6 +120947,8 @@ components:
$ref: "#/components/schemas/TeamNotificationRuleAttributesMsTeams"
pagerduty:
$ref: "#/components/schemas/TeamNotificationRuleAttributesPagerduty"
servicenow:
$ref: "#/components/schemas/TeamNotificationRuleAttributesServiceNow"
slack:
$ref: "#/components/schemas/TeamNotificationRuleAttributesSlack"
type: object
Expand All @@ -120956,6 +120958,10 @@ components:
enabled:
description: Flag indicating email notification
type: boolean
recipient_email:
description: >-
Email address to notify. When omitted and email notifications are enabled, notifications are sent to all team members.
type: string
type: object
TeamNotificationRuleAttributesMsTeams:
description: MS Teams notification settings for the team
Expand All @@ -120971,6 +120977,15 @@ components:
description: Service name for PagerDuty
type: string
type: object
TeamNotificationRuleAttributesServiceNow:
description: ServiceNow notification settings for the team.
properties:
templates:
description: ServiceNow template handle names to use for notifications.
items:
type: string
type: array
type: object
TeamNotificationRuleAttributesSlack:
description: Slack notification settings for the team
properties:
Expand Down Expand Up @@ -227286,6 +227301,10 @@ paths:
- attributes:
email:
enabled: true
recipient_email: alerts@example.com
servicenow:
templates:
- incident-template
slack:
channel: test-channel
workspace: Datadog
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
from datadog_api_client.v2.model.team_notification_rule_attributes_pagerduty import (
TeamNotificationRuleAttributesPagerduty,
)
from datadog_api_client.v2.model.team_notification_rule_attributes_service_now import (
TeamNotificationRuleAttributesServiceNow,
)
from datadog_api_client.v2.model.team_notification_rule_attributes_slack import TeamNotificationRuleAttributesSlack


Expand All @@ -36,6 +39,9 @@ def openapi_types(_):
from datadog_api_client.v2.model.team_notification_rule_attributes_pagerduty import (
TeamNotificationRuleAttributesPagerduty,
)
from datadog_api_client.v2.model.team_notification_rule_attributes_service_now import (
TeamNotificationRuleAttributesServiceNow,
)
from datadog_api_client.v2.model.team_notification_rule_attributes_slack import (
TeamNotificationRuleAttributesSlack,
)
Expand All @@ -44,13 +50,15 @@ def openapi_types(_):
"email": (TeamNotificationRuleAttributesEmail,),
"ms_teams": (TeamNotificationRuleAttributesMsTeams,),
"pagerduty": (TeamNotificationRuleAttributesPagerduty,),
"servicenow": (TeamNotificationRuleAttributesServiceNow,),
"slack": (TeamNotificationRuleAttributesSlack,),
}

attribute_map = {
"email": "email",
"ms_teams": "ms_teams",
"pagerduty": "pagerduty",
"servicenow": "servicenow",
"slack": "slack",
}

Expand All @@ -59,6 +67,7 @@ def __init__(
email: Union[TeamNotificationRuleAttributesEmail, UnsetType] = unset,
ms_teams: Union[TeamNotificationRuleAttributesMsTeams, UnsetType] = unset,
pagerduty: Union[TeamNotificationRuleAttributesPagerduty, UnsetType] = unset,
servicenow: Union[TeamNotificationRuleAttributesServiceNow, UnsetType] = unset,
slack: Union[TeamNotificationRuleAttributesSlack, UnsetType] = unset,
**kwargs,
):
Expand All @@ -74,6 +83,9 @@ def __init__(
:param pagerduty: PagerDuty notification settings for the team
:type pagerduty: TeamNotificationRuleAttributesPagerduty, optional

:param servicenow: ServiceNow notification settings for the team.
:type servicenow: TeamNotificationRuleAttributesServiceNow, optional

:param slack: Slack notification settings for the team
:type slack: TeamNotificationRuleAttributesSlack, optional
"""
Expand All @@ -83,6 +95,8 @@ def __init__(
kwargs["ms_teams"] = ms_teams
if pagerduty is not unset:
kwargs["pagerduty"] = pagerduty
if servicenow is not unset:
kwargs["servicenow"] = servicenow
if slack is not unset:
kwargs["slack"] = slack
super().__init__(kwargs)
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,28 @@ class TeamNotificationRuleAttributesEmail(ModelNormal):
def openapi_types(_):
return {
"enabled": (bool,),
"recipient_email": (str,),
}

attribute_map = {
"enabled": "enabled",
"recipient_email": "recipient_email",
}

def __init__(self_, enabled: Union[bool, UnsetType] = unset, **kwargs):
def __init__(
self_, enabled: Union[bool, UnsetType] = unset, recipient_email: Union[str, UnsetType] = unset, **kwargs
):
"""
Email notification settings for the team

:param enabled: Flag indicating email notification
:type enabled: bool, optional

:param recipient_email: Email address to notify. When omitted and email notifications are enabled, notifications are sent to all team members.
:type recipient_email: str, optional
"""
if enabled is not unset:
kwargs["enabled"] = enabled
if recipient_email is not unset:
kwargs["recipient_email"] = recipient_email
super().__init__(kwargs)
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019-Present Datadog, Inc.
from __future__ import annotations

from typing import List, Union

from datadog_api_client.model_utils import (
ModelNormal,
cached_property,
unset,
UnsetType,
)


class TeamNotificationRuleAttributesServiceNow(ModelNormal):
@cached_property
def openapi_types(_):
return {
"templates": ([str],),
}

attribute_map = {
"templates": "templates",
}

def __init__(self_, templates: Union[List[str], UnsetType] = unset, **kwargs):
"""
ServiceNow notification settings for the team.

:param templates: ServiceNow template handle names to use for notifications.
:type templates: [str], optional
"""
if templates is not unset:
kwargs["templates"] = templates
super().__init__(kwargs)
4 changes: 4 additions & 0 deletions src/datadog_api_client/v2/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10849,6 +10849,9 @@
from datadog_api_client.v2.model.team_notification_rule_attributes_pagerduty import (
TeamNotificationRuleAttributesPagerduty,
)
from datadog_api_client.v2.model.team_notification_rule_attributes_service_now import (
TeamNotificationRuleAttributesServiceNow,
)
from datadog_api_client.v2.model.team_notification_rule_attributes_slack import TeamNotificationRuleAttributesSlack
from datadog_api_client.v2.model.team_notification_rule_request import TeamNotificationRuleRequest
from datadog_api_client.v2.model.team_notification_rule_response import TeamNotificationRuleResponse
Expand Down Expand Up @@ -19246,6 +19249,7 @@
"TeamNotificationRuleAttributesEmail",
"TeamNotificationRuleAttributesMsTeams",
"TeamNotificationRuleAttributesPagerduty",
"TeamNotificationRuleAttributesServiceNow",
"TeamNotificationRuleAttributesSlack",
"TeamNotificationRuleRequest",
"TeamNotificationRuleResponse",
Expand Down
Loading