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.
Files changed (176) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +32 -0
  3. data/README.md +1 -1
  4. data/lib/courier/client.rb +8 -0
  5. data/lib/courier/internal/util.rb +19 -6
  6. data/lib/courier/models/channel.rb +75 -0
  7. data/lib/courier/models/channel_metadata.rb +15 -0
  8. data/lib/courier/models/elemental_content.rb +2 -2
  9. data/lib/courier/models/elemental_html_node_with_type.rb +24 -0
  10. data/lib/courier/models/elemental_node.rb +3 -1
  11. data/lib/courier/models/message_channels.rb +8 -0
  12. data/lib/courier/models/message_providers.rb +8 -0
  13. data/lib/courier/models/message_providers_type.rb +38 -0
  14. data/lib/courier/models/metadata.rb +15 -0
  15. data/lib/courier/models/notification_archive_params.rb +20 -0
  16. data/lib/courier/models/notification_create_params.rb +14 -0
  17. data/lib/courier/models/notification_list_params.rb +13 -4
  18. data/lib/courier/models/notification_list_response.rb +108 -93
  19. data/lib/courier/models/notification_list_versions_params.rb +37 -0
  20. data/lib/courier/models/notification_publish_params.rb +20 -0
  21. data/lib/courier/models/notification_replace_params.rb +20 -0
  22. data/lib/courier/models/notification_retrieve_params.rb +33 -0
  23. data/lib/courier/models/notification_template_create_request.rb +45 -0
  24. data/lib/courier/models/notification_template_get_response.rb +92 -0
  25. data/lib/courier/models/notification_template_mutation_response.rb +51 -0
  26. data/lib/courier/models/notification_template_payload.rb +98 -0
  27. data/lib/courier/models/notification_template_publish_request.rb +19 -0
  28. data/lib/courier/models/notification_template_summary.rb +81 -0
  29. data/lib/courier/models/notification_template_update_request.rb +46 -0
  30. data/lib/courier/models/notification_template_version_list_response.rb +22 -0
  31. data/lib/courier/models/provider.rb +67 -0
  32. data/lib/courier/models/provider_create_params.rb +52 -0
  33. data/lib/courier/models/provider_delete_params.rb +20 -0
  34. data/lib/courier/models/provider_list_params.rb +22 -0
  35. data/lib/courier/models/provider_list_response.rb +24 -0
  36. data/lib/courier/models/provider_retrieve_params.rb +20 -0
  37. data/lib/courier/models/provider_update_params.rb +58 -0
  38. data/lib/courier/models/providers/catalog_list_params.rb +44 -0
  39. data/lib/courier/models/providers/catalog_list_response.rb +26 -0
  40. data/lib/courier/models/providers_catalog_entry.rb +86 -0
  41. data/lib/courier/models/routing_strategy_archive_params.rb +20 -0
  42. data/lib/courier/models/routing_strategy_create_params.rb +14 -0
  43. data/lib/courier/models/routing_strategy_create_request.rb +58 -0
  44. data/lib/courier/models/routing_strategy_get_response.rb +99 -0
  45. data/lib/courier/models/routing_strategy_list_params.rb +30 -0
  46. data/lib/courier/models/routing_strategy_list_response.rb +24 -0
  47. data/lib/courier/models/routing_strategy_mutation_response.rb +19 -0
  48. data/lib/courier/models/routing_strategy_replace_params.rb +20 -0
  49. data/lib/courier/models/routing_strategy_replace_request.rb +59 -0
  50. data/lib/courier/models/routing_strategy_retrieve_params.rb +20 -0
  51. data/lib/courier/models/routing_strategy_summary.rb +75 -0
  52. data/lib/courier/models/send_message_params.rb +6 -154
  53. data/lib/courier/models/tenant_template_input.rb +6 -152
  54. data/lib/courier/models/timeouts.rb +21 -0
  55. data/lib/courier/models/version_node.rb +46 -0
  56. data/lib/courier/models.rb +86 -0
  57. data/lib/courier/resources/notifications.rb +165 -3
  58. data/lib/courier/resources/providers/catalog.rb +49 -0
  59. data/lib/courier/resources/providers.rb +150 -0
  60. data/lib/courier/resources/routing_strategies.rb +151 -0
  61. data/lib/courier/version.rb +1 -1
  62. data/lib/courier.rb +47 -0
  63. data/rbi/courier/client.rbi +6 -0
  64. data/rbi/courier/internal/util.rbi +8 -0
  65. data/rbi/courier/models/channel.rbi +106 -0
  66. data/rbi/courier/models/channel_metadata.rbi +28 -0
  67. data/rbi/courier/models/elemental_content.rbi +6 -3
  68. data/rbi/courier/models/elemental_html_node_with_type.rbi +59 -0
  69. data/rbi/courier/models/elemental_node.rbi +2 -1
  70. data/rbi/courier/models/message_channels.rbi +11 -0
  71. data/rbi/courier/models/message_providers.rbi +11 -0
  72. data/rbi/courier/models/message_providers_type.rbi +60 -0
  73. data/rbi/courier/models/metadata.rbi +26 -0
  74. data/rbi/courier/models/notification_archive_params.rbi +35 -0
  75. data/rbi/courier/models/notification_create_params.rbi +27 -0
  76. data/rbi/courier/models/notification_list_params.rbi +15 -2
  77. data/rbi/courier/models/notification_list_response.rbi +159 -119
  78. data/rbi/courier/models/notification_list_versions_params.rbi +66 -0
  79. data/rbi/courier/models/notification_publish_params.rbi +35 -0
  80. data/rbi/courier/models/notification_replace_params.rbi +35 -0
  81. data/rbi/courier/models/notification_retrieve_params.rbi +54 -0
  82. data/rbi/courier/models/notification_template_create_request.rbi +102 -0
  83. data/rbi/courier/models/notification_template_get_response.rbi +162 -0
  84. data/rbi/courier/models/notification_template_mutation_response.rbi +121 -0
  85. data/rbi/courier/models/notification_template_payload.rbi +183 -0
  86. data/rbi/courier/models/notification_template_publish_request.rbi +35 -0
  87. data/rbi/courier/models/notification_template_summary.rbi +124 -0
  88. data/rbi/courier/models/notification_template_update_request.rbi +103 -0
  89. data/rbi/courier/models/notification_template_version_list_response.rbi +41 -0
  90. data/rbi/courier/models/provider.rbi +87 -0
  91. data/rbi/courier/models/provider_create_params.rbi +82 -0
  92. data/rbi/courier/models/provider_delete_params.rbi +35 -0
  93. data/rbi/courier/models/provider_list_params.rbi +43 -0
  94. data/rbi/courier/models/provider_list_response.rbi +42 -0
  95. data/rbi/courier/models/provider_retrieve_params.rbi +35 -0
  96. data/rbi/courier/models/provider_update_params.rbi +86 -0
  97. data/rbi/courier/models/providers/catalog_list_params.rbi +75 -0
  98. data/rbi/courier/models/providers/catalog_list_response.rbi +47 -0
  99. data/rbi/courier/models/providers_catalog_entry.rbi +129 -0
  100. data/rbi/courier/models/routing_strategy_archive_params.rbi +38 -0
  101. data/rbi/courier/models/routing_strategy_create_params.rbi +30 -0
  102. data/rbi/courier/models/routing_strategy_create_request.rbi +86 -0
  103. data/rbi/courier/models/routing_strategy_get_response.rbi +121 -0
  104. data/rbi/courier/models/routing_strategy_list_params.rbi +54 -0
  105. data/rbi/courier/models/routing_strategy_list_response.rbi +45 -0
  106. data/rbi/courier/models/routing_strategy_mutation_response.rbi +31 -0
  107. data/rbi/courier/models/routing_strategy_replace_params.rbi +38 -0
  108. data/rbi/courier/models/routing_strategy_replace_request.rbi +87 -0
  109. data/rbi/courier/models/routing_strategy_retrieve_params.rbi +38 -0
  110. data/rbi/courier/models/routing_strategy_summary.rbi +95 -0
  111. data/rbi/courier/models/send_message_params.rbi +6 -362
  112. data/rbi/courier/models/tenant_template_input.rbi +8 -336
  113. data/rbi/courier/models/timeouts.rbi +33 -0
  114. data/rbi/courier/models/version_node.rbi +65 -0
  115. data/rbi/courier/models.rbi +94 -0
  116. data/rbi/courier/resources/notifications.rbi +119 -1
  117. data/rbi/courier/resources/providers/catalog.rbi +38 -0
  118. data/rbi/courier/resources/providers.rbi +116 -0
  119. data/rbi/courier/resources/routing_strategies.rbi +126 -0
  120. data/sig/courier/client.rbs +4 -0
  121. data/sig/courier/internal/util.rbs +4 -0
  122. data/sig/courier/models/channel.rbs +61 -0
  123. data/sig/courier/models/channel_metadata.rbs +13 -0
  124. data/sig/courier/models/elemental_html_node_with_type.rbs +32 -0
  125. data/sig/courier/models/elemental_node.rbs +1 -0
  126. data/sig/courier/models/message_channels.rbs +7 -0
  127. data/sig/courier/models/message_providers.rbs +7 -0
  128. data/sig/courier/models/message_providers_type.rbs +35 -0
  129. data/sig/courier/models/metadata.rbs +13 -0
  130. data/sig/courier/models/notification_archive_params.rbs +20 -0
  131. data/sig/courier/models/notification_create_params.rbs +15 -0
  132. data/sig/courier/models/notification_list_params.rbs +7 -1
  133. data/sig/courier/models/notification_list_response.rbs +81 -71
  134. data/sig/courier/models/notification_list_versions_params.rbs +36 -0
  135. data/sig/courier/models/notification_publish_params.rbs +22 -0
  136. data/sig/courier/models/notification_replace_params.rbs +22 -0
  137. data/sig/courier/models/notification_retrieve_params.rbs +30 -0
  138. data/sig/courier/models/notification_template_create_request.rbs +40 -0
  139. data/sig/courier/models/notification_template_get_response.rbs +72 -0
  140. data/sig/courier/models/notification_template_mutation_response.rbs +46 -0
  141. data/sig/courier/models/notification_template_payload.rbs +75 -0
  142. data/sig/courier/models/notification_template_publish_request.rbs +15 -0
  143. data/sig/courier/models/notification_template_summary.rbs +70 -0
  144. data/sig/courier/models/notification_template_update_request.rbs +40 -0
  145. data/sig/courier/models/notification_template_version_list_response.rbs +22 -0
  146. data/sig/courier/models/provider.rbs +52 -0
  147. data/sig/courier/models/provider_create_params.rbs +47 -0
  148. data/sig/courier/models/provider_delete_params.rbs +20 -0
  149. data/sig/courier/models/provider_list_params.rbs +25 -0
  150. data/sig/courier/models/provider_list_response.rbs +22 -0
  151. data/sig/courier/models/provider_retrieve_params.rbs +20 -0
  152. data/sig/courier/models/provider_update_params.rbs +52 -0
  153. data/sig/courier/models/providers/catalog_list_params.rbs +40 -0
  154. data/sig/courier/models/providers/catalog_list_response.rbs +27 -0
  155. data/sig/courier/models/providers_catalog_entry.rbs +64 -0
  156. data/sig/courier/models/routing_strategy_archive_params.rbs +20 -0
  157. data/sig/courier/models/routing_strategy_create_params.rbs +15 -0
  158. data/sig/courier/models/routing_strategy_create_request.rbs +45 -0
  159. data/sig/courier/models/routing_strategy_get_response.rbs +70 -0
  160. data/sig/courier/models/routing_strategy_list_params.rbs +30 -0
  161. data/sig/courier/models/routing_strategy_list_response.rbs +25 -0
  162. data/sig/courier/models/routing_strategy_mutation_response.rbs +13 -0
  163. data/sig/courier/models/routing_strategy_replace_params.rbs +22 -0
  164. data/sig/courier/models/routing_strategy_replace_request.rbs +45 -0
  165. data/sig/courier/models/routing_strategy_retrieve_params.rbs +20 -0
  166. data/sig/courier/models/routing_strategy_summary.rbs +55 -0
  167. data/sig/courier/models/send_message_params.rbs +8 -130
  168. data/sig/courier/models/tenant_template_input.rbs +12 -134
  169. data/sig/courier/models/timeouts.rbs +15 -0
  170. data/sig/courier/models/version_node.rbs +32 -0
  171. data/sig/courier/models.rbs +84 -0
  172. data/sig/courier/resources/notifications.rbs +35 -0
  173. data/sig/courier/resources/providers/catalog.rbs +16 -0
  174. data/sig/courier/resources/providers.rbs +38 -0
  175. data/sig/courier/resources/routing_strategies.rbs +41 -0
  176. metadata +143 -2
@@ -0,0 +1,103 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class NotificationTemplateUpdateRequest < Courier::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ Courier::NotificationTemplateUpdateRequest,
10
+ Courier::Internal::AnyHash
11
+ )
12
+ end
13
+
14
+ # Full document shape used in POST and PUT request bodies, and returned inside the
15
+ # GET response envelope.
16
+ sig { returns(Courier::NotificationTemplatePayload) }
17
+ attr_reader :notification
18
+
19
+ sig do
20
+ params(notification: Courier::NotificationTemplatePayload::OrHash).void
21
+ end
22
+ attr_writer :notification
23
+
24
+ # Template state after update. Case-insensitive input, normalized to uppercase in
25
+ # the response. Defaults to "DRAFT".
26
+ sig do
27
+ returns(
28
+ T.nilable(Courier::NotificationTemplateUpdateRequest::State::OrSymbol)
29
+ )
30
+ end
31
+ attr_reader :state
32
+
33
+ sig do
34
+ params(
35
+ state: Courier::NotificationTemplateUpdateRequest::State::OrSymbol
36
+ ).void
37
+ end
38
+ attr_writer :state
39
+
40
+ # Request body for replacing a notification template. Same shape as create. All
41
+ # fields required (PUT = full replacement).
42
+ sig do
43
+ params(
44
+ notification: Courier::NotificationTemplatePayload::OrHash,
45
+ state: Courier::NotificationTemplateUpdateRequest::State::OrSymbol
46
+ ).returns(T.attached_class)
47
+ end
48
+ def self.new(
49
+ # Full document shape used in POST and PUT request bodies, and returned inside the
50
+ # GET response envelope.
51
+ notification:,
52
+ # Template state after update. Case-insensitive input, normalized to uppercase in
53
+ # the response. Defaults to "DRAFT".
54
+ state: nil
55
+ )
56
+ end
57
+
58
+ sig do
59
+ override.returns(
60
+ {
61
+ notification: Courier::NotificationTemplatePayload,
62
+ state: Courier::NotificationTemplateUpdateRequest::State::OrSymbol
63
+ }
64
+ )
65
+ end
66
+ def to_hash
67
+ end
68
+
69
+ # Template state after update. Case-insensitive input, normalized to uppercase in
70
+ # the response. Defaults to "DRAFT".
71
+ module State
72
+ extend Courier::Internal::Type::Enum
73
+
74
+ TaggedSymbol =
75
+ T.type_alias do
76
+ T.all(Symbol, Courier::NotificationTemplateUpdateRequest::State)
77
+ end
78
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
79
+
80
+ DRAFT =
81
+ T.let(
82
+ :DRAFT,
83
+ Courier::NotificationTemplateUpdateRequest::State::TaggedSymbol
84
+ )
85
+ PUBLISHED =
86
+ T.let(
87
+ :PUBLISHED,
88
+ Courier::NotificationTemplateUpdateRequest::State::TaggedSymbol
89
+ )
90
+
91
+ sig do
92
+ override.returns(
93
+ T::Array[
94
+ Courier::NotificationTemplateUpdateRequest::State::TaggedSymbol
95
+ ]
96
+ )
97
+ end
98
+ def self.values
99
+ end
100
+ end
101
+ end
102
+ end
103
+ end
@@ -0,0 +1,41 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class NotificationTemplateVersionListResponse < Courier::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ Courier::NotificationTemplateVersionListResponse,
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::VersionNode]) }
21
+ attr_accessor :versions
22
+
23
+ sig do
24
+ params(
25
+ paging: Courier::Paging::OrHash,
26
+ versions: T::Array[Courier::VersionNode::OrHash]
27
+ ).returns(T.attached_class)
28
+ end
29
+ def self.new(paging:, versions:)
30
+ end
31
+
32
+ sig do
33
+ override.returns(
34
+ { paging: Courier::Paging, versions: T::Array[Courier::VersionNode] }
35
+ )
36
+ end
37
+ def to_hash
38
+ end
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,87 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class Provider < Courier::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias { T.any(Courier::Provider, Courier::Internal::AnyHash) }
8
+
9
+ # A unique identifier for the provider configuration.
10
+ sig { returns(String) }
11
+ attr_accessor :id
12
+
13
+ # Unix timestamp (ms) of when the provider was created.
14
+ sig { returns(Integer) }
15
+ attr_accessor :created
16
+
17
+ # The provider key (e.g. "sendgrid", "twilio", "slack").
18
+ sig { returns(String) }
19
+ attr_accessor :provider
20
+
21
+ # Provider-specific settings (snake_case keys on the wire).
22
+ sig { returns(T::Hash[Symbol, T.anything]) }
23
+ attr_accessor :settings
24
+
25
+ # Display title. Defaults to "Default Configuration" when not explicitly set.
26
+ sig { returns(String) }
27
+ attr_accessor :title
28
+
29
+ # Optional alias for this configuration.
30
+ sig { returns(T.nilable(String)) }
31
+ attr_reader :alias_
32
+
33
+ sig { params(alias_: String).void }
34
+ attr_writer :alias_
35
+
36
+ # Unix timestamp (ms) of when the provider was last updated.
37
+ sig { returns(T.nilable(Integer)) }
38
+ attr_accessor :updated
39
+
40
+ # A configured provider in the workspace.
41
+ sig do
42
+ params(
43
+ id: String,
44
+ created: Integer,
45
+ provider: String,
46
+ settings: T::Hash[Symbol, T.anything],
47
+ title: String,
48
+ alias_: String,
49
+ updated: T.nilable(Integer)
50
+ ).returns(T.attached_class)
51
+ end
52
+ def self.new(
53
+ # A unique identifier for the provider configuration.
54
+ id:,
55
+ # Unix timestamp (ms) of when the provider was created.
56
+ created:,
57
+ # The provider key (e.g. "sendgrid", "twilio", "slack").
58
+ provider:,
59
+ # Provider-specific settings (snake_case keys on the wire).
60
+ settings:,
61
+ # Display title. Defaults to "Default Configuration" when not explicitly set.
62
+ title:,
63
+ # Optional alias for this configuration.
64
+ alias_: nil,
65
+ # Unix timestamp (ms) of when the provider was last updated.
66
+ updated: nil
67
+ )
68
+ end
69
+
70
+ sig do
71
+ override.returns(
72
+ {
73
+ id: String,
74
+ created: Integer,
75
+ provider: String,
76
+ settings: T::Hash[Symbol, T.anything],
77
+ title: String,
78
+ alias_: String,
79
+ updated: T.nilable(Integer)
80
+ }
81
+ )
82
+ end
83
+ def to_hash
84
+ end
85
+ end
86
+ end
87
+ end
@@ -0,0 +1,82 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class ProviderCreateParams < 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::ProviderCreateParams, Courier::Internal::AnyHash)
12
+ end
13
+
14
+ # The provider key identifying the type (e.g. "sendgrid", "twilio"). Must be a
15
+ # known Courier provider — see the catalog endpoint for valid keys.
16
+ sig { returns(String) }
17
+ attr_accessor :provider
18
+
19
+ # Optional alias for this configuration.
20
+ sig { returns(T.nilable(String)) }
21
+ attr_reader :alias_
22
+
23
+ sig { params(alias_: String).void }
24
+ attr_writer :alias_
25
+
26
+ # Provider-specific settings (snake_case keys). Defaults to an empty object when
27
+ # omitted. Use the catalog endpoint to discover required fields for a given
28
+ # provider — omitting a required field returns a 400 validation error.
29
+ sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
30
+ attr_reader :settings
31
+
32
+ sig { params(settings: T::Hash[Symbol, T.anything]).void }
33
+ attr_writer :settings
34
+
35
+ # Optional display title. Omit to use "Default Configuration".
36
+ sig { returns(T.nilable(String)) }
37
+ attr_reader :title
38
+
39
+ sig { params(title: String).void }
40
+ attr_writer :title
41
+
42
+ sig do
43
+ params(
44
+ provider: String,
45
+ alias_: String,
46
+ settings: T::Hash[Symbol, T.anything],
47
+ title: String,
48
+ request_options: Courier::RequestOptions::OrHash
49
+ ).returns(T.attached_class)
50
+ end
51
+ def self.new(
52
+ # The provider key identifying the type (e.g. "sendgrid", "twilio"). Must be a
53
+ # known Courier provider — see the catalog endpoint for valid keys.
54
+ provider:,
55
+ # Optional alias for this configuration.
56
+ alias_: nil,
57
+ # Provider-specific settings (snake_case keys). Defaults to an empty object when
58
+ # omitted. Use the catalog endpoint to discover required fields for a given
59
+ # provider — omitting a required field returns a 400 validation error.
60
+ settings: nil,
61
+ # Optional display title. Omit to use "Default Configuration".
62
+ title: nil,
63
+ request_options: {}
64
+ )
65
+ end
66
+
67
+ sig do
68
+ override.returns(
69
+ {
70
+ provider: String,
71
+ alias_: String,
72
+ settings: T::Hash[Symbol, T.anything],
73
+ title: String,
74
+ request_options: Courier::RequestOptions
75
+ }
76
+ )
77
+ end
78
+ def to_hash
79
+ end
80
+ end
81
+ end
82
+ end
@@ -0,0 +1,35 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class ProviderDeleteParams < 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::ProviderDeleteParams, 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,43 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class ProviderListParams < 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::ProviderListParams, Courier::Internal::AnyHash)
12
+ end
13
+
14
+ # Opaque cursor for fetching the next page.
15
+ sig { returns(T.nilable(String)) }
16
+ attr_reader :cursor
17
+
18
+ sig { params(cursor: String).void }
19
+ attr_writer :cursor
20
+
21
+ sig do
22
+ params(
23
+ cursor: String,
24
+ request_options: Courier::RequestOptions::OrHash
25
+ ).returns(T.attached_class)
26
+ end
27
+ def self.new(
28
+ # Opaque cursor for fetching the next page.
29
+ cursor: nil,
30
+ request_options: {}
31
+ )
32
+ end
33
+
34
+ sig do
35
+ override.returns(
36
+ { cursor: String, request_options: Courier::RequestOptions }
37
+ )
38
+ end
39
+ def to_hash
40
+ end
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,42 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class ProviderListResponse < Courier::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ Courier::Models::ProviderListResponse,
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::Provider]) }
21
+ attr_accessor :results
22
+
23
+ # Paginated list of provider configurations.
24
+ sig do
25
+ params(
26
+ paging: Courier::Paging::OrHash,
27
+ results: T::Array[Courier::Provider::OrHash]
28
+ ).returns(T.attached_class)
29
+ end
30
+ def self.new(paging:, results:)
31
+ end
32
+
33
+ sig do
34
+ override.returns(
35
+ { paging: Courier::Paging, results: T::Array[Courier::Provider] }
36
+ )
37
+ end
38
+ def to_hash
39
+ end
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,35 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class ProviderRetrieveParams < 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::ProviderRetrieveParams, 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,86 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class ProviderUpdateParams < 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::ProviderUpdateParams, Courier::Internal::AnyHash)
12
+ end
13
+
14
+ sig { returns(String) }
15
+ attr_accessor :id
16
+
17
+ # The provider key identifying the type.
18
+ sig { returns(String) }
19
+ attr_accessor :provider
20
+
21
+ # Updated alias. Omit to clear.
22
+ sig { returns(T.nilable(String)) }
23
+ attr_reader :alias_
24
+
25
+ sig { params(alias_: String).void }
26
+ attr_writer :alias_
27
+
28
+ # Provider-specific settings (snake_case keys). Replaces the full settings object
29
+ # — omitted settings fields are removed. Use the catalog endpoint to check
30
+ # required fields.
31
+ sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
32
+ attr_reader :settings
33
+
34
+ sig { params(settings: T::Hash[Symbol, T.anything]).void }
35
+ attr_writer :settings
36
+
37
+ # Updated display title.
38
+ sig { returns(T.nilable(String)) }
39
+ attr_reader :title
40
+
41
+ sig { params(title: String).void }
42
+ attr_writer :title
43
+
44
+ sig do
45
+ params(
46
+ id: String,
47
+ provider: String,
48
+ alias_: String,
49
+ settings: T::Hash[Symbol, T.anything],
50
+ title: String,
51
+ request_options: Courier::RequestOptions::OrHash
52
+ ).returns(T.attached_class)
53
+ end
54
+ def self.new(
55
+ id:,
56
+ # The provider key identifying the type.
57
+ provider:,
58
+ # Updated alias. Omit to clear.
59
+ alias_: nil,
60
+ # Provider-specific settings (snake_case keys). Replaces the full settings object
61
+ # — omitted settings fields are removed. Use the catalog endpoint to check
62
+ # required fields.
63
+ settings: nil,
64
+ # Updated display title.
65
+ title: nil,
66
+ request_options: {}
67
+ )
68
+ end
69
+
70
+ sig do
71
+ override.returns(
72
+ {
73
+ id: String,
74
+ provider: String,
75
+ alias_: String,
76
+ settings: T::Hash[Symbol, T.anything],
77
+ title: String,
78
+ request_options: Courier::RequestOptions
79
+ }
80
+ )
81
+ end
82
+ def to_hash
83
+ end
84
+ end
85
+ end
86
+ end
@@ -0,0 +1,75 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ module Providers
6
+ class CatalogListParams < Courier::Internal::Type::BaseModel
7
+ extend Courier::Internal::Type::RequestParameters::Converter
8
+ include Courier::Internal::Type::RequestParameters
9
+
10
+ OrHash =
11
+ T.type_alias do
12
+ T.any(
13
+ Courier::Providers::CatalogListParams,
14
+ Courier::Internal::AnyHash
15
+ )
16
+ end
17
+
18
+ # Exact match (case-insensitive) against the provider channel taxonomy (e.g.
19
+ # `email`, `sms`, `push`).
20
+ sig { returns(T.nilable(String)) }
21
+ attr_reader :channel
22
+
23
+ sig { params(channel: String).void }
24
+ attr_writer :channel
25
+
26
+ # Comma-separated provider keys to filter by (e.g. `sendgrid,twilio`).
27
+ sig { returns(T.nilable(String)) }
28
+ attr_reader :keys
29
+
30
+ sig { params(keys: String).void }
31
+ attr_writer :keys
32
+
33
+ # Case-insensitive substring match against the provider display name.
34
+ sig { returns(T.nilable(String)) }
35
+ attr_reader :name
36
+
37
+ sig { params(name: String).void }
38
+ attr_writer :name
39
+
40
+ sig do
41
+ params(
42
+ channel: String,
43
+ keys: String,
44
+ name: String,
45
+ request_options: Courier::RequestOptions::OrHash
46
+ ).returns(T.attached_class)
47
+ end
48
+ def self.new(
49
+ # Exact match (case-insensitive) against the provider channel taxonomy (e.g.
50
+ # `email`, `sms`, `push`).
51
+ channel: nil,
52
+ # Comma-separated provider keys to filter by (e.g. `sendgrid,twilio`).
53
+ keys: nil,
54
+ # Case-insensitive substring match against the provider display name.
55
+ name: nil,
56
+ request_options: {}
57
+ )
58
+ end
59
+
60
+ sig do
61
+ override.returns(
62
+ {
63
+ channel: String,
64
+ keys: String,
65
+ name: String,
66
+ request_options: Courier::RequestOptions
67
+ }
68
+ )
69
+ end
70
+ def to_hash
71
+ end
72
+ end
73
+ end
74
+ end
75
+ end
@@ -0,0 +1,47 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ module Providers
6
+ class CatalogListResponse < Courier::Internal::Type::BaseModel
7
+ OrHash =
8
+ T.type_alias do
9
+ T.any(
10
+ Courier::Models::Providers::CatalogListResponse,
11
+ Courier::Internal::AnyHash
12
+ )
13
+ end
14
+
15
+ sig { returns(Courier::Paging) }
16
+ attr_reader :paging
17
+
18
+ sig { params(paging: Courier::Paging::OrHash).void }
19
+ attr_writer :paging
20
+
21
+ sig { returns(T::Array[Courier::ProvidersCatalogEntry]) }
22
+ attr_accessor :results
23
+
24
+ # Paginated list of available provider types with their configuration schemas.
25
+ sig do
26
+ params(
27
+ paging: Courier::Paging::OrHash,
28
+ results: T::Array[Courier::ProvidersCatalogEntry::OrHash]
29
+ ).returns(T.attached_class)
30
+ end
31
+ def self.new(paging:, results:)
32
+ end
33
+
34
+ sig do
35
+ override.returns(
36
+ {
37
+ paging: Courier::Paging,
38
+ results: T::Array[Courier::ProvidersCatalogEntry]
39
+ }
40
+ )
41
+ end
42
+ def to_hash
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end