prelude-sdk 0.1.0 → 0.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +61 -0
- data/README.md +9 -9
- data/lib/prelude_sdk/client.rb +11 -0
- data/lib/prelude_sdk/internal/transport/pooled_net_requester.rb +13 -11
- data/lib/prelude_sdk/internal/util.rb +39 -3
- data/lib/prelude_sdk/models/lookup_lookup_params.rb +9 -1
- data/lib/prelude_sdk/models/notify_get_subscription_config_params.rb +20 -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 +26 -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 +44 -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 +56 -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 +141 -0
- data/lib/prelude_sdk/models/notify_send_batch_response.rb +239 -0
- data/lib/prelude_sdk/models/notify_send_params.rb +149 -0
- data/lib/prelude_sdk/models/notify_send_response.rb +129 -0
- data/lib/prelude_sdk/models/transactional_send_params.rb +32 -1
- data/lib/prelude_sdk/models/verification_create_params.rb +35 -48
- data/lib/prelude_sdk/models/verification_create_response.rb +15 -0
- data/lib/prelude_sdk/models/verification_management_delete_phone_number_params.rb +8 -1
- data/lib/prelude_sdk/models/verification_management_list_phone_numbers_params.rb +7 -1
- data/lib/prelude_sdk/models/verification_management_set_phone_number_params.rb +8 -1
- data/lib/prelude_sdk/models/watch_predict_params.rb +16 -12
- data/lib/prelude_sdk/models/watch_predict_response.rb +51 -1
- data/lib/prelude_sdk/models/watch_send_feedbacks_params.rb +1 -128
- data/lib/prelude_sdk/models.rb +15 -0
- data/lib/prelude_sdk/resources/lookup.rb +4 -1
- data/lib/prelude_sdk/resources/notify.rb +255 -0
- data/lib/prelude_sdk/resources/transactional.rb +4 -1
- data/lib/prelude_sdk/resources/verification.rb +1 -0
- data/lib/prelude_sdk/resources/verification_management.rb +1 -0
- data/lib/prelude_sdk/resources/watch.rb +1 -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 +10 -0
- data/rbi/prelude_sdk/internal/util.rbi +21 -1
- data/rbi/prelude_sdk/models/lookup_lookup_params.rbi +8 -0
- data/rbi/prelude_sdk/models/notify_get_subscription_config_params.rbi +38 -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 +46 -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 +72 -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 +125 -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 +241 -0
- data/rbi/prelude_sdk/models/notify_send_batch_response.rbi +440 -0
- data/rbi/prelude_sdk/models/notify_send_params.rbi +249 -0
- data/rbi/prelude_sdk/models/notify_send_response.rbi +203 -0
- data/rbi/prelude_sdk/models/transactional_send_params.rbi +50 -0
- data/rbi/prelude_sdk/models/verification_create_params.rbi +53 -93
- data/rbi/prelude_sdk/models/verification_create_response.rbi +26 -0
- data/rbi/prelude_sdk/models/verification_management_delete_phone_number_params.rbi +16 -1
- data/rbi/prelude_sdk/models/verification_management_list_phone_numbers_params.rbi +21 -4
- data/rbi/prelude_sdk/models/verification_management_set_phone_number_params.rbi +16 -1
- data/rbi/prelude_sdk/models/watch_predict_params.rbi +24 -16
- data/rbi/prelude_sdk/models/watch_predict_response.rbi +152 -3
- data/rbi/prelude_sdk/models/watch_send_feedbacks_params.rbi +3 -243
- data/rbi/prelude_sdk/models.rbi +19 -0
- data/rbi/prelude_sdk/resources/lookup.rbi +2 -0
- data/rbi/prelude_sdk/resources/notify.rbi +227 -0
- data/rbi/prelude_sdk/resources/transactional.rbi +5 -0
- data/rbi/prelude_sdk/resources/verification.rbi +1 -0
- data/rbi/prelude_sdk/resources/verification_management.rbi +1 -0
- data/rbi/prelude_sdk/resources/watch.rbi +1 -0
- data/sig/prelude_sdk/client.rbs +2 -0
- data/sig/prelude_sdk/internal/util.rbs +10 -0
- data/sig/prelude_sdk/models/lookup_lookup_params.rbs +8 -1
- data/sig/prelude_sdk/models/notify_get_subscription_config_params.rbs +23 -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 +28 -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 +45 -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 +60 -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 +121 -0
- data/sig/prelude_sdk/models/notify_send_batch_response.rbs +214 -0
- data/sig/prelude_sdk/models/notify_send_params.rbs +121 -0
- data/sig/prelude_sdk/models/notify_send_response.rbs +100 -0
- data/sig/prelude_sdk/models/transactional_send_params.rbs +21 -0
- data/sig/prelude_sdk/models/verification_create_params.rbs +2 -21
- data/sig/prelude_sdk/models/verification_create_response.rbs +2 -1
- data/sig/prelude_sdk/models/verification_management_delete_phone_number_params.rbs +9 -1
- data/sig/prelude_sdk/models/verification_management_list_phone_numbers_params.rbs +14 -3
- data/sig/prelude_sdk/models/verification_management_set_phone_number_params.rbs +9 -1
- data/sig/prelude_sdk/models/watch_predict_response.rbs +41 -3
- data/sig/prelude_sdk/models/watch_send_feedbacks_params.rbs +3 -110
- data/sig/prelude_sdk/models.rbs +14 -0
- data/sig/prelude_sdk/resources/notify.rbs +70 -0
- data/sig/prelude_sdk/resources/transactional.rbs +1 -0
- metadata +61 -2
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module PreludeSDK
|
|
4
|
+
module Models
|
|
5
|
+
# @see PreludeSDK::Resources::Notify#send_batch
|
|
6
|
+
class NotifySendBatchResponse < PreludeSDK::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute error_count
|
|
8
|
+
# Number of failed sends.
|
|
9
|
+
#
|
|
10
|
+
# @return [Integer]
|
|
11
|
+
required :error_count, Integer
|
|
12
|
+
|
|
13
|
+
# @!attribute results
|
|
14
|
+
# The per-recipient result of the bulk send.
|
|
15
|
+
#
|
|
16
|
+
# @return [Array<PreludeSDK::Models::NotifySendBatchResponse::Result>]
|
|
17
|
+
required :results,
|
|
18
|
+
-> { PreludeSDK::Internal::Type::ArrayOf[PreludeSDK::Models::NotifySendBatchResponse::Result] }
|
|
19
|
+
|
|
20
|
+
# @!attribute success_count
|
|
21
|
+
# Number of successful sends.
|
|
22
|
+
#
|
|
23
|
+
# @return [Integer]
|
|
24
|
+
required :success_count, Integer
|
|
25
|
+
|
|
26
|
+
# @!attribute total_count
|
|
27
|
+
# Total number of recipients.
|
|
28
|
+
#
|
|
29
|
+
# @return [Integer]
|
|
30
|
+
required :total_count, Integer
|
|
31
|
+
|
|
32
|
+
# @!attribute callback_url
|
|
33
|
+
# The callback URL used for this bulk request, if any.
|
|
34
|
+
#
|
|
35
|
+
# @return [String, nil]
|
|
36
|
+
optional :callback_url, String
|
|
37
|
+
|
|
38
|
+
# @!attribute request_id
|
|
39
|
+
# A string that identifies this specific request.
|
|
40
|
+
#
|
|
41
|
+
# @return [String, nil]
|
|
42
|
+
optional :request_id, String
|
|
43
|
+
|
|
44
|
+
# @!attribute template_id
|
|
45
|
+
# The template identifier used for this bulk request.
|
|
46
|
+
#
|
|
47
|
+
# @return [String, nil]
|
|
48
|
+
optional :template_id, String
|
|
49
|
+
|
|
50
|
+
# @!attribute variables
|
|
51
|
+
# The variables used for this bulk request.
|
|
52
|
+
#
|
|
53
|
+
# @return [Hash{Symbol=>String}, nil]
|
|
54
|
+
optional :variables, PreludeSDK::Internal::Type::HashOf[String]
|
|
55
|
+
|
|
56
|
+
# @!method initialize(error_count:, results:, success_count:, total_count:, callback_url: nil, request_id: nil, template_id: nil, variables: nil)
|
|
57
|
+
# @param error_count [Integer] Number of failed sends.
|
|
58
|
+
#
|
|
59
|
+
# @param results [Array<PreludeSDK::Models::NotifySendBatchResponse::Result>] The per-recipient result of the bulk send.
|
|
60
|
+
#
|
|
61
|
+
# @param success_count [Integer] Number of successful sends.
|
|
62
|
+
#
|
|
63
|
+
# @param total_count [Integer] Total number of recipients.
|
|
64
|
+
#
|
|
65
|
+
# @param callback_url [String] The callback URL used for this bulk request, if any.
|
|
66
|
+
#
|
|
67
|
+
# @param request_id [String] A string that identifies this specific request.
|
|
68
|
+
#
|
|
69
|
+
# @param template_id [String] The template identifier used for this bulk request.
|
|
70
|
+
#
|
|
71
|
+
# @param variables [Hash{Symbol=>String}] The variables used for this bulk request.
|
|
72
|
+
|
|
73
|
+
class Result < PreludeSDK::Internal::Type::BaseModel
|
|
74
|
+
# @!attribute phone_number
|
|
75
|
+
# The recipient's phone number in E.164 format.
|
|
76
|
+
#
|
|
77
|
+
# @return [String]
|
|
78
|
+
required :phone_number, String
|
|
79
|
+
|
|
80
|
+
# @!attribute success
|
|
81
|
+
# Whether the message was accepted for delivery.
|
|
82
|
+
#
|
|
83
|
+
# @return [Boolean]
|
|
84
|
+
required :success, PreludeSDK::Internal::Type::Boolean
|
|
85
|
+
|
|
86
|
+
# @!attribute error
|
|
87
|
+
# Present only if success is false.
|
|
88
|
+
#
|
|
89
|
+
# @return [PreludeSDK::Models::NotifySendBatchResponse::Result::Error, nil]
|
|
90
|
+
optional :error, -> { PreludeSDK::Models::NotifySendBatchResponse::Result::Error }
|
|
91
|
+
|
|
92
|
+
# @!attribute message
|
|
93
|
+
# Present only if success is true.
|
|
94
|
+
#
|
|
95
|
+
# @return [PreludeSDK::Models::NotifySendBatchResponse::Result::Message, nil]
|
|
96
|
+
optional :message, -> { PreludeSDK::Models::NotifySendBatchResponse::Result::Message }
|
|
97
|
+
|
|
98
|
+
# @!method initialize(phone_number:, success:, error: nil, message: nil)
|
|
99
|
+
# @param phone_number [String] The recipient's phone number in E.164 format.
|
|
100
|
+
#
|
|
101
|
+
# @param success [Boolean] Whether the message was accepted for delivery.
|
|
102
|
+
#
|
|
103
|
+
# @param error [PreludeSDK::Models::NotifySendBatchResponse::Result::Error] Present only if success is false.
|
|
104
|
+
#
|
|
105
|
+
# @param message [PreludeSDK::Models::NotifySendBatchResponse::Result::Message] Present only if success is true.
|
|
106
|
+
|
|
107
|
+
# @see PreludeSDK::Models::NotifySendBatchResponse::Result#error
|
|
108
|
+
class Error < PreludeSDK::Internal::Type::BaseModel
|
|
109
|
+
# @!attribute code
|
|
110
|
+
# The error code.
|
|
111
|
+
#
|
|
112
|
+
# @return [String, nil]
|
|
113
|
+
optional :code, String
|
|
114
|
+
|
|
115
|
+
# @!attribute message
|
|
116
|
+
# A human-readable error message.
|
|
117
|
+
#
|
|
118
|
+
# @return [String, nil]
|
|
119
|
+
optional :message, String
|
|
120
|
+
|
|
121
|
+
# @!method initialize(code: nil, message: nil)
|
|
122
|
+
# Present only if success is false.
|
|
123
|
+
#
|
|
124
|
+
# @param code [String] The error code.
|
|
125
|
+
#
|
|
126
|
+
# @param message [String] A human-readable error message.
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
# @see PreludeSDK::Models::NotifySendBatchResponse::Result#message
|
|
130
|
+
class Message < PreludeSDK::Internal::Type::BaseModel
|
|
131
|
+
# @!attribute id
|
|
132
|
+
# The message identifier.
|
|
133
|
+
#
|
|
134
|
+
# @return [String, nil]
|
|
135
|
+
optional :id, String
|
|
136
|
+
|
|
137
|
+
# @!attribute correlation_id
|
|
138
|
+
# The correlation identifier for the message.
|
|
139
|
+
#
|
|
140
|
+
# @return [String, nil]
|
|
141
|
+
optional :correlation_id, String
|
|
142
|
+
|
|
143
|
+
# @!attribute created_at
|
|
144
|
+
# The message creation date in RFC3339 format.
|
|
145
|
+
#
|
|
146
|
+
# @return [Time, nil]
|
|
147
|
+
optional :created_at, Time
|
|
148
|
+
|
|
149
|
+
# @!attribute encoding
|
|
150
|
+
# The SMS encoding type based on message content. GSM-7 supports standard
|
|
151
|
+
# characters (up to 160 chars per segment), while UCS-2 supports Unicode including
|
|
152
|
+
# emoji (up to 70 chars per segment). Only present for SMS messages.
|
|
153
|
+
#
|
|
154
|
+
# @return [Symbol, PreludeSDK::Models::NotifySendBatchResponse::Result::Message::Encoding, nil]
|
|
155
|
+
optional :encoding, enum: -> { PreludeSDK::Models::NotifySendBatchResponse::Result::Message::Encoding }
|
|
156
|
+
|
|
157
|
+
# @!attribute estimated_segment_count
|
|
158
|
+
# The estimated number of SMS segments for this message. This value is not
|
|
159
|
+
# contractual; the actual segment count will be determined after the SMS is sent
|
|
160
|
+
# by the provider. Only present for SMS messages.
|
|
161
|
+
#
|
|
162
|
+
# @return [Integer, nil]
|
|
163
|
+
optional :estimated_segment_count, Integer
|
|
164
|
+
|
|
165
|
+
# @!attribute expires_at
|
|
166
|
+
# The message expiration date in RFC3339 format.
|
|
167
|
+
#
|
|
168
|
+
# @return [Time, nil]
|
|
169
|
+
optional :expires_at, Time
|
|
170
|
+
|
|
171
|
+
# @!attribute from
|
|
172
|
+
# The Sender ID used for this message.
|
|
173
|
+
#
|
|
174
|
+
# @return [String, nil]
|
|
175
|
+
optional :from, String
|
|
176
|
+
|
|
177
|
+
# @!attribute locale
|
|
178
|
+
# The locale used for the message, if any.
|
|
179
|
+
#
|
|
180
|
+
# @return [String, nil]
|
|
181
|
+
optional :locale, String
|
|
182
|
+
|
|
183
|
+
# @!attribute schedule_at
|
|
184
|
+
# When the message will actually be sent in RFC3339 format with timezone offset.
|
|
185
|
+
#
|
|
186
|
+
# @return [Time, nil]
|
|
187
|
+
optional :schedule_at, Time
|
|
188
|
+
|
|
189
|
+
# @!attribute to
|
|
190
|
+
# The recipient's phone number in E.164 format.
|
|
191
|
+
#
|
|
192
|
+
# @return [String, nil]
|
|
193
|
+
optional :to, String
|
|
194
|
+
|
|
195
|
+
# @!method initialize(id: nil, correlation_id: nil, created_at: nil, encoding: nil, estimated_segment_count: nil, expires_at: nil, from: nil, locale: nil, schedule_at: nil, to: nil)
|
|
196
|
+
# Some parameter documentations has been truncated, see
|
|
197
|
+
# {PreludeSDK::Models::NotifySendBatchResponse::Result::Message} for more details.
|
|
198
|
+
#
|
|
199
|
+
# Present only if success is true.
|
|
200
|
+
#
|
|
201
|
+
# @param id [String] The message identifier.
|
|
202
|
+
#
|
|
203
|
+
# @param correlation_id [String] The correlation identifier for the message.
|
|
204
|
+
#
|
|
205
|
+
# @param created_at [Time] The message creation date in RFC3339 format.
|
|
206
|
+
#
|
|
207
|
+
# @param encoding [Symbol, PreludeSDK::Models::NotifySendBatchResponse::Result::Message::Encoding] The SMS encoding type based on message content. GSM-7 supports standard characte
|
|
208
|
+
#
|
|
209
|
+
# @param estimated_segment_count [Integer] The estimated number of SMS segments for this message. This value is not contrac
|
|
210
|
+
#
|
|
211
|
+
# @param expires_at [Time] The message expiration date in RFC3339 format.
|
|
212
|
+
#
|
|
213
|
+
# @param from [String] The Sender ID used for this message.
|
|
214
|
+
#
|
|
215
|
+
# @param locale [String] The locale used for the message, if any.
|
|
216
|
+
#
|
|
217
|
+
# @param schedule_at [Time] When the message will actually be sent in RFC3339 format with timezone offset.
|
|
218
|
+
#
|
|
219
|
+
# @param to [String] The recipient's phone number in E.164 format.
|
|
220
|
+
|
|
221
|
+
# The SMS encoding type based on message content. GSM-7 supports standard
|
|
222
|
+
# characters (up to 160 chars per segment), while UCS-2 supports Unicode including
|
|
223
|
+
# emoji (up to 70 chars per segment). Only present for SMS messages.
|
|
224
|
+
#
|
|
225
|
+
# @see PreludeSDK::Models::NotifySendBatchResponse::Result::Message#encoding
|
|
226
|
+
module Encoding
|
|
227
|
+
extend PreludeSDK::Internal::Type::Enum
|
|
228
|
+
|
|
229
|
+
GSM_7 = :"GSM-7"
|
|
230
|
+
UCS_2 = :"UCS-2"
|
|
231
|
+
|
|
232
|
+
# @!method self.values
|
|
233
|
+
# @return [Array<Symbol>]
|
|
234
|
+
end
|
|
235
|
+
end
|
|
236
|
+
end
|
|
237
|
+
end
|
|
238
|
+
end
|
|
239
|
+
end
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module PreludeSDK
|
|
4
|
+
module Models
|
|
5
|
+
# @see PreludeSDK::Resources::Notify#send_
|
|
6
|
+
class NotifySendParams < PreludeSDK::Internal::Type::BaseModel
|
|
7
|
+
extend PreludeSDK::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include PreludeSDK::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!attribute template_id
|
|
11
|
+
# The template identifier configured by your Customer Success team.
|
|
12
|
+
#
|
|
13
|
+
# @return [String]
|
|
14
|
+
required :template_id, String
|
|
15
|
+
|
|
16
|
+
# @!attribute to
|
|
17
|
+
# The recipient's phone number in E.164 format.
|
|
18
|
+
#
|
|
19
|
+
# @return [String]
|
|
20
|
+
required :to, String
|
|
21
|
+
|
|
22
|
+
# @!attribute callback_url
|
|
23
|
+
# The URL where webhooks will be sent for message delivery events.
|
|
24
|
+
#
|
|
25
|
+
# @return [String, nil]
|
|
26
|
+
optional :callback_url, String
|
|
27
|
+
|
|
28
|
+
# @!attribute correlation_id
|
|
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
|
+
#
|
|
33
|
+
# @return [String, nil]
|
|
34
|
+
optional :correlation_id, String
|
|
35
|
+
|
|
36
|
+
# @!attribute document
|
|
37
|
+
# A document to attach to the message. Only supported on WhatsApp templates that
|
|
38
|
+
# have a document header.
|
|
39
|
+
#
|
|
40
|
+
# @return [PreludeSDK::Models::NotifySendParams::Document, nil]
|
|
41
|
+
optional :document, -> { PreludeSDK::NotifySendParams::Document }
|
|
42
|
+
|
|
43
|
+
# @!attribute expires_at
|
|
44
|
+
# The message expiration date in RFC3339 format. The message will not be sent if
|
|
45
|
+
# this time is reached.
|
|
46
|
+
#
|
|
47
|
+
# @return [Time, nil]
|
|
48
|
+
optional :expires_at, Time
|
|
49
|
+
|
|
50
|
+
# @!attribute from
|
|
51
|
+
# The Sender ID. Must be approved for your account.
|
|
52
|
+
#
|
|
53
|
+
# @return [String, nil]
|
|
54
|
+
optional :from, String
|
|
55
|
+
|
|
56
|
+
# @!attribute locale
|
|
57
|
+
# A BCP-47 formatted locale string with the language the text message will be sent
|
|
58
|
+
# to. If there's no locale set, the language will be determined by the country
|
|
59
|
+
# code of the phone number. If the language specified doesn't exist, the default
|
|
60
|
+
# set on the template will be used.
|
|
61
|
+
#
|
|
62
|
+
# @return [String, nil]
|
|
63
|
+
optional :locale, String
|
|
64
|
+
|
|
65
|
+
# @!attribute preferred_channel
|
|
66
|
+
# The preferred channel to be used in priority for message delivery. If the
|
|
67
|
+
# channel is unavailable, the system will fallback to other available channels.
|
|
68
|
+
#
|
|
69
|
+
# @return [Symbol, PreludeSDK::Models::NotifySendParams::PreferredChannel, nil]
|
|
70
|
+
optional :preferred_channel, enum: -> { PreludeSDK::NotifySendParams::PreferredChannel }
|
|
71
|
+
|
|
72
|
+
# @!attribute schedule_at
|
|
73
|
+
# Schedule the message for future delivery in RFC3339 format. Marketing messages
|
|
74
|
+
# can be scheduled up to 90 days in advance and will be automatically adjusted for
|
|
75
|
+
# compliance with local time window restrictions.
|
|
76
|
+
#
|
|
77
|
+
# @return [Time, nil]
|
|
78
|
+
optional :schedule_at, Time
|
|
79
|
+
|
|
80
|
+
# @!attribute variables
|
|
81
|
+
# The variables to be replaced in the template.
|
|
82
|
+
#
|
|
83
|
+
# @return [Hash{Symbol=>String}, nil]
|
|
84
|
+
optional :variables, PreludeSDK::Internal::Type::HashOf[String]
|
|
85
|
+
|
|
86
|
+
# @!method initialize(template_id:, to:, callback_url: nil, correlation_id: nil, document: nil, expires_at: nil, from: nil, locale: nil, preferred_channel: nil, schedule_at: nil, variables: nil, request_options: {})
|
|
87
|
+
# Some parameter documentations has been truncated, see
|
|
88
|
+
# {PreludeSDK::Models::NotifySendParams} for more details.
|
|
89
|
+
#
|
|
90
|
+
# @param template_id [String] The template identifier configured by your Customer Success team.
|
|
91
|
+
#
|
|
92
|
+
# @param to [String] The recipient's phone number in E.164 format.
|
|
93
|
+
#
|
|
94
|
+
# @param callback_url [String] The URL where webhooks will be sent for message delivery events.
|
|
95
|
+
#
|
|
96
|
+
# @param correlation_id [String] A user-defined identifier to correlate this message with your internal systems.
|
|
97
|
+
#
|
|
98
|
+
# @param document [PreludeSDK::Models::NotifySendParams::Document] A document to attach to the message. Only supported on WhatsApp templates that h
|
|
99
|
+
#
|
|
100
|
+
# @param expires_at [Time] The message expiration date in RFC3339 format. The message will not be sent if t
|
|
101
|
+
#
|
|
102
|
+
# @param from [String] The Sender ID. Must be approved for your account.
|
|
103
|
+
#
|
|
104
|
+
# @param locale [String] A BCP-47 formatted locale string with the language the text message will be sent
|
|
105
|
+
#
|
|
106
|
+
# @param preferred_channel [Symbol, PreludeSDK::Models::NotifySendParams::PreferredChannel] The preferred channel to be used in priority for message delivery. If the channe
|
|
107
|
+
#
|
|
108
|
+
# @param schedule_at [Time] Schedule the message for future delivery in RFC3339 format. Marketing messages c
|
|
109
|
+
#
|
|
110
|
+
# @param variables [Hash{Symbol=>String}] The variables to be replaced in the template.
|
|
111
|
+
#
|
|
112
|
+
# @param request_options [PreludeSDK::RequestOptions, Hash{Symbol=>Object}]
|
|
113
|
+
|
|
114
|
+
class Document < PreludeSDK::Internal::Type::BaseModel
|
|
115
|
+
# @!attribute filename
|
|
116
|
+
# The filename to display for the document.
|
|
117
|
+
#
|
|
118
|
+
# @return [String]
|
|
119
|
+
required :filename, String
|
|
120
|
+
|
|
121
|
+
# @!attribute url
|
|
122
|
+
# The URL of the document to attach. Must be a valid HTTP or HTTPS URL.
|
|
123
|
+
#
|
|
124
|
+
# @return [String]
|
|
125
|
+
required :url, String
|
|
126
|
+
|
|
127
|
+
# @!method initialize(filename:, url:)
|
|
128
|
+
# A document to attach to the message. Only supported on WhatsApp templates that
|
|
129
|
+
# have a document header.
|
|
130
|
+
#
|
|
131
|
+
# @param filename [String] The filename to display for the document.
|
|
132
|
+
#
|
|
133
|
+
# @param url [String] The URL of the document to attach. Must be a valid HTTP or HTTPS URL.
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
# The preferred channel to be used in priority for message delivery. If the
|
|
137
|
+
# channel is unavailable, the system will fallback to other available channels.
|
|
138
|
+
module PreferredChannel
|
|
139
|
+
extend PreludeSDK::Internal::Type::Enum
|
|
140
|
+
|
|
141
|
+
SMS = :sms
|
|
142
|
+
WHATSAPP = :whatsapp
|
|
143
|
+
|
|
144
|
+
# @!method self.values
|
|
145
|
+
# @return [Array<Symbol>]
|
|
146
|
+
end
|
|
147
|
+
end
|
|
148
|
+
end
|
|
149
|
+
end
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module PreludeSDK
|
|
4
|
+
module Models
|
|
5
|
+
# @see PreludeSDK::Resources::Notify#send_
|
|
6
|
+
class NotifySendResponse < PreludeSDK::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute id
|
|
8
|
+
# The message identifier.
|
|
9
|
+
#
|
|
10
|
+
# @return [String]
|
|
11
|
+
required :id, String
|
|
12
|
+
|
|
13
|
+
# @!attribute created_at
|
|
14
|
+
# The message creation date in RFC3339 format.
|
|
15
|
+
#
|
|
16
|
+
# @return [Time]
|
|
17
|
+
required :created_at, Time
|
|
18
|
+
|
|
19
|
+
# @!attribute expires_at
|
|
20
|
+
# The message expiration date in RFC3339 format.
|
|
21
|
+
#
|
|
22
|
+
# @return [Time]
|
|
23
|
+
required :expires_at, Time
|
|
24
|
+
|
|
25
|
+
# @!attribute template_id
|
|
26
|
+
# The template identifier.
|
|
27
|
+
#
|
|
28
|
+
# @return [String]
|
|
29
|
+
required :template_id, String
|
|
30
|
+
|
|
31
|
+
# @!attribute to
|
|
32
|
+
# The recipient's phone number in E.164 format.
|
|
33
|
+
#
|
|
34
|
+
# @return [String]
|
|
35
|
+
required :to, String
|
|
36
|
+
|
|
37
|
+
# @!attribute variables
|
|
38
|
+
# The variables to be replaced in the template.
|
|
39
|
+
#
|
|
40
|
+
# @return [Hash{Symbol=>String}]
|
|
41
|
+
required :variables, PreludeSDK::Internal::Type::HashOf[String]
|
|
42
|
+
|
|
43
|
+
# @!attribute callback_url
|
|
44
|
+
# The callback URL where webhooks will be sent.
|
|
45
|
+
#
|
|
46
|
+
# @return [String, nil]
|
|
47
|
+
optional :callback_url, String
|
|
48
|
+
|
|
49
|
+
# @!attribute correlation_id
|
|
50
|
+
# A user-defined identifier to correlate this message with your internal systems.
|
|
51
|
+
#
|
|
52
|
+
# @return [String, nil]
|
|
53
|
+
optional :correlation_id, String
|
|
54
|
+
|
|
55
|
+
# @!attribute encoding
|
|
56
|
+
# The SMS encoding type based on message content. GSM-7 supports standard
|
|
57
|
+
# characters (up to 160 chars per segment), while UCS-2 supports Unicode including
|
|
58
|
+
# emoji (up to 70 chars per segment). Only present for SMS messages.
|
|
59
|
+
#
|
|
60
|
+
# @return [Symbol, PreludeSDK::Models::NotifySendResponse::Encoding, nil]
|
|
61
|
+
optional :encoding, enum: -> { PreludeSDK::Models::NotifySendResponse::Encoding }
|
|
62
|
+
|
|
63
|
+
# @!attribute estimated_segment_count
|
|
64
|
+
# The estimated number of SMS segments for this message. This value is not
|
|
65
|
+
# contractual; the actual segment count will be determined after the SMS is sent
|
|
66
|
+
# by the provider. Only present for SMS messages.
|
|
67
|
+
#
|
|
68
|
+
# @return [Integer, nil]
|
|
69
|
+
optional :estimated_segment_count, Integer
|
|
70
|
+
|
|
71
|
+
# @!attribute from
|
|
72
|
+
# The Sender ID used for this message.
|
|
73
|
+
#
|
|
74
|
+
# @return [String, nil]
|
|
75
|
+
optional :from, String
|
|
76
|
+
|
|
77
|
+
# @!attribute schedule_at
|
|
78
|
+
# When the message will actually be sent in RFC3339 format with timezone offset.
|
|
79
|
+
# For marketing messages, this may differ from the requested schedule_at due to
|
|
80
|
+
# automatic compliance adjustments.
|
|
81
|
+
#
|
|
82
|
+
# @return [Time, nil]
|
|
83
|
+
optional :schedule_at, Time
|
|
84
|
+
|
|
85
|
+
# @!method initialize(id:, created_at:, expires_at:, template_id:, to:, variables:, callback_url: nil, correlation_id: nil, encoding: nil, estimated_segment_count: nil, from: nil, schedule_at: nil)
|
|
86
|
+
# Some parameter documentations has been truncated, see
|
|
87
|
+
# {PreludeSDK::Models::NotifySendResponse} for more details.
|
|
88
|
+
#
|
|
89
|
+
# @param id [String] The message identifier.
|
|
90
|
+
#
|
|
91
|
+
# @param created_at [Time] The message creation date in RFC3339 format.
|
|
92
|
+
#
|
|
93
|
+
# @param expires_at [Time] The message expiration date in RFC3339 format.
|
|
94
|
+
#
|
|
95
|
+
# @param template_id [String] The template identifier.
|
|
96
|
+
#
|
|
97
|
+
# @param to [String] The recipient's phone number in E.164 format.
|
|
98
|
+
#
|
|
99
|
+
# @param variables [Hash{Symbol=>String}] The variables to be replaced in the template.
|
|
100
|
+
#
|
|
101
|
+
# @param callback_url [String] The callback URL where webhooks will be sent.
|
|
102
|
+
#
|
|
103
|
+
# @param correlation_id [String] A user-defined identifier to correlate this message with your internal systems.
|
|
104
|
+
#
|
|
105
|
+
# @param encoding [Symbol, PreludeSDK::Models::NotifySendResponse::Encoding] The SMS encoding type based on message content. GSM-7 supports standard characte
|
|
106
|
+
#
|
|
107
|
+
# @param estimated_segment_count [Integer] The estimated number of SMS segments for this message. This value is not contrac
|
|
108
|
+
#
|
|
109
|
+
# @param from [String] The Sender ID used for this message.
|
|
110
|
+
#
|
|
111
|
+
# @param schedule_at [Time] When the message will actually be sent in RFC3339 format with timezone offset. F
|
|
112
|
+
|
|
113
|
+
# The SMS encoding type based on message content. GSM-7 supports standard
|
|
114
|
+
# characters (up to 160 chars per segment), while UCS-2 supports Unicode including
|
|
115
|
+
# emoji (up to 70 chars per segment). Only present for SMS messages.
|
|
116
|
+
#
|
|
117
|
+
# @see PreludeSDK::Models::NotifySendResponse#encoding
|
|
118
|
+
module Encoding
|
|
119
|
+
extend PreludeSDK::Internal::Type::Enum
|
|
120
|
+
|
|
121
|
+
GSM_7 = :"GSM-7"
|
|
122
|
+
UCS_2 = :"UCS-2"
|
|
123
|
+
|
|
124
|
+
# @!method self.values
|
|
125
|
+
# @return [Array<Symbol>]
|
|
126
|
+
end
|
|
127
|
+
end
|
|
128
|
+
end
|
|
129
|
+
end
|
|
@@ -33,6 +33,13 @@ module PreludeSDK
|
|
|
33
33
|
# @return [String, nil]
|
|
34
34
|
optional :correlation_id, String
|
|
35
35
|
|
|
36
|
+
# @!attribute document
|
|
37
|
+
# A document to attach to the message. Only supported on WhatsApp templates that
|
|
38
|
+
# have a document header.
|
|
39
|
+
#
|
|
40
|
+
# @return [PreludeSDK::Models::TransactionalSendParams::Document, nil]
|
|
41
|
+
optional :document, -> { PreludeSDK::TransactionalSendParams::Document }
|
|
42
|
+
|
|
36
43
|
# @!attribute expires_at
|
|
37
44
|
# The message expiration date.
|
|
38
45
|
#
|
|
@@ -74,7 +81,7 @@ module PreludeSDK
|
|
|
74
81
|
# @return [Hash{Symbol=>String}, nil]
|
|
75
82
|
optional :variables, PreludeSDK::Internal::Type::HashOf[String]
|
|
76
83
|
|
|
77
|
-
# @!method initialize(template_id:, to:, callback_url: nil, correlation_id: nil, expires_at: nil, from: nil, locale: nil, preferred_channel: nil, variables: nil, request_options: {})
|
|
84
|
+
# @!method initialize(template_id:, to:, callback_url: nil, correlation_id: nil, document: nil, expires_at: nil, from: nil, locale: nil, preferred_channel: nil, variables: nil, request_options: {})
|
|
78
85
|
# Some parameter documentations has been truncated, see
|
|
79
86
|
# {PreludeSDK::Models::TransactionalSendParams} for more details.
|
|
80
87
|
#
|
|
@@ -86,6 +93,8 @@ module PreludeSDK
|
|
|
86
93
|
#
|
|
87
94
|
# @param correlation_id [String] A user-defined identifier to correlate this transactional message with. It is re
|
|
88
95
|
#
|
|
96
|
+
# @param document [PreludeSDK::Models::TransactionalSendParams::Document] A document to attach to the message. Only supported on WhatsApp templates that h
|
|
97
|
+
#
|
|
89
98
|
# @param expires_at [String] The message expiration date.
|
|
90
99
|
#
|
|
91
100
|
# @param from [String] The Sender ID.
|
|
@@ -98,6 +107,28 @@ module PreludeSDK
|
|
|
98
107
|
#
|
|
99
108
|
# @param request_options [PreludeSDK::RequestOptions, Hash{Symbol=>Object}]
|
|
100
109
|
|
|
110
|
+
class Document < PreludeSDK::Internal::Type::BaseModel
|
|
111
|
+
# @!attribute filename
|
|
112
|
+
# The filename to display for the document.
|
|
113
|
+
#
|
|
114
|
+
# @return [String]
|
|
115
|
+
required :filename, String
|
|
116
|
+
|
|
117
|
+
# @!attribute url
|
|
118
|
+
# The URL of the document to attach. Must be a valid HTTP or HTTPS URL.
|
|
119
|
+
#
|
|
120
|
+
# @return [String]
|
|
121
|
+
required :url, String
|
|
122
|
+
|
|
123
|
+
# @!method initialize(filename:, url:)
|
|
124
|
+
# A document to attach to the message. Only supported on WhatsApp templates that
|
|
125
|
+
# have a document header.
|
|
126
|
+
#
|
|
127
|
+
# @param filename [String] The filename to display for the document.
|
|
128
|
+
#
|
|
129
|
+
# @param url [String] The URL of the document to attach. Must be a valid HTTP or HTTPS URL.
|
|
130
|
+
end
|
|
131
|
+
|
|
101
132
|
# The preferred delivery channel for the message. When specified, the system will
|
|
102
133
|
# prioritize sending via the requested channel if the template is configured for
|
|
103
134
|
# it.
|