trycourier 6.3.0 → 6.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +14 -0
- data/README.md +1 -1
- data/lib/courier/models/elemental_action_node.rb +123 -0
- data/lib/courier/models/elemental_action_node_with_type.rb +3 -1
- data/lib/courier/models/elemental_channel_node.rb +1 -1
- data/lib/courier/models/elemental_divider_node.rb +18 -0
- data/lib/courier/models/elemental_divider_node_with_type.rb +3 -1
- data/lib/courier/models/elemental_html_node.rb +33 -0
- data/lib/courier/models/elemental_html_node_with_type.rb +5 -1
- data/lib/courier/models/elemental_image_node.rb +74 -0
- data/lib/courier/models/elemental_image_node_with_type.rb +3 -1
- data/lib/courier/models/elemental_meta_node.rb +23 -0
- data/lib/courier/models/elemental_meta_node_with_type.rb +5 -1
- data/lib/courier/models/elemental_node.rb +9 -18
- data/lib/courier/models/elemental_quote_node.rb +72 -0
- data/lib/courier/models/elemental_quote_node_with_type.rb +3 -1
- data/lib/courier/models/elemental_text_node.rb +134 -0
- data/lib/courier/models/elemental_text_node_with_type.rb +3 -1
- data/lib/courier/models/journey_send_node.rb +32 -1
- data/lib/courier/models/locales.rb +18 -0
- data/lib/courier/models.rb +19 -0
- data/lib/courier/version.rb +1 -1
- data/lib/courier.rb +8 -0
- data/rbi/courier/models/elemental_action_node.rbi +153 -0
- data/rbi/courier/models/elemental_action_node_with_type.rbi +2 -1
- data/rbi/courier/models/elemental_divider_node.rbi +28 -0
- data/rbi/courier/models/elemental_divider_node_with_type.rbi +2 -1
- data/rbi/courier/models/elemental_html_node.rbi +52 -0
- data/rbi/courier/models/elemental_html_node_with_type.rbi +4 -1
- data/rbi/courier/models/elemental_image_node.rbi +94 -0
- data/rbi/courier/models/elemental_image_node_with_type.rbi +2 -1
- data/rbi/courier/models/elemental_meta_node.rbi +30 -0
- data/rbi/courier/models/elemental_meta_node_with_type.rbi +4 -1
- data/rbi/courier/models/elemental_node.rbi +1 -10
- data/rbi/courier/models/elemental_quote_node.rbi +95 -0
- data/rbi/courier/models/elemental_quote_node_with_type.rbi +2 -1
- data/rbi/courier/models/elemental_text_node.rbi +177 -0
- data/rbi/courier/models/elemental_text_node_with_type.rbi +2 -1
- data/rbi/courier/models/journey_send_node.rbi +45 -0
- data/rbi/courier/models/locales.rbi +27 -0
- data/rbi/courier/models.rbi +18 -0
- data/sig/courier/models/elemental_action_node.rbs +112 -0
- data/sig/courier/models/elemental_action_node_with_type.rbs +1 -1
- data/sig/courier/models/elemental_divider_node.rbs +15 -0
- data/sig/courier/models/elemental_divider_node_with_type.rbs +1 -1
- data/sig/courier/models/elemental_html_node.rbs +23 -0
- data/sig/courier/models/elemental_html_node_with_type.rbs +1 -1
- data/sig/courier/models/elemental_image_node.rbs +71 -0
- data/sig/courier/models/elemental_image_node_with_type.rbs +1 -1
- data/sig/courier/models/elemental_meta_node.rbs +15 -0
- data/sig/courier/models/elemental_meta_node_with_type.rbs +1 -1
- data/sig/courier/models/elemental_quote_node.rbs +66 -0
- data/sig/courier/models/elemental_quote_node_with_type.rbs +1 -1
- data/sig/courier/models/elemental_text_node.rbs +127 -0
- data/sig/courier/models/elemental_text_node_with_type.rbs +1 -1
- data/sig/courier/models/journey_send_node.rbs +24 -0
- data/sig/courier/models/locales.rbs +17 -0
- data/sig/courier/models.rbs +18 -0
- metadata +26 -2
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class ElementalImageNode < Courier::Models::ElementalBaseNode
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(Courier::ElementalImageNode, Courier::Internal::AnyHash)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
# The source of the image.
|
|
12
|
+
sig { returns(String) }
|
|
13
|
+
attr_accessor :src
|
|
14
|
+
|
|
15
|
+
# The alignment of the image.
|
|
16
|
+
sig { returns(T.nilable(Courier::Alignment::OrSymbol)) }
|
|
17
|
+
attr_accessor :align
|
|
18
|
+
|
|
19
|
+
# Alternate text for the image.
|
|
20
|
+
sig { returns(T.nilable(String)) }
|
|
21
|
+
attr_accessor :alt_text
|
|
22
|
+
|
|
23
|
+
# CSS border color applied to the image. For example, `#ccc`
|
|
24
|
+
sig { returns(T.nilable(String)) }
|
|
25
|
+
attr_accessor :border_color
|
|
26
|
+
|
|
27
|
+
# CSS border width applied to the image. For example, `1px`
|
|
28
|
+
sig { returns(T.nilable(String)) }
|
|
29
|
+
attr_accessor :border_size
|
|
30
|
+
|
|
31
|
+
# A URL to link to when the image is clicked.
|
|
32
|
+
sig { returns(T.nilable(String)) }
|
|
33
|
+
attr_accessor :href
|
|
34
|
+
|
|
35
|
+
# CSS padding applied around the image. For example, `10px`
|
|
36
|
+
sig { returns(T.nilable(String)) }
|
|
37
|
+
attr_accessor :padding
|
|
38
|
+
|
|
39
|
+
# CSS width properties to apply to the image. For example, 50px
|
|
40
|
+
sig { returns(T.nilable(String)) }
|
|
41
|
+
attr_accessor :width
|
|
42
|
+
|
|
43
|
+
# Used to embed an image into the notification.
|
|
44
|
+
sig do
|
|
45
|
+
params(
|
|
46
|
+
src: String,
|
|
47
|
+
align: T.nilable(Courier::Alignment::OrSymbol),
|
|
48
|
+
alt_text: T.nilable(String),
|
|
49
|
+
border_color: T.nilable(String),
|
|
50
|
+
border_size: T.nilable(String),
|
|
51
|
+
href: T.nilable(String),
|
|
52
|
+
padding: T.nilable(String),
|
|
53
|
+
width: T.nilable(String)
|
|
54
|
+
).returns(T.attached_class)
|
|
55
|
+
end
|
|
56
|
+
def self.new(
|
|
57
|
+
# The source of the image.
|
|
58
|
+
src:,
|
|
59
|
+
# The alignment of the image.
|
|
60
|
+
align: nil,
|
|
61
|
+
# Alternate text for the image.
|
|
62
|
+
alt_text: nil,
|
|
63
|
+
# CSS border color applied to the image. For example, `#ccc`
|
|
64
|
+
border_color: nil,
|
|
65
|
+
# CSS border width applied to the image. For example, `1px`
|
|
66
|
+
border_size: nil,
|
|
67
|
+
# A URL to link to when the image is clicked.
|
|
68
|
+
href: nil,
|
|
69
|
+
# CSS padding applied around the image. For example, `10px`
|
|
70
|
+
padding: nil,
|
|
71
|
+
# CSS width properties to apply to the image. For example, 50px
|
|
72
|
+
width: nil
|
|
73
|
+
)
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
sig do
|
|
77
|
+
override.returns(
|
|
78
|
+
{
|
|
79
|
+
src: String,
|
|
80
|
+
align: T.nilable(Courier::Alignment::OrSymbol),
|
|
81
|
+
alt_text: T.nilable(String),
|
|
82
|
+
border_color: T.nilable(String),
|
|
83
|
+
border_size: T.nilable(String),
|
|
84
|
+
href: T.nilable(String),
|
|
85
|
+
padding: T.nilable(String),
|
|
86
|
+
width: T.nilable(String)
|
|
87
|
+
}
|
|
88
|
+
)
|
|
89
|
+
end
|
|
90
|
+
def to_hash
|
|
91
|
+
end
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
end
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
module Courier
|
|
4
4
|
module Models
|
|
5
|
-
class ElementalImageNodeWithType < Courier::Models::
|
|
5
|
+
class ElementalImageNodeWithType < Courier::Models::ElementalImageNode
|
|
6
6
|
OrHash =
|
|
7
7
|
T.type_alias do
|
|
8
8
|
T.any(Courier::ElementalImageNodeWithType, Courier::Internal::AnyHash)
|
|
@@ -18,6 +18,7 @@ module Courier
|
|
|
18
18
|
end
|
|
19
19
|
attr_writer :type
|
|
20
20
|
|
|
21
|
+
# Used to embed an image into the notification.
|
|
21
22
|
sig do
|
|
22
23
|
params(
|
|
23
24
|
type: Courier::ElementalImageNodeWithType::Type::OrSymbol
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class ElementalMetaNode < Courier::Models::ElementalBaseNode
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(Courier::ElementalMetaNode, Courier::Internal::AnyHash)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
# The title to be displayed by supported channels. For example, the email subject.
|
|
12
|
+
sig { returns(T.nilable(String)) }
|
|
13
|
+
attr_accessor :title
|
|
14
|
+
|
|
15
|
+
# The meta element contains information describing the notification that may be
|
|
16
|
+
# used by a particular channel or provider. One important field is the title field
|
|
17
|
+
# which will be used as the title for channels that support it.
|
|
18
|
+
sig { params(title: T.nilable(String)).returns(T.attached_class) }
|
|
19
|
+
def self.new(
|
|
20
|
+
# The title to be displayed by supported channels. For example, the email subject.
|
|
21
|
+
title: nil
|
|
22
|
+
)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
sig { override.returns({ title: T.nilable(String) }) }
|
|
26
|
+
def to_hash
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
module Courier
|
|
4
4
|
module Models
|
|
5
|
-
class ElementalMetaNodeWithType < Courier::Models::
|
|
5
|
+
class ElementalMetaNodeWithType < Courier::Models::ElementalMetaNode
|
|
6
6
|
OrHash =
|
|
7
7
|
T.type_alias do
|
|
8
8
|
T.any(Courier::ElementalMetaNodeWithType, Courier::Internal::AnyHash)
|
|
@@ -18,6 +18,9 @@ module Courier
|
|
|
18
18
|
end
|
|
19
19
|
attr_writer :type
|
|
20
20
|
|
|
21
|
+
# The meta element contains information describing the notification that may be
|
|
22
|
+
# used by a particular channel or provider. One important field is the title field
|
|
23
|
+
# which will be used as the title for channels that support it.
|
|
21
24
|
sig do
|
|
22
25
|
params(
|
|
23
26
|
type: Courier::ElementalMetaNodeWithType::Type::OrSymbol
|
|
@@ -2,16 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
module Courier
|
|
4
4
|
module Models
|
|
5
|
-
#
|
|
6
|
-
# channel it is sent through. For example, you may want to display a detailed
|
|
7
|
-
# message when the notification is sent through email, and a more concise message
|
|
8
|
-
# in a push notification. Channel elements are only valid as top-level elements;
|
|
9
|
-
# you cannot nest channel elements. If there is a channel element specified at the
|
|
10
|
-
# top-level of the document, all sibling elements must be channel elements. Note:
|
|
11
|
-
# As an alternative, most elements support a `channel` property. Which allows you
|
|
12
|
-
# to selectively display an individual element on a per channel basis. See the
|
|
13
|
-
# [control flow docs](https://www.courier.com/docs/platform/content/elemental/control-flow/)
|
|
14
|
-
# for more details.
|
|
5
|
+
# Represents a body of text to be rendered inside of the notification.
|
|
15
6
|
module ElementalNode
|
|
16
7
|
extend Courier::Internal::Type::Union
|
|
17
8
|
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class ElementalQuoteNode < Courier::Models::ElementalBaseNode
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(Courier::ElementalQuoteNode, Courier::Internal::AnyHash)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
# The text value of the quote.
|
|
12
|
+
sig { returns(String) }
|
|
13
|
+
attr_accessor :content
|
|
14
|
+
|
|
15
|
+
# Alignment of the quote.
|
|
16
|
+
sig { returns(T.nilable(Courier::Alignment::OrSymbol)) }
|
|
17
|
+
attr_accessor :align
|
|
18
|
+
|
|
19
|
+
# CSS border color property. For example, `#fff`
|
|
20
|
+
sig { returns(T.nilable(String)) }
|
|
21
|
+
attr_accessor :border_color
|
|
22
|
+
|
|
23
|
+
# CSS px font size for this quote block, e.g. `16px`. Overrides the size of the
|
|
24
|
+
# `text_style` preset. Email only.
|
|
25
|
+
sig { returns(T.nilable(String)) }
|
|
26
|
+
attr_accessor :font_size
|
|
27
|
+
|
|
28
|
+
# CSS line height for this quote block, as a px value or a unitless multiplier,
|
|
29
|
+
# e.g. `24px` or `1.5`. Email only.
|
|
30
|
+
sig { returns(T.nilable(String)) }
|
|
31
|
+
attr_accessor :line_height
|
|
32
|
+
|
|
33
|
+
# Region specific content. See
|
|
34
|
+
# [locales docs](https://www.courier.com/docs/platform/content/elemental/locales/)
|
|
35
|
+
# for more details.
|
|
36
|
+
sig { returns(T.nilable(T::Hash[Symbol, Courier::LocaleItem])) }
|
|
37
|
+
attr_accessor :locales
|
|
38
|
+
|
|
39
|
+
sig { returns(T.nilable(Courier::TextStyle::OrSymbol)) }
|
|
40
|
+
attr_reader :text_style
|
|
41
|
+
|
|
42
|
+
sig { params(text_style: Courier::TextStyle::OrSymbol).void }
|
|
43
|
+
attr_writer :text_style
|
|
44
|
+
|
|
45
|
+
# Renders a quote block.
|
|
46
|
+
sig do
|
|
47
|
+
params(
|
|
48
|
+
content: String,
|
|
49
|
+
align: T.nilable(Courier::Alignment::OrSymbol),
|
|
50
|
+
border_color: T.nilable(String),
|
|
51
|
+
font_size: T.nilable(String),
|
|
52
|
+
line_height: T.nilable(String),
|
|
53
|
+
locales: T.nilable(T::Hash[Symbol, Courier::LocaleItem::OrHash]),
|
|
54
|
+
text_style: Courier::TextStyle::OrSymbol
|
|
55
|
+
).returns(T.attached_class)
|
|
56
|
+
end
|
|
57
|
+
def self.new(
|
|
58
|
+
# The text value of the quote.
|
|
59
|
+
content:,
|
|
60
|
+
# Alignment of the quote.
|
|
61
|
+
align: nil,
|
|
62
|
+
# CSS border color property. For example, `#fff`
|
|
63
|
+
border_color: nil,
|
|
64
|
+
# CSS px font size for this quote block, e.g. `16px`. Overrides the size of the
|
|
65
|
+
# `text_style` preset. Email only.
|
|
66
|
+
font_size: nil,
|
|
67
|
+
# CSS line height for this quote block, as a px value or a unitless multiplier,
|
|
68
|
+
# e.g. `24px` or `1.5`. Email only.
|
|
69
|
+
line_height: nil,
|
|
70
|
+
# Region specific content. See
|
|
71
|
+
# [locales docs](https://www.courier.com/docs/platform/content/elemental/locales/)
|
|
72
|
+
# for more details.
|
|
73
|
+
locales: nil,
|
|
74
|
+
text_style: nil
|
|
75
|
+
)
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
sig do
|
|
79
|
+
override.returns(
|
|
80
|
+
{
|
|
81
|
+
content: String,
|
|
82
|
+
align: T.nilable(Courier::Alignment::OrSymbol),
|
|
83
|
+
border_color: T.nilable(String),
|
|
84
|
+
font_size: T.nilable(String),
|
|
85
|
+
line_height: T.nilable(String),
|
|
86
|
+
locales: T.nilable(T::Hash[Symbol, Courier::LocaleItem]),
|
|
87
|
+
text_style: Courier::TextStyle::OrSymbol
|
|
88
|
+
}
|
|
89
|
+
)
|
|
90
|
+
end
|
|
91
|
+
def to_hash
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
end
|
|
95
|
+
end
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
module Courier
|
|
4
4
|
module Models
|
|
5
|
-
class ElementalQuoteNodeWithType < Courier::Models::
|
|
5
|
+
class ElementalQuoteNodeWithType < Courier::Models::ElementalQuoteNode
|
|
6
6
|
OrHash =
|
|
7
7
|
T.type_alias do
|
|
8
8
|
T.any(Courier::ElementalQuoteNodeWithType, Courier::Internal::AnyHash)
|
|
@@ -18,6 +18,7 @@ module Courier
|
|
|
18
18
|
end
|
|
19
19
|
attr_writer :type
|
|
20
20
|
|
|
21
|
+
# Renders a quote block.
|
|
21
22
|
sig do
|
|
22
23
|
params(
|
|
23
24
|
type: Courier::ElementalQuoteNodeWithType::Type::OrSymbol
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class ElementalTextNode < Courier::Models::ElementalBaseNode
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(Courier::ElementalTextNode, Courier::Internal::AnyHash)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
# The text content displayed in the notification. Either this field must be
|
|
12
|
+
# specified, or the elements field
|
|
13
|
+
sig { returns(String) }
|
|
14
|
+
attr_accessor :content
|
|
15
|
+
|
|
16
|
+
# Text alignment.
|
|
17
|
+
sig { returns(T.nilable(Courier::ElementalTextNode::Align::OrSymbol)) }
|
|
18
|
+
attr_reader :align
|
|
19
|
+
|
|
20
|
+
sig { params(align: Courier::ElementalTextNode::Align::OrSymbol).void }
|
|
21
|
+
attr_writer :align
|
|
22
|
+
|
|
23
|
+
# Apply bold to the text
|
|
24
|
+
sig { returns(T.nilable(String)) }
|
|
25
|
+
attr_accessor :bold
|
|
26
|
+
|
|
27
|
+
# Specifies the color of text. Can be any valid css color value
|
|
28
|
+
sig { returns(T.nilable(String)) }
|
|
29
|
+
attr_accessor :color
|
|
30
|
+
|
|
31
|
+
# CSS px font size for this text block, e.g. `16px`. Overrides the size of the
|
|
32
|
+
# `text_style` preset. Email only.
|
|
33
|
+
sig { returns(T.nilable(String)) }
|
|
34
|
+
attr_accessor :font_size
|
|
35
|
+
|
|
36
|
+
sig { returns(T.nilable(Courier::ElementalTextNode::Format::OrSymbol)) }
|
|
37
|
+
attr_accessor :format_
|
|
38
|
+
|
|
39
|
+
# Apply italics to the text
|
|
40
|
+
sig { returns(T.nilable(String)) }
|
|
41
|
+
attr_accessor :italic
|
|
42
|
+
|
|
43
|
+
# CSS line height for this text block, as a px value or a unitless multiplier,
|
|
44
|
+
# e.g. `24px` or `1.5`. Email only.
|
|
45
|
+
sig { returns(T.nilable(String)) }
|
|
46
|
+
attr_accessor :line_height
|
|
47
|
+
|
|
48
|
+
# Region specific content. See
|
|
49
|
+
# [locales docs](https://www.courier.com/docs/platform/content/elemental/locales/)
|
|
50
|
+
# for more details.
|
|
51
|
+
sig { returns(T.nilable(T::Hash[Symbol, Courier::LocaleItem])) }
|
|
52
|
+
attr_accessor :locales
|
|
53
|
+
|
|
54
|
+
# Apply a strike through the text
|
|
55
|
+
sig { returns(T.nilable(String)) }
|
|
56
|
+
attr_accessor :strikethrough
|
|
57
|
+
|
|
58
|
+
# Allows the text to be rendered as a heading level.
|
|
59
|
+
sig { returns(T.nilable(Courier::TextStyle::OrSymbol)) }
|
|
60
|
+
attr_accessor :text_style
|
|
61
|
+
|
|
62
|
+
# Apply an underline to the text
|
|
63
|
+
sig { returns(T.nilable(String)) }
|
|
64
|
+
attr_accessor :underline
|
|
65
|
+
|
|
66
|
+
# Represents a body of text to be rendered inside of the notification.
|
|
67
|
+
sig do
|
|
68
|
+
params(
|
|
69
|
+
content: String,
|
|
70
|
+
align: Courier::ElementalTextNode::Align::OrSymbol,
|
|
71
|
+
bold: T.nilable(String),
|
|
72
|
+
color: T.nilable(String),
|
|
73
|
+
font_size: T.nilable(String),
|
|
74
|
+
format_: T.nilable(Courier::ElementalTextNode::Format::OrSymbol),
|
|
75
|
+
italic: T.nilable(String),
|
|
76
|
+
line_height: T.nilable(String),
|
|
77
|
+
locales: T.nilable(T::Hash[Symbol, Courier::LocaleItem::OrHash]),
|
|
78
|
+
strikethrough: T.nilable(String),
|
|
79
|
+
text_style: T.nilable(Courier::TextStyle::OrSymbol),
|
|
80
|
+
underline: T.nilable(String)
|
|
81
|
+
).returns(T.attached_class)
|
|
82
|
+
end
|
|
83
|
+
def self.new(
|
|
84
|
+
# The text content displayed in the notification. Either this field must be
|
|
85
|
+
# specified, or the elements field
|
|
86
|
+
content:,
|
|
87
|
+
# Text alignment.
|
|
88
|
+
align: nil,
|
|
89
|
+
# Apply bold to the text
|
|
90
|
+
bold: nil,
|
|
91
|
+
# Specifies the color of text. Can be any valid css color value
|
|
92
|
+
color: nil,
|
|
93
|
+
# CSS px font size for this text block, e.g. `16px`. Overrides the size of the
|
|
94
|
+
# `text_style` preset. Email only.
|
|
95
|
+
font_size: nil,
|
|
96
|
+
format_: nil,
|
|
97
|
+
# Apply italics to the text
|
|
98
|
+
italic: nil,
|
|
99
|
+
# CSS line height for this text block, as a px value or a unitless multiplier,
|
|
100
|
+
# e.g. `24px` or `1.5`. Email only.
|
|
101
|
+
line_height: nil,
|
|
102
|
+
# Region specific content. See
|
|
103
|
+
# [locales docs](https://www.courier.com/docs/platform/content/elemental/locales/)
|
|
104
|
+
# for more details.
|
|
105
|
+
locales: nil,
|
|
106
|
+
# Apply a strike through the text
|
|
107
|
+
strikethrough: nil,
|
|
108
|
+
# Allows the text to be rendered as a heading level.
|
|
109
|
+
text_style: nil,
|
|
110
|
+
# Apply an underline to the text
|
|
111
|
+
underline: nil
|
|
112
|
+
)
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
sig do
|
|
116
|
+
override.returns(
|
|
117
|
+
{
|
|
118
|
+
content: String,
|
|
119
|
+
align: Courier::ElementalTextNode::Align::OrSymbol,
|
|
120
|
+
bold: T.nilable(String),
|
|
121
|
+
color: T.nilable(String),
|
|
122
|
+
font_size: T.nilable(String),
|
|
123
|
+
format_: T.nilable(Courier::ElementalTextNode::Format::OrSymbol),
|
|
124
|
+
italic: T.nilable(String),
|
|
125
|
+
line_height: T.nilable(String),
|
|
126
|
+
locales: T.nilable(T::Hash[Symbol, Courier::LocaleItem]),
|
|
127
|
+
strikethrough: T.nilable(String),
|
|
128
|
+
text_style: T.nilable(Courier::TextStyle::OrSymbol),
|
|
129
|
+
underline: T.nilable(String)
|
|
130
|
+
}
|
|
131
|
+
)
|
|
132
|
+
end
|
|
133
|
+
def to_hash
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
# Text alignment.
|
|
137
|
+
module Align
|
|
138
|
+
extend Courier::Internal::Type::Enum
|
|
139
|
+
|
|
140
|
+
TaggedSymbol =
|
|
141
|
+
T.type_alias { T.all(Symbol, Courier::ElementalTextNode::Align) }
|
|
142
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
143
|
+
|
|
144
|
+
LEFT = T.let(:left, Courier::ElementalTextNode::Align::TaggedSymbol)
|
|
145
|
+
CENTER = T.let(:center, Courier::ElementalTextNode::Align::TaggedSymbol)
|
|
146
|
+
RIGHT = T.let(:right, Courier::ElementalTextNode::Align::TaggedSymbol)
|
|
147
|
+
|
|
148
|
+
sig do
|
|
149
|
+
override.returns(
|
|
150
|
+
T::Array[Courier::ElementalTextNode::Align::TaggedSymbol]
|
|
151
|
+
)
|
|
152
|
+
end
|
|
153
|
+
def self.values
|
|
154
|
+
end
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
module Format
|
|
158
|
+
extend Courier::Internal::Type::Enum
|
|
159
|
+
|
|
160
|
+
TaggedSymbol =
|
|
161
|
+
T.type_alias { T.all(Symbol, Courier::ElementalTextNode::Format) }
|
|
162
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
163
|
+
|
|
164
|
+
MARKDOWN =
|
|
165
|
+
T.let(:markdown, Courier::ElementalTextNode::Format::TaggedSymbol)
|
|
166
|
+
|
|
167
|
+
sig do
|
|
168
|
+
override.returns(
|
|
169
|
+
T::Array[Courier::ElementalTextNode::Format::TaggedSymbol]
|
|
170
|
+
)
|
|
171
|
+
end
|
|
172
|
+
def self.values
|
|
173
|
+
end
|
|
174
|
+
end
|
|
175
|
+
end
|
|
176
|
+
end
|
|
177
|
+
end
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
module Courier
|
|
4
4
|
module Models
|
|
5
|
-
class ElementalTextNodeWithType < Courier::Models::
|
|
5
|
+
class ElementalTextNodeWithType < Courier::Models::ElementalTextNode
|
|
6
6
|
OrHash =
|
|
7
7
|
T.type_alias do
|
|
8
8
|
T.any(Courier::ElementalTextNodeWithType, Courier::Internal::AnyHash)
|
|
@@ -18,6 +18,7 @@ module Courier
|
|
|
18
18
|
end
|
|
19
19
|
attr_writer :type
|
|
20
20
|
|
|
21
|
+
# Represents a body of text to be rendered inside of the notification.
|
|
21
22
|
sig do
|
|
22
23
|
params(
|
|
23
24
|
type: Courier::ElementalTextNodeWithType::Type::OrSymbol
|
|
@@ -23,6 +23,16 @@ module Courier
|
|
|
23
23
|
sig { params(id: String).void }
|
|
24
24
|
attr_writer :id
|
|
25
25
|
|
|
26
|
+
# The channel this node sends through. Optional — when omitted, the field is
|
|
27
|
+
# absent from the node, including on `GET`; nodes created before this field
|
|
28
|
+
# existed have it unset. Setting it makes the node's channel explicit to any
|
|
29
|
+
# client reading the journey.
|
|
30
|
+
sig { returns(T.nilable(Courier::JourneySendNode::Channel::OrSymbol)) }
|
|
31
|
+
attr_reader :channel
|
|
32
|
+
|
|
33
|
+
sig { params(channel: Courier::JourneySendNode::Channel::OrSymbol).void }
|
|
34
|
+
attr_writer :channel
|
|
35
|
+
|
|
26
36
|
# Condition spec for a journey node. Accepts a single condition atom, an AND/OR
|
|
27
37
|
# group, or an AND/OR nested group. Omit the `conditions` property entirely to
|
|
28
38
|
# express "no conditions".
|
|
@@ -70,6 +80,7 @@ module Courier
|
|
|
70
80
|
message: Courier::JourneySendNode::Message::OrHash,
|
|
71
81
|
type: Courier::JourneySendNode::Type::OrSymbol,
|
|
72
82
|
id: String,
|
|
83
|
+
channel: Courier::JourneySendNode::Channel::OrSymbol,
|
|
73
84
|
conditions:
|
|
74
85
|
T.any(
|
|
75
86
|
T::Array[String],
|
|
@@ -83,6 +94,11 @@ module Courier
|
|
|
83
94
|
message:,
|
|
84
95
|
type:,
|
|
85
96
|
id: nil,
|
|
97
|
+
# The channel this node sends through. Optional — when omitted, the field is
|
|
98
|
+
# absent from the node, including on `GET`; nodes created before this field
|
|
99
|
+
# existed have it unset. Setting it makes the node's channel explicit to any
|
|
100
|
+
# client reading the journey.
|
|
101
|
+
channel: nil,
|
|
86
102
|
# Condition spec for a journey node. Accepts a single condition atom, an AND/OR
|
|
87
103
|
# group, or an AND/OR nested group. Omit the `conditions` property entirely to
|
|
88
104
|
# express "no conditions".
|
|
@@ -100,6 +116,7 @@ module Courier
|
|
|
100
116
|
message: Courier::JourneySendNode::Message,
|
|
101
117
|
type: Courier::JourneySendNode::Type::OrSymbol,
|
|
102
118
|
id: String,
|
|
119
|
+
channel: Courier::JourneySendNode::Channel::OrSymbol,
|
|
103
120
|
conditions:
|
|
104
121
|
T.any(
|
|
105
122
|
T::Array[String],
|
|
@@ -417,6 +434,34 @@ module Courier
|
|
|
417
434
|
def self.values
|
|
418
435
|
end
|
|
419
436
|
end
|
|
437
|
+
|
|
438
|
+
# The channel this node sends through. Optional — when omitted, the field is
|
|
439
|
+
# absent from the node, including on `GET`; nodes created before this field
|
|
440
|
+
# existed have it unset. Setting it makes the node's channel explicit to any
|
|
441
|
+
# client reading the journey.
|
|
442
|
+
module Channel
|
|
443
|
+
extend Courier::Internal::Type::Enum
|
|
444
|
+
|
|
445
|
+
TaggedSymbol =
|
|
446
|
+
T.type_alias { T.all(Symbol, Courier::JourneySendNode::Channel) }
|
|
447
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
448
|
+
|
|
449
|
+
EMAIL = T.let(:email, Courier::JourneySendNode::Channel::TaggedSymbol)
|
|
450
|
+
SMS = T.let(:sms, Courier::JourneySendNode::Channel::TaggedSymbol)
|
|
451
|
+
PUSH = T.let(:push, Courier::JourneySendNode::Channel::TaggedSymbol)
|
|
452
|
+
INBOX = T.let(:inbox, Courier::JourneySendNode::Channel::TaggedSymbol)
|
|
453
|
+
SLACK = T.let(:slack, Courier::JourneySendNode::Channel::TaggedSymbol)
|
|
454
|
+
MSTEAMS =
|
|
455
|
+
T.let(:msteams, Courier::JourneySendNode::Channel::TaggedSymbol)
|
|
456
|
+
|
|
457
|
+
sig do
|
|
458
|
+
override.returns(
|
|
459
|
+
T::Array[Courier::JourneySendNode::Channel::TaggedSymbol]
|
|
460
|
+
)
|
|
461
|
+
end
|
|
462
|
+
def self.values
|
|
463
|
+
end
|
|
464
|
+
end
|
|
420
465
|
end
|
|
421
466
|
end
|
|
422
467
|
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class LocaleItem < Courier::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias { T.any(Courier::LocaleItem, Courier::Internal::AnyHash) }
|
|
8
|
+
|
|
9
|
+
sig { returns(String) }
|
|
10
|
+
attr_accessor :content
|
|
11
|
+
|
|
12
|
+
sig { params(content: String).returns(T.attached_class) }
|
|
13
|
+
def self.new(content:)
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
sig { override.returns({ content: String }) }
|
|
17
|
+
def to_hash
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
Locales =
|
|
22
|
+
T.let(
|
|
23
|
+
Courier::Internal::Type::HashOf[Courier::LocaleItem],
|
|
24
|
+
Courier::Internal::Type::Converter
|
|
25
|
+
)
|
|
26
|
+
end
|
|
27
|
+
end
|
data/rbi/courier/models.rbi
CHANGED
|
@@ -160,6 +160,8 @@ module Courier
|
|
|
160
160
|
|
|
161
161
|
Discord = Courier::Models::Discord
|
|
162
162
|
|
|
163
|
+
ElementalActionNode = Courier::Models::ElementalActionNode
|
|
164
|
+
|
|
163
165
|
ElementalActionNodeWithType = Courier::Models::ElementalActionNodeWithType
|
|
164
166
|
|
|
165
167
|
ElementalBaseNode = Courier::Models::ElementalBaseNode
|
|
@@ -172,18 +174,30 @@ module Courier
|
|
|
172
174
|
|
|
173
175
|
ElementalContentSugar = Courier::Models::ElementalContentSugar
|
|
174
176
|
|
|
177
|
+
ElementalDividerNode = Courier::Models::ElementalDividerNode
|
|
178
|
+
|
|
175
179
|
ElementalDividerNodeWithType = Courier::Models::ElementalDividerNodeWithType
|
|
176
180
|
|
|
181
|
+
ElementalHTMLNode = Courier::Models::ElementalHTMLNode
|
|
182
|
+
|
|
177
183
|
ElementalHTMLNodeWithType = Courier::Models::ElementalHTMLNodeWithType
|
|
178
184
|
|
|
185
|
+
ElementalImageNode = Courier::Models::ElementalImageNode
|
|
186
|
+
|
|
179
187
|
ElementalImageNodeWithType = Courier::Models::ElementalImageNodeWithType
|
|
180
188
|
|
|
189
|
+
ElementalMetaNode = Courier::Models::ElementalMetaNode
|
|
190
|
+
|
|
181
191
|
ElementalMetaNodeWithType = Courier::Models::ElementalMetaNodeWithType
|
|
182
192
|
|
|
183
193
|
ElementalNode = Courier::Models::ElementalNode
|
|
184
194
|
|
|
195
|
+
ElementalQuoteNode = Courier::Models::ElementalQuoteNode
|
|
196
|
+
|
|
185
197
|
ElementalQuoteNodeWithType = Courier::Models::ElementalQuoteNodeWithType
|
|
186
198
|
|
|
199
|
+
ElementalTextNode = Courier::Models::ElementalTextNode
|
|
200
|
+
|
|
187
201
|
ElementalTextNodeWithType = Courier::Models::ElementalTextNodeWithType
|
|
188
202
|
|
|
189
203
|
ElementWithChecksums = Courier::Models::ElementWithChecksums
|
|
@@ -346,6 +360,10 @@ module Courier
|
|
|
346
360
|
|
|
347
361
|
ListUpdateParams = Courier::Models::ListUpdateParams
|
|
348
362
|
|
|
363
|
+
LocaleItem = Courier::Models::LocaleItem
|
|
364
|
+
|
|
365
|
+
Locales = T.let(Courier::Models::Locales, Courier::Internal::Type::Converter)
|
|
366
|
+
|
|
349
367
|
Logo = Courier::Models::Logo
|
|
350
368
|
|
|
351
369
|
MessageCancelParams = Courier::Models::MessageCancelParams
|