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
22 changes: 22 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120230,6 +120230,8 @@ components:
description: "The channel ID."
example: CHANNEL
type: string
customizable_content:
$ref: "#/components/schemas/SendSlackMessageActionCustomizableContent"
type:
$ref: "#/components/schemas/SendSlackMessageActionType"
workspace:
Expand All @@ -120241,6 +120243,26 @@ components:
- channel
- workspace
type: object
SendSlackMessageActionCustomizableContent:
description: "Options that customize the content of the Slack message sent for a Page."
properties:
include_description:
description: "Whether to include the Page description in the Slack message."
example: true
type: boolean
include_source:
description: "Whether to include the source that triggered the Page in the Slack message."
example: true
type: boolean
mirror_replies:
description: "Whether to mirror replies posted in the Slack message thread to the Page timeline."
example: false
type: boolean
thread_timeline:
description: "Whether to post Page timeline updates as replies in the Slack message thread."
example: false
type: boolean
type: object
SendSlackMessageActionType:
default: send_slack_message
description: "Indicates that the action is a send Slack message action."
Expand Down
3 changes: 3 additions & 0 deletions src/datadog_api_client/v2/model/routing_rule_action.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ def __init__(self, **kwargs):
:param channel: The channel ID.
:type channel: str

:param customizable_content: Options that customize the content of the Slack message sent for a Page.
:type customizable_content: SendSlackMessageActionCustomizableContent, optional

:param type: Indicates that the action is a send Slack message action.
:type type: SendSlackMessageActionType

Expand Down
26 changes: 24 additions & 2 deletions src/datadog_api_client/v2/model/send_slack_message_action.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,48 +3,70 @@
# Copyright 2019-Present Datadog, Inc.
from __future__ import annotations

from typing import TYPE_CHECKING
from typing import Union, TYPE_CHECKING

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


if TYPE_CHECKING:
from datadog_api_client.v2.model.send_slack_message_action_customizable_content import (
SendSlackMessageActionCustomizableContent,
)
from datadog_api_client.v2.model.send_slack_message_action_type import SendSlackMessageActionType


class SendSlackMessageAction(ModelNormal):
@cached_property
def openapi_types(_):
from datadog_api_client.v2.model.send_slack_message_action_customizable_content import (
SendSlackMessageActionCustomizableContent,
)
from datadog_api_client.v2.model.send_slack_message_action_type import SendSlackMessageActionType

return {
"channel": (str,),
"customizable_content": (SendSlackMessageActionCustomizableContent,),
"type": (SendSlackMessageActionType,),
"workspace": (str,),
}

attribute_map = {
"channel": "channel",
"customizable_content": "customizable_content",
"type": "type",
"workspace": "workspace",
}

def __init__(self_, channel: str, type: SendSlackMessageActionType, workspace: str, **kwargs):
def __init__(
self_,
channel: str,
type: SendSlackMessageActionType,
workspace: str,
customizable_content: Union[SendSlackMessageActionCustomizableContent, UnsetType] = unset,
**kwargs,
):
"""
Sends a message to a Slack channel.

:param channel: The channel ID.
:type channel: str

:param customizable_content: Options that customize the content of the Slack message sent for a Page.
:type customizable_content: SendSlackMessageActionCustomizableContent, optional

:param type: Indicates that the action is a send Slack message action.
:type type: SendSlackMessageActionType

:param workspace: The workspace ID.
:type workspace: str
"""
if customizable_content is not unset:
kwargs["customizable_content"] = customizable_content
super().__init__(kwargs)

self_.channel = channel
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# 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 Union

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


class SendSlackMessageActionCustomizableContent(ModelNormal):
@cached_property
def openapi_types(_):
return {
"include_description": (bool,),
"include_source": (bool,),
"mirror_replies": (bool,),
"thread_timeline": (bool,),
}

attribute_map = {
"include_description": "include_description",
"include_source": "include_source",
"mirror_replies": "mirror_replies",
"thread_timeline": "thread_timeline",
}

def __init__(
self_,
include_description: Union[bool, UnsetType] = unset,
include_source: Union[bool, UnsetType] = unset,
mirror_replies: Union[bool, UnsetType] = unset,
thread_timeline: Union[bool, UnsetType] = unset,
**kwargs,
):
"""
Options that customize the content of the Slack message sent for a Page.

:param include_description: Whether to include the Page description in the Slack message.
:type include_description: bool, optional

:param include_source: Whether to include the source that triggered the Page in the Slack message.
:type include_source: bool, optional

:param mirror_replies: Whether to mirror replies posted in the Slack message thread to the Page timeline.
:type mirror_replies: bool, optional

:param thread_timeline: Whether to post Page timeline updates as replies in the Slack message thread.
:type thread_timeline: bool, optional
"""
if include_description is not unset:
kwargs["include_description"] = include_description
if include_source is not unset:
kwargs["include_source"] = include_source
if mirror_replies is not unset:
kwargs["mirror_replies"] = mirror_replies
if thread_timeline is not unset:
kwargs["thread_timeline"] = thread_timeline
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 @@ -10825,6 +10825,9 @@
from datadog_api_client.v2.model.selectors import Selectors
from datadog_api_client.v2.model.self_service_trigger_wrapper import SelfServiceTriggerWrapper
from datadog_api_client.v2.model.send_slack_message_action import SendSlackMessageAction
from datadog_api_client.v2.model.send_slack_message_action_customizable_content import (
SendSlackMessageActionCustomizableContent,
)
from datadog_api_client.v2.model.send_slack_message_action_type import SendSlackMessageActionType
from datadog_api_client.v2.model.send_teams_message_action import SendTeamsMessageAction
from datadog_api_client.v2.model.send_teams_message_action_type import SendTeamsMessageActionType
Expand Down Expand Up @@ -20180,6 +20183,7 @@
"Selectors",
"SelfServiceTriggerWrapper",
"SendSlackMessageAction",
"SendSlackMessageActionCustomizableContent",
"SendSlackMessageActionType",
"SendTeamsMessageAction",
"SendTeamsMessageActionType",
Expand Down
Loading