trycourier 4.8.0 → 4.9.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 +32 -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/channel.rb +75 -0
- data/lib/courier/models/channel_metadata.rb +15 -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_create_params.rb +14 -0
- 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_publish_params.rb +20 -0
- data/lib/courier/models/notification_replace_params.rb +20 -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_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_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 +86 -0
- data/lib/courier/resources/notifications.rb +165 -3
- data/lib/courier/resources/providers/catalog.rb +49 -0
- data/lib/courier/resources/providers.rb +150 -0
- data/lib/courier/resources/routing_strategies.rb +151 -0
- data/lib/courier/version.rb +1 -1
- data/lib/courier.rb +47 -0
- data/rbi/courier/client.rbi +6 -0
- data/rbi/courier/internal/util.rbi +8 -0
- data/rbi/courier/models/channel.rbi +106 -0
- data/rbi/courier/models/channel_metadata.rbi +28 -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_create_params.rbi +27 -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_publish_params.rbi +35 -0
- data/rbi/courier/models/notification_replace_params.rbi +35 -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_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_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 +94 -0
- data/rbi/courier/resources/notifications.rbi +119 -1
- data/rbi/courier/resources/providers/catalog.rbi +38 -0
- data/rbi/courier/resources/providers.rbi +116 -0
- data/rbi/courier/resources/routing_strategies.rbi +126 -0
- data/sig/courier/client.rbs +4 -0
- data/sig/courier/internal/util.rbs +4 -0
- data/sig/courier/models/channel.rbs +61 -0
- data/sig/courier/models/channel_metadata.rbs +13 -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_create_params.rbs +15 -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_publish_params.rbs +22 -0
- data/sig/courier/models/notification_replace_params.rbs +22 -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_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_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 +84 -0
- data/sig/courier/resources/notifications.rbs +35 -0
- data/sig/courier/resources/providers/catalog.rbs +16 -0
- data/sig/courier/resources/providers.rbs +38 -0
- data/sig/courier/resources/routing_strategies.rbs +41 -0
- metadata +143 -2
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class ProvidersCatalogEntry < Courier::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(Courier::ProvidersCatalogEntry, Courier::Internal::AnyHash)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
# Courier taxonomy channel (e.g. email, push, sms, direct_message, inbox,
|
|
12
|
+
# webhook).
|
|
13
|
+
sig { returns(String) }
|
|
14
|
+
attr_accessor :channel
|
|
15
|
+
|
|
16
|
+
# Short description of the provider.
|
|
17
|
+
sig { returns(String) }
|
|
18
|
+
attr_accessor :description
|
|
19
|
+
|
|
20
|
+
# Human-readable display name.
|
|
21
|
+
sig { returns(String) }
|
|
22
|
+
attr_accessor :name
|
|
23
|
+
|
|
24
|
+
# The provider key (e.g. "sendgrid", "twilio").
|
|
25
|
+
sig { returns(String) }
|
|
26
|
+
attr_accessor :provider
|
|
27
|
+
|
|
28
|
+
# Map of setting field names (snake_case) to their schema descriptors. Each
|
|
29
|
+
# descriptor has `type` and `required`. Empty when the provider has no
|
|
30
|
+
# configurable schema.
|
|
31
|
+
sig { returns(T::Hash[Symbol, Courier::ProvidersCatalogEntry::Setting]) }
|
|
32
|
+
attr_accessor :settings
|
|
33
|
+
|
|
34
|
+
# A provider type from the catalog. Contains the key, display name, description,
|
|
35
|
+
# and a `settings` object describing configuration schema fields.
|
|
36
|
+
sig do
|
|
37
|
+
params(
|
|
38
|
+
channel: String,
|
|
39
|
+
description: String,
|
|
40
|
+
name: String,
|
|
41
|
+
provider: String,
|
|
42
|
+
settings:
|
|
43
|
+
T::Hash[Symbol, Courier::ProvidersCatalogEntry::Setting::OrHash]
|
|
44
|
+
).returns(T.attached_class)
|
|
45
|
+
end
|
|
46
|
+
def self.new(
|
|
47
|
+
# Courier taxonomy channel (e.g. email, push, sms, direct_message, inbox,
|
|
48
|
+
# webhook).
|
|
49
|
+
channel:,
|
|
50
|
+
# Short description of the provider.
|
|
51
|
+
description:,
|
|
52
|
+
# Human-readable display name.
|
|
53
|
+
name:,
|
|
54
|
+
# The provider key (e.g. "sendgrid", "twilio").
|
|
55
|
+
provider:,
|
|
56
|
+
# Map of setting field names (snake_case) to their schema descriptors. Each
|
|
57
|
+
# descriptor has `type` and `required`. Empty when the provider has no
|
|
58
|
+
# configurable schema.
|
|
59
|
+
settings:
|
|
60
|
+
)
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
sig do
|
|
64
|
+
override.returns(
|
|
65
|
+
{
|
|
66
|
+
channel: String,
|
|
67
|
+
description: String,
|
|
68
|
+
name: String,
|
|
69
|
+
provider: String,
|
|
70
|
+
settings: T::Hash[Symbol, Courier::ProvidersCatalogEntry::Setting]
|
|
71
|
+
}
|
|
72
|
+
)
|
|
73
|
+
end
|
|
74
|
+
def to_hash
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
class Setting < Courier::Internal::Type::BaseModel
|
|
78
|
+
OrHash =
|
|
79
|
+
T.type_alias do
|
|
80
|
+
T.any(
|
|
81
|
+
Courier::ProvidersCatalogEntry::Setting,
|
|
82
|
+
Courier::Internal::AnyHash
|
|
83
|
+
)
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# Whether this field is required when configuring the provider.
|
|
87
|
+
sig { returns(T::Boolean) }
|
|
88
|
+
attr_accessor :required
|
|
89
|
+
|
|
90
|
+
# The field's data type (e.g. "string", "boolean", "enum").
|
|
91
|
+
sig { returns(String) }
|
|
92
|
+
attr_accessor :type
|
|
93
|
+
|
|
94
|
+
# Allowed values when `type` is "enum".
|
|
95
|
+
sig { returns(T.nilable(T::Array[String])) }
|
|
96
|
+
attr_reader :values
|
|
97
|
+
|
|
98
|
+
sig { params(values: T::Array[String]).void }
|
|
99
|
+
attr_writer :values
|
|
100
|
+
|
|
101
|
+
# Describes a single configuration field in the provider catalog.
|
|
102
|
+
sig do
|
|
103
|
+
params(
|
|
104
|
+
required: T::Boolean,
|
|
105
|
+
type: String,
|
|
106
|
+
values: T::Array[String]
|
|
107
|
+
).returns(T.attached_class)
|
|
108
|
+
end
|
|
109
|
+
def self.new(
|
|
110
|
+
# Whether this field is required when configuring the provider.
|
|
111
|
+
required:,
|
|
112
|
+
# The field's data type (e.g. "string", "boolean", "enum").
|
|
113
|
+
type:,
|
|
114
|
+
# Allowed values when `type` is "enum".
|
|
115
|
+
values: nil
|
|
116
|
+
)
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
sig do
|
|
120
|
+
override.returns(
|
|
121
|
+
{ required: T::Boolean, type: String, values: T::Array[String] }
|
|
122
|
+
)
|
|
123
|
+
end
|
|
124
|
+
def to_hash
|
|
125
|
+
end
|
|
126
|
+
end
|
|
127
|
+
end
|
|
128
|
+
end
|
|
129
|
+
end
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class RoutingStrategyArchiveParams < 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(
|
|
12
|
+
Courier::RoutingStrategyArchiveParams,
|
|
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,30 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class RoutingStrategyCreateParams < Courier::Models::RoutingStrategyCreateRequest
|
|
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::RoutingStrategyCreateParams,
|
|
13
|
+
Courier::Internal::AnyHash
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
sig do
|
|
18
|
+
params(request_options: Courier::RequestOptions::OrHash).returns(
|
|
19
|
+
T.attached_class
|
|
20
|
+
)
|
|
21
|
+
end
|
|
22
|
+
def self.new(request_options: {})
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
sig { override.returns({ request_options: Courier::RequestOptions }) }
|
|
26
|
+
def to_hash
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class RoutingStrategyCreateRequest < Courier::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(
|
|
9
|
+
Courier::RoutingStrategyCreateRequest,
|
|
10
|
+
Courier::Internal::AnyHash
|
|
11
|
+
)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# Human-readable name for the routing strategy.
|
|
15
|
+
sig { returns(String) }
|
|
16
|
+
attr_accessor :name
|
|
17
|
+
|
|
18
|
+
# Routing tree defining channel selection method and order.
|
|
19
|
+
sig { returns(Courier::MessageRouting) }
|
|
20
|
+
attr_reader :routing
|
|
21
|
+
|
|
22
|
+
sig { params(routing: Courier::MessageRouting::OrHash).void }
|
|
23
|
+
attr_writer :routing
|
|
24
|
+
|
|
25
|
+
# Per-channel delivery configuration. Defaults to empty if omitted.
|
|
26
|
+
sig { returns(T.nilable(T::Hash[Symbol, Courier::Channel])) }
|
|
27
|
+
attr_accessor :channels
|
|
28
|
+
|
|
29
|
+
# Optional description of the routing strategy.
|
|
30
|
+
sig { returns(T.nilable(String)) }
|
|
31
|
+
attr_accessor :description
|
|
32
|
+
|
|
33
|
+
# Per-provider delivery configuration. Defaults to empty if omitted.
|
|
34
|
+
sig { returns(T.nilable(T::Hash[Symbol, Courier::MessageProvidersType])) }
|
|
35
|
+
attr_accessor :providers
|
|
36
|
+
|
|
37
|
+
# Optional tags for categorization.
|
|
38
|
+
sig { returns(T.nilable(T::Array[String])) }
|
|
39
|
+
attr_accessor :tags
|
|
40
|
+
|
|
41
|
+
# Request body for creating a routing strategy.
|
|
42
|
+
sig do
|
|
43
|
+
params(
|
|
44
|
+
name: String,
|
|
45
|
+
routing: Courier::MessageRouting::OrHash,
|
|
46
|
+
channels: T.nilable(T::Hash[Symbol, Courier::Channel::OrHash]),
|
|
47
|
+
description: T.nilable(String),
|
|
48
|
+
providers:
|
|
49
|
+
T.nilable(T::Hash[Symbol, Courier::MessageProvidersType::OrHash]),
|
|
50
|
+
tags: T.nilable(T::Array[String])
|
|
51
|
+
).returns(T.attached_class)
|
|
52
|
+
end
|
|
53
|
+
def self.new(
|
|
54
|
+
# Human-readable name for the routing strategy.
|
|
55
|
+
name:,
|
|
56
|
+
# Routing tree defining channel selection method and order.
|
|
57
|
+
routing:,
|
|
58
|
+
# Per-channel delivery configuration. Defaults to empty if omitted.
|
|
59
|
+
channels: nil,
|
|
60
|
+
# Optional description of the routing strategy.
|
|
61
|
+
description: nil,
|
|
62
|
+
# Per-provider delivery configuration. Defaults to empty if omitted.
|
|
63
|
+
providers: nil,
|
|
64
|
+
# Optional tags for categorization.
|
|
65
|
+
tags: nil
|
|
66
|
+
)
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
sig do
|
|
70
|
+
override.returns(
|
|
71
|
+
{
|
|
72
|
+
name: String,
|
|
73
|
+
routing: Courier::MessageRouting,
|
|
74
|
+
channels: T.nilable(T::Hash[Symbol, Courier::Channel]),
|
|
75
|
+
description: T.nilable(String),
|
|
76
|
+
providers:
|
|
77
|
+
T.nilable(T::Hash[Symbol, Courier::MessageProvidersType]),
|
|
78
|
+
tags: T.nilable(T::Array[String])
|
|
79
|
+
}
|
|
80
|
+
)
|
|
81
|
+
end
|
|
82
|
+
def to_hash
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
end
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class RoutingStrategyGetResponse < Courier::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(Courier::RoutingStrategyGetResponse, Courier::Internal::AnyHash)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
# The routing strategy ID (rs\_ prefix).
|
|
12
|
+
sig { returns(String) }
|
|
13
|
+
attr_accessor :id
|
|
14
|
+
|
|
15
|
+
# Per-channel delivery configuration. May be empty.
|
|
16
|
+
sig { returns(T::Hash[Symbol, Courier::Channel]) }
|
|
17
|
+
attr_accessor :channels
|
|
18
|
+
|
|
19
|
+
# Epoch milliseconds when the strategy was created.
|
|
20
|
+
sig { returns(Integer) }
|
|
21
|
+
attr_accessor :created
|
|
22
|
+
|
|
23
|
+
# User ID of the creator.
|
|
24
|
+
sig { returns(String) }
|
|
25
|
+
attr_accessor :creator
|
|
26
|
+
|
|
27
|
+
# Human-readable name.
|
|
28
|
+
sig { returns(String) }
|
|
29
|
+
attr_accessor :name
|
|
30
|
+
|
|
31
|
+
# Per-provider delivery configuration. May be empty.
|
|
32
|
+
sig { returns(T::Hash[Symbol, Courier::MessageProvidersType]) }
|
|
33
|
+
attr_accessor :providers
|
|
34
|
+
|
|
35
|
+
# Routing tree defining channel selection method and order.
|
|
36
|
+
sig { returns(Courier::MessageRouting) }
|
|
37
|
+
attr_reader :routing
|
|
38
|
+
|
|
39
|
+
sig { params(routing: Courier::MessageRouting::OrHash).void }
|
|
40
|
+
attr_writer :routing
|
|
41
|
+
|
|
42
|
+
# Description of the routing strategy.
|
|
43
|
+
sig { returns(T.nilable(String)) }
|
|
44
|
+
attr_accessor :description
|
|
45
|
+
|
|
46
|
+
# Tags for categorization.
|
|
47
|
+
sig { returns(T.nilable(T::Array[String])) }
|
|
48
|
+
attr_accessor :tags
|
|
49
|
+
|
|
50
|
+
# Epoch milliseconds of last update.
|
|
51
|
+
sig { returns(T.nilable(Integer)) }
|
|
52
|
+
attr_accessor :updated
|
|
53
|
+
|
|
54
|
+
# User ID of the last updater.
|
|
55
|
+
sig { returns(T.nilable(String)) }
|
|
56
|
+
attr_accessor :updater
|
|
57
|
+
|
|
58
|
+
# Full routing strategy entity returned by GET.
|
|
59
|
+
sig do
|
|
60
|
+
params(
|
|
61
|
+
id: String,
|
|
62
|
+
channels: T::Hash[Symbol, Courier::Channel::OrHash],
|
|
63
|
+
created: Integer,
|
|
64
|
+
creator: String,
|
|
65
|
+
name: String,
|
|
66
|
+
providers: T::Hash[Symbol, Courier::MessageProvidersType::OrHash],
|
|
67
|
+
routing: Courier::MessageRouting::OrHash,
|
|
68
|
+
description: T.nilable(String),
|
|
69
|
+
tags: T.nilable(T::Array[String]),
|
|
70
|
+
updated: T.nilable(Integer),
|
|
71
|
+
updater: T.nilable(String)
|
|
72
|
+
).returns(T.attached_class)
|
|
73
|
+
end
|
|
74
|
+
def self.new(
|
|
75
|
+
# The routing strategy ID (rs\_ prefix).
|
|
76
|
+
id:,
|
|
77
|
+
# Per-channel delivery configuration. May be empty.
|
|
78
|
+
channels:,
|
|
79
|
+
# Epoch milliseconds when the strategy was created.
|
|
80
|
+
created:,
|
|
81
|
+
# User ID of the creator.
|
|
82
|
+
creator:,
|
|
83
|
+
# Human-readable name.
|
|
84
|
+
name:,
|
|
85
|
+
# Per-provider delivery configuration. May be empty.
|
|
86
|
+
providers:,
|
|
87
|
+
# Routing tree defining channel selection method and order.
|
|
88
|
+
routing:,
|
|
89
|
+
# Description of the routing strategy.
|
|
90
|
+
description: nil,
|
|
91
|
+
# Tags for categorization.
|
|
92
|
+
tags: nil,
|
|
93
|
+
# Epoch milliseconds of last update.
|
|
94
|
+
updated: nil,
|
|
95
|
+
# User ID of the last updater.
|
|
96
|
+
updater: nil
|
|
97
|
+
)
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
sig do
|
|
101
|
+
override.returns(
|
|
102
|
+
{
|
|
103
|
+
id: String,
|
|
104
|
+
channels: T::Hash[Symbol, Courier::Channel],
|
|
105
|
+
created: Integer,
|
|
106
|
+
creator: String,
|
|
107
|
+
name: String,
|
|
108
|
+
providers: T::Hash[Symbol, Courier::MessageProvidersType],
|
|
109
|
+
routing: Courier::MessageRouting,
|
|
110
|
+
description: T.nilable(String),
|
|
111
|
+
tags: T.nilable(T::Array[String]),
|
|
112
|
+
updated: T.nilable(Integer),
|
|
113
|
+
updater: T.nilable(String)
|
|
114
|
+
}
|
|
115
|
+
)
|
|
116
|
+
end
|
|
117
|
+
def to_hash
|
|
118
|
+
end
|
|
119
|
+
end
|
|
120
|
+
end
|
|
121
|
+
end
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class RoutingStrategyListParams < 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::RoutingStrategyListParams, Courier::Internal::AnyHash)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# Opaque pagination cursor from a previous response. Omit for the first page.
|
|
15
|
+
sig { returns(T.nilable(String)) }
|
|
16
|
+
attr_accessor :cursor
|
|
17
|
+
|
|
18
|
+
# Maximum number of results per page. Default 20, max 100.
|
|
19
|
+
sig { returns(T.nilable(Integer)) }
|
|
20
|
+
attr_reader :limit
|
|
21
|
+
|
|
22
|
+
sig { params(limit: Integer).void }
|
|
23
|
+
attr_writer :limit
|
|
24
|
+
|
|
25
|
+
sig do
|
|
26
|
+
params(
|
|
27
|
+
cursor: T.nilable(String),
|
|
28
|
+
limit: Integer,
|
|
29
|
+
request_options: Courier::RequestOptions::OrHash
|
|
30
|
+
).returns(T.attached_class)
|
|
31
|
+
end
|
|
32
|
+
def self.new(
|
|
33
|
+
# Opaque pagination cursor from a previous response. Omit for the first page.
|
|
34
|
+
cursor: nil,
|
|
35
|
+
# Maximum number of results per page. Default 20, max 100.
|
|
36
|
+
limit: nil,
|
|
37
|
+
request_options: {}
|
|
38
|
+
)
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
sig do
|
|
42
|
+
override.returns(
|
|
43
|
+
{
|
|
44
|
+
cursor: T.nilable(String),
|
|
45
|
+
limit: Integer,
|
|
46
|
+
request_options: Courier::RequestOptions
|
|
47
|
+
}
|
|
48
|
+
)
|
|
49
|
+
end
|
|
50
|
+
def to_hash
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class RoutingStrategyListResponse < Courier::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(
|
|
9
|
+
Courier::RoutingStrategyListResponse,
|
|
10
|
+
Courier::Internal::AnyHash
|
|
11
|
+
)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
sig { returns(Courier::Paging) }
|
|
15
|
+
attr_reader :paging
|
|
16
|
+
|
|
17
|
+
sig { params(paging: Courier::Paging::OrHash).void }
|
|
18
|
+
attr_writer :paging
|
|
19
|
+
|
|
20
|
+
sig { returns(T::Array[Courier::RoutingStrategySummary]) }
|
|
21
|
+
attr_accessor :results
|
|
22
|
+
|
|
23
|
+
# Paginated list of routing strategy summaries.
|
|
24
|
+
sig do
|
|
25
|
+
params(
|
|
26
|
+
paging: Courier::Paging::OrHash,
|
|
27
|
+
results: T::Array[Courier::RoutingStrategySummary::OrHash]
|
|
28
|
+
).returns(T.attached_class)
|
|
29
|
+
end
|
|
30
|
+
def self.new(paging:, results:)
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
sig do
|
|
34
|
+
override.returns(
|
|
35
|
+
{
|
|
36
|
+
paging: Courier::Paging,
|
|
37
|
+
results: T::Array[Courier::RoutingStrategySummary]
|
|
38
|
+
}
|
|
39
|
+
)
|
|
40
|
+
end
|
|
41
|
+
def to_hash
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class RoutingStrategyMutationResponse < Courier::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(
|
|
9
|
+
Courier::RoutingStrategyMutationResponse,
|
|
10
|
+
Courier::Internal::AnyHash
|
|
11
|
+
)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# The routing strategy ID (rs\_ prefix).
|
|
15
|
+
sig { returns(String) }
|
|
16
|
+
attr_accessor :id
|
|
17
|
+
|
|
18
|
+
# Response returned by create and replace operations.
|
|
19
|
+
sig { params(id: String).returns(T.attached_class) }
|
|
20
|
+
def self.new(
|
|
21
|
+
# The routing strategy ID (rs\_ prefix).
|
|
22
|
+
id:
|
|
23
|
+
)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
sig { override.returns({ id: String }) }
|
|
27
|
+
def to_hash
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class RoutingStrategyReplaceParams < Courier::Models::RoutingStrategyReplaceRequest
|
|
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::RoutingStrategyReplaceParams,
|
|
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,87 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class RoutingStrategyReplaceRequest < Courier::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(
|
|
9
|
+
Courier::RoutingStrategyReplaceRequest,
|
|
10
|
+
Courier::Internal::AnyHash
|
|
11
|
+
)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# Human-readable name for the routing strategy.
|
|
15
|
+
sig { returns(String) }
|
|
16
|
+
attr_accessor :name
|
|
17
|
+
|
|
18
|
+
# Routing tree defining channel selection method and order.
|
|
19
|
+
sig { returns(Courier::MessageRouting) }
|
|
20
|
+
attr_reader :routing
|
|
21
|
+
|
|
22
|
+
sig { params(routing: Courier::MessageRouting::OrHash).void }
|
|
23
|
+
attr_writer :routing
|
|
24
|
+
|
|
25
|
+
# Per-channel delivery configuration. Omit to clear.
|
|
26
|
+
sig { returns(T.nilable(T::Hash[Symbol, Courier::Channel])) }
|
|
27
|
+
attr_accessor :channels
|
|
28
|
+
|
|
29
|
+
# Optional description. Omit or null to clear.
|
|
30
|
+
sig { returns(T.nilable(String)) }
|
|
31
|
+
attr_accessor :description
|
|
32
|
+
|
|
33
|
+
# Per-provider delivery configuration. Omit to clear.
|
|
34
|
+
sig { returns(T.nilable(T::Hash[Symbol, Courier::MessageProvidersType])) }
|
|
35
|
+
attr_accessor :providers
|
|
36
|
+
|
|
37
|
+
# Optional tags. Omit or null to clear.
|
|
38
|
+
sig { returns(T.nilable(T::Array[String])) }
|
|
39
|
+
attr_accessor :tags
|
|
40
|
+
|
|
41
|
+
# Request body for replacing a routing strategy. Full document replacement;
|
|
42
|
+
# missing optional fields are cleared.
|
|
43
|
+
sig do
|
|
44
|
+
params(
|
|
45
|
+
name: String,
|
|
46
|
+
routing: Courier::MessageRouting::OrHash,
|
|
47
|
+
channels: T.nilable(T::Hash[Symbol, Courier::Channel::OrHash]),
|
|
48
|
+
description: T.nilable(String),
|
|
49
|
+
providers:
|
|
50
|
+
T.nilable(T::Hash[Symbol, Courier::MessageProvidersType::OrHash]),
|
|
51
|
+
tags: T.nilable(T::Array[String])
|
|
52
|
+
).returns(T.attached_class)
|
|
53
|
+
end
|
|
54
|
+
def self.new(
|
|
55
|
+
# Human-readable name for the routing strategy.
|
|
56
|
+
name:,
|
|
57
|
+
# Routing tree defining channel selection method and order.
|
|
58
|
+
routing:,
|
|
59
|
+
# Per-channel delivery configuration. Omit to clear.
|
|
60
|
+
channels: nil,
|
|
61
|
+
# Optional description. Omit or null to clear.
|
|
62
|
+
description: nil,
|
|
63
|
+
# Per-provider delivery configuration. Omit to clear.
|
|
64
|
+
providers: nil,
|
|
65
|
+
# Optional tags. Omit or null to clear.
|
|
66
|
+
tags: nil
|
|
67
|
+
)
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
sig do
|
|
71
|
+
override.returns(
|
|
72
|
+
{
|
|
73
|
+
name: String,
|
|
74
|
+
routing: Courier::MessageRouting,
|
|
75
|
+
channels: T.nilable(T::Hash[Symbol, Courier::Channel]),
|
|
76
|
+
description: T.nilable(String),
|
|
77
|
+
providers:
|
|
78
|
+
T.nilable(T::Hash[Symbol, Courier::MessageProvidersType]),
|
|
79
|
+
tags: T.nilable(T::Array[String])
|
|
80
|
+
}
|
|
81
|
+
)
|
|
82
|
+
end
|
|
83
|
+
def to_hash
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
end
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class RoutingStrategyRetrieveParams < 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(
|
|
12
|
+
Courier::RoutingStrategyRetrieveParams,
|
|
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
|