Skip to content
Merged
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
8 changes: 8 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,25 @@ from courier.types import (
ChannelPreference,
DeviceType,
Discord,
ElementalActionNode,
ElementalActionNodeWithType,
ElementalBaseNode,
ElementalChannelNode,
ElementalChannelNodeWithType,
ElementalContent,
ElementalContentSugar,
ElementalDividerNode,
ElementalDividerNodeWithType,
ElementalHTMLNode,
ElementalHTMLNodeWithType,
ElementalImageNode,
ElementalImageNodeWithType,
ElementalMetaNode,
ElementalMetaNodeWithType,
ElementalNode,
ElementalQuoteNode,
ElementalQuoteNodeWithType,
ElementalTextNode,
ElementalTextNodeWithType,
Expo,
FilterConfig,
Expand All @@ -36,6 +43,7 @@ from courier.types import (
ListFilter,
ListPatternRecipient,
ListRecipient,
Locales,
MessageChannels,
MessageContext,
MessageProviders,
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "trycourier"
version = "9.4.0"
version = "9.3.0"
description = "The official Python library for the Courier API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion src/courier/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "courier"
__version__ = "9.4.0" # x-release-please-version
__version__ = "9.3.0" # x-release-please-version
8 changes: 8 additions & 0 deletions src/courier/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
Paging as Paging,
Channel as Channel,
Discord as Discord,
Locales as Locales,
MsTeams as MsTeams,
Intercom as Intercom,
Metadata as Metadata,
Expand Down Expand Up @@ -66,17 +67,24 @@
AudienceRecipient as AudienceRecipient,
ChannelPreference as ChannelPreference,
ElementalBaseNode as ElementalBaseNode,
ElementalHTMLNode as ElementalHTMLNode,
ElementalMetaNode as ElementalMetaNode,
ElementalTextNode as ElementalTextNode,
IntercomRecipient as IntercomRecipient,
SendDirectMessage as SendDirectMessage,
SendToSlackUserID as SendToSlackUserID,
ElementalImageNode as ElementalImageNode,
ElementalQuoteNode as ElementalQuoteNode,
PagerdutyRecipient as PagerdutyRecipient,
SendToMsTeamsEmail as SendToMsTeamsEmail,
SendToSlackChannel as SendToSlackChannel,
WebhookProfileType as WebhookProfileType,
ElementalActionNode as ElementalActionNode,
SendToMsTeamsUserID as SendToMsTeamsUserID,
SlackBaseProperties as SlackBaseProperties,
AudienceFilterConfig as AudienceFilterConfig,
ElementalChannelNode as ElementalChannelNode,
ElementalDividerNode as ElementalDividerNode,
ListPatternRecipient as ListPatternRecipient,
MessageProvidersType as MessageProvidersType,
RecipientPreferences as RecipientPreferences,
Expand Down
8 changes: 8 additions & 0 deletions src/courier/types/shared/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from .aws_sns import AwsSns as AwsSns
from .channel import Channel as Channel
from .discord import Discord as Discord
from .locales import Locales as Locales
from .intercom import Intercom as Intercom
from .metadata import Metadata as Metadata
from .ms_teams import MsTeams as MsTeams
Expand Down Expand Up @@ -46,17 +47,24 @@
from .intercom_recipient import IntercomRecipient as IntercomRecipient
from .ms_teams_recipient import MsTeamsRecipient as MsTeamsRecipient
from .elemental_base_node import ElementalBaseNode as ElementalBaseNode
from .elemental_html_node import ElementalHTMLNode as ElementalHTMLNode
from .elemental_meta_node import ElementalMetaNode as ElementalMetaNode
from .elemental_text_node import ElementalTextNode as ElementalTextNode
from .pagerduty_recipient import PagerdutyRecipient as PagerdutyRecipient
from .send_direct_message import SendDirectMessage as SendDirectMessage
from .send_to_slack_email import SendToSlackEmail as SendToSlackEmail
from .elemental_image_node import ElementalImageNode as ElementalImageNode
from .elemental_quote_node import ElementalQuoteNode as ElementalQuoteNode
from .webhook_profile_type import WebhookProfileType as WebhookProfileType
from .elemental_action_node import ElementalActionNode as ElementalActionNode
from .recipient_preferences import RecipientPreferences as RecipientPreferences
from .send_to_slack_channel import SendToSlackChannel as SendToSlackChannel
from .send_to_slack_user_id import SendToSlackUserID as SendToSlackUserID
from .slack_base_properties import SlackBaseProperties as SlackBaseProperties
from .audience_filter_config import AudienceFilterConfig as AudienceFilterConfig
from .channel_classification import ChannelClassification as ChannelClassification
from .elemental_channel_node import ElementalChannelNode as ElementalChannelNode
from .elemental_divider_node import ElementalDividerNode as ElementalDividerNode
from .list_pattern_recipient import ListPatternRecipient as ListPatternRecipient
from .message_providers_type import MessageProvidersType as MessageProvidersType
from .send_to_ms_teams_email import SendToMsTeamsEmail as SendToMsTeamsEmail
Expand Down
58 changes: 58 additions & 0 deletions src/courier/types/shared/elemental_action_node.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import Optional
from typing_extensions import Literal

from .locales import Locales
from .alignment import Alignment
from .elemental_base_node import ElementalBaseNode

__all__ = ["ElementalActionNode"]


class ElementalActionNode(ElementalBaseNode):
"""Allows the user to execute an action. Can be a button or a link."""

content: str
"""The text content of the action shown to the user."""

href: str
"""The target URL of the action."""

action_id: Optional[str] = None
"""A unique id used to identify the action when it is executed."""

align: Optional[Alignment] = None
"""The alignment of the action button. Defaults to "center"."""

background_color: Optional[str] = None
"""The background color of the action button."""

border_radius: Optional[str] = None
"""CSS border-radius applied to the action button. For example, `4px`"""

border_size: Optional[str] = None
"""CSS border width applied to the action button. For example, `1px`"""

disable_tracking: Optional[bool] = None
"""
When true, the action's href is not rewritten for click-through tracking, even
when click-through tracking is enabled for the workspace.
"""

font_size: Optional[str] = None
"""CSS font-size applied to the action button label. For example, `14px`"""

locales: Optional[Locales] = None
"""Region specific content.

See
[locales docs](https://www.courier.com/docs/platform/content/elemental/locales/)
for more details.
"""

padding: Optional[str] = None
"""CSS padding applied to the action button. For example, `8px 16px`"""

style: Optional[Literal["button", "link"]] = None
"""Defaults to `button`."""
6 changes: 4 additions & 2 deletions src/courier/types/shared/elemental_action_node_with_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
from typing import Optional
from typing_extensions import Literal

from .elemental_base_node import ElementalBaseNode
from .elemental_action_node import ElementalActionNode

__all__ = ["ElementalActionNodeWithType"]


class ElementalActionNodeWithType(ElementalBaseNode):
class ElementalActionNodeWithType(ElementalActionNode):
"""Allows the user to execute an action. Can be a button or a link."""

type: Optional[Literal["action"]] = None
9 changes: 1 addition & 8 deletions src/courier/types/shared/elemental_channel_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,7 @@

class ElementalChannelNode(ElementalBaseNode):
"""
The channel element allows a notification to be customized based on which channel it is sent through.
For example, you may want to display a detailed message when the notification is sent through email,
and a more concise message in a push notification. Channel elements are only valid as top-level
elements; you cannot nest channel elements. If there is a channel element specified at the top-level
of the document, all sibling elements must be channel elements.
Note: As an alternative, most elements support a `channel` property. Which allows you to selectively
display an individual element on a per channel basis. See the
[control flow docs](https://www.courier.com/docs/platform/content/elemental/control-flow/) for more details.
The channel element allows a notification to be customized based on which channel it is sent through. For example, you may want to display a detailed message when the notification is sent through email, and a more concise message in a push notification. Channel elements are only valid as top-level elements; you cannot nest channel elements. If there is a channel element specified at the top-level of the document, all sibling elements must be channel elements. Note: As an alternative, most elements support a `channel` property. Which allows you to selectively display an individual element on a per channel basis. See the [control flow docs](https://www.courier.com/docs/platform/content/elemental/control-flow/) for more details.
"""

channel: Optional[str] = None
Expand Down
9 changes: 1 addition & 8 deletions src/courier/types/shared/elemental_channel_node_with_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,7 @@

class ElementalChannelNodeWithType(ElementalChannelNode):
"""
The channel element allows a notification to be customized based on which channel it is sent through.
For example, you may want to display a detailed message when the notification is sent through email,
and a more concise message in a push notification. Channel elements are only valid as top-level
elements; you cannot nest channel elements. If there is a channel element specified at the top-level
of the document, all sibling elements must be channel elements.
Note: As an alternative, most elements support a `channel` property. Which allows you to selectively
display an individual element on a per channel basis. See the
[control flow docs](https://www.courier.com/docs/platform/content/elemental/control-flow/) for more details.
The channel element allows a notification to be customized based on which channel it is sent through. For example, you may want to display a detailed message when the notification is sent through email, and a more concise message in a push notification. Channel elements are only valid as top-level elements; you cannot nest channel elements. If there is a channel element specified at the top-level of the document, all sibling elements must be channel elements. Note: As an alternative, most elements support a `channel` property. Which allows you to selectively display an individual element on a per channel basis. See the [control flow docs](https://www.courier.com/docs/platform/content/elemental/control-flow/) for more details.
"""

type: Optional[Literal["channel"]] = None
14 changes: 14 additions & 0 deletions src/courier/types/shared/elemental_divider_node.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import Optional

from .elemental_base_node import ElementalBaseNode

__all__ = ["ElementalDividerNode"]


class ElementalDividerNode(ElementalBaseNode):
"""Renders a dividing line between elements."""

color: Optional[str] = None
"""The CSS color to render the line with. For example, `#fff`"""
6 changes: 4 additions & 2 deletions src/courier/types/shared/elemental_divider_node_with_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
from typing import Optional
from typing_extensions import Literal

from .elemental_base_node import ElementalBaseNode
from .elemental_divider_node import ElementalDividerNode

__all__ = ["ElementalDividerNodeWithType"]


class ElementalDividerNodeWithType(ElementalBaseNode):
class ElementalDividerNodeWithType(ElementalDividerNode):
"""Renders a dividing line between elements."""

type: Optional[Literal["divider"]] = None
26 changes: 26 additions & 0 deletions src/courier/types/shared/elemental_html_node.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import Optional

from .locales import Locales
from .elemental_base_node import ElementalBaseNode

__all__ = ["ElementalHTMLNode"]


class ElementalHTMLNode(ElementalBaseNode):
"""Raw HTML string inside an Elemental document.

When rendering a message, this node is turned into output only for the email channel; for other channels it produces no blocks.
"""

content: str
"""Raw HTML string to render inside the notification."""

locales: Optional[Locales] = None
"""Region specific content.

See
[locales docs](https://www.courier.com/docs/platform/content/elemental/locales/)
for more details.
"""
9 changes: 7 additions & 2 deletions src/courier/types/shared/elemental_html_node_with_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,15 @@
from typing import Optional
from typing_extensions import Literal

from .elemental_base_node import ElementalBaseNode
from .elemental_html_node import ElementalHTMLNode

__all__ = ["ElementalHTMLNodeWithType"]


class ElementalHTMLNodeWithType(ElementalBaseNode):
class ElementalHTMLNodeWithType(ElementalHTMLNode):
"""Raw HTML string inside an Elemental document.

When rendering a message, this node is turned into output only for the email channel; for other channels it produces no blocks.
"""

type: Optional[Literal["html"]] = None
38 changes: 38 additions & 0 deletions src/courier/types/shared/elemental_image_node.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import Optional

from pydantic import Field as FieldInfo

from .alignment import Alignment
from .elemental_base_node import ElementalBaseNode

__all__ = ["ElementalImageNode"]


class ElementalImageNode(ElementalBaseNode):
"""Used to embed an image into the notification."""

src: str
"""The source of the image."""

align: Optional[Alignment] = None
"""The alignment of the image."""

alt_text: Optional[str] = FieldInfo(alias="altText", default=None)
"""Alternate text for the image."""

border_color: Optional[str] = None
"""CSS border color applied to the image. For example, `#ccc`"""

border_size: Optional[str] = None
"""CSS border width applied to the image. For example, `1px`"""

href: Optional[str] = None
"""A URL to link to when the image is clicked."""

padding: Optional[str] = None
"""CSS padding applied around the image. For example, `10px`"""

width: Optional[str] = None
"""CSS width properties to apply to the image. For example, 50px"""
6 changes: 4 additions & 2 deletions src/courier/types/shared/elemental_image_node_with_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
from typing import Optional
from typing_extensions import Literal

from .elemental_base_node import ElementalBaseNode
from .elemental_image_node import ElementalImageNode

__all__ = ["ElementalImageNodeWithType"]


class ElementalImageNodeWithType(ElementalBaseNode):
class ElementalImageNodeWithType(ElementalImageNode):
"""Used to embed an image into the notification."""

type: Optional[Literal["image"]] = None
19 changes: 19 additions & 0 deletions src/courier/types/shared/elemental_meta_node.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import Optional

from .elemental_base_node import ElementalBaseNode

__all__ = ["ElementalMetaNode"]


class ElementalMetaNode(ElementalBaseNode):
"""
The meta element contains information describing the notification that may be used by a particular channel or provider. One important field is the title field which will be used as the title for channels that support it.
"""

title: Optional[str] = None
"""The title to be displayed by supported channels.

For example, the email subject.
"""
8 changes: 6 additions & 2 deletions src/courier/types/shared/elemental_meta_node_with_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@
from typing import Optional
from typing_extensions import Literal

from .elemental_base_node import ElementalBaseNode
from .elemental_meta_node import ElementalMetaNode

__all__ = ["ElementalMetaNodeWithType"]


class ElementalMetaNodeWithType(ElementalBaseNode):
class ElementalMetaNodeWithType(ElementalMetaNode):
"""
The meta element contains information describing the notification that may be used by a particular channel or provider. One important field is the title field which will be used as the title for channels that support it.
"""

type: Optional[Literal["meta"]] = None
Loading
Loading