trycourier 4.8.0 → 4.10.0
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 +41 -0
- data/README.md +1 -1
- data/lib/courier/client.rb +8 -0
- data/lib/courier/internal/util.rb +19 -6
- data/lib/courier/models/associated_notification_list_response.rb +24 -0
- data/lib/courier/models/channel.rb +75 -0
- data/lib/courier/models/channel_metadata.rb +15 -0
- data/lib/courier/models/element_with_checksums.rb +60 -0
- data/lib/courier/models/elemental_content.rb +2 -2
- data/lib/courier/models/elemental_html_node_with_type.rb +24 -0
- data/lib/courier/models/elemental_node.rb +3 -1
- data/lib/courier/models/message_channels.rb +8 -0
- data/lib/courier/models/message_providers.rb +8 -0
- data/lib/courier/models/message_providers_type.rb +38 -0
- data/lib/courier/models/metadata.rb +15 -0
- data/lib/courier/models/notification_archive_params.rb +20 -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_create_params.rb +14 -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_list_params.rb +13 -4
- data/lib/courier/models/notification_list_response.rb +108 -93
- data/lib/courier/models/notification_list_versions_params.rb +37 -0
- data/lib/courier/models/notification_locale_put_request.rb +39 -0
- data/lib/courier/models/notification_publish_params.rb +20 -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_replace_params.rb +20 -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_retrieve_params.rb +33 -0
- data/lib/courier/models/notification_template_create_request.rb +45 -0
- data/lib/courier/models/notification_template_get_response.rb +92 -0
- data/lib/courier/models/notification_template_mutation_response.rb +51 -0
- data/lib/courier/models/notification_template_payload.rb +98 -0
- data/lib/courier/models/notification_template_publish_request.rb +19 -0
- data/lib/courier/models/notification_template_state.rb +16 -0
- data/lib/courier/models/notification_template_summary.rb +81 -0
- data/lib/courier/models/notification_template_update_request.rb +46 -0
- data/lib/courier/models/notification_template_version_list_response.rb +22 -0
- data/lib/courier/models/provider.rb +67 -0
- data/lib/courier/models/provider_create_params.rb +52 -0
- data/lib/courier/models/provider_delete_params.rb +20 -0
- data/lib/courier/models/provider_list_params.rb +22 -0
- data/lib/courier/models/provider_list_response.rb +24 -0
- data/lib/courier/models/provider_retrieve_params.rb +20 -0
- data/lib/courier/models/provider_update_params.rb +58 -0
- data/lib/courier/models/providers/catalog_list_params.rb +44 -0
- data/lib/courier/models/providers/catalog_list_response.rb +26 -0
- data/lib/courier/models/providers_catalog_entry.rb +86 -0
- data/lib/courier/models/routing_strategy_archive_params.rb +20 -0
- data/lib/courier/models/routing_strategy_create_params.rb +14 -0
- data/lib/courier/models/routing_strategy_create_request.rb +58 -0
- data/lib/courier/models/routing_strategy_get_response.rb +99 -0
- data/lib/courier/models/routing_strategy_list_notifications_params.rb +37 -0
- data/lib/courier/models/routing_strategy_list_params.rb +30 -0
- data/lib/courier/models/routing_strategy_list_response.rb +24 -0
- data/lib/courier/models/routing_strategy_mutation_response.rb +19 -0
- data/lib/courier/models/routing_strategy_replace_params.rb +20 -0
- data/lib/courier/models/routing_strategy_replace_request.rb +59 -0
- data/lib/courier/models/routing_strategy_retrieve_params.rb +20 -0
- data/lib/courier/models/routing_strategy_summary.rb +75 -0
- data/lib/courier/models/send_message_params.rb +6 -154
- data/lib/courier/models/tenant_template_input.rb +6 -152
- data/lib/courier/models/timeouts.rb +21 -0
- data/lib/courier/models/version_node.rb +46 -0
- data/lib/courier/models.rb +110 -0
- data/lib/courier/resources/notifications.rb +289 -12
- data/lib/courier/resources/providers/catalog.rb +49 -0
- data/lib/courier/resources/providers.rb +150 -0
- data/lib/courier/resources/routing_strategies.rb +179 -0
- data/lib/courier/version.rb +1 -1
- data/lib/courier.rb +60 -2
- data/rbi/courier/client.rbi +6 -0
- data/rbi/courier/internal/util.rbi +8 -0
- data/rbi/courier/models/associated_notification_list_response.rbi +45 -0
- data/rbi/courier/models/channel.rbi +106 -0
- data/rbi/courier/models/channel_metadata.rbi +28 -0
- data/rbi/courier/models/element_with_checksums.rbi +109 -0
- data/rbi/courier/models/elemental_content.rbi +6 -3
- data/rbi/courier/models/elemental_html_node_with_type.rbi +59 -0
- data/rbi/courier/models/elemental_node.rbi +2 -1
- data/rbi/courier/models/message_channels.rbi +11 -0
- data/rbi/courier/models/message_providers.rbi +11 -0
- data/rbi/courier/models/message_providers_type.rbi +60 -0
- data/rbi/courier/models/metadata.rbi +26 -0
- data/rbi/courier/models/notification_archive_params.rbi +35 -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_create_params.rbi +27 -0
- data/rbi/courier/models/notification_element_put_request.rbi +98 -0
- data/rbi/courier/models/notification_list_params.rbi +15 -2
- data/rbi/courier/models/notification_list_response.rbi +159 -119
- data/rbi/courier/models/notification_list_versions_params.rbi +66 -0
- data/rbi/courier/models/notification_locale_put_request.rbi +79 -0
- data/rbi/courier/models/notification_publish_params.rbi +35 -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_replace_params.rbi +35 -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_retrieve_params.rbi +54 -0
- data/rbi/courier/models/notification_template_create_request.rbi +102 -0
- data/rbi/courier/models/notification_template_get_response.rbi +162 -0
- data/rbi/courier/models/notification_template_mutation_response.rbi +121 -0
- data/rbi/courier/models/notification_template_payload.rbi +183 -0
- data/rbi/courier/models/notification_template_publish_request.rbi +35 -0
- data/rbi/courier/models/notification_template_state.rbi +26 -0
- data/rbi/courier/models/notification_template_summary.rbi +124 -0
- data/rbi/courier/models/notification_template_update_request.rbi +103 -0
- data/rbi/courier/models/notification_template_version_list_response.rbi +41 -0
- data/rbi/courier/models/provider.rbi +87 -0
- data/rbi/courier/models/provider_create_params.rbi +82 -0
- data/rbi/courier/models/provider_delete_params.rbi +35 -0
- data/rbi/courier/models/provider_list_params.rbi +43 -0
- data/rbi/courier/models/provider_list_response.rbi +42 -0
- data/rbi/courier/models/provider_retrieve_params.rbi +35 -0
- data/rbi/courier/models/provider_update_params.rbi +86 -0
- data/rbi/courier/models/providers/catalog_list_params.rbi +75 -0
- data/rbi/courier/models/providers/catalog_list_response.rbi +47 -0
- data/rbi/courier/models/providers_catalog_entry.rbi +129 -0
- data/rbi/courier/models/routing_strategy_archive_params.rbi +38 -0
- data/rbi/courier/models/routing_strategy_create_params.rbi +30 -0
- data/rbi/courier/models/routing_strategy_create_request.rbi +86 -0
- data/rbi/courier/models/routing_strategy_get_response.rbi +121 -0
- data/rbi/courier/models/routing_strategy_list_notifications_params.rbi +63 -0
- data/rbi/courier/models/routing_strategy_list_params.rbi +54 -0
- data/rbi/courier/models/routing_strategy_list_response.rbi +45 -0
- data/rbi/courier/models/routing_strategy_mutation_response.rbi +31 -0
- data/rbi/courier/models/routing_strategy_replace_params.rbi +38 -0
- data/rbi/courier/models/routing_strategy_replace_request.rbi +87 -0
- data/rbi/courier/models/routing_strategy_retrieve_params.rbi +38 -0
- data/rbi/courier/models/routing_strategy_summary.rbi +95 -0
- data/rbi/courier/models/send_message_params.rbi +6 -362
- data/rbi/courier/models/tenant_template_input.rbi +8 -336
- data/rbi/courier/models/timeouts.rbi +33 -0
- data/rbi/courier/models/version_node.rbi +65 -0
- data/rbi/courier/models.rbi +122 -0
- data/rbi/courier/resources/notifications.rbi +222 -6
- data/rbi/courier/resources/providers/catalog.rbi +38 -0
- data/rbi/courier/resources/providers.rbi +116 -0
- data/rbi/courier/resources/routing_strategies.rbi +147 -0
- data/sig/courier/client.rbs +4 -0
- data/sig/courier/internal/util.rbs +4 -0
- data/sig/courier/models/associated_notification_list_response.rbs +25 -0
- data/sig/courier/models/channel.rbs +61 -0
- data/sig/courier/models/channel_metadata.rbs +13 -0
- data/sig/courier/models/element_with_checksums.rbs +60 -0
- data/sig/courier/models/elemental_html_node_with_type.rbs +32 -0
- data/sig/courier/models/elemental_node.rbs +1 -0
- data/sig/courier/models/message_channels.rbs +7 -0
- data/sig/courier/models/message_providers.rbs +7 -0
- data/sig/courier/models/message_providers_type.rbs +35 -0
- data/sig/courier/models/metadata.rbs +13 -0
- data/sig/courier/models/notification_archive_params.rbs +20 -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_create_params.rbs +15 -0
- data/sig/courier/models/notification_element_put_request.rbs +64 -0
- data/sig/courier/models/notification_list_params.rbs +7 -1
- data/sig/courier/models/notification_list_response.rbs +81 -71
- data/sig/courier/models/notification_list_versions_params.rbs +36 -0
- data/sig/courier/models/notification_locale_put_request.rbs +39 -0
- data/sig/courier/models/notification_publish_params.rbs +22 -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_replace_params.rbs +22 -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_retrieve_params.rbs +30 -0
- data/sig/courier/models/notification_template_create_request.rbs +40 -0
- data/sig/courier/models/notification_template_get_response.rbs +72 -0
- data/sig/courier/models/notification_template_mutation_response.rbs +46 -0
- data/sig/courier/models/notification_template_payload.rbs +75 -0
- data/sig/courier/models/notification_template_publish_request.rbs +15 -0
- data/sig/courier/models/notification_template_state.rbs +14 -0
- data/sig/courier/models/notification_template_summary.rbs +70 -0
- data/sig/courier/models/notification_template_update_request.rbs +40 -0
- data/sig/courier/models/notification_template_version_list_response.rbs +22 -0
- data/sig/courier/models/provider.rbs +52 -0
- data/sig/courier/models/provider_create_params.rbs +47 -0
- data/sig/courier/models/provider_delete_params.rbs +20 -0
- data/sig/courier/models/provider_list_params.rbs +25 -0
- data/sig/courier/models/provider_list_response.rbs +22 -0
- data/sig/courier/models/provider_retrieve_params.rbs +20 -0
- data/sig/courier/models/provider_update_params.rbs +52 -0
- data/sig/courier/models/providers/catalog_list_params.rbs +40 -0
- data/sig/courier/models/providers/catalog_list_response.rbs +27 -0
- data/sig/courier/models/providers_catalog_entry.rbs +64 -0
- data/sig/courier/models/routing_strategy_archive_params.rbs +20 -0
- data/sig/courier/models/routing_strategy_create_params.rbs +15 -0
- data/sig/courier/models/routing_strategy_create_request.rbs +45 -0
- data/sig/courier/models/routing_strategy_get_response.rbs +70 -0
- data/sig/courier/models/routing_strategy_list_notifications_params.rbs +34 -0
- data/sig/courier/models/routing_strategy_list_params.rbs +30 -0
- data/sig/courier/models/routing_strategy_list_response.rbs +25 -0
- data/sig/courier/models/routing_strategy_mutation_response.rbs +13 -0
- data/sig/courier/models/routing_strategy_replace_params.rbs +22 -0
- data/sig/courier/models/routing_strategy_replace_request.rbs +45 -0
- data/sig/courier/models/routing_strategy_retrieve_params.rbs +20 -0
- data/sig/courier/models/routing_strategy_summary.rbs +55 -0
- data/sig/courier/models/send_message_params.rbs +8 -130
- data/sig/courier/models/tenant_template_input.rbs +12 -134
- data/sig/courier/models/timeouts.rbs +15 -0
- data/sig/courier/models/version_node.rbs +32 -0
- data/sig/courier/models.rbs +108 -0
- data/sig/courier/resources/notifications.rbs +65 -3
- data/sig/courier/resources/providers/catalog.rbs +16 -0
- data/sig/courier/resources/providers.rbs +38 -0
- data/sig/courier/resources/routing_strategies.rbs +48 -0
- metadata +182 -8
- data/lib/courier/models/notifications/draft_retrieve_content_params.rb +0 -22
- data/lib/courier/resources/notifications/draft.rb +0 -33
- data/rbi/courier/models/notifications/draft_retrieve_content_params.rbi +0 -40
- data/rbi/courier/resources/notifications/draft.rbi +0 -23
- data/sig/courier/models/notifications/draft_retrieve_content_params.rbs +0 -22
- data/sig/courier/resources/notifications/draft.rbs +0 -14
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class Channel < Courier::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias { T.any(Courier::Channel, Courier::Internal::AnyHash) }
|
|
8
|
+
|
|
9
|
+
# Brand id used for rendering.
|
|
10
|
+
sig { returns(T.nilable(String)) }
|
|
11
|
+
attr_accessor :brand_id
|
|
12
|
+
|
|
13
|
+
# JS conditional with access to data/profile.
|
|
14
|
+
sig { returns(T.nilable(String)) }
|
|
15
|
+
attr_accessor :if_
|
|
16
|
+
|
|
17
|
+
sig { returns(T.nilable(Courier::ChannelMetadata)) }
|
|
18
|
+
attr_reader :metadata
|
|
19
|
+
|
|
20
|
+
sig { params(metadata: T.nilable(Courier::ChannelMetadata::OrHash)).void }
|
|
21
|
+
attr_writer :metadata
|
|
22
|
+
|
|
23
|
+
# Channel specific overrides.
|
|
24
|
+
sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
|
|
25
|
+
attr_accessor :override
|
|
26
|
+
|
|
27
|
+
# Providers enabled for this channel.
|
|
28
|
+
sig { returns(T.nilable(T::Array[String])) }
|
|
29
|
+
attr_accessor :providers
|
|
30
|
+
|
|
31
|
+
# Defaults to `single`.
|
|
32
|
+
sig { returns(T.nilable(Courier::Channel::RoutingMethod::OrSymbol)) }
|
|
33
|
+
attr_accessor :routing_method
|
|
34
|
+
|
|
35
|
+
sig { returns(T.nilable(Courier::Timeouts)) }
|
|
36
|
+
attr_reader :timeouts
|
|
37
|
+
|
|
38
|
+
sig { params(timeouts: T.nilable(Courier::Timeouts::OrHash)).void }
|
|
39
|
+
attr_writer :timeouts
|
|
40
|
+
|
|
41
|
+
sig do
|
|
42
|
+
params(
|
|
43
|
+
brand_id: T.nilable(String),
|
|
44
|
+
if_: T.nilable(String),
|
|
45
|
+
metadata: T.nilable(Courier::ChannelMetadata::OrHash),
|
|
46
|
+
override: T.nilable(T::Hash[Symbol, T.anything]),
|
|
47
|
+
providers: T.nilable(T::Array[String]),
|
|
48
|
+
routing_method: T.nilable(Courier::Channel::RoutingMethod::OrSymbol),
|
|
49
|
+
timeouts: T.nilable(Courier::Timeouts::OrHash)
|
|
50
|
+
).returns(T.attached_class)
|
|
51
|
+
end
|
|
52
|
+
def self.new(
|
|
53
|
+
# Brand id used for rendering.
|
|
54
|
+
brand_id: nil,
|
|
55
|
+
# JS conditional with access to data/profile.
|
|
56
|
+
if_: nil,
|
|
57
|
+
metadata: nil,
|
|
58
|
+
# Channel specific overrides.
|
|
59
|
+
override: nil,
|
|
60
|
+
# Providers enabled for this channel.
|
|
61
|
+
providers: nil,
|
|
62
|
+
# Defaults to `single`.
|
|
63
|
+
routing_method: nil,
|
|
64
|
+
timeouts: nil
|
|
65
|
+
)
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
sig do
|
|
69
|
+
override.returns(
|
|
70
|
+
{
|
|
71
|
+
brand_id: T.nilable(String),
|
|
72
|
+
if_: T.nilable(String),
|
|
73
|
+
metadata: T.nilable(Courier::ChannelMetadata),
|
|
74
|
+
override: T.nilable(T::Hash[Symbol, T.anything]),
|
|
75
|
+
providers: T.nilable(T::Array[String]),
|
|
76
|
+
routing_method:
|
|
77
|
+
T.nilable(Courier::Channel::RoutingMethod::OrSymbol),
|
|
78
|
+
timeouts: T.nilable(Courier::Timeouts)
|
|
79
|
+
}
|
|
80
|
+
)
|
|
81
|
+
end
|
|
82
|
+
def to_hash
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# Defaults to `single`.
|
|
86
|
+
module RoutingMethod
|
|
87
|
+
extend Courier::Internal::Type::Enum
|
|
88
|
+
|
|
89
|
+
TaggedSymbol =
|
|
90
|
+
T.type_alias { T.all(Symbol, Courier::Channel::RoutingMethod) }
|
|
91
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
92
|
+
|
|
93
|
+
ALL = T.let(:all, Courier::Channel::RoutingMethod::TaggedSymbol)
|
|
94
|
+
SINGLE = T.let(:single, Courier::Channel::RoutingMethod::TaggedSymbol)
|
|
95
|
+
|
|
96
|
+
sig do
|
|
97
|
+
override.returns(
|
|
98
|
+
T::Array[Courier::Channel::RoutingMethod::TaggedSymbol]
|
|
99
|
+
)
|
|
100
|
+
end
|
|
101
|
+
def self.values
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
end
|
|
105
|
+
end
|
|
106
|
+
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class ChannelMetadata < Courier::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(Courier::ChannelMetadata, Courier::Internal::AnyHash)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
sig { returns(T.nilable(Courier::Utm)) }
|
|
12
|
+
attr_reader :utm
|
|
13
|
+
|
|
14
|
+
sig { params(utm: T.nilable(Courier::Utm::OrHash)).void }
|
|
15
|
+
attr_writer :utm
|
|
16
|
+
|
|
17
|
+
sig do
|
|
18
|
+
params(utm: T.nilable(Courier::Utm::OrHash)).returns(T.attached_class)
|
|
19
|
+
end
|
|
20
|
+
def self.new(utm: nil)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
sig { override.returns({ utm: T.nilable(Courier::Utm) }) }
|
|
24
|
+
def to_hash
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class ElementWithChecksums < Courier::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(Courier::ElementWithChecksums, Courier::Internal::AnyHash)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
# MD5 hash of translatable content.
|
|
12
|
+
sig { returns(String) }
|
|
13
|
+
attr_accessor :checksum
|
|
14
|
+
|
|
15
|
+
# Element type (text, meta, action, etc.).
|
|
16
|
+
sig { returns(String) }
|
|
17
|
+
attr_accessor :type
|
|
18
|
+
|
|
19
|
+
sig { returns(T.nilable(String)) }
|
|
20
|
+
attr_reader :id
|
|
21
|
+
|
|
22
|
+
sig { params(id: String).void }
|
|
23
|
+
attr_writer :id
|
|
24
|
+
|
|
25
|
+
# Nested child elements (for group-type elements).
|
|
26
|
+
sig { returns(T.nilable(T::Array[Courier::ElementWithChecksums])) }
|
|
27
|
+
attr_reader :elements
|
|
28
|
+
|
|
29
|
+
sig { params(elements: T::Array[Courier::ElementWithChecksums]).void }
|
|
30
|
+
attr_writer :elements
|
|
31
|
+
|
|
32
|
+
# Locale-specific content with checksums.
|
|
33
|
+
sig do
|
|
34
|
+
returns(
|
|
35
|
+
T.nilable(T::Hash[Symbol, Courier::ElementWithChecksums::Locale])
|
|
36
|
+
)
|
|
37
|
+
end
|
|
38
|
+
attr_reader :locales
|
|
39
|
+
|
|
40
|
+
sig do
|
|
41
|
+
params(
|
|
42
|
+
locales:
|
|
43
|
+
T::Hash[Symbol, Courier::ElementWithChecksums::Locale::OrHash]
|
|
44
|
+
).void
|
|
45
|
+
end
|
|
46
|
+
attr_writer :locales
|
|
47
|
+
|
|
48
|
+
# An element with its content checksum and optional nested elements and locale
|
|
49
|
+
# checksums.
|
|
50
|
+
sig do
|
|
51
|
+
params(
|
|
52
|
+
checksum: String,
|
|
53
|
+
type: String,
|
|
54
|
+
id: String,
|
|
55
|
+
elements: T::Array[Courier::ElementWithChecksums],
|
|
56
|
+
locales:
|
|
57
|
+
T::Hash[Symbol, Courier::ElementWithChecksums::Locale::OrHash]
|
|
58
|
+
).returns(T.attached_class)
|
|
59
|
+
end
|
|
60
|
+
def self.new(
|
|
61
|
+
# MD5 hash of translatable content.
|
|
62
|
+
checksum:,
|
|
63
|
+
# Element type (text, meta, action, etc.).
|
|
64
|
+
type:,
|
|
65
|
+
id: nil,
|
|
66
|
+
# Nested child elements (for group-type elements).
|
|
67
|
+
elements: nil,
|
|
68
|
+
# Locale-specific content with checksums.
|
|
69
|
+
locales: nil
|
|
70
|
+
)
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
sig do
|
|
74
|
+
override.returns(
|
|
75
|
+
{
|
|
76
|
+
checksum: String,
|
|
77
|
+
type: String,
|
|
78
|
+
id: String,
|
|
79
|
+
elements: T::Array[Courier::ElementWithChecksums],
|
|
80
|
+
locales: T::Hash[Symbol, Courier::ElementWithChecksums::Locale]
|
|
81
|
+
}
|
|
82
|
+
)
|
|
83
|
+
end
|
|
84
|
+
def to_hash
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
class Locale < Courier::Internal::Type::BaseModel
|
|
88
|
+
OrHash =
|
|
89
|
+
T.type_alias do
|
|
90
|
+
T.any(
|
|
91
|
+
Courier::ElementWithChecksums::Locale,
|
|
92
|
+
Courier::Internal::AnyHash
|
|
93
|
+
)
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
sig { returns(String) }
|
|
97
|
+
attr_accessor :checksum
|
|
98
|
+
|
|
99
|
+
sig { params(checksum: String).returns(T.attached_class) }
|
|
100
|
+
def self.new(checksum:)
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
sig { override.returns({ checksum: String }) }
|
|
104
|
+
def to_hash
|
|
105
|
+
end
|
|
106
|
+
end
|
|
107
|
+
end
|
|
108
|
+
end
|
|
109
|
+
end
|
|
@@ -18,7 +18,8 @@ module Courier
|
|
|
18
18
|
Courier::ElementalImageNodeWithType,
|
|
19
19
|
Courier::ElementalActionNodeWithType,
|
|
20
20
|
Courier::ElementalDividerNodeWithType,
|
|
21
|
-
Courier::ElementalQuoteNodeWithType
|
|
21
|
+
Courier::ElementalQuoteNodeWithType,
|
|
22
|
+
Courier::ElementalHTMLNodeWithType
|
|
22
23
|
)
|
|
23
24
|
]
|
|
24
25
|
)
|
|
@@ -40,7 +41,8 @@ module Courier
|
|
|
40
41
|
Courier::ElementalImageNodeWithType::OrHash,
|
|
41
42
|
Courier::ElementalActionNodeWithType::OrHash,
|
|
42
43
|
Courier::ElementalDividerNodeWithType::OrHash,
|
|
43
|
-
Courier::ElementalQuoteNodeWithType::OrHash
|
|
44
|
+
Courier::ElementalQuoteNodeWithType::OrHash,
|
|
45
|
+
Courier::ElementalHTMLNodeWithType::OrHash
|
|
44
46
|
)
|
|
45
47
|
],
|
|
46
48
|
version: String
|
|
@@ -65,7 +67,8 @@ module Courier
|
|
|
65
67
|
Courier::ElementalImageNodeWithType,
|
|
66
68
|
Courier::ElementalActionNodeWithType,
|
|
67
69
|
Courier::ElementalDividerNodeWithType,
|
|
68
|
-
Courier::ElementalQuoteNodeWithType
|
|
70
|
+
Courier::ElementalQuoteNodeWithType,
|
|
71
|
+
Courier::ElementalHTMLNodeWithType
|
|
69
72
|
)
|
|
70
73
|
],
|
|
71
74
|
version: String
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class ElementalHTMLNodeWithType < Courier::Models::ElementalBaseNode
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(Courier::ElementalHTMLNodeWithType, Courier::Internal::AnyHash)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
sig do
|
|
12
|
+
returns(T.nilable(Courier::ElementalHTMLNodeWithType::Type::OrSymbol))
|
|
13
|
+
end
|
|
14
|
+
attr_reader :type
|
|
15
|
+
|
|
16
|
+
sig do
|
|
17
|
+
params(type: Courier::ElementalHTMLNodeWithType::Type::OrSymbol).void
|
|
18
|
+
end
|
|
19
|
+
attr_writer :type
|
|
20
|
+
|
|
21
|
+
sig do
|
|
22
|
+
params(
|
|
23
|
+
type: Courier::ElementalHTMLNodeWithType::Type::OrSymbol
|
|
24
|
+
).returns(T.attached_class)
|
|
25
|
+
end
|
|
26
|
+
def self.new(type: nil)
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
sig do
|
|
30
|
+
override.returns(
|
|
31
|
+
{ type: Courier::ElementalHTMLNodeWithType::Type::OrSymbol }
|
|
32
|
+
)
|
|
33
|
+
end
|
|
34
|
+
def to_hash
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
module Type
|
|
38
|
+
extend Courier::Internal::Type::Enum
|
|
39
|
+
|
|
40
|
+
TaggedSymbol =
|
|
41
|
+
T.type_alias do
|
|
42
|
+
T.all(Symbol, Courier::ElementalHTMLNodeWithType::Type)
|
|
43
|
+
end
|
|
44
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
45
|
+
|
|
46
|
+
HTML =
|
|
47
|
+
T.let(:html, Courier::ElementalHTMLNodeWithType::Type::TaggedSymbol)
|
|
48
|
+
|
|
49
|
+
sig do
|
|
50
|
+
override.returns(
|
|
51
|
+
T::Array[Courier::ElementalHTMLNodeWithType::Type::TaggedSymbol]
|
|
52
|
+
)
|
|
53
|
+
end
|
|
54
|
+
def self.values
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
@@ -24,7 +24,8 @@ module Courier
|
|
|
24
24
|
Courier::ElementalImageNodeWithType,
|
|
25
25
|
Courier::ElementalActionNodeWithType,
|
|
26
26
|
Courier::ElementalDividerNodeWithType,
|
|
27
|
-
Courier::ElementalQuoteNodeWithType
|
|
27
|
+
Courier::ElementalQuoteNodeWithType,
|
|
28
|
+
Courier::ElementalHTMLNodeWithType
|
|
28
29
|
)
|
|
29
30
|
end
|
|
30
31
|
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class MessageProvidersType < Courier::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(Courier::MessageProvidersType, Courier::Internal::AnyHash)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
# JS conditional with access to data/profile.
|
|
12
|
+
sig { returns(T.nilable(String)) }
|
|
13
|
+
attr_accessor :if_
|
|
14
|
+
|
|
15
|
+
sig { returns(T.nilable(Courier::Metadata)) }
|
|
16
|
+
attr_reader :metadata
|
|
17
|
+
|
|
18
|
+
sig { params(metadata: T.nilable(Courier::Metadata::OrHash)).void }
|
|
19
|
+
attr_writer :metadata
|
|
20
|
+
|
|
21
|
+
# Provider-specific overrides.
|
|
22
|
+
sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
|
|
23
|
+
attr_accessor :override
|
|
24
|
+
|
|
25
|
+
sig { returns(T.nilable(Integer)) }
|
|
26
|
+
attr_accessor :timeouts
|
|
27
|
+
|
|
28
|
+
sig do
|
|
29
|
+
params(
|
|
30
|
+
if_: T.nilable(String),
|
|
31
|
+
metadata: T.nilable(Courier::Metadata::OrHash),
|
|
32
|
+
override: T.nilable(T::Hash[Symbol, T.anything]),
|
|
33
|
+
timeouts: T.nilable(Integer)
|
|
34
|
+
).returns(T.attached_class)
|
|
35
|
+
end
|
|
36
|
+
def self.new(
|
|
37
|
+
# JS conditional with access to data/profile.
|
|
38
|
+
if_: nil,
|
|
39
|
+
metadata: nil,
|
|
40
|
+
# Provider-specific overrides.
|
|
41
|
+
override: nil,
|
|
42
|
+
timeouts: nil
|
|
43
|
+
)
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
sig do
|
|
47
|
+
override.returns(
|
|
48
|
+
{
|
|
49
|
+
if_: T.nilable(String),
|
|
50
|
+
metadata: T.nilable(Courier::Metadata),
|
|
51
|
+
override: T.nilable(T::Hash[Symbol, T.anything]),
|
|
52
|
+
timeouts: T.nilable(Integer)
|
|
53
|
+
}
|
|
54
|
+
)
|
|
55
|
+
end
|
|
56
|
+
def to_hash
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class Metadata < Courier::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias { T.any(Courier::Metadata, Courier::Internal::AnyHash) }
|
|
8
|
+
|
|
9
|
+
sig { returns(T.nilable(Courier::Utm)) }
|
|
10
|
+
attr_reader :utm
|
|
11
|
+
|
|
12
|
+
sig { params(utm: T.nilable(Courier::Utm::OrHash)).void }
|
|
13
|
+
attr_writer :utm
|
|
14
|
+
|
|
15
|
+
sig do
|
|
16
|
+
params(utm: T.nilable(Courier::Utm::OrHash)).returns(T.attached_class)
|
|
17
|
+
end
|
|
18
|
+
def self.new(utm: nil)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
sig { override.returns({ utm: T.nilable(Courier::Utm) }) }
|
|
22
|
+
def to_hash
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class NotificationArchiveParams < Courier::Internal::Type::BaseModel
|
|
6
|
+
extend Courier::Internal::Type::RequestParameters::Converter
|
|
7
|
+
include Courier::Internal::Type::RequestParameters
|
|
8
|
+
|
|
9
|
+
OrHash =
|
|
10
|
+
T.type_alias do
|
|
11
|
+
T.any(Courier::NotificationArchiveParams, Courier::Internal::AnyHash)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
sig { returns(String) }
|
|
15
|
+
attr_accessor :id
|
|
16
|
+
|
|
17
|
+
sig do
|
|
18
|
+
params(
|
|
19
|
+
id: String,
|
|
20
|
+
request_options: Courier::RequestOptions::OrHash
|
|
21
|
+
).returns(T.attached_class)
|
|
22
|
+
end
|
|
23
|
+
def self.new(id:, request_options: {})
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
sig do
|
|
27
|
+
override.returns(
|
|
28
|
+
{ id: String, request_options: Courier::RequestOptions }
|
|
29
|
+
)
|
|
30
|
+
end
|
|
31
|
+
def to_hash
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class NotificationContentGetResponse < Courier::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(
|
|
9
|
+
Courier::NotificationContentGetResponse,
|
|
10
|
+
Courier::Internal::AnyHash
|
|
11
|
+
)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
sig { returns(T::Array[Courier::ElementWithChecksums]) }
|
|
15
|
+
attr_accessor :elements
|
|
16
|
+
|
|
17
|
+
# Content version identifier.
|
|
18
|
+
sig { returns(String) }
|
|
19
|
+
attr_accessor :version
|
|
20
|
+
|
|
21
|
+
# Elemental content response for V2 templates. Contains versioned elements with
|
|
22
|
+
# content checksums.
|
|
23
|
+
sig do
|
|
24
|
+
params(
|
|
25
|
+
elements: T::Array[Courier::ElementWithChecksums::OrHash],
|
|
26
|
+
version: String
|
|
27
|
+
).returns(T.attached_class)
|
|
28
|
+
end
|
|
29
|
+
def self.new(
|
|
30
|
+
elements:,
|
|
31
|
+
# Content version identifier.
|
|
32
|
+
version:
|
|
33
|
+
)
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
sig do
|
|
37
|
+
override.returns(
|
|
38
|
+
{ elements: T::Array[Courier::ElementWithChecksums], version: String }
|
|
39
|
+
)
|
|
40
|
+
end
|
|
41
|
+
def to_hash
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
@@ -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
|