prelude-sdk 0.1.0 → 0.2.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 +13 -0
- data/README.md +9 -9
- data/lib/prelude_sdk/client.rb +4 -0
- data/lib/prelude_sdk/models/notify_get_subscription_config_params.rb +14 -0
- data/lib/prelude_sdk/models/notify_get_subscription_config_response.rb +120 -0
- data/lib/prelude_sdk/models/notify_get_subscription_phone_number_params.rb +20 -0
- data/lib/prelude_sdk/models/notify_get_subscription_phone_number_response.rb +104 -0
- data/lib/prelude_sdk/models/notify_list_subscription_configs_params.rb +30 -0
- data/lib/prelude_sdk/models/notify_list_subscription_configs_response.rb +144 -0
- data/lib/prelude_sdk/models/notify_list_subscription_phone_number_events_params.rb +37 -0
- data/lib/prelude_sdk/models/notify_list_subscription_phone_number_events_response.rb +132 -0
- data/lib/prelude_sdk/models/notify_list_subscription_phone_numbers_params.rb +49 -0
- data/lib/prelude_sdk/models/notify_list_subscription_phone_numbers_response.rb +132 -0
- data/lib/prelude_sdk/models/notify_send_batch_params.rb +110 -0
- data/lib/prelude_sdk/models/notify_send_batch_response.rb +201 -0
- data/lib/prelude_sdk/models/notify_send_params.rb +118 -0
- data/lib/prelude_sdk/models/notify_send_response.rb +94 -0
- data/lib/prelude_sdk/models.rb +15 -0
- data/lib/prelude_sdk/resources/notify.rb +247 -0
- data/lib/prelude_sdk/version.rb +1 -1
- data/lib/prelude_sdk.rb +16 -0
- data/manifest.yaml +1 -0
- data/rbi/prelude_sdk/client.rbi +3 -0
- data/rbi/prelude_sdk/models/notify_get_subscription_config_params.rbi +30 -0
- data/rbi/prelude_sdk/models/notify_get_subscription_config_response.rbi +224 -0
- data/rbi/prelude_sdk/models/notify_get_subscription_phone_number_params.rbi +38 -0
- data/rbi/prelude_sdk/models/notify_get_subscription_phone_number_response.rbi +199 -0
- data/rbi/prelude_sdk/models/notify_list_subscription_configs_params.rbi +60 -0
- data/rbi/prelude_sdk/models/notify_list_subscription_configs_response.rbi +286 -0
- data/rbi/prelude_sdk/models/notify_list_subscription_phone_number_events_params.rbi +66 -0
- data/rbi/prelude_sdk/models/notify_list_subscription_phone_number_events_response.rbi +259 -0
- data/rbi/prelude_sdk/models/notify_list_subscription_phone_numbers_params.rbi +119 -0
- data/rbi/prelude_sdk/models/notify_list_subscription_phone_numbers_response.rbi +259 -0
- data/rbi/prelude_sdk/models/notify_send_batch_params.rbi +191 -0
- data/rbi/prelude_sdk/models/notify_send_batch_response.rbi +360 -0
- data/rbi/prelude_sdk/models/notify_send_params.rbi +201 -0
- data/rbi/prelude_sdk/models/notify_send_response.rbi +128 -0
- data/rbi/prelude_sdk/models.rbi +19 -0
- data/rbi/prelude_sdk/resources/notify.rbi +218 -0
- data/sig/prelude_sdk/client.rbs +2 -0
- data/sig/prelude_sdk/models/notify_get_subscription_config_params.rbs +15 -0
- data/sig/prelude_sdk/models/notify_get_subscription_config_response.rbs +95 -0
- data/sig/prelude_sdk/models/notify_get_subscription_phone_number_params.rbs +23 -0
- data/sig/prelude_sdk/models/notify_get_subscription_phone_number_response.rbs +71 -0
- data/sig/prelude_sdk/models/notify_list_subscription_configs_params.rbs +32 -0
- data/sig/prelude_sdk/models/notify_list_subscription_configs_response.rbs +119 -0
- data/sig/prelude_sdk/models/notify_list_subscription_phone_number_events_params.rbs +36 -0
- data/sig/prelude_sdk/models/notify_list_subscription_phone_number_events_response.rbs +95 -0
- data/sig/prelude_sdk/models/notify_list_subscription_phone_numbers_params.rbs +55 -0
- data/sig/prelude_sdk/models/notify_list_subscription_phone_numbers_response.rbs +95 -0
- data/sig/prelude_sdk/models/notify_send_batch_params.rbs +100 -0
- data/sig/prelude_sdk/models/notify_send_batch_response.rbs +187 -0
- data/sig/prelude_sdk/models/notify_send_params.rbs +100 -0
- data/sig/prelude_sdk/models/notify_send_response.rbs +73 -0
- data/sig/prelude_sdk/models.rbs +14 -0
- data/sig/prelude_sdk/resources/notify.rbs +68 -0
- metadata +47 -2
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module PreludeSDK
|
|
4
|
+
module Models
|
|
5
|
+
class NotifySendBatchResponse < PreludeSDK::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(
|
|
9
|
+
PreludeSDK::Models::NotifySendBatchResponse,
|
|
10
|
+
PreludeSDK::Internal::AnyHash
|
|
11
|
+
)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# Number of failed sends.
|
|
15
|
+
sig { returns(Integer) }
|
|
16
|
+
attr_accessor :error_count
|
|
17
|
+
|
|
18
|
+
# The per-recipient result of the bulk send.
|
|
19
|
+
sig do
|
|
20
|
+
returns(T::Array[PreludeSDK::Models::NotifySendBatchResponse::Result])
|
|
21
|
+
end
|
|
22
|
+
attr_accessor :results
|
|
23
|
+
|
|
24
|
+
# Number of successful sends.
|
|
25
|
+
sig { returns(Integer) }
|
|
26
|
+
attr_accessor :success_count
|
|
27
|
+
|
|
28
|
+
# Total number of recipients.
|
|
29
|
+
sig { returns(Integer) }
|
|
30
|
+
attr_accessor :total_count
|
|
31
|
+
|
|
32
|
+
# The callback URL used for this bulk request, if any.
|
|
33
|
+
sig { returns(T.nilable(String)) }
|
|
34
|
+
attr_reader :callback_url
|
|
35
|
+
|
|
36
|
+
sig { params(callback_url: String).void }
|
|
37
|
+
attr_writer :callback_url
|
|
38
|
+
|
|
39
|
+
# A string that identifies this specific request.
|
|
40
|
+
sig { returns(T.nilable(String)) }
|
|
41
|
+
attr_reader :request_id
|
|
42
|
+
|
|
43
|
+
sig { params(request_id: String).void }
|
|
44
|
+
attr_writer :request_id
|
|
45
|
+
|
|
46
|
+
# The template identifier used for this bulk request.
|
|
47
|
+
sig { returns(T.nilable(String)) }
|
|
48
|
+
attr_reader :template_id
|
|
49
|
+
|
|
50
|
+
sig { params(template_id: String).void }
|
|
51
|
+
attr_writer :template_id
|
|
52
|
+
|
|
53
|
+
# The variables used for this bulk request.
|
|
54
|
+
sig { returns(T.nilable(T::Hash[Symbol, String])) }
|
|
55
|
+
attr_reader :variables
|
|
56
|
+
|
|
57
|
+
sig { params(variables: T::Hash[Symbol, String]).void }
|
|
58
|
+
attr_writer :variables
|
|
59
|
+
|
|
60
|
+
sig do
|
|
61
|
+
params(
|
|
62
|
+
error_count: Integer,
|
|
63
|
+
results:
|
|
64
|
+
T::Array[
|
|
65
|
+
PreludeSDK::Models::NotifySendBatchResponse::Result::OrHash
|
|
66
|
+
],
|
|
67
|
+
success_count: Integer,
|
|
68
|
+
total_count: Integer,
|
|
69
|
+
callback_url: String,
|
|
70
|
+
request_id: String,
|
|
71
|
+
template_id: String,
|
|
72
|
+
variables: T::Hash[Symbol, String]
|
|
73
|
+
).returns(T.attached_class)
|
|
74
|
+
end
|
|
75
|
+
def self.new(
|
|
76
|
+
# Number of failed sends.
|
|
77
|
+
error_count:,
|
|
78
|
+
# The per-recipient result of the bulk send.
|
|
79
|
+
results:,
|
|
80
|
+
# Number of successful sends.
|
|
81
|
+
success_count:,
|
|
82
|
+
# Total number of recipients.
|
|
83
|
+
total_count:,
|
|
84
|
+
# The callback URL used for this bulk request, if any.
|
|
85
|
+
callback_url: nil,
|
|
86
|
+
# A string that identifies this specific request.
|
|
87
|
+
request_id: nil,
|
|
88
|
+
# The template identifier used for this bulk request.
|
|
89
|
+
template_id: nil,
|
|
90
|
+
# The variables used for this bulk request.
|
|
91
|
+
variables: nil
|
|
92
|
+
)
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
sig do
|
|
96
|
+
override.returns(
|
|
97
|
+
{
|
|
98
|
+
error_count: Integer,
|
|
99
|
+
results:
|
|
100
|
+
T::Array[PreludeSDK::Models::NotifySendBatchResponse::Result],
|
|
101
|
+
success_count: Integer,
|
|
102
|
+
total_count: Integer,
|
|
103
|
+
callback_url: String,
|
|
104
|
+
request_id: String,
|
|
105
|
+
template_id: String,
|
|
106
|
+
variables: T::Hash[Symbol, String]
|
|
107
|
+
}
|
|
108
|
+
)
|
|
109
|
+
end
|
|
110
|
+
def to_hash
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
class Result < PreludeSDK::Internal::Type::BaseModel
|
|
114
|
+
OrHash =
|
|
115
|
+
T.type_alias do
|
|
116
|
+
T.any(
|
|
117
|
+
PreludeSDK::Models::NotifySendBatchResponse::Result,
|
|
118
|
+
PreludeSDK::Internal::AnyHash
|
|
119
|
+
)
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
# The recipient's phone number in E.164 format.
|
|
123
|
+
sig { returns(String) }
|
|
124
|
+
attr_accessor :phone_number
|
|
125
|
+
|
|
126
|
+
# Whether the message was accepted for delivery.
|
|
127
|
+
sig { returns(T::Boolean) }
|
|
128
|
+
attr_accessor :success
|
|
129
|
+
|
|
130
|
+
# Present only if success is false.
|
|
131
|
+
sig do
|
|
132
|
+
returns(
|
|
133
|
+
T.nilable(
|
|
134
|
+
PreludeSDK::Models::NotifySendBatchResponse::Result::Error
|
|
135
|
+
)
|
|
136
|
+
)
|
|
137
|
+
end
|
|
138
|
+
attr_reader :error
|
|
139
|
+
|
|
140
|
+
sig do
|
|
141
|
+
params(
|
|
142
|
+
error:
|
|
143
|
+
PreludeSDK::Models::NotifySendBatchResponse::Result::Error::OrHash
|
|
144
|
+
).void
|
|
145
|
+
end
|
|
146
|
+
attr_writer :error
|
|
147
|
+
|
|
148
|
+
# Present only if success is true.
|
|
149
|
+
sig do
|
|
150
|
+
returns(
|
|
151
|
+
T.nilable(
|
|
152
|
+
PreludeSDK::Models::NotifySendBatchResponse::Result::Message
|
|
153
|
+
)
|
|
154
|
+
)
|
|
155
|
+
end
|
|
156
|
+
attr_reader :message
|
|
157
|
+
|
|
158
|
+
sig do
|
|
159
|
+
params(
|
|
160
|
+
message:
|
|
161
|
+
PreludeSDK::Models::NotifySendBatchResponse::Result::Message::OrHash
|
|
162
|
+
).void
|
|
163
|
+
end
|
|
164
|
+
attr_writer :message
|
|
165
|
+
|
|
166
|
+
sig do
|
|
167
|
+
params(
|
|
168
|
+
phone_number: String,
|
|
169
|
+
success: T::Boolean,
|
|
170
|
+
error:
|
|
171
|
+
PreludeSDK::Models::NotifySendBatchResponse::Result::Error::OrHash,
|
|
172
|
+
message:
|
|
173
|
+
PreludeSDK::Models::NotifySendBatchResponse::Result::Message::OrHash
|
|
174
|
+
).returns(T.attached_class)
|
|
175
|
+
end
|
|
176
|
+
def self.new(
|
|
177
|
+
# The recipient's phone number in E.164 format.
|
|
178
|
+
phone_number:,
|
|
179
|
+
# Whether the message was accepted for delivery.
|
|
180
|
+
success:,
|
|
181
|
+
# Present only if success is false.
|
|
182
|
+
error: nil,
|
|
183
|
+
# Present only if success is true.
|
|
184
|
+
message: nil
|
|
185
|
+
)
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
sig do
|
|
189
|
+
override.returns(
|
|
190
|
+
{
|
|
191
|
+
phone_number: String,
|
|
192
|
+
success: T::Boolean,
|
|
193
|
+
error: PreludeSDK::Models::NotifySendBatchResponse::Result::Error,
|
|
194
|
+
message:
|
|
195
|
+
PreludeSDK::Models::NotifySendBatchResponse::Result::Message
|
|
196
|
+
}
|
|
197
|
+
)
|
|
198
|
+
end
|
|
199
|
+
def to_hash
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
class Error < PreludeSDK::Internal::Type::BaseModel
|
|
203
|
+
OrHash =
|
|
204
|
+
T.type_alias do
|
|
205
|
+
T.any(
|
|
206
|
+
PreludeSDK::Models::NotifySendBatchResponse::Result::Error,
|
|
207
|
+
PreludeSDK::Internal::AnyHash
|
|
208
|
+
)
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
# The error code.
|
|
212
|
+
sig { returns(T.nilable(String)) }
|
|
213
|
+
attr_reader :code
|
|
214
|
+
|
|
215
|
+
sig { params(code: String).void }
|
|
216
|
+
attr_writer :code
|
|
217
|
+
|
|
218
|
+
# A human-readable error message.
|
|
219
|
+
sig { returns(T.nilable(String)) }
|
|
220
|
+
attr_reader :message
|
|
221
|
+
|
|
222
|
+
sig { params(message: String).void }
|
|
223
|
+
attr_writer :message
|
|
224
|
+
|
|
225
|
+
# Present only if success is false.
|
|
226
|
+
sig do
|
|
227
|
+
params(code: String, message: String).returns(T.attached_class)
|
|
228
|
+
end
|
|
229
|
+
def self.new(
|
|
230
|
+
# The error code.
|
|
231
|
+
code: nil,
|
|
232
|
+
# A human-readable error message.
|
|
233
|
+
message: nil
|
|
234
|
+
)
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
sig { override.returns({ code: String, message: String }) }
|
|
238
|
+
def to_hash
|
|
239
|
+
end
|
|
240
|
+
end
|
|
241
|
+
|
|
242
|
+
class Message < PreludeSDK::Internal::Type::BaseModel
|
|
243
|
+
OrHash =
|
|
244
|
+
T.type_alias do
|
|
245
|
+
T.any(
|
|
246
|
+
PreludeSDK::Models::NotifySendBatchResponse::Result::Message,
|
|
247
|
+
PreludeSDK::Internal::AnyHash
|
|
248
|
+
)
|
|
249
|
+
end
|
|
250
|
+
|
|
251
|
+
# The message identifier.
|
|
252
|
+
sig { returns(T.nilable(String)) }
|
|
253
|
+
attr_reader :id
|
|
254
|
+
|
|
255
|
+
sig { params(id: String).void }
|
|
256
|
+
attr_writer :id
|
|
257
|
+
|
|
258
|
+
# The correlation identifier for the message.
|
|
259
|
+
sig { returns(T.nilable(String)) }
|
|
260
|
+
attr_reader :correlation_id
|
|
261
|
+
|
|
262
|
+
sig { params(correlation_id: String).void }
|
|
263
|
+
attr_writer :correlation_id
|
|
264
|
+
|
|
265
|
+
# The message creation date in RFC3339 format.
|
|
266
|
+
sig { returns(T.nilable(Time)) }
|
|
267
|
+
attr_reader :created_at
|
|
268
|
+
|
|
269
|
+
sig { params(created_at: Time).void }
|
|
270
|
+
attr_writer :created_at
|
|
271
|
+
|
|
272
|
+
# The message expiration date in RFC3339 format.
|
|
273
|
+
sig { returns(T.nilable(Time)) }
|
|
274
|
+
attr_reader :expires_at
|
|
275
|
+
|
|
276
|
+
sig { params(expires_at: Time).void }
|
|
277
|
+
attr_writer :expires_at
|
|
278
|
+
|
|
279
|
+
# The Sender ID used for this message.
|
|
280
|
+
sig { returns(T.nilable(String)) }
|
|
281
|
+
attr_reader :from
|
|
282
|
+
|
|
283
|
+
sig { params(from: String).void }
|
|
284
|
+
attr_writer :from
|
|
285
|
+
|
|
286
|
+
# The locale used for the message, if any.
|
|
287
|
+
sig { returns(T.nilable(String)) }
|
|
288
|
+
attr_reader :locale
|
|
289
|
+
|
|
290
|
+
sig { params(locale: String).void }
|
|
291
|
+
attr_writer :locale
|
|
292
|
+
|
|
293
|
+
# When the message will actually be sent in RFC3339 format with timezone offset.
|
|
294
|
+
sig { returns(T.nilable(Time)) }
|
|
295
|
+
attr_reader :schedule_at
|
|
296
|
+
|
|
297
|
+
sig { params(schedule_at: Time).void }
|
|
298
|
+
attr_writer :schedule_at
|
|
299
|
+
|
|
300
|
+
# The recipient's phone number in E.164 format.
|
|
301
|
+
sig { returns(T.nilable(String)) }
|
|
302
|
+
attr_reader :to
|
|
303
|
+
|
|
304
|
+
sig { params(to: String).void }
|
|
305
|
+
attr_writer :to
|
|
306
|
+
|
|
307
|
+
# Present only if success is true.
|
|
308
|
+
sig do
|
|
309
|
+
params(
|
|
310
|
+
id: String,
|
|
311
|
+
correlation_id: String,
|
|
312
|
+
created_at: Time,
|
|
313
|
+
expires_at: Time,
|
|
314
|
+
from: String,
|
|
315
|
+
locale: String,
|
|
316
|
+
schedule_at: Time,
|
|
317
|
+
to: String
|
|
318
|
+
).returns(T.attached_class)
|
|
319
|
+
end
|
|
320
|
+
def self.new(
|
|
321
|
+
# The message identifier.
|
|
322
|
+
id: nil,
|
|
323
|
+
# The correlation identifier for the message.
|
|
324
|
+
correlation_id: nil,
|
|
325
|
+
# The message creation date in RFC3339 format.
|
|
326
|
+
created_at: nil,
|
|
327
|
+
# The message expiration date in RFC3339 format.
|
|
328
|
+
expires_at: nil,
|
|
329
|
+
# The Sender ID used for this message.
|
|
330
|
+
from: nil,
|
|
331
|
+
# The locale used for the message, if any.
|
|
332
|
+
locale: nil,
|
|
333
|
+
# When the message will actually be sent in RFC3339 format with timezone offset.
|
|
334
|
+
schedule_at: nil,
|
|
335
|
+
# The recipient's phone number in E.164 format.
|
|
336
|
+
to: nil
|
|
337
|
+
)
|
|
338
|
+
end
|
|
339
|
+
|
|
340
|
+
sig do
|
|
341
|
+
override.returns(
|
|
342
|
+
{
|
|
343
|
+
id: String,
|
|
344
|
+
correlation_id: String,
|
|
345
|
+
created_at: Time,
|
|
346
|
+
expires_at: Time,
|
|
347
|
+
from: String,
|
|
348
|
+
locale: String,
|
|
349
|
+
schedule_at: Time,
|
|
350
|
+
to: String
|
|
351
|
+
}
|
|
352
|
+
)
|
|
353
|
+
end
|
|
354
|
+
def to_hash
|
|
355
|
+
end
|
|
356
|
+
end
|
|
357
|
+
end
|
|
358
|
+
end
|
|
359
|
+
end
|
|
360
|
+
end
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module PreludeSDK
|
|
4
|
+
module Models
|
|
5
|
+
class NotifySendParams < PreludeSDK::Internal::Type::BaseModel
|
|
6
|
+
extend PreludeSDK::Internal::Type::RequestParameters::Converter
|
|
7
|
+
include PreludeSDK::Internal::Type::RequestParameters
|
|
8
|
+
|
|
9
|
+
OrHash =
|
|
10
|
+
T.type_alias do
|
|
11
|
+
T.any(PreludeSDK::NotifySendParams, PreludeSDK::Internal::AnyHash)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# The template identifier configured by your Customer Success team.
|
|
15
|
+
sig { returns(String) }
|
|
16
|
+
attr_accessor :template_id
|
|
17
|
+
|
|
18
|
+
# The recipient's phone number in E.164 format.
|
|
19
|
+
sig { returns(String) }
|
|
20
|
+
attr_accessor :to
|
|
21
|
+
|
|
22
|
+
# The URL where webhooks will be sent for message delivery events.
|
|
23
|
+
sig { returns(T.nilable(String)) }
|
|
24
|
+
attr_reader :callback_url
|
|
25
|
+
|
|
26
|
+
sig { params(callback_url: String).void }
|
|
27
|
+
attr_writer :callback_url
|
|
28
|
+
|
|
29
|
+
# A user-defined identifier to correlate this message with your internal systems.
|
|
30
|
+
# It is returned in the response and any webhook events that refer to this
|
|
31
|
+
# message.
|
|
32
|
+
sig { returns(T.nilable(String)) }
|
|
33
|
+
attr_reader :correlation_id
|
|
34
|
+
|
|
35
|
+
sig { params(correlation_id: String).void }
|
|
36
|
+
attr_writer :correlation_id
|
|
37
|
+
|
|
38
|
+
# The message expiration date in RFC3339 format. The message will not be sent if
|
|
39
|
+
# this time is reached.
|
|
40
|
+
sig { returns(T.nilable(Time)) }
|
|
41
|
+
attr_reader :expires_at
|
|
42
|
+
|
|
43
|
+
sig { params(expires_at: Time).void }
|
|
44
|
+
attr_writer :expires_at
|
|
45
|
+
|
|
46
|
+
# The Sender ID. Must be approved for your account.
|
|
47
|
+
sig { returns(T.nilable(String)) }
|
|
48
|
+
attr_reader :from
|
|
49
|
+
|
|
50
|
+
sig { params(from: String).void }
|
|
51
|
+
attr_writer :from
|
|
52
|
+
|
|
53
|
+
# A BCP-47 formatted locale string with the language the text message will be sent
|
|
54
|
+
# to. If there's no locale set, the language will be determined by the country
|
|
55
|
+
# code of the phone number. If the language specified doesn't exist, the default
|
|
56
|
+
# set on the template will be used.
|
|
57
|
+
sig { returns(T.nilable(String)) }
|
|
58
|
+
attr_reader :locale
|
|
59
|
+
|
|
60
|
+
sig { params(locale: String).void }
|
|
61
|
+
attr_writer :locale
|
|
62
|
+
|
|
63
|
+
# The preferred channel to be used in priority for message delivery. If the
|
|
64
|
+
# channel is unavailable, the system will fallback to other available channels.
|
|
65
|
+
sig do
|
|
66
|
+
returns(
|
|
67
|
+
T.nilable(PreludeSDK::NotifySendParams::PreferredChannel::OrSymbol)
|
|
68
|
+
)
|
|
69
|
+
end
|
|
70
|
+
attr_reader :preferred_channel
|
|
71
|
+
|
|
72
|
+
sig do
|
|
73
|
+
params(
|
|
74
|
+
preferred_channel:
|
|
75
|
+
PreludeSDK::NotifySendParams::PreferredChannel::OrSymbol
|
|
76
|
+
).void
|
|
77
|
+
end
|
|
78
|
+
attr_writer :preferred_channel
|
|
79
|
+
|
|
80
|
+
# Schedule the message for future delivery in RFC3339 format. Marketing messages
|
|
81
|
+
# can be scheduled up to 90 days in advance and will be automatically adjusted for
|
|
82
|
+
# compliance with local time window restrictions.
|
|
83
|
+
sig { returns(T.nilable(Time)) }
|
|
84
|
+
attr_reader :schedule_at
|
|
85
|
+
|
|
86
|
+
sig { params(schedule_at: Time).void }
|
|
87
|
+
attr_writer :schedule_at
|
|
88
|
+
|
|
89
|
+
# The variables to be replaced in the template.
|
|
90
|
+
sig { returns(T.nilable(T::Hash[Symbol, String])) }
|
|
91
|
+
attr_reader :variables
|
|
92
|
+
|
|
93
|
+
sig { params(variables: T::Hash[Symbol, String]).void }
|
|
94
|
+
attr_writer :variables
|
|
95
|
+
|
|
96
|
+
sig do
|
|
97
|
+
params(
|
|
98
|
+
template_id: String,
|
|
99
|
+
to: String,
|
|
100
|
+
callback_url: String,
|
|
101
|
+
correlation_id: String,
|
|
102
|
+
expires_at: Time,
|
|
103
|
+
from: String,
|
|
104
|
+
locale: String,
|
|
105
|
+
preferred_channel:
|
|
106
|
+
PreludeSDK::NotifySendParams::PreferredChannel::OrSymbol,
|
|
107
|
+
schedule_at: Time,
|
|
108
|
+
variables: T::Hash[Symbol, String],
|
|
109
|
+
request_options: PreludeSDK::RequestOptions::OrHash
|
|
110
|
+
).returns(T.attached_class)
|
|
111
|
+
end
|
|
112
|
+
def self.new(
|
|
113
|
+
# The template identifier configured by your Customer Success team.
|
|
114
|
+
template_id:,
|
|
115
|
+
# The recipient's phone number in E.164 format.
|
|
116
|
+
to:,
|
|
117
|
+
# The URL where webhooks will be sent for message delivery events.
|
|
118
|
+
callback_url: nil,
|
|
119
|
+
# A user-defined identifier to correlate this message with your internal systems.
|
|
120
|
+
# It is returned in the response and any webhook events that refer to this
|
|
121
|
+
# message.
|
|
122
|
+
correlation_id: nil,
|
|
123
|
+
# The message expiration date in RFC3339 format. The message will not be sent if
|
|
124
|
+
# this time is reached.
|
|
125
|
+
expires_at: nil,
|
|
126
|
+
# The Sender ID. Must be approved for your account.
|
|
127
|
+
from: nil,
|
|
128
|
+
# A BCP-47 formatted locale string with the language the text message will be sent
|
|
129
|
+
# to. If there's no locale set, the language will be determined by the country
|
|
130
|
+
# code of the phone number. If the language specified doesn't exist, the default
|
|
131
|
+
# set on the template will be used.
|
|
132
|
+
locale: nil,
|
|
133
|
+
# The preferred channel to be used in priority for message delivery. If the
|
|
134
|
+
# channel is unavailable, the system will fallback to other available channels.
|
|
135
|
+
preferred_channel: nil,
|
|
136
|
+
# Schedule the message for future delivery in RFC3339 format. Marketing messages
|
|
137
|
+
# can be scheduled up to 90 days in advance and will be automatically adjusted for
|
|
138
|
+
# compliance with local time window restrictions.
|
|
139
|
+
schedule_at: nil,
|
|
140
|
+
# The variables to be replaced in the template.
|
|
141
|
+
variables: nil,
|
|
142
|
+
request_options: {}
|
|
143
|
+
)
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
sig do
|
|
147
|
+
override.returns(
|
|
148
|
+
{
|
|
149
|
+
template_id: String,
|
|
150
|
+
to: String,
|
|
151
|
+
callback_url: String,
|
|
152
|
+
correlation_id: String,
|
|
153
|
+
expires_at: Time,
|
|
154
|
+
from: String,
|
|
155
|
+
locale: String,
|
|
156
|
+
preferred_channel:
|
|
157
|
+
PreludeSDK::NotifySendParams::PreferredChannel::OrSymbol,
|
|
158
|
+
schedule_at: Time,
|
|
159
|
+
variables: T::Hash[Symbol, String],
|
|
160
|
+
request_options: PreludeSDK::RequestOptions
|
|
161
|
+
}
|
|
162
|
+
)
|
|
163
|
+
end
|
|
164
|
+
def to_hash
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
# The preferred channel to be used in priority for message delivery. If the
|
|
168
|
+
# channel is unavailable, the system will fallback to other available channels.
|
|
169
|
+
module PreferredChannel
|
|
170
|
+
extend PreludeSDK::Internal::Type::Enum
|
|
171
|
+
|
|
172
|
+
TaggedSymbol =
|
|
173
|
+
T.type_alias do
|
|
174
|
+
T.all(Symbol, PreludeSDK::NotifySendParams::PreferredChannel)
|
|
175
|
+
end
|
|
176
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
177
|
+
|
|
178
|
+
SMS =
|
|
179
|
+
T.let(
|
|
180
|
+
:sms,
|
|
181
|
+
PreludeSDK::NotifySendParams::PreferredChannel::TaggedSymbol
|
|
182
|
+
)
|
|
183
|
+
WHATSAPP =
|
|
184
|
+
T.let(
|
|
185
|
+
:whatsapp,
|
|
186
|
+
PreludeSDK::NotifySendParams::PreferredChannel::TaggedSymbol
|
|
187
|
+
)
|
|
188
|
+
|
|
189
|
+
sig do
|
|
190
|
+
override.returns(
|
|
191
|
+
T::Array[
|
|
192
|
+
PreludeSDK::NotifySendParams::PreferredChannel::TaggedSymbol
|
|
193
|
+
]
|
|
194
|
+
)
|
|
195
|
+
end
|
|
196
|
+
def self.values
|
|
197
|
+
end
|
|
198
|
+
end
|
|
199
|
+
end
|
|
200
|
+
end
|
|
201
|
+
end
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module PreludeSDK
|
|
4
|
+
module Models
|
|
5
|
+
class NotifySendResponse < PreludeSDK::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(
|
|
9
|
+
PreludeSDK::Models::NotifySendResponse,
|
|
10
|
+
PreludeSDK::Internal::AnyHash
|
|
11
|
+
)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# The message identifier.
|
|
15
|
+
sig { returns(String) }
|
|
16
|
+
attr_accessor :id
|
|
17
|
+
|
|
18
|
+
# The message creation date in RFC3339 format.
|
|
19
|
+
sig { returns(Time) }
|
|
20
|
+
attr_accessor :created_at
|
|
21
|
+
|
|
22
|
+
# The message expiration date in RFC3339 format.
|
|
23
|
+
sig { returns(Time) }
|
|
24
|
+
attr_accessor :expires_at
|
|
25
|
+
|
|
26
|
+
# The template identifier.
|
|
27
|
+
sig { returns(String) }
|
|
28
|
+
attr_accessor :template_id
|
|
29
|
+
|
|
30
|
+
# The recipient's phone number in E.164 format.
|
|
31
|
+
sig { returns(String) }
|
|
32
|
+
attr_accessor :to
|
|
33
|
+
|
|
34
|
+
# The variables to be replaced in the template.
|
|
35
|
+
sig { returns(T::Hash[Symbol, String]) }
|
|
36
|
+
attr_accessor :variables
|
|
37
|
+
|
|
38
|
+
# The callback URL where webhooks will be sent.
|
|
39
|
+
sig { returns(T.nilable(String)) }
|
|
40
|
+
attr_reader :callback_url
|
|
41
|
+
|
|
42
|
+
sig { params(callback_url: String).void }
|
|
43
|
+
attr_writer :callback_url
|
|
44
|
+
|
|
45
|
+
# A user-defined identifier to correlate this message with your internal systems.
|
|
46
|
+
sig { returns(T.nilable(String)) }
|
|
47
|
+
attr_reader :correlation_id
|
|
48
|
+
|
|
49
|
+
sig { params(correlation_id: String).void }
|
|
50
|
+
attr_writer :correlation_id
|
|
51
|
+
|
|
52
|
+
# The Sender ID used for this message.
|
|
53
|
+
sig { returns(T.nilable(String)) }
|
|
54
|
+
attr_reader :from
|
|
55
|
+
|
|
56
|
+
sig { params(from: String).void }
|
|
57
|
+
attr_writer :from
|
|
58
|
+
|
|
59
|
+
# When the message will actually be sent in RFC3339 format with timezone offset.
|
|
60
|
+
# For marketing messages, this may differ from the requested schedule_at due to
|
|
61
|
+
# automatic compliance adjustments.
|
|
62
|
+
sig { returns(T.nilable(Time)) }
|
|
63
|
+
attr_reader :schedule_at
|
|
64
|
+
|
|
65
|
+
sig { params(schedule_at: Time).void }
|
|
66
|
+
attr_writer :schedule_at
|
|
67
|
+
|
|
68
|
+
sig do
|
|
69
|
+
params(
|
|
70
|
+
id: String,
|
|
71
|
+
created_at: Time,
|
|
72
|
+
expires_at: Time,
|
|
73
|
+
template_id: String,
|
|
74
|
+
to: String,
|
|
75
|
+
variables: T::Hash[Symbol, String],
|
|
76
|
+
callback_url: String,
|
|
77
|
+
correlation_id: String,
|
|
78
|
+
from: String,
|
|
79
|
+
schedule_at: Time
|
|
80
|
+
).returns(T.attached_class)
|
|
81
|
+
end
|
|
82
|
+
def self.new(
|
|
83
|
+
# The message identifier.
|
|
84
|
+
id:,
|
|
85
|
+
# The message creation date in RFC3339 format.
|
|
86
|
+
created_at:,
|
|
87
|
+
# The message expiration date in RFC3339 format.
|
|
88
|
+
expires_at:,
|
|
89
|
+
# The template identifier.
|
|
90
|
+
template_id:,
|
|
91
|
+
# The recipient's phone number in E.164 format.
|
|
92
|
+
to:,
|
|
93
|
+
# The variables to be replaced in the template.
|
|
94
|
+
variables:,
|
|
95
|
+
# The callback URL where webhooks will be sent.
|
|
96
|
+
callback_url: nil,
|
|
97
|
+
# A user-defined identifier to correlate this message with your internal systems.
|
|
98
|
+
correlation_id: nil,
|
|
99
|
+
# The Sender ID used for this message.
|
|
100
|
+
from: nil,
|
|
101
|
+
# When the message will actually be sent in RFC3339 format with timezone offset.
|
|
102
|
+
# For marketing messages, this may differ from the requested schedule_at due to
|
|
103
|
+
# automatic compliance adjustments.
|
|
104
|
+
schedule_at: nil
|
|
105
|
+
)
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
sig do
|
|
109
|
+
override.returns(
|
|
110
|
+
{
|
|
111
|
+
id: String,
|
|
112
|
+
created_at: Time,
|
|
113
|
+
expires_at: Time,
|
|
114
|
+
template_id: String,
|
|
115
|
+
to: String,
|
|
116
|
+
variables: T::Hash[Symbol, String],
|
|
117
|
+
callback_url: String,
|
|
118
|
+
correlation_id: String,
|
|
119
|
+
from: String,
|
|
120
|
+
schedule_at: Time
|
|
121
|
+
}
|
|
122
|
+
)
|
|
123
|
+
end
|
|
124
|
+
def to_hash
|
|
125
|
+
end
|
|
126
|
+
end
|
|
127
|
+
end
|
|
128
|
+
end
|
data/rbi/prelude_sdk/models.rbi
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
3
3
|
module PreludeSDK
|
|
4
4
|
LookupLookupParams = PreludeSDK::Models::LookupLookupParams
|
|
5
5
|
|
|
6
|
+
NotifyGetSubscriptionConfigParams =
|
|
7
|
+
PreludeSDK::Models::NotifyGetSubscriptionConfigParams
|
|
8
|
+
|
|
9
|
+
NotifyGetSubscriptionPhoneNumberParams =
|
|
10
|
+
PreludeSDK::Models::NotifyGetSubscriptionPhoneNumberParams
|
|
11
|
+
|
|
12
|
+
NotifyListSubscriptionConfigsParams =
|
|
13
|
+
PreludeSDK::Models::NotifyListSubscriptionConfigsParams
|
|
14
|
+
|
|
15
|
+
NotifyListSubscriptionPhoneNumberEventsParams =
|
|
16
|
+
PreludeSDK::Models::NotifyListSubscriptionPhoneNumberEventsParams
|
|
17
|
+
|
|
18
|
+
NotifyListSubscriptionPhoneNumbersParams =
|
|
19
|
+
PreludeSDK::Models::NotifyListSubscriptionPhoneNumbersParams
|
|
20
|
+
|
|
21
|
+
NotifySendBatchParams = PreludeSDK::Models::NotifySendBatchParams
|
|
22
|
+
|
|
23
|
+
NotifySendParams = PreludeSDK::Models::NotifySendParams
|
|
24
|
+
|
|
6
25
|
TransactionalSendParams = PreludeSDK::Models::TransactionalSendParams
|
|
7
26
|
|
|
8
27
|
VerificationCheckParams = PreludeSDK::Models::VerificationCheckParams
|