Skip to content

Commit 2ffe00c

Browse files
chore(types): extract ElementalHTMLNodeWithType from inline union member
1 parent 4f067ed commit 2ffe00c

9 files changed

Lines changed: 39 additions & 20 deletions

File tree

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 89
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/courier%2Fcourier-28c3d906924905ea7f42fd645574bea0988de857d0d023770695160d8ed7435e.yml
33
openapi_spec_hash: 59844e5d8943f8df663069f28aff328c
4-
config_hash: 1ffb164d1c97b45fb182fe619456e3f9
4+
config_hash: d7b97d207a178b94ed49b63d914f2ba6

api.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ from courier.types import (
1919
ElementalContent,
2020
ElementalContentSugar,
2121
ElementalDividerNodeWithType,
22+
ElementalHTMLNodeWithType,
2223
ElementalImageNodeWithType,
2324
ElementalMetaNodeWithType,
2425
ElementalNode,

src/courier/types/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
SendToMsTeamsChannelID as SendToMsTeamsChannelID,
7070
SendToMsTeamsChannelName as SendToMsTeamsChannelName,
7171
UserProfileFirebaseToken as UserProfileFirebaseToken,
72+
ElementalHTMLNodeWithType as ElementalHTMLNodeWithType,
7273
ElementalMetaNodeWithType as ElementalMetaNodeWithType,
7374
ElementalTextNodeWithType as ElementalTextNodeWithType,
7475
ElementalImageNodeWithType as ElementalImageNodeWithType,

src/courier/types/shared/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
from .send_to_ms_teams_user_id import SendToMsTeamsUserID as SendToMsTeamsUserID
6060
from .send_to_ms_teams_channel_id import SendToMsTeamsChannelID as SendToMsTeamsChannelID
6161
from .user_profile_firebase_token import UserProfileFirebaseToken as UserProfileFirebaseToken
62+
from .elemental_html_node_with_type import ElementalHTMLNodeWithType as ElementalHTMLNodeWithType
6263
from .elemental_meta_node_with_type import ElementalMetaNodeWithType as ElementalMetaNodeWithType
6364
from .elemental_text_node_with_type import ElementalTextNodeWithType as ElementalTextNodeWithType
6465
from .send_to_ms_teams_channel_name import SendToMsTeamsChannelName as SendToMsTeamsChannelName
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from typing import Optional
4+
from typing_extensions import Literal
5+
6+
from .elemental_base_node import ElementalBaseNode
7+
8+
__all__ = ["ElementalHTMLNodeWithType"]
9+
10+
11+
class ElementalHTMLNodeWithType(ElementalBaseNode):
12+
type: Optional[Literal["html"]] = None
Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
from typing import Union, Optional
4-
from typing_extensions import Literal, TypeAlias
3+
from typing import Union
4+
from typing_extensions import TypeAlias
55

6-
from .elemental_base_node import ElementalBaseNode
6+
from .elemental_html_node_with_type import ElementalHTMLNodeWithType
77
from .elemental_meta_node_with_type import ElementalMetaNodeWithType
88
from .elemental_text_node_with_type import ElementalTextNodeWithType
99
from .elemental_image_node_with_type import ElementalImageNodeWithType
@@ -12,12 +12,7 @@
1212
from .elemental_channel_node_with_type import ElementalChannelNodeWithType
1313
from .elemental_divider_node_with_type import ElementalDividerNodeWithType
1414

15-
__all__ = ["ElementalNode", "UnionMember7"]
16-
17-
18-
class UnionMember7(ElementalBaseNode):
19-
type: Optional[Literal["html"]] = None
20-
15+
__all__ = ["ElementalNode"]
2116

2217
ElementalNode: TypeAlias = Union[
2318
ElementalTextNodeWithType,
@@ -27,5 +22,5 @@ class UnionMember7(ElementalBaseNode):
2722
ElementalActionNodeWithType,
2823
ElementalDividerNodeWithType,
2924
ElementalQuoteNodeWithType,
30-
UnionMember7,
25+
ElementalHTMLNodeWithType,
3126
]

src/courier/types/shared_params/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
from .message_routing_channel import MessageRoutingChannel as MessageRoutingChannel
4242
from .send_to_ms_teams_user_id import SendToMsTeamsUserID as SendToMsTeamsUserID
4343
from .send_to_ms_teams_channel_id import SendToMsTeamsChannelID as SendToMsTeamsChannelID
44+
from .elemental_html_node_with_type import ElementalHTMLNodeWithType as ElementalHTMLNodeWithType
4445
from .elemental_meta_node_with_type import ElementalMetaNodeWithType as ElementalMetaNodeWithType
4546
from .elemental_text_node_with_type import ElementalTextNodeWithType as ElementalTextNodeWithType
4647
from .send_to_ms_teams_channel_name import SendToMsTeamsChannelName as SendToMsTeamsChannelName
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from typing_extensions import Literal
6+
7+
from .elemental_base_node import ElementalBaseNode
8+
9+
__all__ = ["ElementalHTMLNodeWithType"]
10+
11+
12+
class ElementalHTMLNodeWithType(ElementalBaseNode, total=False):
13+
type: Literal["html"]

src/courier/types/shared_params/elemental_node.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
from __future__ import annotations
44

55
from typing import Union
6-
from typing_extensions import Literal, TypeAlias
6+
from typing_extensions import TypeAlias
77

8-
from .elemental_base_node import ElementalBaseNode
8+
from .elemental_html_node_with_type import ElementalHTMLNodeWithType
99
from .elemental_meta_node_with_type import ElementalMetaNodeWithType
1010
from .elemental_text_node_with_type import ElementalTextNodeWithType
1111
from .elemental_image_node_with_type import ElementalImageNodeWithType
@@ -14,12 +14,7 @@
1414
from .elemental_channel_node_with_type import ElementalChannelNodeWithType
1515
from .elemental_divider_node_with_type import ElementalDividerNodeWithType
1616

17-
__all__ = ["ElementalNode", "UnionMember7"]
18-
19-
20-
class UnionMember7(ElementalBaseNode, total=False):
21-
type: Literal["html"]
22-
17+
__all__ = ["ElementalNode"]
2318

2419
ElementalNode: TypeAlias = Union[
2520
ElementalTextNodeWithType,
@@ -29,5 +24,5 @@ class UnionMember7(ElementalBaseNode, total=False):
2924
ElementalActionNodeWithType,
3025
ElementalDividerNodeWithType,
3126
ElementalQuoteNodeWithType,
32-
UnionMember7,
27+
ElementalHTMLNodeWithType,
3328
]

0 commit comments

Comments
 (0)