trycourier 4.9.0 → 4.10.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 +18 -0
- data/lib/courier/internal/util.rb +3 -1
- data/lib/courier/models/associated_notification_list_response.rb +24 -0
- data/lib/courier/models/element_with_checksums.rb +60 -0
- data/lib/courier/models/notification_content_get_response.rb +26 -0
- data/lib/courier/models/notification_content_mutation_response.rb +61 -0
- data/lib/courier/models/notification_content_put_request.rb +51 -0
- data/lib/courier/models/notification_element_put_request.rb +62 -0
- data/lib/courier/models/notification_get_content.rb +0 -1
- data/lib/courier/models/notification_locale_put_request.rb +39 -0
- data/lib/courier/models/notification_put_content_params.rb +20 -0
- data/lib/courier/models/notification_put_element_params.rb +26 -0
- data/lib/courier/models/notification_put_locale_params.rb +26 -0
- data/lib/courier/models/notification_retrieve_content_params.rb +14 -1
- data/lib/courier/models/notification_retrieve_content_response.rb +21 -0
- data/lib/courier/models/notification_template_get_response.rb +1 -1
- data/lib/courier/models/notification_template_state.rb +16 -0
- data/lib/courier/models/provider_update_params.rb +3 -2
- data/lib/courier/models/routing_strategy_get_response.rb +1 -1
- data/lib/courier/models/routing_strategy_list_notifications_params.rb +37 -0
- data/lib/courier/models.rb +24 -4
- data/lib/courier/resources/notifications.rb +128 -13
- data/lib/courier/resources/providers.rb +7 -5
- data/lib/courier/resources/routing_strategies.rb +32 -4
- data/lib/courier/version.rb +1 -1
- data/lib/courier.rb +13 -4
- data/rbi/courier/models/associated_notification_list_response.rbi +45 -0
- data/rbi/courier/models/element_with_checksums.rbi +109 -0
- data/rbi/courier/models/notification_content_get_response.rbi +45 -0
- data/rbi/courier/models/notification_content_mutation_response.rbi +95 -0
- data/rbi/courier/models/notification_content_put_request.rbi +145 -0
- data/rbi/courier/models/notification_element_put_request.rbi +98 -0
- data/rbi/courier/models/notification_locale_put_request.rbi +79 -0
- data/rbi/courier/models/notification_put_content_params.rbi +38 -0
- data/rbi/courier/models/notification_put_element_params.rbi +46 -0
- data/rbi/courier/models/notification_put_locale_params.rbi +46 -0
- data/rbi/courier/models/notification_retrieve_content_params.rbi +21 -2
- data/rbi/courier/models/notification_retrieve_content_response.rbi +29 -0
- data/rbi/courier/models/notification_template_state.rbi +26 -0
- data/rbi/courier/models/provider_update_params.rbi +4 -2
- data/rbi/courier/models/routing_strategy_list_notifications_params.rbi +63 -0
- data/rbi/courier/models.rbi +28 -6
- data/rbi/courier/resources/notifications.rbi +105 -7
- data/rbi/courier/resources/providers.rbi +7 -4
- data/rbi/courier/resources/routing_strategies.rbi +23 -2
- data/sig/courier/models/associated_notification_list_response.rbs +25 -0
- data/sig/courier/models/element_with_checksums.rbs +60 -0
- data/sig/courier/models/notification_content_get_response.rbs +22 -0
- data/sig/courier/models/notification_content_mutation_response.rbs +47 -0
- data/sig/courier/models/notification_content_put_request.rbs +50 -0
- data/sig/courier/models/notification_element_put_request.rbs +64 -0
- data/sig/courier/models/notification_locale_put_request.rbs +39 -0
- data/sig/courier/models/notification_put_content_params.rbs +22 -0
- data/sig/courier/models/notification_put_element_params.rbs +32 -0
- data/sig/courier/models/notification_put_locale_params.rbs +32 -0
- data/sig/courier/models/notification_retrieve_content_params.rbs +12 -2
- data/sig/courier/models/notification_retrieve_content_response.rbs +12 -0
- data/sig/courier/models/notification_template_state.rbs +14 -0
- data/sig/courier/models/routing_strategy_list_notifications_params.rbs +34 -0
- data/sig/courier/models.rbs +24 -4
- data/sig/courier/resources/notifications.rbs +32 -5
- data/sig/courier/resources/routing_strategies.rbs +9 -2
- metadata +41 -14
- data/lib/courier/models/notification_template_mutation_response.rb +0 -51
- data/lib/courier/models/notifications/draft_retrieve_content_params.rb +0 -22
- data/lib/courier/models/routing_strategy_mutation_response.rb +0 -19
- data/lib/courier/resources/notifications/draft.rb +0 -33
- data/rbi/courier/models/notification_template_mutation_response.rbi +0 -121
- data/rbi/courier/models/notifications/draft_retrieve_content_params.rbi +0 -40
- data/rbi/courier/models/routing_strategy_mutation_response.rbi +0 -31
- data/rbi/courier/resources/notifications/draft.rbi +0 -23
- data/sig/courier/models/notification_template_mutation_response.rbs +0 -46
- data/sig/courier/models/notifications/draft_retrieve_content_params.rbs +0 -22
- data/sig/courier/models/routing_strategy_mutation_response.rbs +0 -13
- data/sig/courier/resources/notifications/draft.rbs +0 -14
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class NotificationContentMutationResponse < Courier::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(
|
|
9
|
+
Courier::NotificationContentMutationResponse,
|
|
10
|
+
Courier::Internal::AnyHash
|
|
11
|
+
)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# Template ID.
|
|
15
|
+
sig { returns(String) }
|
|
16
|
+
attr_accessor :id
|
|
17
|
+
|
|
18
|
+
sig do
|
|
19
|
+
returns(T::Array[Courier::NotificationContentMutationResponse::Element])
|
|
20
|
+
end
|
|
21
|
+
attr_accessor :elements
|
|
22
|
+
|
|
23
|
+
# Template state. Defaults to `DRAFT`.
|
|
24
|
+
sig { returns(Courier::NotificationTemplateState::TaggedSymbol) }
|
|
25
|
+
attr_accessor :state
|
|
26
|
+
|
|
27
|
+
# Content version identifier.
|
|
28
|
+
sig { returns(String) }
|
|
29
|
+
attr_accessor :version
|
|
30
|
+
|
|
31
|
+
# Shared mutation response for `PUT` content, `PUT` element, and `PUT` locale
|
|
32
|
+
# operations. Contains the template ID, content version, per-element checksums,
|
|
33
|
+
# and resulting state.
|
|
34
|
+
sig do
|
|
35
|
+
params(
|
|
36
|
+
id: String,
|
|
37
|
+
elements:
|
|
38
|
+
T::Array[
|
|
39
|
+
Courier::NotificationContentMutationResponse::Element::OrHash
|
|
40
|
+
],
|
|
41
|
+
state: Courier::NotificationTemplateState::OrSymbol,
|
|
42
|
+
version: String
|
|
43
|
+
).returns(T.attached_class)
|
|
44
|
+
end
|
|
45
|
+
def self.new(
|
|
46
|
+
# Template ID.
|
|
47
|
+
id:,
|
|
48
|
+
elements:,
|
|
49
|
+
# Template state. Defaults to `DRAFT`.
|
|
50
|
+
state:,
|
|
51
|
+
# Content version identifier.
|
|
52
|
+
version:
|
|
53
|
+
)
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
sig do
|
|
57
|
+
override.returns(
|
|
58
|
+
{
|
|
59
|
+
id: String,
|
|
60
|
+
elements:
|
|
61
|
+
T::Array[Courier::NotificationContentMutationResponse::Element],
|
|
62
|
+
state: Courier::NotificationTemplateState::TaggedSymbol,
|
|
63
|
+
version: String
|
|
64
|
+
}
|
|
65
|
+
)
|
|
66
|
+
end
|
|
67
|
+
def to_hash
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
class Element < Courier::Internal::Type::BaseModel
|
|
71
|
+
OrHash =
|
|
72
|
+
T.type_alias do
|
|
73
|
+
T.any(
|
|
74
|
+
Courier::NotificationContentMutationResponse::Element,
|
|
75
|
+
Courier::Internal::AnyHash
|
|
76
|
+
)
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
sig { returns(String) }
|
|
80
|
+
attr_accessor :id
|
|
81
|
+
|
|
82
|
+
sig { returns(String) }
|
|
83
|
+
attr_accessor :checksum
|
|
84
|
+
|
|
85
|
+
sig { params(id: String, checksum: String).returns(T.attached_class) }
|
|
86
|
+
def self.new(id:, checksum:)
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
sig { override.returns({ id: String, checksum: String }) }
|
|
90
|
+
def to_hash
|
|
91
|
+
end
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
end
|
|
95
|
+
end
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class NotificationContentPutRequest < Courier::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(
|
|
9
|
+
Courier::NotificationContentPutRequest,
|
|
10
|
+
Courier::Internal::AnyHash
|
|
11
|
+
)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# Elemental content payload. The server defaults `version` when omitted.
|
|
15
|
+
sig { returns(Courier::NotificationContentPutRequest::Content) }
|
|
16
|
+
attr_reader :content
|
|
17
|
+
|
|
18
|
+
sig do
|
|
19
|
+
params(
|
|
20
|
+
content: Courier::NotificationContentPutRequest::Content::OrHash
|
|
21
|
+
).void
|
|
22
|
+
end
|
|
23
|
+
attr_writer :content
|
|
24
|
+
|
|
25
|
+
# Template state. Defaults to `DRAFT`.
|
|
26
|
+
sig { returns(T.nilable(Courier::NotificationTemplateState::OrSymbol)) }
|
|
27
|
+
attr_reader :state
|
|
28
|
+
|
|
29
|
+
sig { params(state: Courier::NotificationTemplateState::OrSymbol).void }
|
|
30
|
+
attr_writer :state
|
|
31
|
+
|
|
32
|
+
# Request body for replacing the elemental content of a notification template.
|
|
33
|
+
sig do
|
|
34
|
+
params(
|
|
35
|
+
content: Courier::NotificationContentPutRequest::Content::OrHash,
|
|
36
|
+
state: Courier::NotificationTemplateState::OrSymbol
|
|
37
|
+
).returns(T.attached_class)
|
|
38
|
+
end
|
|
39
|
+
def self.new(
|
|
40
|
+
# Elemental content payload. The server defaults `version` when omitted.
|
|
41
|
+
content:,
|
|
42
|
+
# Template state. Defaults to `DRAFT`.
|
|
43
|
+
state: nil
|
|
44
|
+
)
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
sig do
|
|
48
|
+
override.returns(
|
|
49
|
+
{
|
|
50
|
+
content: Courier::NotificationContentPutRequest::Content,
|
|
51
|
+
state: Courier::NotificationTemplateState::OrSymbol
|
|
52
|
+
}
|
|
53
|
+
)
|
|
54
|
+
end
|
|
55
|
+
def to_hash
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
class Content < Courier::Internal::Type::BaseModel
|
|
59
|
+
OrHash =
|
|
60
|
+
T.type_alias do
|
|
61
|
+
T.any(
|
|
62
|
+
Courier::NotificationContentPutRequest::Content,
|
|
63
|
+
Courier::Internal::AnyHash
|
|
64
|
+
)
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
sig do
|
|
68
|
+
returns(
|
|
69
|
+
T::Array[
|
|
70
|
+
T.any(
|
|
71
|
+
Courier::ElementalTextNodeWithType,
|
|
72
|
+
Courier::ElementalMetaNodeWithType,
|
|
73
|
+
Courier::ElementalChannelNodeWithType,
|
|
74
|
+
Courier::ElementalImageNodeWithType,
|
|
75
|
+
Courier::ElementalActionNodeWithType,
|
|
76
|
+
Courier::ElementalDividerNodeWithType,
|
|
77
|
+
Courier::ElementalQuoteNodeWithType,
|
|
78
|
+
Courier::ElementalHTMLNodeWithType
|
|
79
|
+
)
|
|
80
|
+
]
|
|
81
|
+
)
|
|
82
|
+
end
|
|
83
|
+
attr_accessor :elements
|
|
84
|
+
|
|
85
|
+
# Content version identifier (e.g., `2022-01-01`). Optional; server defaults when
|
|
86
|
+
# omitted.
|
|
87
|
+
sig { returns(T.nilable(String)) }
|
|
88
|
+
attr_reader :version
|
|
89
|
+
|
|
90
|
+
sig { params(version: String).void }
|
|
91
|
+
attr_writer :version
|
|
92
|
+
|
|
93
|
+
# Elemental content payload. The server defaults `version` when omitted.
|
|
94
|
+
sig do
|
|
95
|
+
params(
|
|
96
|
+
elements:
|
|
97
|
+
T::Array[
|
|
98
|
+
T.any(
|
|
99
|
+
Courier::ElementalTextNodeWithType::OrHash,
|
|
100
|
+
Courier::ElementalMetaNodeWithType::OrHash,
|
|
101
|
+
Courier::ElementalChannelNodeWithType::OrHash,
|
|
102
|
+
Courier::ElementalImageNodeWithType::OrHash,
|
|
103
|
+
Courier::ElementalActionNodeWithType::OrHash,
|
|
104
|
+
Courier::ElementalDividerNodeWithType::OrHash,
|
|
105
|
+
Courier::ElementalQuoteNodeWithType::OrHash,
|
|
106
|
+
Courier::ElementalHTMLNodeWithType::OrHash
|
|
107
|
+
)
|
|
108
|
+
],
|
|
109
|
+
version: String
|
|
110
|
+
).returns(T.attached_class)
|
|
111
|
+
end
|
|
112
|
+
def self.new(
|
|
113
|
+
elements:,
|
|
114
|
+
# Content version identifier (e.g., `2022-01-01`). Optional; server defaults when
|
|
115
|
+
# omitted.
|
|
116
|
+
version: nil
|
|
117
|
+
)
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
sig do
|
|
121
|
+
override.returns(
|
|
122
|
+
{
|
|
123
|
+
elements:
|
|
124
|
+
T::Array[
|
|
125
|
+
T.any(
|
|
126
|
+
Courier::ElementalTextNodeWithType,
|
|
127
|
+
Courier::ElementalMetaNodeWithType,
|
|
128
|
+
Courier::ElementalChannelNodeWithType,
|
|
129
|
+
Courier::ElementalImageNodeWithType,
|
|
130
|
+
Courier::ElementalActionNodeWithType,
|
|
131
|
+
Courier::ElementalDividerNodeWithType,
|
|
132
|
+
Courier::ElementalQuoteNodeWithType,
|
|
133
|
+
Courier::ElementalHTMLNodeWithType
|
|
134
|
+
)
|
|
135
|
+
],
|
|
136
|
+
version: String
|
|
137
|
+
}
|
|
138
|
+
)
|
|
139
|
+
end
|
|
140
|
+
def to_hash
|
|
141
|
+
end
|
|
142
|
+
end
|
|
143
|
+
end
|
|
144
|
+
end
|
|
145
|
+
end
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class NotificationElementPutRequest < Courier::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(
|
|
9
|
+
Courier::NotificationElementPutRequest,
|
|
10
|
+
Courier::Internal::AnyHash
|
|
11
|
+
)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# Element type (text, meta, action, image, etc.).
|
|
15
|
+
sig { returns(String) }
|
|
16
|
+
attr_accessor :type
|
|
17
|
+
|
|
18
|
+
sig { returns(T.nilable(T::Array[String])) }
|
|
19
|
+
attr_reader :channels
|
|
20
|
+
|
|
21
|
+
sig { params(channels: T::Array[String]).void }
|
|
22
|
+
attr_writer :channels
|
|
23
|
+
|
|
24
|
+
sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
|
|
25
|
+
attr_reader :data
|
|
26
|
+
|
|
27
|
+
sig { params(data: T::Hash[Symbol, T.anything]).void }
|
|
28
|
+
attr_writer :data
|
|
29
|
+
|
|
30
|
+
sig { returns(T.nilable(String)) }
|
|
31
|
+
attr_reader :if_
|
|
32
|
+
|
|
33
|
+
sig { params(if_: String).void }
|
|
34
|
+
attr_writer :if_
|
|
35
|
+
|
|
36
|
+
sig { returns(T.nilable(String)) }
|
|
37
|
+
attr_reader :loop_
|
|
38
|
+
|
|
39
|
+
sig { params(loop_: String).void }
|
|
40
|
+
attr_writer :loop_
|
|
41
|
+
|
|
42
|
+
sig { returns(T.nilable(String)) }
|
|
43
|
+
attr_reader :ref
|
|
44
|
+
|
|
45
|
+
sig { params(ref: String).void }
|
|
46
|
+
attr_writer :ref
|
|
47
|
+
|
|
48
|
+
# Template state. Defaults to `DRAFT`.
|
|
49
|
+
sig { returns(T.nilable(Courier::NotificationTemplateState::OrSymbol)) }
|
|
50
|
+
attr_reader :state
|
|
51
|
+
|
|
52
|
+
sig { params(state: Courier::NotificationTemplateState::OrSymbol).void }
|
|
53
|
+
attr_writer :state
|
|
54
|
+
|
|
55
|
+
# Request body for updating a single element. Additional type-specific fields are
|
|
56
|
+
# allowed.
|
|
57
|
+
sig do
|
|
58
|
+
params(
|
|
59
|
+
type: String,
|
|
60
|
+
channels: T::Array[String],
|
|
61
|
+
data: T::Hash[Symbol, T.anything],
|
|
62
|
+
if_: String,
|
|
63
|
+
loop_: String,
|
|
64
|
+
ref: String,
|
|
65
|
+
state: Courier::NotificationTemplateState::OrSymbol
|
|
66
|
+
).returns(T.attached_class)
|
|
67
|
+
end
|
|
68
|
+
def self.new(
|
|
69
|
+
# Element type (text, meta, action, image, etc.).
|
|
70
|
+
type:,
|
|
71
|
+
channels: nil,
|
|
72
|
+
data: nil,
|
|
73
|
+
if_: nil,
|
|
74
|
+
loop_: nil,
|
|
75
|
+
ref: nil,
|
|
76
|
+
# Template state. Defaults to `DRAFT`.
|
|
77
|
+
state: nil
|
|
78
|
+
)
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
sig do
|
|
82
|
+
override.returns(
|
|
83
|
+
{
|
|
84
|
+
type: String,
|
|
85
|
+
channels: T::Array[String],
|
|
86
|
+
data: T::Hash[Symbol, T.anything],
|
|
87
|
+
if_: String,
|
|
88
|
+
loop_: String,
|
|
89
|
+
ref: String,
|
|
90
|
+
state: Courier::NotificationTemplateState::OrSymbol
|
|
91
|
+
}
|
|
92
|
+
)
|
|
93
|
+
end
|
|
94
|
+
def to_hash
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
end
|
|
98
|
+
end
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class NotificationLocalePutRequest < Courier::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(
|
|
9
|
+
Courier::NotificationLocalePutRequest,
|
|
10
|
+
Courier::Internal::AnyHash
|
|
11
|
+
)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# Elements with locale-specific content overrides.
|
|
15
|
+
sig { returns(T::Array[Courier::NotificationLocalePutRequest::Element]) }
|
|
16
|
+
attr_accessor :elements
|
|
17
|
+
|
|
18
|
+
# Template state. Defaults to `DRAFT`.
|
|
19
|
+
sig { returns(T.nilable(Courier::NotificationTemplateState::OrSymbol)) }
|
|
20
|
+
attr_reader :state
|
|
21
|
+
|
|
22
|
+
sig { params(state: Courier::NotificationTemplateState::OrSymbol).void }
|
|
23
|
+
attr_writer :state
|
|
24
|
+
|
|
25
|
+
# Request body for setting locale-specific content overrides. Each element
|
|
26
|
+
# override must include the target element ID.
|
|
27
|
+
sig do
|
|
28
|
+
params(
|
|
29
|
+
elements:
|
|
30
|
+
T::Array[Courier::NotificationLocalePutRequest::Element::OrHash],
|
|
31
|
+
state: Courier::NotificationTemplateState::OrSymbol
|
|
32
|
+
).returns(T.attached_class)
|
|
33
|
+
end
|
|
34
|
+
def self.new(
|
|
35
|
+
# Elements with locale-specific content overrides.
|
|
36
|
+
elements:,
|
|
37
|
+
# Template state. Defaults to `DRAFT`.
|
|
38
|
+
state: nil
|
|
39
|
+
)
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
sig do
|
|
43
|
+
override.returns(
|
|
44
|
+
{
|
|
45
|
+
elements: T::Array[Courier::NotificationLocalePutRequest::Element],
|
|
46
|
+
state: Courier::NotificationTemplateState::OrSymbol
|
|
47
|
+
}
|
|
48
|
+
)
|
|
49
|
+
end
|
|
50
|
+
def to_hash
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
class Element < Courier::Internal::Type::BaseModel
|
|
54
|
+
OrHash =
|
|
55
|
+
T.type_alias do
|
|
56
|
+
T.any(
|
|
57
|
+
Courier::NotificationLocalePutRequest::Element,
|
|
58
|
+
Courier::Internal::AnyHash
|
|
59
|
+
)
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Target element ID.
|
|
63
|
+
sig { returns(String) }
|
|
64
|
+
attr_accessor :id
|
|
65
|
+
|
|
66
|
+
sig { params(id: String).returns(T.attached_class) }
|
|
67
|
+
def self.new(
|
|
68
|
+
# Target element ID.
|
|
69
|
+
id:
|
|
70
|
+
)
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
sig { override.returns({ id: String }) }
|
|
74
|
+
def to_hash
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
end
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class NotificationPutContentParams < Courier::Models::NotificationContentPutRequest
|
|
6
|
+
extend Courier::Internal::Type::RequestParameters::Converter
|
|
7
|
+
include Courier::Internal::Type::RequestParameters
|
|
8
|
+
|
|
9
|
+
OrHash =
|
|
10
|
+
T.type_alias do
|
|
11
|
+
T.any(
|
|
12
|
+
Courier::NotificationPutContentParams,
|
|
13
|
+
Courier::Internal::AnyHash
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
sig { returns(String) }
|
|
18
|
+
attr_accessor :id
|
|
19
|
+
|
|
20
|
+
sig do
|
|
21
|
+
params(
|
|
22
|
+
id: String,
|
|
23
|
+
request_options: Courier::RequestOptions::OrHash
|
|
24
|
+
).returns(T.attached_class)
|
|
25
|
+
end
|
|
26
|
+
def self.new(id:, request_options: {})
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
sig do
|
|
30
|
+
override.returns(
|
|
31
|
+
{ id: String, request_options: Courier::RequestOptions }
|
|
32
|
+
)
|
|
33
|
+
end
|
|
34
|
+
def to_hash
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class NotificationPutElementParams < Courier::Models::NotificationElementPutRequest
|
|
6
|
+
extend Courier::Internal::Type::RequestParameters::Converter
|
|
7
|
+
include Courier::Internal::Type::RequestParameters
|
|
8
|
+
|
|
9
|
+
OrHash =
|
|
10
|
+
T.type_alias do
|
|
11
|
+
T.any(
|
|
12
|
+
Courier::NotificationPutElementParams,
|
|
13
|
+
Courier::Internal::AnyHash
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
sig { returns(String) }
|
|
18
|
+
attr_accessor :id
|
|
19
|
+
|
|
20
|
+
sig { returns(String) }
|
|
21
|
+
attr_accessor :element_id
|
|
22
|
+
|
|
23
|
+
sig do
|
|
24
|
+
params(
|
|
25
|
+
id: String,
|
|
26
|
+
element_id: String,
|
|
27
|
+
request_options: Courier::RequestOptions::OrHash
|
|
28
|
+
).returns(T.attached_class)
|
|
29
|
+
end
|
|
30
|
+
def self.new(id:, element_id:, request_options: {})
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
sig do
|
|
34
|
+
override.returns(
|
|
35
|
+
{
|
|
36
|
+
id: String,
|
|
37
|
+
element_id: String,
|
|
38
|
+
request_options: Courier::RequestOptions
|
|
39
|
+
}
|
|
40
|
+
)
|
|
41
|
+
end
|
|
42
|
+
def to_hash
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class NotificationPutLocaleParams < Courier::Models::NotificationLocalePutRequest
|
|
6
|
+
extend Courier::Internal::Type::RequestParameters::Converter
|
|
7
|
+
include Courier::Internal::Type::RequestParameters
|
|
8
|
+
|
|
9
|
+
OrHash =
|
|
10
|
+
T.type_alias do
|
|
11
|
+
T.any(
|
|
12
|
+
Courier::NotificationPutLocaleParams,
|
|
13
|
+
Courier::Internal::AnyHash
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
sig { returns(String) }
|
|
18
|
+
attr_accessor :id
|
|
19
|
+
|
|
20
|
+
sig { returns(String) }
|
|
21
|
+
attr_accessor :locale_id
|
|
22
|
+
|
|
23
|
+
sig do
|
|
24
|
+
params(
|
|
25
|
+
id: String,
|
|
26
|
+
locale_id: String,
|
|
27
|
+
request_options: Courier::RequestOptions::OrHash
|
|
28
|
+
).returns(T.attached_class)
|
|
29
|
+
end
|
|
30
|
+
def self.new(id:, locale_id:, request_options: {})
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
sig do
|
|
34
|
+
override.returns(
|
|
35
|
+
{
|
|
36
|
+
id: String,
|
|
37
|
+
locale_id: String,
|
|
38
|
+
request_options: Courier::RequestOptions
|
|
39
|
+
}
|
|
40
|
+
)
|
|
41
|
+
end
|
|
42
|
+
def to_hash
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
@@ -17,18 +17,37 @@ module Courier
|
|
|
17
17
|
sig { returns(String) }
|
|
18
18
|
attr_accessor :id
|
|
19
19
|
|
|
20
|
+
# Accepts `draft`, `published`, or a version string (e.g., `v001`). Defaults to
|
|
21
|
+
# `published`.
|
|
22
|
+
sig { returns(T.nilable(String)) }
|
|
23
|
+
attr_reader :version
|
|
24
|
+
|
|
25
|
+
sig { params(version: String).void }
|
|
26
|
+
attr_writer :version
|
|
27
|
+
|
|
20
28
|
sig do
|
|
21
29
|
params(
|
|
22
30
|
id: String,
|
|
31
|
+
version: String,
|
|
23
32
|
request_options: Courier::RequestOptions::OrHash
|
|
24
33
|
).returns(T.attached_class)
|
|
25
34
|
end
|
|
26
|
-
def self.new(
|
|
35
|
+
def self.new(
|
|
36
|
+
id:,
|
|
37
|
+
# Accepts `draft`, `published`, or a version string (e.g., `v001`). Defaults to
|
|
38
|
+
# `published`.
|
|
39
|
+
version: nil,
|
|
40
|
+
request_options: {}
|
|
41
|
+
)
|
|
27
42
|
end
|
|
28
43
|
|
|
29
44
|
sig do
|
|
30
45
|
override.returns(
|
|
31
|
-
{
|
|
46
|
+
{
|
|
47
|
+
id: String,
|
|
48
|
+
version: String,
|
|
49
|
+
request_options: Courier::RequestOptions
|
|
50
|
+
}
|
|
32
51
|
)
|
|
33
52
|
end
|
|
34
53
|
def to_hash
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
# Elemental content response for V2 templates. Contains versioned elements with
|
|
6
|
+
# content checksums.
|
|
7
|
+
module NotificationRetrieveContentResponse
|
|
8
|
+
extend Courier::Internal::Type::Union
|
|
9
|
+
|
|
10
|
+
Variants =
|
|
11
|
+
T.type_alias do
|
|
12
|
+
T.any(
|
|
13
|
+
Courier::NotificationContentGetResponse,
|
|
14
|
+
Courier::NotificationGetContent
|
|
15
|
+
)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
sig do
|
|
19
|
+
override.returns(
|
|
20
|
+
T::Array[
|
|
21
|
+
Courier::Models::NotificationRetrieveContentResponse::Variants
|
|
22
|
+
]
|
|
23
|
+
)
|
|
24
|
+
end
|
|
25
|
+
def self.variants
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
# Template state. Defaults to `DRAFT`.
|
|
6
|
+
module NotificationTemplateState
|
|
7
|
+
extend Courier::Internal::Type::Enum
|
|
8
|
+
|
|
9
|
+
TaggedSymbol =
|
|
10
|
+
T.type_alias { T.all(Symbol, Courier::NotificationTemplateState) }
|
|
11
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
12
|
+
|
|
13
|
+
DRAFT = T.let(:DRAFT, Courier::NotificationTemplateState::TaggedSymbol)
|
|
14
|
+
PUBLISHED =
|
|
15
|
+
T.let(:PUBLISHED, Courier::NotificationTemplateState::TaggedSymbol)
|
|
16
|
+
|
|
17
|
+
sig do
|
|
18
|
+
override.returns(
|
|
19
|
+
T::Array[Courier::NotificationTemplateState::TaggedSymbol]
|
|
20
|
+
)
|
|
21
|
+
end
|
|
22
|
+
def self.values
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -14,7 +14,8 @@ module Courier
|
|
|
14
14
|
sig { returns(String) }
|
|
15
15
|
attr_accessor :id
|
|
16
16
|
|
|
17
|
-
# The provider key identifying the type.
|
|
17
|
+
# The provider key identifying the type. Required on every request because it
|
|
18
|
+
# selects the provider-specific settings schema for validation.
|
|
18
19
|
sig { returns(String) }
|
|
19
20
|
attr_accessor :provider
|
|
20
21
|
|
|
@@ -53,7 +54,8 @@ module Courier
|
|
|
53
54
|
end
|
|
54
55
|
def self.new(
|
|
55
56
|
id:,
|
|
56
|
-
# The provider key identifying the type.
|
|
57
|
+
# The provider key identifying the type. Required on every request because it
|
|
58
|
+
# selects the provider-specific settings schema for validation.
|
|
57
59
|
provider:,
|
|
58
60
|
# Updated alias. Omit to clear.
|
|
59
61
|
alias_: nil,
|