trycourier 4.25.0 → 4.26.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +21 -0
  3. data/README.md +16 -19
  4. data/lib/courier/client.rb +4 -0
  5. data/lib/courier/models/bulk_add_users_params.rb +26 -0
  6. data/lib/courier/models/bulk_create_job_params.rb +29 -0
  7. data/lib/courier/models/bulk_create_job_response.rb +16 -0
  8. data/lib/courier/models/bulk_list_users_params.rb +33 -0
  9. data/lib/courier/models/bulk_list_users_response.rb +49 -0
  10. data/lib/courier/models/bulk_retrieve_job_params.rb +20 -0
  11. data/lib/courier/models/bulk_retrieve_job_response.rb +76 -0
  12. data/lib/courier/models/bulk_run_job_params.rb +20 -0
  13. data/lib/courier/models/inbound_bulk_message.rb +91 -0
  14. data/lib/courier/models/inbound_bulk_message_user.rb +54 -0
  15. data/lib/courier/models/notification_template_alias.rb +24 -0
  16. data/lib/courier/models/notification_template_create_request.rb +5 -5
  17. data/lib/courier/models/notification_template_response.rb +16 -1
  18. data/lib/courier/models/notification_template_update_request.rb +7 -6
  19. data/lib/courier/models/notification_template_write_payload.rb +28 -0
  20. data/lib/courier/models.rb +18 -0
  21. data/lib/courier/resources/bulk.rb +141 -0
  22. data/lib/courier/resources/notifications.rb +2 -2
  23. data/lib/courier/resources/send.rb +2 -1
  24. data/lib/courier/version.rb +1 -1
  25. data/lib/courier.rb +13 -0
  26. data/rbi/courier/client.rbi +3 -0
  27. data/rbi/courier/models/bulk_add_users_params.rbi +43 -0
  28. data/rbi/courier/models/bulk_create_job_params.rbi +54 -0
  29. data/rbi/courier/models/bulk_create_job_response.rbi +26 -0
  30. data/rbi/courier/models/bulk_list_users_params.rbi +51 -0
  31. data/rbi/courier/models/bulk_list_users_response.rbi +125 -0
  32. data/rbi/courier/models/bulk_retrieve_job_params.rbi +35 -0
  33. data/rbi/courier/models/bulk_retrieve_job_response.rbi +157 -0
  34. data/rbi/courier/models/bulk_run_job_params.rbi +35 -0
  35. data/rbi/courier/models/inbound_bulk_message.rbi +124 -0
  36. data/rbi/courier/models/inbound_bulk_message_user.rbi +88 -0
  37. data/rbi/courier/models/notification_template_alias.rbi +28 -0
  38. data/rbi/courier/models/notification_template_create_request.rbi +10 -8
  39. data/rbi/courier/models/notification_template_response.rbi +19 -0
  40. data/rbi/courier/models/notification_template_update_request.rbi +12 -9
  41. data/rbi/courier/models/notification_template_write_payload.rbi +44 -0
  42. data/rbi/courier/models.rbi +19 -0
  43. data/rbi/courier/resources/bulk.rbi +102 -0
  44. data/rbi/courier/resources/notifications.rbi +6 -6
  45. data/rbi/courier/resources/send.rbi +2 -1
  46. data/sig/courier/client.rbs +2 -0
  47. data/sig/courier/models/bulk_add_users_params.rbs +28 -0
  48. data/sig/courier/models/bulk_create_job_params.rbs +24 -0
  49. data/sig/courier/models/bulk_create_job_response.rbs +13 -0
  50. data/sig/courier/models/bulk_list_users_params.rbs +28 -0
  51. data/sig/courier/models/bulk_list_users_response.rbs +65 -0
  52. data/sig/courier/models/bulk_retrieve_job_params.rbs +23 -0
  53. data/sig/courier/models/bulk_retrieve_job_response.rbs +66 -0
  54. data/sig/courier/models/bulk_run_job_params.rbs +23 -0
  55. data/sig/courier/models/inbound_bulk_message.rbs +58 -0
  56. data/sig/courier/models/inbound_bulk_message_user.rbs +42 -0
  57. data/sig/courier/models/notification_template_alias.rbs +13 -0
  58. data/sig/courier/models/notification_template_create_request.rbs +4 -4
  59. data/sig/courier/models/notification_template_response.rbs +9 -0
  60. data/sig/courier/models/notification_template_update_request.rbs +4 -4
  61. data/sig/courier/models/notification_template_write_payload.rbs +15 -0
  62. data/sig/courier/models.rbs +18 -0
  63. data/sig/courier/resources/bulk.rbs +34 -0
  64. data/sig/courier/resources/notifications.rbs +2 -2
  65. metadata +41 -2
@@ -0,0 +1,157 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class BulkRetrieveJobResponse < Courier::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ Courier::Models::BulkRetrieveJobResponse,
10
+ Courier::Internal::AnyHash
11
+ )
12
+ end
13
+
14
+ sig { returns(Courier::Models::BulkRetrieveJobResponse::Job) }
15
+ attr_reader :job
16
+
17
+ sig do
18
+ params(job: Courier::Models::BulkRetrieveJobResponse::Job::OrHash).void
19
+ end
20
+ attr_writer :job
21
+
22
+ sig do
23
+ params(
24
+ job: Courier::Models::BulkRetrieveJobResponse::Job::OrHash
25
+ ).returns(T.attached_class)
26
+ end
27
+ def self.new(job:)
28
+ end
29
+
30
+ sig do
31
+ override.returns({ job: Courier::Models::BulkRetrieveJobResponse::Job })
32
+ end
33
+ def to_hash
34
+ end
35
+
36
+ class Job < Courier::Internal::Type::BaseModel
37
+ OrHash =
38
+ T.type_alias do
39
+ T.any(
40
+ Courier::Models::BulkRetrieveJobResponse::Job,
41
+ Courier::Internal::AnyHash
42
+ )
43
+ end
44
+
45
+ # Bulk message definition. Supports two formats:
46
+ #
47
+ # - V1 format: Requires `event` field (event ID or notification ID)
48
+ # - V2 format: Optionally use `template` (notification ID) or `content` (Elemental
49
+ # content) in addition to `event`
50
+ sig { returns(Courier::InboundBulkMessage) }
51
+ attr_reader :definition
52
+
53
+ sig { params(definition: Courier::InboundBulkMessage::OrHash).void }
54
+ attr_writer :definition
55
+
56
+ sig { returns(Integer) }
57
+ attr_accessor :enqueued
58
+
59
+ sig { returns(Integer) }
60
+ attr_accessor :failures
61
+
62
+ sig { returns(Integer) }
63
+ attr_accessor :received
64
+
65
+ sig do
66
+ returns(
67
+ Courier::Models::BulkRetrieveJobResponse::Job::Status::TaggedSymbol
68
+ )
69
+ end
70
+ attr_accessor :status
71
+
72
+ sig do
73
+ params(
74
+ definition: Courier::InboundBulkMessage::OrHash,
75
+ enqueued: Integer,
76
+ failures: Integer,
77
+ received: Integer,
78
+ status:
79
+ Courier::Models::BulkRetrieveJobResponse::Job::Status::OrSymbol
80
+ ).returns(T.attached_class)
81
+ end
82
+ def self.new(
83
+ # Bulk message definition. Supports two formats:
84
+ #
85
+ # - V1 format: Requires `event` field (event ID or notification ID)
86
+ # - V2 format: Optionally use `template` (notification ID) or `content` (Elemental
87
+ # content) in addition to `event`
88
+ definition:,
89
+ enqueued:,
90
+ failures:,
91
+ received:,
92
+ status:
93
+ )
94
+ end
95
+
96
+ sig do
97
+ override.returns(
98
+ {
99
+ definition: Courier::InboundBulkMessage,
100
+ enqueued: Integer,
101
+ failures: Integer,
102
+ received: Integer,
103
+ status:
104
+ Courier::Models::BulkRetrieveJobResponse::Job::Status::TaggedSymbol
105
+ }
106
+ )
107
+ end
108
+ def to_hash
109
+ end
110
+
111
+ module Status
112
+ extend Courier::Internal::Type::Enum
113
+
114
+ TaggedSymbol =
115
+ T.type_alias do
116
+ T.all(
117
+ Symbol,
118
+ Courier::Models::BulkRetrieveJobResponse::Job::Status
119
+ )
120
+ end
121
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
122
+
123
+ CREATED =
124
+ T.let(
125
+ :CREATED,
126
+ Courier::Models::BulkRetrieveJobResponse::Job::Status::TaggedSymbol
127
+ )
128
+ PROCESSING =
129
+ T.let(
130
+ :PROCESSING,
131
+ Courier::Models::BulkRetrieveJobResponse::Job::Status::TaggedSymbol
132
+ )
133
+ COMPLETED =
134
+ T.let(
135
+ :COMPLETED,
136
+ Courier::Models::BulkRetrieveJobResponse::Job::Status::TaggedSymbol
137
+ )
138
+ ERROR =
139
+ T.let(
140
+ :ERROR,
141
+ Courier::Models::BulkRetrieveJobResponse::Job::Status::TaggedSymbol
142
+ )
143
+
144
+ sig do
145
+ override.returns(
146
+ T::Array[
147
+ Courier::Models::BulkRetrieveJobResponse::Job::Status::TaggedSymbol
148
+ ]
149
+ )
150
+ end
151
+ def self.values
152
+ end
153
+ end
154
+ end
155
+ end
156
+ end
157
+ end
@@ -0,0 +1,35 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class BulkRunJobParams < 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::BulkRunJobParams, Courier::Internal::AnyHash)
12
+ end
13
+
14
+ sig { returns(String) }
15
+ attr_accessor :job_id
16
+
17
+ sig do
18
+ params(
19
+ job_id: String,
20
+ request_options: Courier::RequestOptions::OrHash
21
+ ).returns(T.attached_class)
22
+ end
23
+ def self.new(job_id:, request_options: {})
24
+ end
25
+
26
+ sig do
27
+ override.returns(
28
+ { job_id: String, request_options: Courier::RequestOptions }
29
+ )
30
+ end
31
+ def to_hash
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,124 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class InboundBulkMessage < Courier::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Courier::InboundBulkMessage, Courier::Internal::AnyHash)
9
+ end
10
+
11
+ # Event ID or Notification ID (required). Can be either a Notification ID (e.g.,
12
+ # "FRH3QXM9E34W4RKP7MRC8NZ1T8V8") or a custom Event ID (e.g., "welcome-email")
13
+ # mapped to a notification.
14
+ sig { returns(String) }
15
+ attr_accessor :event
16
+
17
+ sig { returns(T.nilable(String)) }
18
+ attr_accessor :brand
19
+
20
+ # Elemental content (optional, for V2 format). When provided, this will be used
21
+ # instead of the notification associated with the `event` field.
22
+ sig do
23
+ returns(
24
+ T.nilable(
25
+ T.any(Courier::ElementalContentSugar, Courier::ElementalContent)
26
+ )
27
+ )
28
+ end
29
+ attr_accessor :content
30
+
31
+ sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
32
+ attr_accessor :data
33
+
34
+ sig { returns(T.nilable(T::Hash[Symbol, T::Hash[Symbol, T.anything]])) }
35
+ attr_accessor :locale
36
+
37
+ sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
38
+ attr_accessor :override
39
+
40
+ # Notification ID or template ID (optional, for V2 format). When provided, this
41
+ # will be used instead of the notification associated with the `event` field.
42
+ sig { returns(T.nilable(String)) }
43
+ attr_accessor :template
44
+
45
+ # Bulk message definition. Supports two formats:
46
+ #
47
+ # - V1 format: Requires `event` field (event ID or notification ID)
48
+ # - V2 format: Optionally use `template` (notification ID) or `content` (Elemental
49
+ # content) in addition to `event`
50
+ sig do
51
+ params(
52
+ event: String,
53
+ brand: T.nilable(String),
54
+ content:
55
+ T.nilable(
56
+ T.any(
57
+ Courier::ElementalContentSugar::OrHash,
58
+ Courier::ElementalContent::OrHash
59
+ )
60
+ ),
61
+ data: T.nilable(T::Hash[Symbol, T.anything]),
62
+ locale: T.nilable(T::Hash[Symbol, T::Hash[Symbol, T.anything]]),
63
+ override: T.nilable(T::Hash[Symbol, T.anything]),
64
+ template: T.nilable(String)
65
+ ).returns(T.attached_class)
66
+ end
67
+ def self.new(
68
+ # Event ID or Notification ID (required). Can be either a Notification ID (e.g.,
69
+ # "FRH3QXM9E34W4RKP7MRC8NZ1T8V8") or a custom Event ID (e.g., "welcome-email")
70
+ # mapped to a notification.
71
+ event:,
72
+ brand: nil,
73
+ # Elemental content (optional, for V2 format). When provided, this will be used
74
+ # instead of the notification associated with the `event` field.
75
+ content: nil,
76
+ data: nil,
77
+ locale: nil,
78
+ override: nil,
79
+ # Notification ID or template ID (optional, for V2 format). When provided, this
80
+ # will be used instead of the notification associated with the `event` field.
81
+ template: nil
82
+ )
83
+ end
84
+
85
+ sig do
86
+ override.returns(
87
+ {
88
+ event: String,
89
+ brand: T.nilable(String),
90
+ content:
91
+ T.nilable(
92
+ T.any(Courier::ElementalContentSugar, Courier::ElementalContent)
93
+ ),
94
+ data: T.nilable(T::Hash[Symbol, T.anything]),
95
+ locale: T.nilable(T::Hash[Symbol, T::Hash[Symbol, T.anything]]),
96
+ override: T.nilable(T::Hash[Symbol, T.anything]),
97
+ template: T.nilable(String)
98
+ }
99
+ )
100
+ end
101
+ def to_hash
102
+ end
103
+
104
+ # Elemental content (optional, for V2 format). When provided, this will be used
105
+ # instead of the notification associated with the `event` field.
106
+ module Content
107
+ extend Courier::Internal::Type::Union
108
+
109
+ Variants =
110
+ T.type_alias do
111
+ T.any(Courier::ElementalContentSugar, Courier::ElementalContent)
112
+ end
113
+
114
+ sig do
115
+ override.returns(
116
+ T::Array[Courier::InboundBulkMessage::Content::Variants]
117
+ )
118
+ end
119
+ def self.variants
120
+ end
121
+ end
122
+ end
123
+ end
124
+ end
@@ -0,0 +1,88 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class InboundBulkMessageUser < Courier::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Courier::InboundBulkMessageUser, Courier::Internal::AnyHash)
9
+ end
10
+
11
+ # User-specific data that will be merged with message.data
12
+ sig { returns(T.nilable(T.anything)) }
13
+ attr_reader :data
14
+
15
+ sig { params(data: T.anything).void }
16
+ attr_writer :data
17
+
18
+ sig { returns(T.nilable(Courier::RecipientPreferences)) }
19
+ attr_reader :preferences
20
+
21
+ sig do
22
+ params(
23
+ preferences: T.nilable(Courier::RecipientPreferences::OrHash)
24
+ ).void
25
+ end
26
+ attr_writer :preferences
27
+
28
+ # User profile information. For email-based bulk jobs, `profile.email` is required
29
+ # for provider routing to determine if the message can be delivered. The email
30
+ # address should be provided here rather than in `to.email`.
31
+ sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
32
+ attr_accessor :profile
33
+
34
+ # User ID (legacy field, use profile or to.user_id instead)
35
+ sig { returns(T.nilable(String)) }
36
+ attr_accessor :recipient
37
+
38
+ # Optional recipient information. Note: For email provider routing, use
39
+ # `profile.email` instead of `to.email`. The `to` field is primarily used for
40
+ # recipient identification and data merging.
41
+ sig { returns(T.nilable(Courier::UserRecipient)) }
42
+ attr_reader :to
43
+
44
+ sig { params(to: T.nilable(Courier::UserRecipient::OrHash)).void }
45
+ attr_writer :to
46
+
47
+ sig do
48
+ params(
49
+ data: T.anything,
50
+ preferences: T.nilable(Courier::RecipientPreferences::OrHash),
51
+ profile: T.nilable(T::Hash[Symbol, T.anything]),
52
+ recipient: T.nilable(String),
53
+ to: T.nilable(Courier::UserRecipient::OrHash)
54
+ ).returns(T.attached_class)
55
+ end
56
+ def self.new(
57
+ # User-specific data that will be merged with message.data
58
+ data: nil,
59
+ preferences: nil,
60
+ # User profile information. For email-based bulk jobs, `profile.email` is required
61
+ # for provider routing to determine if the message can be delivered. The email
62
+ # address should be provided here rather than in `to.email`.
63
+ profile: nil,
64
+ # User ID (legacy field, use profile or to.user_id instead)
65
+ recipient: nil,
66
+ # Optional recipient information. Note: For email provider routing, use
67
+ # `profile.email` instead of `to.email`. The `to` field is primarily used for
68
+ # recipient identification and data merging.
69
+ to: nil
70
+ )
71
+ end
72
+
73
+ sig do
74
+ override.returns(
75
+ {
76
+ data: T.anything,
77
+ preferences: T.nilable(Courier::RecipientPreferences),
78
+ profile: T.nilable(T::Hash[Symbol, T.anything]),
79
+ recipient: T.nilable(String),
80
+ to: T.nilable(Courier::UserRecipient)
81
+ }
82
+ )
83
+ end
84
+ def to_hash
85
+ end
86
+ end
87
+ end
88
+ end
@@ -0,0 +1,28 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ # A template's send-time alias as returned by a read, omitted entirely when it has
6
+ # none. Usually a single string; an array for a template that resolves from
7
+ # several aliases, which writes through this API can no longer produce — only
8
+ # templates predating that restriction, or aliases attached outside this API, hold
9
+ # more than one.
10
+ module NotificationTemplateAlias
11
+ extend Courier::Internal::Type::Union
12
+
13
+ Variants = T.type_alias { T.any(String, T::Array[String]) }
14
+
15
+ sig do
16
+ override.returns(T::Array[Courier::NotificationTemplateAlias::Variants])
17
+ end
18
+ def self.variants
19
+ end
20
+
21
+ StringArray =
22
+ T.let(
23
+ Courier::Internal::Type::ArrayOf[String],
24
+ Courier::Internal::Type::Converter
25
+ )
26
+ end
27
+ end
28
+ end
@@ -11,13 +11,15 @@ module Courier
11
11
  )
12
12
  end
13
13
 
14
- # Core template fields used in POST and PUT request bodies (nested under a
15
- # `notification` key) and returned at the top level in responses.
16
- sig { returns(Courier::NotificationTemplatePayload) }
14
+ # Template fields accepted in POST and PUT request bodies, nested under a
15
+ # `notification` key.
16
+ sig { returns(Courier::NotificationTemplateWritePayload) }
17
17
  attr_reader :notification
18
18
 
19
19
  sig do
20
- params(notification: Courier::NotificationTemplatePayload::OrHash).void
20
+ params(
21
+ notification: Courier::NotificationTemplateWritePayload::OrHash
22
+ ).void
21
23
  end
22
24
  attr_writer :notification
23
25
 
@@ -40,13 +42,13 @@ module Courier
40
42
  # Request body for creating a notification template.
41
43
  sig do
42
44
  params(
43
- notification: Courier::NotificationTemplatePayload::OrHash,
45
+ notification: Courier::NotificationTemplateWritePayload::OrHash,
44
46
  state: Courier::NotificationTemplateCreateRequest::State::OrSymbol
45
47
  ).returns(T.attached_class)
46
48
  end
47
49
  def self.new(
48
- # Core template fields used in POST and PUT request bodies (nested under a
49
- # `notification` key) and returned at the top level in responses.
50
+ # Template fields accepted in POST and PUT request bodies, nested under a
51
+ # `notification` key.
50
52
  notification:,
51
53
  # Template state after creation. Case-insensitive input, normalized to uppercase
52
54
  # in the response. Defaults to "DRAFT".
@@ -57,7 +59,7 @@ module Courier
57
59
  sig do
58
60
  override.returns(
59
61
  {
60
- notification: Courier::NotificationTemplatePayload,
62
+ notification: Courier::NotificationTemplateWritePayload,
61
63
  state: Courier::NotificationTemplateCreateRequest::State::OrSymbol
62
64
  }
63
65
  )
@@ -29,6 +29,17 @@ module Courier
29
29
  end
30
30
  attr_accessor :state
31
31
 
32
+ # A template's send-time alias as returned by a read, omitted entirely when it has
33
+ # none. Usually a single string; an array for a template that resolves from
34
+ # several aliases, which writes through this API can no longer produce — only
35
+ # templates predating that restriction, or aliases attached outside this API, hold
36
+ # more than one.
37
+ sig { returns(T.nilable(Courier::NotificationTemplateAlias::Variants)) }
38
+ attr_reader :alias_
39
+
40
+ sig { params(alias_: Courier::NotificationTemplateAlias::Variants).void }
41
+ attr_writer :alias_
42
+
32
43
  # Epoch milliseconds of last update.
33
44
  sig { returns(T.nilable(Integer)) }
34
45
  attr_reader :updated
@@ -51,6 +62,7 @@ module Courier
51
62
  created: Integer,
52
63
  creator: String,
53
64
  state: Courier::NotificationTemplateResponse::State::OrSymbol,
65
+ alias_: Courier::NotificationTemplateAlias::Variants,
54
66
  updated: Integer,
55
67
  updater: String
56
68
  ).returns(T.attached_class)
@@ -64,6 +76,12 @@ module Courier
64
76
  creator:,
65
77
  # The template state. Always uppercase.
66
78
  state:,
79
+ # A template's send-time alias as returned by a read, omitted entirely when it has
80
+ # none. Usually a single string; an array for a template that resolves from
81
+ # several aliases, which writes through this API can no longer produce — only
82
+ # templates predating that restriction, or aliases attached outside this API, hold
83
+ # more than one.
84
+ alias_: nil,
67
85
  # Epoch milliseconds of last update.
68
86
  updated: nil,
69
87
  # User ID of the last updater.
@@ -78,6 +96,7 @@ module Courier
78
96
  created: Integer,
79
97
  creator: String,
80
98
  state: Courier::NotificationTemplateResponse::State::TaggedSymbol,
99
+ alias_: Courier::NotificationTemplateAlias::Variants,
81
100
  updated: Integer,
82
101
  updater: String
83
102
  }
@@ -11,13 +11,15 @@ module Courier
11
11
  )
12
12
  end
13
13
 
14
- # Core template fields used in POST and PUT request bodies (nested under a
15
- # `notification` key) and returned at the top level in responses.
16
- sig { returns(Courier::NotificationTemplatePayload) }
14
+ # Template fields accepted in POST and PUT request bodies, nested under a
15
+ # `notification` key.
16
+ sig { returns(Courier::NotificationTemplateWritePayload) }
17
17
  attr_reader :notification
18
18
 
19
19
  sig do
20
- params(notification: Courier::NotificationTemplatePayload::OrHash).void
20
+ params(
21
+ notification: Courier::NotificationTemplateWritePayload::OrHash
22
+ ).void
21
23
  end
22
24
  attr_writer :notification
23
25
 
@@ -38,16 +40,17 @@ module Courier
38
40
  attr_writer :state
39
41
 
40
42
  # Request body for replacing a notification template. Same shape as create. All
41
- # fields required (PUT = full replacement).
43
+ # fields required (PUT = full replacement), except `alias`, whose omission means
44
+ # "leave the existing aliases alone".
42
45
  sig do
43
46
  params(
44
- notification: Courier::NotificationTemplatePayload::OrHash,
47
+ notification: Courier::NotificationTemplateWritePayload::OrHash,
45
48
  state: Courier::NotificationTemplateUpdateRequest::State::OrSymbol
46
49
  ).returns(T.attached_class)
47
50
  end
48
51
  def self.new(
49
- # Core template fields used in POST and PUT request bodies (nested under a
50
- # `notification` key) and returned at the top level in responses.
52
+ # Template fields accepted in POST and PUT request bodies, nested under a
53
+ # `notification` key.
51
54
  notification:,
52
55
  # Template state after update. Case-insensitive input, normalized to uppercase in
53
56
  # the response. Defaults to "DRAFT".
@@ -58,7 +61,7 @@ module Courier
58
61
  sig do
59
62
  override.returns(
60
63
  {
61
- notification: Courier::NotificationTemplatePayload,
64
+ notification: Courier::NotificationTemplateWritePayload,
62
65
  state: Courier::NotificationTemplateUpdateRequest::State::OrSymbol
63
66
  }
64
67
  )
@@ -0,0 +1,44 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class NotificationTemplateWritePayload < Courier::Models::NotificationTemplatePayload
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ Courier::NotificationTemplateWritePayload,
10
+ Courier::Internal::AnyHash
11
+ )
12
+ end
13
+
14
+ # Send-time alias for this template — the value you pass as `event` to POST /send.
15
+ # Writes accept a single alias only. Optional, with three distinct meanings. Omit
16
+ # it to leave any existing aliases untouched. Send a string to make this the
17
+ # template's only alias — a template that already resolved from several aliases
18
+ # keeps just this one and the rest are detached. Send null to remove every alias
19
+ # from the template. An alias may not be claimed by another template — doing so
20
+ # returns 409 — and may not begin with "tenant/".
21
+ sig { returns(T.nilable(String)) }
22
+ attr_accessor :alias_
23
+
24
+ # Template fields accepted in POST and PUT request bodies, nested under a
25
+ # `notification` key.
26
+ sig { params(alias_: T.nilable(String)).returns(T.attached_class) }
27
+ def self.new(
28
+ # Send-time alias for this template — the value you pass as `event` to POST /send.
29
+ # Writes accept a single alias only. Optional, with three distinct meanings. Omit
30
+ # it to leave any existing aliases untouched. Send a string to make this the
31
+ # template's only alias — a template that already resolved from several aliases
32
+ # keeps just this one and the rest are detached. Send null to remove every alias
33
+ # from the template. An alias may not be claimed by another template — doing so
34
+ # returns 409 — and may not begin with "tenant/".
35
+ alias_: nil
36
+ )
37
+ end
38
+
39
+ sig { override.returns({ alias_: T.nilable(String) }) }
40
+ def to_hash
41
+ end
42
+ end
43
+ end
44
+ end
@@ -106,6 +106,16 @@ module Courier
106
106
 
107
107
  BroadcastUpdateParams = Courier::Models::BroadcastUpdateParams
108
108
 
109
+ BulkAddUsersParams = Courier::Models::BulkAddUsersParams
110
+
111
+ BulkCreateJobParams = Courier::Models::BulkCreateJobParams
112
+
113
+ BulkListUsersParams = Courier::Models::BulkListUsersParams
114
+
115
+ BulkRetrieveJobParams = Courier::Models::BulkRetrieveJobParams
116
+
117
+ BulkRunJobParams = Courier::Models::BulkRunJobParams
118
+
109
119
  CancelJourneyRequest = Courier::Models::CancelJourneyRequest
110
120
 
111
121
  CancelJourneyResponse = Courier::Models::CancelJourneyResponse
@@ -178,6 +188,10 @@ module Courier
178
188
 
179
189
  Icons = Courier::Models::Icons
180
190
 
191
+ InboundBulkMessage = Courier::Models::InboundBulkMessage
192
+
193
+ InboundBulkMessageUser = Courier::Models::InboundBulkMessageUser
194
+
181
195
  InboundTrackEventParams = Courier::Models::InboundTrackEventParams
182
196
 
183
197
  Intercom = Courier::Models::Intercom
@@ -378,6 +392,8 @@ module Courier
378
392
 
379
393
  Notifications = Courier::Models::Notifications
380
394
 
395
+ NotificationTemplateAlias = Courier::Models::NotificationTemplateAlias
396
+
381
397
  NotificationTemplateCreateRequest =
382
398
  Courier::Models::NotificationTemplateCreateRequest
383
399
 
@@ -398,6 +414,9 @@ module Courier
398
414
  NotificationTemplateVersionListResponse =
399
415
  Courier::Models::NotificationTemplateVersionListResponse
400
416
 
417
+ NotificationTemplateWritePayload =
418
+ Courier::Models::NotificationTemplateWritePayload
419
+
401
420
  Pagerduty = Courier::Models::Pagerduty
402
421
 
403
422
  PagerdutyRecipient = Courier::Models::PagerdutyRecipient