trycourier 6.1.0 → 6.3.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 (57) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +14 -0
  3. data/README.md +1 -1
  4. data/lib/courier/models/journey_send_node.rb +38 -2
  5. data/lib/courier/models/journey_send_node_to_ms_teams.rb +81 -0
  6. data/lib/courier/models/journey_send_node_to_slack.rb +20 -0
  7. data/lib/courier/models/journey_send_node_to_slack_channel.rb +29 -0
  8. data/lib/courier/models/journey_send_node_to_slack_email.rb +30 -0
  9. data/lib/courier/models/journey_send_node_to_slack_user_id.rb +29 -0
  10. data/lib/courier/models/ms_teams.rb +6 -0
  11. data/lib/courier/models/ms_teams_base_properties.rb +10 -5
  12. data/lib/courier/models/ms_teams_recipient.rb +6 -1
  13. data/lib/courier/models/notification_get_metrics_params.rb +83 -0
  14. data/lib/courier/models/notification_metrics_response.rb +165 -0
  15. data/lib/courier/models/send_to_ms_teams_channel_id.rb +9 -5
  16. data/lib/courier/models/send_to_ms_teams_channel_name.rb +12 -9
  17. data/lib/courier/models/send_to_ms_teams_email.rb +8 -5
  18. data/lib/courier/models/send_to_ms_teams_user_id.rb +13 -10
  19. data/lib/courier/models/user_profile.rb +3 -1
  20. data/lib/courier/models.rb +14 -0
  21. data/lib/courier/resources/notifications.rb +53 -0
  22. data/lib/courier/version.rb +1 -1
  23. data/lib/courier.rb +7 -0
  24. data/rbi/courier/models/journey_send_node.rbi +78 -0
  25. data/rbi/courier/models/journey_send_node_to_ms_teams.rbi +124 -0
  26. data/rbi/courier/models/journey_send_node_to_slack.rbi +26 -0
  27. data/rbi/courier/models/journey_send_node_to_slack_channel.rbi +45 -0
  28. data/rbi/courier/models/journey_send_node_to_slack_email.rbi +47 -0
  29. data/rbi/courier/models/journey_send_node_to_slack_user_id.rbi +45 -0
  30. data/rbi/courier/models/ms_teams.rbi +2 -0
  31. data/rbi/courier/models/ms_teams_base_properties.rbi +15 -5
  32. data/rbi/courier/models/ms_teams_recipient.rbi +7 -1
  33. data/rbi/courier/models/notification_get_metrics_params.rbi +167 -0
  34. data/rbi/courier/models/notification_metrics_response.rbi +269 -0
  35. data/rbi/courier/models/send_to_ms_teams_channel_id.rbi +14 -5
  36. data/rbi/courier/models/send_to_ms_teams_channel_name.rbi +16 -8
  37. data/rbi/courier/models/send_to_ms_teams_email.rbi +13 -5
  38. data/rbi/courier/models/send_to_ms_teams_user_id.rbi +16 -8
  39. data/rbi/courier/models/user_profile.rbi +4 -0
  40. data/rbi/courier/models.rbi +14 -0
  41. data/rbi/courier/resources/notifications.rbi +57 -0
  42. data/sig/courier/models/journey_send_node.rbs +18 -0
  43. data/sig/courier/models/journey_send_node_to_ms_teams.rbs +64 -0
  44. data/sig/courier/models/journey_send_node_to_slack.rbs +14 -0
  45. data/sig/courier/models/journey_send_node_to_slack_channel.rbs +18 -0
  46. data/sig/courier/models/journey_send_node_to_slack_email.rbs +18 -0
  47. data/sig/courier/models/journey_send_node_to_slack_user_id.rbs +18 -0
  48. data/sig/courier/models/ms_teams_base_properties.rbs +7 -3
  49. data/sig/courier/models/notification_get_metrics_params.rbs +69 -0
  50. data/sig/courier/models/notification_metrics_response.rbs +127 -0
  51. data/sig/courier/models/send_to_ms_teams_channel_id.rbs +8 -4
  52. data/sig/courier/models/send_to_ms_teams_channel_name.rbs +11 -7
  53. data/sig/courier/models/send_to_ms_teams_email.rbs +8 -4
  54. data/sig/courier/models/send_to_ms_teams_user_id.rbs +13 -9
  55. data/sig/courier/models.rbs +14 -0
  56. data/sig/courier/resources/notifications.rbs +9 -0
  57. metadata +23 -2
@@ -8,16 +8,26 @@ module Courier
8
8
  T.any(Courier::MsTeamsBaseProperties, Courier::Internal::AnyHash)
9
9
  end
10
10
 
11
- sig { returns(String) }
12
- attr_accessor :service_url
11
+ sig { returns(T.nilable(String)) }
12
+ attr_reader :service_url
13
13
 
14
- sig { returns(String) }
15
- attr_accessor :tenant_id
14
+ sig { params(service_url: String).void }
15
+ attr_writer :service_url
16
16
 
17
+ sig { returns(T.nilable(String)) }
18
+ attr_reader :tenant_id
19
+
20
+ sig { params(tenant_id: String).void }
21
+ attr_writer :tenant_id
22
+
23
+ # Tenant context shared by every MS Teams send variant. Provide at least one of
24
+ # `tenant_id` or `service_url`. If you provide both, they must agree — a
25
+ # `service_url` pointing at a different Microsoft tenant than `tenant_id` is
26
+ # rejected.
17
27
  sig do
18
28
  params(service_url: String, tenant_id: String).returns(T.attached_class)
19
29
  end
20
- def self.new(service_url:, tenant_id:)
30
+ def self.new(service_url: nil, tenant_id: nil)
21
31
  end
22
32
 
23
33
  sig { override.returns({ service_url: String, tenant_id: String }) }
@@ -8,6 +8,8 @@ module Courier
8
8
  T.any(Courier::MsTeamsRecipient, Courier::Internal::AnyHash)
9
9
  end
10
10
 
11
+ # Provide at least one of `tenant_id` or `service_url`. If you provide both, they
12
+ # must agree.
11
13
  sig do
12
14
  returns(
13
15
  T.any(
@@ -34,7 +36,11 @@ module Courier
34
36
  )
35
37
  ).returns(T.attached_class)
36
38
  end
37
- def self.new(ms_teams:)
39
+ def self.new(
40
+ # Provide at least one of `tenant_id` or `service_url`. If you provide both, they
41
+ # must agree.
42
+ ms_teams:
43
+ )
38
44
  end
39
45
 
40
46
  sig do
@@ -0,0 +1,167 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class NotificationGetMetricsParams < 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::NotificationGetMetricsParams,
13
+ Courier::Internal::AnyHash
14
+ )
15
+ end
16
+
17
+ sig { returns(String) }
18
+ attr_accessor :id
19
+
20
+ # The end of the window, as an ISO 8601 timestamp with an offset. Must be supplied
21
+ # together with `start`. An `end` in the future is accepted and not clamped — the
22
+ # trailing buckets come back empty.
23
+ sig { returns(T.nilable(Time)) }
24
+ attr_reader :end_
25
+
26
+ sig { params(end_: Time).void }
27
+ attr_writer :end_
28
+
29
+ # The size of each bucket in the series. Defaults to `DAY`. `WEEK` buckets start
30
+ # on Sunday. A fine granularity caps the window it can cover: `HOUR` spans at most
31
+ # 7 days and `DAY` at most 90 days, and a wider window returns `400` — request a
32
+ # coarser granularity instead. `WEEK` and `MONTH` are uncapped, subject to the
33
+ # 1000-bucket limit on a single response.
34
+ sig do
35
+ returns(
36
+ T.nilable(
37
+ Courier::NotificationGetMetricsParams::Granularity::OrSymbol
38
+ )
39
+ )
40
+ end
41
+ attr_reader :granularity
42
+
43
+ sig do
44
+ params(
45
+ granularity:
46
+ Courier::NotificationGetMetricsParams::Granularity::OrSymbol
47
+ ).void
48
+ end
49
+ attr_writer :granularity
50
+
51
+ # The length of the window, counted back from now, as an ISO 8601 duration
52
+ # (`P30D`, `P12W`, `PT12H`). Defaults to `P30D`, and is ignored when `start` and
53
+ # `end` are supplied. A malformed or non-positive duration returns `400`.
54
+ sig { returns(T.nilable(String)) }
55
+ attr_reader :lookback
56
+
57
+ sig { params(lookback: String).void }
58
+ attr_writer :lookback
59
+
60
+ # The inclusive start of the window, as an ISO 8601 timestamp with an offset
61
+ # (`2026-04-01T00:00:00Z`). Must be supplied together with `end` and be earlier
62
+ # than it; either one alone returns `400`.
63
+ sig { returns(T.nilable(Time)) }
64
+ attr_reader :start
65
+
66
+ sig { params(start: Time).void }
67
+ attr_writer :start
68
+
69
+ sig do
70
+ params(
71
+ id: String,
72
+ end_: Time,
73
+ granularity:
74
+ Courier::NotificationGetMetricsParams::Granularity::OrSymbol,
75
+ lookback: String,
76
+ start: Time,
77
+ request_options: Courier::RequestOptions::OrHash
78
+ ).returns(T.attached_class)
79
+ end
80
+ def self.new(
81
+ id:,
82
+ # The end of the window, as an ISO 8601 timestamp with an offset. Must be supplied
83
+ # together with `start`. An `end` in the future is accepted and not clamped — the
84
+ # trailing buckets come back empty.
85
+ end_: nil,
86
+ # The size of each bucket in the series. Defaults to `DAY`. `WEEK` buckets start
87
+ # on Sunday. A fine granularity caps the window it can cover: `HOUR` spans at most
88
+ # 7 days and `DAY` at most 90 days, and a wider window returns `400` — request a
89
+ # coarser granularity instead. `WEEK` and `MONTH` are uncapped, subject to the
90
+ # 1000-bucket limit on a single response.
91
+ granularity: nil,
92
+ # The length of the window, counted back from now, as an ISO 8601 duration
93
+ # (`P30D`, `P12W`, `PT12H`). Defaults to `P30D`, and is ignored when `start` and
94
+ # `end` are supplied. A malformed or non-positive duration returns `400`.
95
+ lookback: nil,
96
+ # The inclusive start of the window, as an ISO 8601 timestamp with an offset
97
+ # (`2026-04-01T00:00:00Z`). Must be supplied together with `end` and be earlier
98
+ # than it; either one alone returns `400`.
99
+ start: nil,
100
+ request_options: {}
101
+ )
102
+ end
103
+
104
+ sig do
105
+ override.returns(
106
+ {
107
+ id: String,
108
+ end_: Time,
109
+ granularity:
110
+ Courier::NotificationGetMetricsParams::Granularity::OrSymbol,
111
+ lookback: String,
112
+ start: Time,
113
+ request_options: Courier::RequestOptions
114
+ }
115
+ )
116
+ end
117
+ def to_hash
118
+ end
119
+
120
+ # The size of each bucket in the series. Defaults to `DAY`. `WEEK` buckets start
121
+ # on Sunday. A fine granularity caps the window it can cover: `HOUR` spans at most
122
+ # 7 days and `DAY` at most 90 days, and a wider window returns `400` — request a
123
+ # coarser granularity instead. `WEEK` and `MONTH` are uncapped, subject to the
124
+ # 1000-bucket limit on a single response.
125
+ module Granularity
126
+ extend Courier::Internal::Type::Enum
127
+
128
+ TaggedSymbol =
129
+ T.type_alias do
130
+ T.all(Symbol, Courier::NotificationGetMetricsParams::Granularity)
131
+ end
132
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
133
+
134
+ HOUR =
135
+ T.let(
136
+ :HOUR,
137
+ Courier::NotificationGetMetricsParams::Granularity::TaggedSymbol
138
+ )
139
+ DAY =
140
+ T.let(
141
+ :DAY,
142
+ Courier::NotificationGetMetricsParams::Granularity::TaggedSymbol
143
+ )
144
+ WEEK =
145
+ T.let(
146
+ :WEEK,
147
+ Courier::NotificationGetMetricsParams::Granularity::TaggedSymbol
148
+ )
149
+ MONTH =
150
+ T.let(
151
+ :MONTH,
152
+ Courier::NotificationGetMetricsParams::Granularity::TaggedSymbol
153
+ )
154
+
155
+ sig do
156
+ override.returns(
157
+ T::Array[
158
+ Courier::NotificationGetMetricsParams::Granularity::TaggedSymbol
159
+ ]
160
+ )
161
+ end
162
+ def self.values
163
+ end
164
+ end
165
+ end
166
+ end
167
+ end
@@ -0,0 +1,269 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class NotificationMetricsResponse < Courier::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ Courier::NotificationMetricsResponse,
10
+ Courier::Internal::AnyHash
11
+ )
12
+ end
13
+
14
+ # End of the window actually queried, ceiled onto the granularity grid.
15
+ # Second-precision UTC.
16
+ sig { returns(Time) }
17
+ attr_accessor :end_
18
+
19
+ # Bucket size the series was built at.
20
+ sig do
21
+ returns(Courier::NotificationMetricsResponse::Granularity::TaggedSymbol)
22
+ end
23
+ attr_accessor :granularity
24
+
25
+ # The template the series describes, echoed from the request.
26
+ sig { returns(String) }
27
+ attr_accessor :notification_id
28
+
29
+ # One entry per bucket between `start` and `end`, oldest first, including buckets
30
+ # with no activity.
31
+ sig { returns(T::Array[Courier::NotificationMetricsResponse::Series]) }
32
+ attr_accessor :series
33
+
34
+ # Inclusive start of the window actually queried, floored onto the granularity
35
+ # grid. Second-precision UTC.
36
+ sig { returns(Time) }
37
+ attr_accessor :start
38
+
39
+ sig do
40
+ params(
41
+ end_: Time,
42
+ granularity:
43
+ Courier::NotificationMetricsResponse::Granularity::OrSymbol,
44
+ notification_id: String,
45
+ series:
46
+ T::Array[Courier::NotificationMetricsResponse::Series::OrHash],
47
+ start: Time
48
+ ).returns(T.attached_class)
49
+ end
50
+ def self.new(
51
+ # End of the window actually queried, ceiled onto the granularity grid.
52
+ # Second-precision UTC.
53
+ end_:,
54
+ # Bucket size the series was built at.
55
+ granularity:,
56
+ # The template the series describes, echoed from the request.
57
+ notification_id:,
58
+ # One entry per bucket between `start` and `end`, oldest first, including buckets
59
+ # with no activity.
60
+ series:,
61
+ # Inclusive start of the window actually queried, floored onto the granularity
62
+ # grid. Second-precision UTC.
63
+ start:
64
+ )
65
+ end
66
+
67
+ sig do
68
+ override.returns(
69
+ {
70
+ end_: Time,
71
+ granularity:
72
+ Courier::NotificationMetricsResponse::Granularity::TaggedSymbol,
73
+ notification_id: String,
74
+ series: T::Array[Courier::NotificationMetricsResponse::Series],
75
+ start: Time
76
+ }
77
+ )
78
+ end
79
+ def to_hash
80
+ end
81
+
82
+ # Bucket size the series was built at.
83
+ module Granularity
84
+ extend Courier::Internal::Type::Enum
85
+
86
+ TaggedSymbol =
87
+ T.type_alias do
88
+ T.all(Symbol, Courier::NotificationMetricsResponse::Granularity)
89
+ end
90
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
91
+
92
+ HOUR =
93
+ T.let(
94
+ :HOUR,
95
+ Courier::NotificationMetricsResponse::Granularity::TaggedSymbol
96
+ )
97
+ DAY =
98
+ T.let(
99
+ :DAY,
100
+ Courier::NotificationMetricsResponse::Granularity::TaggedSymbol
101
+ )
102
+ WEEK =
103
+ T.let(
104
+ :WEEK,
105
+ Courier::NotificationMetricsResponse::Granularity::TaggedSymbol
106
+ )
107
+ MONTH =
108
+ T.let(
109
+ :MONTH,
110
+ Courier::NotificationMetricsResponse::Granularity::TaggedSymbol
111
+ )
112
+
113
+ sig do
114
+ override.returns(
115
+ T::Array[
116
+ Courier::NotificationMetricsResponse::Granularity::TaggedSymbol
117
+ ]
118
+ )
119
+ end
120
+ def self.values
121
+ end
122
+ end
123
+
124
+ class Series < Courier::Internal::Type::BaseModel
125
+ OrHash =
126
+ T.type_alias do
127
+ T.any(
128
+ Courier::NotificationMetricsResponse::Series,
129
+ Courier::Internal::AnyHash
130
+ )
131
+ end
132
+
133
+ # One entry per provider and channel that handled a message in this bucket. Empty
134
+ # when nothing was sent.
135
+ sig do
136
+ returns(T::Array[Courier::NotificationMetricsResponse::Series::Data])
137
+ end
138
+ attr_accessor :data
139
+
140
+ # Start of the bucket, second-precision UTC.
141
+ sig { returns(Time) }
142
+ attr_accessor :period
143
+
144
+ sig do
145
+ params(
146
+ data:
147
+ T::Array[
148
+ Courier::NotificationMetricsResponse::Series::Data::OrHash
149
+ ],
150
+ period: Time
151
+ ).returns(T.attached_class)
152
+ end
153
+ def self.new(
154
+ # One entry per provider and channel that handled a message in this bucket. Empty
155
+ # when nothing was sent.
156
+ data:,
157
+ # Start of the bucket, second-precision UTC.
158
+ period:
159
+ )
160
+ end
161
+
162
+ sig do
163
+ override.returns(
164
+ {
165
+ data:
166
+ T::Array[Courier::NotificationMetricsResponse::Series::Data],
167
+ period: Time
168
+ }
169
+ )
170
+ end
171
+ def to_hash
172
+ end
173
+
174
+ class Data < Courier::Internal::Type::BaseModel
175
+ OrHash =
176
+ T.type_alias do
177
+ T.any(
178
+ Courier::NotificationMetricsResponse::Series::Data,
179
+ Courier::Internal::AnyHash
180
+ )
181
+ end
182
+
183
+ # Channel the provider delivered on, e.g. `email`.
184
+ sig { returns(String) }
185
+ attr_accessor :channel
186
+
187
+ # Messages with at least one tracked link click.
188
+ sig { returns(Integer) }
189
+ attr_accessor :clicked
190
+
191
+ # Messages the provider confirmed as delivered.
192
+ sig { returns(Integer) }
193
+ attr_accessor :delivered
194
+
195
+ # Messages the provider rejected or failed on, including ones a later provider
196
+ # then delivered.
197
+ sig { returns(Integer) }
198
+ attr_accessor :errors
199
+
200
+ # Messages opened at least once. Always `0` on channels with no open tracking.
201
+ sig { returns(Integer) }
202
+ attr_accessor :opened
203
+
204
+ # Provider that handled the messages, e.g. `sendgrid`.
205
+ sig { returns(String) }
206
+ attr_accessor :provider
207
+
208
+ # Messages handed to the provider.
209
+ sig { returns(Integer) }
210
+ attr_accessor :sent
211
+
212
+ # Messages Courier could not deliver on any provider for the channel.
213
+ sig { returns(Integer) }
214
+ attr_accessor :undeliverable
215
+
216
+ sig do
217
+ params(
218
+ channel: String,
219
+ clicked: Integer,
220
+ delivered: Integer,
221
+ errors: Integer,
222
+ opened: Integer,
223
+ provider: String,
224
+ sent: Integer,
225
+ undeliverable: Integer
226
+ ).returns(T.attached_class)
227
+ end
228
+ def self.new(
229
+ # Channel the provider delivered on, e.g. `email`.
230
+ channel:,
231
+ # Messages with at least one tracked link click.
232
+ clicked:,
233
+ # Messages the provider confirmed as delivered.
234
+ delivered:,
235
+ # Messages the provider rejected or failed on, including ones a later provider
236
+ # then delivered.
237
+ errors:,
238
+ # Messages opened at least once. Always `0` on channels with no open tracking.
239
+ opened:,
240
+ # Provider that handled the messages, e.g. `sendgrid`.
241
+ provider:,
242
+ # Messages handed to the provider.
243
+ sent:,
244
+ # Messages Courier could not deliver on any provider for the channel.
245
+ undeliverable:
246
+ )
247
+ end
248
+
249
+ sig do
250
+ override.returns(
251
+ {
252
+ channel: String,
253
+ clicked: Integer,
254
+ delivered: Integer,
255
+ errors: Integer,
256
+ opened: Integer,
257
+ provider: String,
258
+ sent: Integer,
259
+ undeliverable: Integer
260
+ }
261
+ )
262
+ end
263
+ def to_hash
264
+ end
265
+ end
266
+ end
267
+ end
268
+ end
269
+ end
@@ -11,12 +11,21 @@ module Courier
11
11
  sig { returns(String) }
12
12
  attr_accessor :channel_id
13
13
 
14
- sig { returns(String) }
15
- attr_accessor :service_url
14
+ sig { returns(T.nilable(String)) }
15
+ attr_reader :service_url
16
16
 
17
- sig { returns(String) }
18
- attr_accessor :tenant_id
17
+ sig { params(service_url: String).void }
18
+ attr_writer :service_url
19
+
20
+ sig { returns(T.nilable(String)) }
21
+ attr_reader :tenant_id
22
+
23
+ sig { params(tenant_id: String).void }
24
+ attr_writer :tenant_id
19
25
 
26
+ # Sends directly to a Microsoft Teams channel by its Bot Framework ID. Still
27
+ # provide at least one of `tenant_id` or `service_url` — sends without either have
28
+ # failed Bot Framework authentication in testing.
20
29
  sig do
21
30
  params(
22
31
  channel_id: String,
@@ -24,7 +33,7 @@ module Courier
24
33
  tenant_id: String
25
34
  ).returns(T.attached_class)
26
35
  end
27
- def self.new(channel_id:, service_url:, tenant_id:)
36
+ def self.new(channel_id:, service_url: nil, tenant_id: nil)
28
37
  end
29
38
 
30
39
  sig do
@@ -11,32 +11,40 @@ module Courier
11
11
  sig { returns(String) }
12
12
  attr_accessor :channel_name
13
13
 
14
- sig { returns(String) }
15
- attr_accessor :service_url
16
-
17
14
  sig { returns(String) }
18
15
  attr_accessor :team_id
19
16
 
20
- sig { returns(String) }
21
- attr_accessor :tenant_id
17
+ sig { returns(T.nilable(String)) }
18
+ attr_reader :service_url
19
+
20
+ sig { params(service_url: String).void }
21
+ attr_writer :service_url
22
+
23
+ sig { returns(T.nilable(String)) }
24
+ attr_reader :tenant_id
22
25
 
26
+ sig { params(tenant_id: String).void }
27
+ attr_writer :tenant_id
28
+
29
+ # `team_id` is required alongside `channel_name`. Also provide at least one of
30
+ # `tenant_id` or `service_url`; if you provide both, they must agree.
23
31
  sig do
24
32
  params(
25
33
  channel_name: String,
26
- service_url: String,
27
34
  team_id: String,
35
+ service_url: String,
28
36
  tenant_id: String
29
37
  ).returns(T.attached_class)
30
38
  end
31
- def self.new(channel_name:, service_url:, team_id:, tenant_id:)
39
+ def self.new(channel_name:, team_id:, service_url: nil, tenant_id: nil)
32
40
  end
33
41
 
34
42
  sig do
35
43
  override.returns(
36
44
  {
37
45
  channel_name: String,
38
- service_url: String,
39
46
  team_id: String,
47
+ service_url: String,
40
48
  tenant_id: String
41
49
  }
42
50
  )
@@ -11,18 +11,26 @@ module Courier
11
11
  sig { returns(String) }
12
12
  attr_accessor :email
13
13
 
14
- sig { returns(String) }
15
- attr_accessor :service_url
14
+ sig { returns(T.nilable(String)) }
15
+ attr_reader :service_url
16
16
 
17
- sig { returns(String) }
18
- attr_accessor :tenant_id
17
+ sig { params(service_url: String).void }
18
+ attr_writer :service_url
19
+
20
+ sig { returns(T.nilable(String)) }
21
+ attr_reader :tenant_id
22
+
23
+ sig { params(tenant_id: String).void }
24
+ attr_writer :tenant_id
19
25
 
26
+ # Provide at least one of `tenant_id` or `service_url`. If you provide both, they
27
+ # must agree.
20
28
  sig do
21
29
  params(email: String, service_url: String, tenant_id: String).returns(
22
30
  T.attached_class
23
31
  )
24
32
  end
25
- def self.new(email:, service_url:, tenant_id:)
33
+ def self.new(email:, service_url: nil, tenant_id: nil)
26
34
  end
27
35
 
28
36
  sig do
@@ -9,25 +9,33 @@ module Courier
9
9
  end
10
10
 
11
11
  sig { returns(String) }
12
- attr_accessor :service_url
12
+ attr_accessor :user_id
13
13
 
14
- sig { returns(String) }
15
- attr_accessor :tenant_id
14
+ sig { returns(T.nilable(String)) }
15
+ attr_reader :service_url
16
16
 
17
- sig { returns(String) }
18
- attr_accessor :user_id
17
+ sig { params(service_url: String).void }
18
+ attr_writer :service_url
19
+
20
+ sig { returns(T.nilable(String)) }
21
+ attr_reader :tenant_id
22
+
23
+ sig { params(tenant_id: String).void }
24
+ attr_writer :tenant_id
19
25
 
26
+ # Provide at least one of `tenant_id` or `service_url`. If you provide both, they
27
+ # must agree.
20
28
  sig do
21
- params(service_url: String, tenant_id: String, user_id: String).returns(
29
+ params(user_id: String, service_url: String, tenant_id: String).returns(
22
30
  T.attached_class
23
31
  )
24
32
  end
25
- def self.new(service_url:, tenant_id:, user_id:)
33
+ def self.new(user_id:, service_url: nil, tenant_id: nil)
26
34
  end
27
35
 
28
36
  sig do
29
37
  override.returns(
30
- { service_url: String, tenant_id: String, user_id: String }
38
+ { user_id: String, service_url: String, tenant_id: String }
31
39
  )
32
40
  end
33
41
  def to_hash
@@ -87,6 +87,8 @@ module Courier
87
87
  sig { returns(T.nilable(String)) }
88
88
  attr_accessor :middle_name
89
89
 
90
+ # Provide at least one of `tenant_id` or `service_url`. If you provide both, they
91
+ # must agree.
90
92
  sig do
91
93
  returns(
92
94
  T.nilable(
@@ -240,6 +242,8 @@ module Courier
240
242
  intercom: nil,
241
243
  locale: nil,
242
244
  middle_name: nil,
245
+ # Provide at least one of `tenant_id` or `service_url`. If you provide both, they
246
+ # must agree.
243
247
  ms_teams: nil,
244
248
  name: nil,
245
249
  nickname: nil,