didit-sdk 2.27.0 → 2.29.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0c1a314fb5fcba211b2f36af456a5f50e49e7de4ff2284d47986393fccaab730
4
- data.tar.gz: 385067f5e9f0024c2593a6c41375ec682aea36dde381f7938402c94c04bccb55
3
+ metadata.gz: b48affb51dd53c8b0b35edc6019e58ebd1243d7c0fc630dee7a9b66d7250df78
4
+ data.tar.gz: 130bd65e7b485f7187804543e6c5ac418b2cf3d00f9191606bdf628851e046fd
5
5
  SHA512:
6
- metadata.gz: 9d295ab730711a598bdd1bebb7a9c5c41704235dd8300219410f7fa512bfbe87bb1c131c3fdde0053c3fb8ae857ffc136650cc4b54709071a726d834981d52bb
7
- data.tar.gz: 8851af3a6ee47fc6d2fe854e1bb214a7488b69f862ef72c98194fdf4168697fc91c13711dee30382f14846a99d22dd46789cbc2f1f53c6c31aad8628064b95a6
6
+ metadata.gz: 519955db14df472e57099f2b04154c796a5c2633b1d50bcf8213130ee30ef4c0cfdb41257e3de825924029979c998a4de667358c1abeb79960a87150d7c15594
7
+ data.tar.gz: eddde8a041a4f4a672f6100e72c9fe34e32e6f842dc081fe98e31dd96416f988be8c04fcb463d6c1a1d51452514999286e2657b328c0cbe7f8657be331a00700
data/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.29.0](https://github.com/didit-protocol/sdk-ruby/compare/v2.28.0...v2.29.0) (2026-11-22)
4
+
5
+
6
+ ### Features
7
+
8
+ * **spec:** sync API spec 2026-11-21 ([de93ce0](https://github.com/didit-protocol/sdk-ruby/commit/de93ce0fc01b16c62fce4398dbff2db4f590c1bd))
9
+
10
+ ## [2.28.0](https://github.com/didit-protocol/sdk-ruby/compare/v2.27.0...v2.28.0) (2026-11-21)
11
+
12
+
13
+ ### Features
14
+
15
+ * **spec:** sync API spec 2026-11-21 ([e6208b6](https://github.com/didit-protocol/sdk-ruby/commit/e6208b6bfbceaed761e316df59afcbcc14248ab3))
16
+
3
17
  ## [2.27.0](https://github.com/didit-protocol/sdk-ruby/compare/v2.26.0...v2.27.0) (2026-11-21)
4
18
 
5
19
 
data/README.md CHANGED
@@ -257,7 +257,7 @@ account.account.organizations.list
257
257
  Choices this SDK makes where [docs/DESIGN.md](docs/DESIGN.md) leaves the language idiom open:
258
258
 
259
259
  - **Arguments.** Ids in the path are positional; request fields are keywords. An omitted keyword is left out of the request and `nil` sends JSON `null`. `Didit::OMIT` leaves a keyword out explicitly, which helps when building calls conditionally. Keywords that are Ruby keywords (`retry:`, `case:`) work as usual.
260
- - **Names.** Methods and readers are snake_case. A field that would hide an `Object` method gets a trailing underscore (`method` is `method_`); camelCase fields read as snake_case (`firstName` is `first_name`). `model[:wireName]` always gives the raw value.
260
+ - **Names.** Methods and readers are snake_case. A field that would hide an `Object` method gets a trailing underscore (`method` is `method_`); camelCase fields read as snake_case (`firstName` is `first_name`). An operation whose method name is a method every Ruby object has appends the singular resource (`messages.send` is `messages.send_message`); a name that would still hide a built-in method raises at generation time. `model[:wireName]` always gives the raw value.
261
261
  - **Types.** Responses are `Didit::Model` subclasses under `Didit::Types`, loaded on first use. Readers convert on access and never raise: a value with an unexpected shape comes back as it is. Date-times are `Time`, dates are `Date`, numbers are `Float`, and string decimals stay strings. Models support `to_h`, `to_json`, `==` and pattern matching (`in {status: "Approved"}`).
262
262
  - **Open enums.** Known values are frozen string constants (`Didit::Types::SessionDecisionStatus::APPROVED`, plus `VALUES`); values the SDK does not know are returned unchanged.
263
263
  - **Signatures.** RBS signatures ship in `sig/` with the gem, so Steep users get typed calls and results. Readers of required fields are typed non-nil; if the API ever omits one, the reader returns nil.
@@ -0,0 +1,299 @@
1
+ # Code generated by codegen from openapi/*.json. DO NOT EDIT.
2
+ # frozen_string_literal: true
3
+
4
+ module Didit
5
+ module Resources
6
+ # The +messages+ resource.
7
+ class Messages < Didit::Resource
8
+ # Cancel a scheduled message
9
+ #
10
+ # Cancel a message scheduled with `schedule_at`, before its time: only a `scheduled` message can be cancelled,
11
+ # and nothing is charged for it. A `queued` or `sending` message is already going out and settles within seconds
12
+ # (`sent`, `delivered` or `failed`): it cannot be cancelled.
13
+ #
14
+ # A scoped API key needs write access to messages.
15
+ #
16
+ # +POST /v3/messages/{message_id}/cancel/+
17
+ #
18
+ # @param message_id [String] The message's id, or the id of any of its attempts.
19
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
20
+ # @return [Didit::Types::Message]
21
+ def cancel(message_id, request_options: nil)
22
+ @client.request(
23
+ :post,
24
+ "/v3/messages/{message_id}/cancel/",
25
+ path_params: { "message_id" => message_id },
26
+ response: Types::Message,
27
+ request_options: request_options
28
+ )
29
+ end
30
+
31
+ # Delete a message
32
+ #
33
+ # Delete the message, every attempt, its text and its recipient. Deletion is irreversible. A message that has
34
+ # not gone out yet cannot be deleted (`409`): cancel a `scheduled` one first; a `queued` or `sending` one
35
+ # settles within seconds. An SMS already `sent` and waiting for its delivery report can be deleted, except
36
+ # during the moment it is handed to another route (`409`, retry within seconds); what it owes is charged first,
37
+ # and its delivery report then finds nothing. Usage already billed stays on your invoice; it holds no text or
38
+ # address.
39
+ #
40
+ # A scoped API key needs write access to messages.
41
+ #
42
+ # +DELETE /v3/messages/{message_id}/+
43
+ #
44
+ # @param message_id [String] The message's id, or the id of any of its attempts.
45
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
46
+ # @return [nil]
47
+ def delete(message_id, request_options: nil)
48
+ @client.request(
49
+ :delete,
50
+ "/v3/messages/{message_id}/",
51
+ path_params: { "message_id" => message_id },
52
+ request_options: request_options
53
+ )
54
+ end
55
+
56
+ # List messages
57
+ #
58
+ # Your messages, newest first, with every attempt.
59
+ #
60
+ # A scoped API key needs read access to messages.
61
+ #
62
+ # +GET /v3/messages/+
63
+ #
64
+ # @param limit [Integer]
65
+ # @param offset [Integer]
66
+ # @param status [String]
67
+ # @param channel [String] The channel of the latest attempt.
68
+ # @param to [String] Recipient, exact. A message whose recipient was erased is not found by it.
69
+ # @param correlation_id [String]
70
+ # @param created_after [Time, String]
71
+ # @param created_before [Time, String]
72
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
73
+ # @return [Didit::Page<Didit::Types::Message>]
74
+ def list(
75
+ limit: OMIT,
76
+ offset: OMIT,
77
+ status: OMIT,
78
+ channel: OMIT,
79
+ to: OMIT,
80
+ correlation_id: OMIT,
81
+ created_after: OMIT,
82
+ created_before: OMIT,
83
+ request_options: nil
84
+ )
85
+ @client.request(
86
+ :get,
87
+ "/v3/messages/",
88
+ query: {
89
+ "limit" => limit,
90
+ "offset" => offset,
91
+ "status" => status,
92
+ "channel" => channel,
93
+ "to" => to,
94
+ "correlation_id" => correlation_id,
95
+ "created_after" => created_after,
96
+ "created_before" => created_before
97
+ },
98
+ page: Types::Message,
99
+ request_options: request_options
100
+ )
101
+ end
102
+
103
+ # List message prices for a country
104
+ #
105
+ # What one message costs your organization on each channel to a country: SMS per segment (carrier price plus
106
+ # Didit's fee), WhatsApp per message (WhatsApp's utility rate plus Didit's fee from Didit's number; from your
107
+ # own connected WhatsApp Business account, `carrier` is `0.0000`: WhatsApp bills its rate to your account
108
+ # directly and Didit charges only its fee), email flat. Your plan's discount is applied to the fee. The SMS
109
+ # carrier part is an estimate; the billed one is the price the carrier reports.
110
+ #
111
+ # A scoped API key needs read access to messages.
112
+ #
113
+ # +GET /v3/messages/prices/+
114
+ #
115
+ # @param country [String] ISO 3166-1 alpha-2 country of the recipient.
116
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
117
+ # @return [Didit::Types::MessagePrices]
118
+ def list_prices(country:, request_options: nil)
119
+ @client.request(
120
+ :get,
121
+ "/v3/messages/prices/",
122
+ query: {
123
+ "country" => country
124
+ },
125
+ response: Types::MessagePrices,
126
+ request_options: request_options
127
+ )
128
+ end
129
+
130
+ # Retrieve a message
131
+ #
132
+ # One message with every attempt, by its id or the id of any of its attempts.
133
+ #
134
+ # A scoped API key needs read access to messages.
135
+ #
136
+ # +GET /v3/messages/{message_id}/+
137
+ #
138
+ # @param message_id [String] The message's id, or the id of any of its attempts.
139
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
140
+ # @return [Didit::Types::Message]
141
+ def retrieve(message_id, request_options: nil)
142
+ @client.request(
143
+ :get,
144
+ "/v3/messages/{message_id}/",
145
+ path_params: { "message_id" => message_id },
146
+ response: Types::Message,
147
+ request_options: request_options
148
+ )
149
+ end
150
+
151
+ # Retrieve the Messages API settings
152
+ #
153
+ # Your application's Messages API settings: how many days a message keeps its text and recipient.
154
+ #
155
+ # A scoped API key needs read access to application settings.
156
+ #
157
+ # +GET /v3/messages/settings/+
158
+ #
159
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
160
+ # @return [Didit::Types::MessagesSettings]
161
+ def retrieve_settings(request_options: nil)
162
+ @client.request(
163
+ :get,
164
+ "/v3/messages/settings/",
165
+ response: Types::MessagesSettings,
166
+ request_options: request_options
167
+ )
168
+ end
169
+
170
+ # Send a message
171
+ #
172
+ # Send a transactional SMS, WhatsApp or email message to a phone number or an email address, now or scheduled,
173
+ # from one of your templates or as free text. Free text goes out on SMS and email; WhatsApp delivers only an
174
+ # approved template, except inside a 24-hour reply window (the person wrote to you first), so a message that
175
+ # lists WhatsApp uses `template_id` for it to go out there.
176
+ #
177
+ # **Fallback.** List several `channels`: each is tried in order, and the next one is used when a channel cannot
178
+ # take the message (switched off, the recipient opted out, no approved WhatsApp template, balance) or when the
179
+ # message fails on it later (rejected, undeliverable, expired). Every attempt is in `attempts`; a skipped
180
+ # channel is a `failed` attempt with its `error` and no price.
181
+ #
182
+ # **Statuses** reach your webhook destinations subscribed to `message.status.updated`.
183
+ #
184
+ # **Billing.** SMS: the carrier's price plus Didit's fee, per segment. WhatsApp from Didit's number: WhatsApp's
185
+ # rate for the market plus Didit's fee; from your own connected WhatsApp Business account, WhatsApp bills its
186
+ # rate to your account directly and Didit charges only its fee. Email: a flat price. Your plan's discount
187
+ # applies to the fee, never to the carrier's or WhatsApp's part. A failed SMS or WhatsApp attempt, a skipped one
188
+ # and a cancelled one are free; an email is charged once the receiving mail system accepts it, so an email that
189
+ # bounces later is charged. SMS and WhatsApp open after your first top-up (`403 plan_locked`); a sandbox
190
+ # application simulates every message and charges nothing. See the [prices per
191
+ # country](/getting-started/pricing).
192
+ #
193
+ # **Retention.** Didit erases a message's text and recipient `retention_days` after its last event (created,
194
+ # sent, delivered, read, failed or cancelled; 30 days unless you set another value with `PATCH
195
+ # /v3/messages/settings/`); the message itself, its status, channel, country, segments, price and timestamps
196
+ # stay, so lists and invoices still add up. A message still waiting to go out (`scheduled`, `queued`, `sending`)
197
+ # keeps them until it goes out; one cancelled before it went out counts from its cancellation. A request no
198
+ # channel can take is refused and nothing of it is stored. To erase a message sooner, delete it with `DELETE
199
+ # /v3/messages/{message_id}/` once it went out or ended: cancel a `scheduled` message first; a `queued` or
200
+ # `sending` one settles within seconds.
201
+ #
202
+ # A scoped API key needs write access to messages.
203
+ #
204
+ # +POST /v3/messages/+
205
+ #
206
+ # @param to [String] Recipient: an E.164 phone number (`+447700900123`), or an email address for email.
207
+ # @param to_email [String] The email address for the `email` channel when `to` is a phone number.
208
+ # @param channels [Array<String>] Channels to try, in order. The next one is used when a channel cannot take the
209
+ # message (switched off, opted out, no approved WhatsApp template...) or the message fails on it. Default
210
+ # `["sms"]` for a phone number, `["email"]` for an email address.
211
+ # @param body [String] Free text, sent as written, for SMS and email. On WhatsApp free text goes out only inside
212
+ # a 24-hour reply window (the person wrote to you first); outside it WhatsApp delivers only an approved
213
+ # template, so use `template_id`, or a free-text WhatsApp attempt falls back to the next channel. Limits: SMS
214
+ # 1,000, WhatsApp 4,096, email 10,000 characters.
215
+ # @param template_id [String] One of your message templates; each channel uses the template's text for that
216
+ # channel.
217
+ # @param variables [Hash{String => String}] Values for the template's `{{variables}}`. Every variable of the
218
+ # text used needs one.
219
+ # @param locale [String] BCP-47 language of the template text. Default: the recipient country's language, then
220
+ # English.
221
+ # @param subject [String] Subject of a free-text email.
222
+ # @param schedule_at [Time, String] When to send it, up to 90 days ahead. Default: now.
223
+ # @param expires_at [Time, String] Validity: never sent after it. After the send time, at most 72 hours after
224
+ # it.
225
+ # @param correlation_id [String] Your reference, returned in every response and webhook, filterable in the list.
226
+ # @param options [Hash]
227
+ # @param idempotency_key [String] sent as the Idempotency-Key header
228
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
229
+ # @return [Didit::Types::Message]
230
+ def send_message(
231
+ to:,
232
+ to_email: OMIT,
233
+ channels: OMIT,
234
+ body: OMIT,
235
+ template_id: OMIT,
236
+ variables: OMIT,
237
+ locale: OMIT,
238
+ subject: OMIT,
239
+ schedule_at: OMIT,
240
+ expires_at: OMIT,
241
+ correlation_id: OMIT,
242
+ options: OMIT,
243
+ idempotency_key: OMIT,
244
+ request_options: nil
245
+ )
246
+ @client.request(
247
+ :post,
248
+ "/v3/messages/",
249
+ body: {
250
+ "to" => to,
251
+ "to_email" => to_email,
252
+ "channels" => channels,
253
+ "body" => body,
254
+ "template_id" => template_id,
255
+ "variables" => variables,
256
+ "locale" => locale,
257
+ "subject" => subject,
258
+ "schedule_at" => schedule_at,
259
+ "expires_at" => expires_at,
260
+ "correlation_id" => correlation_id,
261
+ "options" => options
262
+ },
263
+ headers: { "Idempotency-Key" => idempotency_key },
264
+ response: Types::Message,
265
+ request_options: request_options
266
+ )
267
+ end
268
+
269
+ # Update the Messages API settings
270
+ #
271
+ # Set how many days a message keeps its text and recipient, from 2 to 365 (default 30). Shortening the retention
272
+ # erases, within the hour, the text and recipient of every message already past the new one (irreversible); the
273
+ # messages themselves, with their status, channel, country, segments, price and timestamps, stay. Lengthening it
274
+ # applies to the messages not erased yet.
275
+ #
276
+ # A scoped API key needs write access to application settings.
277
+ #
278
+ # +PATCH /v3/messages/settings/+
279
+ #
280
+ # @param retention_days [Integer] Days after a message's last event (created, sent, delivered, read, failed or
281
+ # cancelled) before Didit erases its text and recipient (`to`, `body`, `subject` and template variables read
282
+ # `null` from then on). Status, channel, country, segments, price and timestamps stay. A message still waiting
283
+ # to go out (`scheduled`, `queued`, `sending`) is erased only after it went out; one cancelled before it wen...
284
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
285
+ # @return [Didit::Types::MessagesSettings]
286
+ def update_settings(retention_days:, request_options: nil)
287
+ @client.request(
288
+ :patch,
289
+ "/v3/messages/settings/",
290
+ body: {
291
+ "retention_days" => retention_days
292
+ },
293
+ response: Types::MessagesSettings,
294
+ request_options: request_options
295
+ )
296
+ end
297
+ end
298
+ end
299
+ end
@@ -36,6 +36,41 @@ module Didit
36
36
  request_options: request_options
37
37
  )
38
38
  end
39
+
40
+ # Get the price book (public, unauthenticated)
41
+ #
42
+ # Returns Didit's public list prices: every plan with its monthly and yearly price and its discount, the white
43
+ # label price, Didit's fee on each Messages channel, and every flat usage price. Use it to quote Didit's prices
44
+ # in your own product or to check a price before you build a workflow.
45
+ #
46
+ # Public: send no auth header. The response contains no organization data and is the same for every caller. It
47
+ # carries an `ETag`, so send `If-None-Match` to get a `304 Not Modified` when nothing changed.
48
+ #
49
+ # **Messages fees.** An SMS costs the carrier's price per segment plus Didit's fee per segment
50
+ # (`message_fee_usd_by_channel.sms`, also `messages_fee_usd`). A WhatsApp message sent from Didit's number costs
51
+ # WhatsApp's rate plus Didit's own WhatsApp fee (`message_fee_usd_by_channel.whatsapp`); sent from your own
52
+ # WhatsApp Business account, WhatsApp bills you directly and Didit charges only its fee. The carrier's and
53
+ # WhatsApp's parts are passed on at cost.
54
+ #
55
+ # These are list prices before your plan discount, which applies to Didit's fee only on carrier-priced items and
56
+ # to the whole price everywhere else. A negotiated or contract price replaces the list price for your
57
+ # organization. Per-item prices are on their own feeds, such as [phone verification
58
+ # prices](/getting-started/phone-verification-pricing) and [bank verification
59
+ # prices](/getting-started/bank-verification-pricing).
60
+ #
61
+ # +GET /v3/organization/price-book/+
62
+ #
63
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
64
+ # @return [Didit::Types::PublicPriceBook]
65
+ def price_book(request_options: nil)
66
+ @client.request(
67
+ :get,
68
+ "/v3/organization/price-book/",
69
+ auth: :none,
70
+ response: Types::PublicPriceBook,
71
+ request_options: request_options
72
+ )
73
+ end
39
74
  end
40
75
  end
41
76
  end
@@ -31,6 +31,7 @@ module Didit
31
31
  autoload :Ip, "didit/resources/ip"
32
32
  autoload :Kyb, "didit/resources/kyb"
33
33
  autoload :Lists, "didit/resources/lists"
34
+ autoload :Messages, "didit/resources/messages"
34
35
  autoload :MonitoringEvents, "didit/resources/monitoring_events"
35
36
  autoload :Networks, "didit/resources/networks"
36
37
  autoload :PassiveLiveness, "didit/resources/passive_liveness"
@@ -187,6 +188,11 @@ module Didit
187
188
  @lists ||= Resources::Lists.new(self)
188
189
  end
189
190
 
191
+ # @return [Didit::Resources::Messages]
192
+ def messages
193
+ @messages ||= Resources::Messages.new(self)
194
+ end
195
+
190
196
  # @return [Didit::Resources::MonitoringEvents]
191
197
  def monitoring_events
192
198
  @monitoring_events ||= Resources::MonitoringEvents.new(self)
@@ -2372,6 +2372,127 @@ module Didit
2372
2372
  VALUES = [OFFICIAL].freeze
2373
2373
  end
2374
2374
 
2375
+ # Known values of an open enum: the API may send others.
2376
+ module MessageAttemptChannel
2377
+ SMS = "sms"
2378
+ WHATSAPP = "whatsapp"
2379
+ EMAIL = "email"
2380
+
2381
+ VALUES = [SMS, WHATSAPP, EMAIL].freeze
2382
+ end
2383
+
2384
+ # SMS only: the alphabet the text is sent in. `null` once the text is erased.
2385
+ module MessageAttemptEncoding
2386
+ GSM_7 = "GSM-7"
2387
+ UCS_2 = "UCS-2"
2388
+
2389
+ VALUES = [GSM_7, UCS_2].freeze
2390
+ end
2391
+
2392
+ # Known values of an open enum: the API may send others.
2393
+ module MessageAttemptStatus
2394
+ SCHEDULED = "scheduled"
2395
+ QUEUED = "queued"
2396
+ SENDING = "sending"
2397
+ SENT = "sent"
2398
+ DELIVERED = "delivered"
2399
+ READ = "read"
2400
+ FAILED = "failed"
2401
+ CANCELLED = "cancelled"
2402
+
2403
+ VALUES = [SCHEDULED, QUEUED, SENDING, SENT, DELIVERED, READ, FAILED, CANCELLED].freeze
2404
+ end
2405
+
2406
+ # The channel of the latest attempt.
2407
+ module MessageChannel
2408
+ SMS = "sms"
2409
+ WHATSAPP = "whatsapp"
2410
+ EMAIL = "email"
2411
+
2412
+ VALUES = [SMS, WHATSAPP, EMAIL].freeze
2413
+ end
2414
+
2415
+ # Known values of an open enum: the API may send others.
2416
+ module MessageChannelPriceChannel
2417
+ SMS = "sms"
2418
+ WHATSAPP = "whatsapp"
2419
+ EMAIL = "email"
2420
+
2421
+ VALUES = [SMS, WHATSAPP, EMAIL].freeze
2422
+ end
2423
+
2424
+ # Known values of an open enum: the API may send others.
2425
+ module MessageChannelPriceUnit
2426
+ SEGMENT = "segment"
2427
+ MESSAGE = "message"
2428
+
2429
+ VALUES = [SEGMENT, MESSAGE].freeze
2430
+ end
2431
+
2432
+ # Known values of an open enum: the API may send others.
2433
+ module MessageChannels
2434
+ SMS = "sms"
2435
+ WHATSAPP = "whatsapp"
2436
+ EMAIL = "email"
2437
+
2438
+ VALUES = [SMS, WHATSAPP, EMAIL].freeze
2439
+ end
2440
+
2441
+ # Known values of an open enum: the API may send others.
2442
+ module MessageEncoding
2443
+ GSM_7 = "GSM-7"
2444
+ UCS_2 = "UCS-2"
2445
+
2446
+ VALUES = [GSM_7, UCS_2].freeze
2447
+ end
2448
+
2449
+ # `invalid_recipient`: the address is not valid for the channel, or the number has no account on it.
2450
+ # `unreachable`: the carrier could not reach the device. `rejected`: the carrier or platform refused the message.
2451
+ # `opted_out`: the recipient opted out of the channel. `expired`: `expires_at` passed before it could go out.
2452
+ # `template_required`: WhatsApp only delivers an approved WhatsApp template. `channel_unavailable`: the channel is
2453
+ # switched off, not configured, not in your contract or locked until your first top-up. `insufficient_credits`:
2454
+ # the balance does not cover it. `rate_limited`: throttled and retries ran out. `delivery_unconfirmed`: the
2455
+ # outcome is unknown and it is not sent again automatically. `cancelled`: cancelled before its time.
2456
+ # `template_channel_missing`, `template_variable_missing`, `empty_body`, `body_too_long`: the content cannot go
2457
+ # out on this channel. `unknown`: any other failure.
2458
+ module MessageErrorCode
2459
+ INVALID_RECIPIENT = "invalid_recipient"
2460
+ UNREACHABLE = "unreachable"
2461
+ REJECTED = "rejected"
2462
+ OPTED_OUT = "opted_out"
2463
+ EXPIRED = "expired"
2464
+ TEMPLATE_REQUIRED = "template_required"
2465
+ CHANNEL_UNAVAILABLE = "channel_unavailable"
2466
+ INSUFFICIENT_CREDITS = "insufficient_credits"
2467
+ RATE_LIMITED = "rate_limited"
2468
+ DELIVERY_UNCONFIRMED = "delivery_unconfirmed"
2469
+ CANCELLED = "cancelled"
2470
+ TEMPLATE_CHANNEL_MISSING = "template_channel_missing"
2471
+ TEMPLATE_VARIABLE_MISSING = "template_variable_missing"
2472
+ EMPTY_BODY = "empty_body"
2473
+ BODY_TOO_LONG = "body_too_long"
2474
+ UNKNOWN = "unknown"
2475
+
2476
+ VALUES = [INVALID_RECIPIENT, UNREACHABLE, REJECTED, OPTED_OUT, EXPIRED, TEMPLATE_REQUIRED, CHANNEL_UNAVAILABLE, INSUFFICIENT_CREDITS, RATE_LIMITED, DELIVERY_UNCONFIRMED, CANCELLED, TEMPLATE_CHANNEL_MISSING, TEMPLATE_VARIABLE_MISSING, EMPTY_BODY, BODY_TOO_LONG, UNKNOWN].freeze
2477
+ end
2478
+
2479
+ # `scheduled`: waiting for `schedule_at`. `queued`: accepted, waiting to go out. `sending`: being handed to the
2480
+ # carrier. `sent`: the carrier or platform accepted it. `delivered`: delivered to the device or inbox. `read`: a
2481
+ # WhatsApp read receipt or an email open. `failed`: not delivered, see `error`. `cancelled`: cancelled before its
2482
+ # time.
2483
+ module MessageStatus
2484
+ SCHEDULED = "scheduled"
2485
+ QUEUED = "queued"
2486
+ SENDING = "sending"
2487
+ SENT = "sent"
2488
+ DELIVERED = "delivered"
2489
+ READ = "read"
2490
+ FAILED = "failed"
2491
+ CANCELLED = "cancelled"
2492
+
2493
+ VALUES = [SCHEDULED, QUEUED, SENDING, SENT, DELIVERED, READ, FAILED, CANCELLED].freeze
2494
+ end
2495
+
2375
2496
  # Event category.
2376
2497
  module MonitoringEventCreateRequestEventCategory
2377
2498
  AUTH = "auth"
@@ -2820,6 +2941,23 @@ module Didit
2820
2941
  VALUES = [SUCCESS, RETRY, BLOCKED].freeze
2821
2942
  end
2822
2943
 
2944
+ # Known values of an open enum: the API may send others.
2945
+ module PublicPriceBookCurrency
2946
+ USD = "USD"
2947
+
2948
+ VALUES = [USD].freeze
2949
+ end
2950
+
2951
+ # The plan.
2952
+ module PublicPriceBookPlanKey
2953
+ FREE = "free"
2954
+ GROWTH = "growth"
2955
+ SCALE = "scale"
2956
+ ENTERPRISE = "enterprise"
2957
+
2958
+ VALUES = [FREE, GROWTH, SCALE, ENTERPRISE].freeze
2959
+ end
2960
+
2823
2961
  # Known values of an open enum: the API may send others.
2824
2962
  module QuestionnaireDetailStatus
2825
2963
  DRAFT = "draft"
@@ -6949,8 +7087,9 @@ module Didit
6949
7087
  INVESTIGATOR_SLA_BREACHED = "investigator.sla.breached"
6950
7088
  INVESTIGATOR_QA_FAILED = "investigator.qa.failed"
6951
7089
  INVESTIGATOR_EXTERNAL_REPORT_READY = "investigator.external.report.ready"
7090
+ MESSAGE_STATUS_UPDATED = "message.status.updated"
6952
7091
 
6953
- VALUES = [STATUS_UPDATED, DATA_UPDATED, USER_STATUS_UPDATED, USER_DATA_UPDATED, BUSINESS_STATUS_UPDATED, BUSINESS_DATA_UPDATED, ACTIVITY_CREATED, TRANSACTION_CREATED, TRANSACTION_STATUS_UPDATED, TRAVEL_RULE_STATUS_UPDATED, WORKFLOW_COMPLIANCE_CHANGED, TRANSACTION_RULE_SUGGESTIONS_CREATED, AUTH_SIGNUP, AUTH_LOGIN, AUTH_LOGIN_FAILED, AUTH_PASSWORD_RESET_REQUESTED, AUTH_PASSWORD_RESET_COMPLETED, AUTH_MFA_CHANGED, AUTH_NEW_DEVICE, AUTH_ACCOUNT_LOCKED, INVESTIGATOR_REPORT_READY, INVESTIGATOR_DECISION_AUTOMATED, INVESTIGATOR_DECISION_OVERRIDDEN, INVESTIGATOR_DECISION_CONTESTED, INVESTIGATOR_QUESTION_RAISED, INVESTIGATOR_AUTOMATION_PAUSED, INVESTIGATOR_RFI_ANSWERED, INVESTIGATOR_RFI_OVERDUE, INVESTIGATOR_DRIFT_DETECTED, INVESTIGATOR_SLA_BREACHED, INVESTIGATOR_QA_FAILED, INVESTIGATOR_EXTERNAL_REPORT_READY].freeze
7092
+ VALUES = [STATUS_UPDATED, DATA_UPDATED, USER_STATUS_UPDATED, USER_DATA_UPDATED, BUSINESS_STATUS_UPDATED, BUSINESS_DATA_UPDATED, ACTIVITY_CREATED, TRANSACTION_CREATED, TRANSACTION_STATUS_UPDATED, TRAVEL_RULE_STATUS_UPDATED, WORKFLOW_COMPLIANCE_CHANGED, TRANSACTION_RULE_SUGGESTIONS_CREATED, AUTH_SIGNUP, AUTH_LOGIN, AUTH_LOGIN_FAILED, AUTH_PASSWORD_RESET_REQUESTED, AUTH_PASSWORD_RESET_COMPLETED, AUTH_MFA_CHANGED, AUTH_NEW_DEVICE, AUTH_ACCOUNT_LOCKED, INVESTIGATOR_REPORT_READY, INVESTIGATOR_DECISION_AUTOMATED, INVESTIGATOR_DECISION_OVERRIDDEN, INVESTIGATOR_DECISION_CONTESTED, INVESTIGATOR_QUESTION_RAISED, INVESTIGATOR_AUTOMATION_PAUSED, INVESTIGATOR_RFI_ANSWERED, INVESTIGATOR_RFI_OVERDUE, INVESTIGATOR_DRIFT_DETECTED, INVESTIGATOR_SLA_BREACHED, INVESTIGATOR_QA_FAILED, INVESTIGATOR_EXTERNAL_REPORT_READY, MESSAGE_STATUS_UPDATED].freeze
6954
7093
  end
6955
7094
 
6956
7095
  # Draft versions are editable; published versions are immutable and used for new sessions.
@@ -9657,6 +9796,98 @@ module Didit
9657
9796
  field :section, "section", :string
9658
9797
  end
9659
9798
 
9799
+ # A transactional message: its latest attempt's state, then every attempt in order. `id` is the first attempt's
9800
+ # id; the message is also found by any attempt's id. Statuses never move back within one attempt; a failed attempt
9801
+ # followed by another channel makes the message `queued` again on that channel.
9802
+ class Message < Didit::Model
9803
+ field :id, "id", :string
9804
+ field :status, "status", :string
9805
+ field :to, "to", :string
9806
+ field :channel, "channel", :string
9807
+ field :channels, "channels", [:array, :string]
9808
+ field :body, "body", :string
9809
+ field :subject, "subject", :string
9810
+ field :template_id, "template_id", :string
9811
+ field :locale, "locale", :string
9812
+ field :correlation_id, "correlation_id", :string
9813
+ field :segments, "segments", :integer
9814
+ field :encoding, "encoding", :string
9815
+ field :price, "price", "MessagePrice"
9816
+ field :error, "error", "MessageError"
9817
+ field :schedule_at, "schedule_at", :datetime
9818
+ field :expires_at, "expires_at", :datetime
9819
+ field :created_at, "created_at", :datetime
9820
+ field :sent_at, "sent_at", :datetime
9821
+ field :delivered_at, "delivered_at", :datetime
9822
+ field :read_at, "read_at", :datetime
9823
+ field :failed_at, "failed_at", :datetime
9824
+ field :attempts, "attempts", [:array, "MessageAttempt"]
9825
+ field :is_sandbox, "is_sandbox", :boolean
9826
+ end
9827
+
9828
+ # One channel's attempt. A channel that could not take the message is kept as a `failed` attempt that never left,
9829
+ # with its `error` and no price.
9830
+ class MessageAttempt < Didit::Model
9831
+ field :id, "id", :string
9832
+ field :channel, "channel", :string
9833
+ field :to, "to", :string
9834
+ field :status, "status", :string
9835
+ field :error, "error", "MessageError"
9836
+ field :price, "price", "MessagePrice"
9837
+ field :segments, "segments", :integer
9838
+ field :encoding, "encoding", :string
9839
+ field :created_at, "created_at", :datetime
9840
+ field :sent_at, "sent_at", :datetime
9841
+ field :delivered_at, "delivered_at", :datetime
9842
+ field :read_at, "read_at", :datetime
9843
+ field :failed_at, "failed_at", :datetime
9844
+ end
9845
+
9846
+ class MessageChannelPrice < Didit::Model
9847
+ field :channel, "channel", :string
9848
+ field :unit, "unit", :string
9849
+ field :category, "category", :string
9850
+ field :carrier, "carrier", :string
9851
+ field :fee, "fee", :string
9852
+ field :price, "price", :string
9853
+ end
9854
+
9855
+ # Why an attempt failed or was skipped. `message` is a sentence for people; read `code` in code.
9856
+ class MessageError < Didit::Model
9857
+ field :code, "code", :string
9858
+ field :message, "message", :string
9859
+ end
9860
+
9861
+ class MessageList < Didit::Model
9862
+ field :count, "count", :integer
9863
+ field :next, "next", :string
9864
+ field :previous, "previous", :string
9865
+ field :results, "results", [:array, "Message"]
9866
+ end
9867
+
9868
+ # What the message costs, in `currency`. `carrier` is the carrier's or WhatsApp's part, passed through at cost;
9869
+ # `fee` is Didit's fee with your plan's discount. Both are `null` when one flat amount prices the message (email,
9870
+ # or a contract or negotiated rate). `final` is `false` while the amount is an estimate, before the carrier's
9871
+ # delivery report gives the real price.
9872
+ class MessagePrice < Didit::Model
9873
+ field :amount, "amount", :string
9874
+ field :currency, "currency", :string
9875
+ field :carrier, "carrier", :string
9876
+ field :fee, "fee", :string
9877
+ field :final, "final", :boolean
9878
+ end
9879
+
9880
+ class MessagePrices < Didit::Model
9881
+ field :country, "country", :string
9882
+ field :currency, "currency", :string
9883
+ field :channels, "channels", [:array, "MessageChannelPrice"]
9884
+ end
9885
+
9886
+ # Your application's settings for the Messages API.
9887
+ class MessagesSettings < Didit::Model
9888
+ field :retention_days, "retention_days", :integer
9889
+ end
9890
+
9660
9891
  # One stored monitoring event as returned by the list and subject-timeline endpoints. Restricted evidence
9661
9892
  # (payload, device context, rule evidence) is only returned by `GET /v3/events/{event_uuid}/`.
9662
9893
  class MonitoringEvent < Didit::Model
@@ -10435,6 +10666,38 @@ module Didit
10435
10666
  field :metadata, "metadata", :any
10436
10667
  end
10437
10668
 
10669
+ class PublicPriceBook < Didit::Model
10670
+ field :currency, "currency", :string
10671
+ field :plans, "plans", [:array, "PublicPriceBookPlan"]
10672
+ field :white_label_usd, "white_label_usd", :string
10673
+ field :messages_fee_usd, "messages_fee_usd", :string
10674
+ field :message_fee_usd_by_channel, "message_fee_usd_by_channel", "PublicPriceBookMessageFees"
10675
+ field :lines, "lines", [:array, "PublicPriceBookLine"]
10676
+ end
10677
+
10678
+ class PublicPriceBookLine < Didit::Model
10679
+ field :key, "key", :string
10680
+ field :product, "product", :string
10681
+ field :feature, "feature", :string
10682
+ field :unit, "unit", :string
10683
+ field :list_price_usd, "list_price_usd", :string
10684
+ end
10685
+
10686
+ # Didit's fee on each carrier-priced Messages channel, excluding the carrier's or WhatsApp's price, which is
10687
+ # passed on at cost. Null where the fee is not published.
10688
+ class PublicPriceBookMessageFees < Didit::Model
10689
+ field :sms, "sms", :string
10690
+ field :whatsapp, "whatsapp", :string
10691
+ end
10692
+
10693
+ class PublicPriceBookPlan < Didit::Model
10694
+ field :key, "key", :string
10695
+ field :price_usd_month, "price_usd_month", :string
10696
+ field :price_usd_year, "price_usd_year", :string
10697
+ field :discount_percent, "discount_percent", :integer
10698
+ field :transactions_included_per_month, "transactions_included_per_month", :integer
10699
+ end
10700
+
10438
10701
  # Full questionnaire detail returned from GET, POST (create) and PATCH (update) endpoints.
10439
10702
  class QuestionnaireDetail < Didit::Model
10440
10703
  field :questionnaire_id, "questionnaire_id", :string
@@ -0,0 +1,38 @@
1
+ # Code generated by codegen from openapi/*.json. DO NOT EDIT.
2
+ # frozen_string_literal: true
3
+
4
+ module Didit
5
+ module Types
6
+ # Known values of an open enum: the API may send others.
7
+ module MessagesListParamsChannel
8
+ SMS = "sms"
9
+ WHATSAPP = "whatsapp"
10
+ EMAIL = "email"
11
+
12
+ VALUES = [SMS, WHATSAPP, EMAIL].freeze
13
+ end
14
+
15
+ # Known values of an open enum: the API may send others.
16
+ module MessagesListParamsStatus
17
+ SCHEDULED = "scheduled"
18
+ QUEUED = "queued"
19
+ SENDING = "sending"
20
+ SENT = "sent"
21
+ DELIVERED = "delivered"
22
+ READ = "read"
23
+ FAILED = "failed"
24
+ CANCELLED = "cancelled"
25
+
26
+ VALUES = [SCHEDULED, QUEUED, SENDING, SENT, DELIVERED, READ, FAILED, CANCELLED].freeze
27
+ end
28
+
29
+ # Known values of an open enum: the API may send others.
30
+ module MessagesSendParamsChannels
31
+ SMS = "sms"
32
+ WHATSAPP = "whatsapp"
33
+ EMAIL = "email"
34
+
35
+ VALUES = [SMS, WHATSAPP, EMAIL].freeze
36
+ end
37
+ end
38
+ end
data/lib/didit/types.rb CHANGED
@@ -810,6 +810,27 @@ module Didit
810
810
  autoload :ListsListResponse, "didit/types/lists"
811
811
  autoload :ListsUpdateResponse, "didit/types/lists"
812
812
  autoload :LoginResponse, "didit/types/account_components"
813
+ autoload :Message, "didit/types/components"
814
+ autoload :MessageAttempt, "didit/types/components"
815
+ autoload :MessageAttemptChannel, "didit/types/components"
816
+ autoload :MessageAttemptEncoding, "didit/types/components"
817
+ autoload :MessageAttemptStatus, "didit/types/components"
818
+ autoload :MessageChannel, "didit/types/components"
819
+ autoload :MessageChannelPrice, "didit/types/components"
820
+ autoload :MessageChannelPriceChannel, "didit/types/components"
821
+ autoload :MessageChannelPriceUnit, "didit/types/components"
822
+ autoload :MessageChannels, "didit/types/components"
823
+ autoload :MessageEncoding, "didit/types/components"
824
+ autoload :MessageError, "didit/types/components"
825
+ autoload :MessageErrorCode, "didit/types/components"
826
+ autoload :MessageList, "didit/types/components"
827
+ autoload :MessagePrice, "didit/types/components"
828
+ autoload :MessagePrices, "didit/types/components"
829
+ autoload :MessageStatus, "didit/types/components"
830
+ autoload :MessagesListParamsChannel, "didit/types/messages"
831
+ autoload :MessagesListParamsStatus, "didit/types/messages"
832
+ autoload :MessagesSendParamsChannels, "didit/types/messages"
833
+ autoload :MessagesSettings, "didit/types/components"
813
834
  autoload :MonitoringEvent, "didit/types/components"
814
835
  autoload :MonitoringEventCreateRequestEventCategory, "didit/types/components"
815
836
  autoload :MonitoringEventDetail, "didit/types/components"
@@ -994,6 +1015,12 @@ module Didit
994
1015
  autoload :ProofOfAddressVerifyResponsePoaWarnings, "didit/types/proof_of_address"
995
1016
  autoload :ProofOfAddressVerifyResponsePoaWarningsFeature, "didit/types/proof_of_address"
996
1017
  autoload :ProofOfAddressVerifyResponsePoaWarningsLogType, "didit/types/proof_of_address"
1018
+ autoload :PublicPriceBook, "didit/types/components"
1019
+ autoload :PublicPriceBookCurrency, "didit/types/components"
1020
+ autoload :PublicPriceBookLine, "didit/types/components"
1021
+ autoload :PublicPriceBookMessageFees, "didit/types/components"
1022
+ autoload :PublicPriceBookPlan, "didit/types/components"
1023
+ autoload :PublicPriceBookPlanKey, "didit/types/components"
997
1024
  autoload :QuestionnaireDetail, "didit/types/components"
998
1025
  autoload :QuestionnaireDetailStatus, "didit/types/components"
999
1026
  autoload :QuestionnaireListItem, "didit/types/components"
data/lib/didit/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Didit
4
- VERSION = "2.27.0" # x-release-please-version
4
+ VERSION = "2.29.0" # x-release-please-version
5
5
  end
@@ -0,0 +1,16 @@
1
+ # Code generated by codegen from openapi/*.json. DO NOT EDIT.
2
+
3
+ module Didit
4
+ module Resources
5
+ class Messages < Didit::Resource
6
+ def cancel: (String message_id, ?request_options: Didit::request_options?) -> Didit::Types::Message
7
+ def delete: (String message_id, ?request_options: Didit::request_options?) -> nil
8
+ def list: (?limit: Integer, ?offset: Integer, ?status: String, ?channel: String, ?to: String, ?correlation_id: String, ?created_after: Time | String, ?created_before: Time | String, ?request_options: Didit::request_options?) -> Didit::Page[Didit::Types::Message]
9
+ def list_prices: (country: String, ?request_options: Didit::request_options?) -> Didit::Types::MessagePrices
10
+ def retrieve: (String message_id, ?request_options: Didit::request_options?) -> Didit::Types::Message
11
+ def retrieve_settings: (?request_options: Didit::request_options?) -> Didit::Types::MessagesSettings
12
+ def send_message: (to: String, ?to_email: String, ?channels: Array[String], ?body: String, ?template_id: String, ?variables: Hash[String | Symbol, String], ?locale: String, ?subject: String, ?schedule_at: Time | String, ?expires_at: Time | String, ?correlation_id: String, ?options: Didit::Types::messages_send_params_options, ?idempotency_key: String, ?request_options: Didit::request_options?) -> Didit::Types::Message
13
+ def update_settings: (retention_days: Integer, ?request_options: Didit::request_options?) -> Didit::Types::MessagesSettings
14
+ end
15
+ end
16
+ end
@@ -4,6 +4,7 @@ module Didit
4
4
  module Resources
5
5
  class Pricing < Didit::Resource
6
6
  def bank_verification: (?request_options: Didit::request_options?) -> Didit::Types::BankVerificationPricing
7
+ def price_book: (?request_options: Didit::request_options?) -> Didit::Types::PublicPriceBook
7
8
  end
8
9
  end
9
10
  end
@@ -30,6 +30,7 @@ module Didit
30
30
  def ip: () -> Didit::Resources::Ip
31
31
  def kyb: () -> Didit::Resources::Kyb
32
32
  def lists: () -> Didit::Resources::Lists
33
+ def messages: () -> Didit::Resources::Messages
33
34
  def monitoring_events: () -> Didit::Resources::MonitoringEvents
34
35
  def networks: () -> Didit::Resources::Networks
35
36
  def passive_liveness: () -> Didit::Resources::PassiveLiveness
@@ -1961,6 +1961,106 @@ module Didit
1961
1961
  VALUES: Array[String]
1962
1962
  end
1963
1963
 
1964
+ module MessageAttemptChannel
1965
+ SMS: String
1966
+ WHATSAPP: String
1967
+ EMAIL: String
1968
+
1969
+ VALUES: Array[String]
1970
+ end
1971
+
1972
+ module MessageAttemptEncoding
1973
+ GSM_7: String
1974
+ UCS_2: String
1975
+
1976
+ VALUES: Array[String]
1977
+ end
1978
+
1979
+ module MessageAttemptStatus
1980
+ SCHEDULED: String
1981
+ QUEUED: String
1982
+ SENDING: String
1983
+ SENT: String
1984
+ DELIVERED: String
1985
+ READ: String
1986
+ FAILED: String
1987
+ CANCELLED: String
1988
+
1989
+ VALUES: Array[String]
1990
+ end
1991
+
1992
+ module MessageChannel
1993
+ SMS: String
1994
+ WHATSAPP: String
1995
+ EMAIL: String
1996
+
1997
+ VALUES: Array[String]
1998
+ end
1999
+
2000
+ module MessageChannelPriceChannel
2001
+ SMS: String
2002
+ WHATSAPP: String
2003
+ EMAIL: String
2004
+
2005
+ VALUES: Array[String]
2006
+ end
2007
+
2008
+ module MessageChannelPriceUnit
2009
+ SEGMENT: String
2010
+ MESSAGE: String
2011
+
2012
+ VALUES: Array[String]
2013
+ end
2014
+
2015
+ module MessageChannels
2016
+ SMS: String
2017
+ WHATSAPP: String
2018
+ EMAIL: String
2019
+
2020
+ VALUES: Array[String]
2021
+ end
2022
+
2023
+ module MessageEncoding
2024
+ GSM_7: String
2025
+ UCS_2: String
2026
+
2027
+ VALUES: Array[String]
2028
+ end
2029
+
2030
+ module MessageErrorCode
2031
+ INVALID_RECIPIENT: String
2032
+ UNREACHABLE: String
2033
+ REJECTED: String
2034
+ OPTED_OUT: String
2035
+ EXPIRED: String
2036
+ TEMPLATE_REQUIRED: String
2037
+ CHANNEL_UNAVAILABLE: String
2038
+ INSUFFICIENT_CREDITS: String
2039
+ RATE_LIMITED: String
2040
+ DELIVERY_UNCONFIRMED: String
2041
+ CANCELLED: String
2042
+ TEMPLATE_CHANNEL_MISSING: String
2043
+ TEMPLATE_VARIABLE_MISSING: String
2044
+ EMPTY_BODY: String
2045
+ BODY_TOO_LONG: String
2046
+ UNKNOWN: String
2047
+
2048
+ VALUES: Array[String]
2049
+ end
2050
+
2051
+ module MessageStatus
2052
+ SCHEDULED: String
2053
+ QUEUED: String
2054
+ SENDING: String
2055
+ SENT: String
2056
+ DELIVERED: String
2057
+ READ: String
2058
+ FAILED: String
2059
+ CANCELLED: String
2060
+
2061
+ VALUES: Array[String]
2062
+ end
2063
+
1964
2064
  module MonitoringEventCreateRequestEventCategory
1965
2065
  AUTH: String
1966
2066
  SESSION: String
@@ -2344,6 +2444,21 @@ module Didit
2344
2444
  VALUES: Array[String]
2345
2445
  end
2346
2446
 
2447
+ module PublicPriceBookCurrency
2448
+ USD: String
2449
+
2450
+ VALUES: Array[String]
2451
+ end
2452
+
2453
+ module PublicPriceBookPlanKey
2454
+ FREE: String
2455
+ GROWTH: String
2456
+ SCALE: String
2457
+ ENTERPRISE: String
2458
+
2459
+ VALUES: Array[String]
2460
+ end
2461
+
2347
2462
  module QuestionnaireDetailStatus
2348
2463
  DRAFT: String
2349
2464
  PUBLISHED: String
@@ -5809,6 +5924,7 @@ module Didit
5809
5924
  INVESTIGATOR_SLA_BREACHED: String
5810
5925
  INVESTIGATOR_QA_FAILED: String
5811
5926
  INVESTIGATOR_EXTERNAL_REPORT_READY: String
5927
+ MESSAGE_STATUS_UPDATED: String
5812
5928
 
5813
5929
  VALUES: Array[String]
5814
5930
  end
@@ -8365,6 +8481,87 @@ module Didit
8365
8481
  def section: () -> String?
8366
8482
  end
8367
8483
 
8484
+ class Message < Didit::Model
8485
+ def id: () -> String
8486
+ def status: () -> String
8487
+ def to: () -> String?
8488
+ def channel: () -> String
8489
+ def channels: () -> Array[String]
8490
+ def body: () -> String?
8491
+ def subject: () -> String?
8492
+ def template_id: () -> String?
8493
+ def locale: () -> String?
8494
+ def correlation_id: () -> String?
8495
+ def segments: () -> Integer
8496
+ def encoding: () -> String?
8497
+ def price: () -> Didit::Types::MessagePrice?
8498
+ def error: () -> Didit::Types::MessageError?
8499
+ def schedule_at: () -> Time?
8500
+ def expires_at: () -> Time?
8501
+ def created_at: () -> Time
8502
+ def sent_at: () -> Time?
8503
+ def delivered_at: () -> Time?
8504
+ def read_at: () -> Time?
8505
+ def failed_at: () -> Time?
8506
+ def attempts: () -> Array[Didit::Types::MessageAttempt]
8507
+ def is_sandbox: () -> bool
8508
+ end
8509
+
8510
+ class MessageAttempt < Didit::Model
8511
+ def id: () -> String
8512
+ def channel: () -> String
8513
+ def to: () -> String?
8514
+ def status: () -> String
8515
+ def error: () -> Didit::Types::MessageError?
8516
+ def price: () -> Didit::Types::MessagePrice?
8517
+ def segments: () -> Integer
8518
+ def encoding: () -> String?
8519
+ def created_at: () -> Time
8520
+ def sent_at: () -> Time?
8521
+ def delivered_at: () -> Time?
8522
+ def read_at: () -> Time?
8523
+ def failed_at: () -> Time?
8524
+ end
8525
+
8526
+ class MessageChannelPrice < Didit::Model
8527
+ def channel: () -> String
8528
+ def unit: () -> String
8529
+ def category: () -> String?
8530
+ def carrier: () -> String?
8531
+ def fee: () -> String?
8532
+ def price: () -> String?
8533
+ end
8534
+
8535
+ class MessageError < Didit::Model
8536
+ def code: () -> String
8537
+ def message: () -> String
8538
+ end
8539
+
8540
+ class MessageList < Didit::Model
8541
+ def count: () -> Integer
8542
+ def `next`: () -> String?
8543
+ def previous: () -> String?
8544
+ def results: () -> Array[Didit::Types::Message]
8545
+ end
8546
+
8547
+ class MessagePrice < Didit::Model
8548
+ def amount: () -> String
8549
+ def currency: () -> String
8550
+ def carrier: () -> String?
8551
+ def fee: () -> String?
8552
+ def final: () -> bool
8553
+ end
8554
+
8555
+ class MessagePrices < Didit::Model
8556
+ def country: () -> String
8557
+ def currency: () -> String
8558
+ def channels: () -> Array[Didit::Types::MessageChannelPrice]
8559
+ end
8560
+
8561
+ class MessagesSettings < Didit::Model
8562
+ def retention_days: () -> Integer
8563
+ end
8564
+
8368
8565
  class MonitoringEvent < Didit::Model
8369
8566
  def event_uuid: () -> String
8370
8567
  def event_id: () -> String
@@ -9084,6 +9281,36 @@ module Didit
9084
9281
  def metadata: () -> Hash[String, untyped]?
9085
9282
  end
9086
9283
 
9284
+ class PublicPriceBook < Didit::Model
9285
+ def currency: () -> String
9286
+ def plans: () -> Array[Didit::Types::PublicPriceBookPlan]
9287
+ def white_label_usd: () -> String?
9288
+ def messages_fee_usd: () -> String?
9289
+ def message_fee_usd_by_channel: () -> Didit::Types::PublicPriceBookMessageFees
9290
+ def lines: () -> Array[Didit::Types::PublicPriceBookLine]
9291
+ end
9292
+
9293
+ class PublicPriceBookLine < Didit::Model
9294
+ def key: () -> String
9295
+ def product: () -> String
9296
+ def feature: () -> String
9297
+ def unit: () -> String
9298
+ def list_price_usd: () -> String
9299
+ end
9300
+
9301
+ class PublicPriceBookMessageFees < Didit::Model
9302
+ def sms: () -> String?
9303
+ def whatsapp: () -> String?
9304
+ end
9305
+
9306
+ class PublicPriceBookPlan < Didit::Model
9307
+ def key: () -> String
9308
+ def price_usd_month: () -> String?
9309
+ def price_usd_year: () -> String?
9310
+ def discount_percent: () -> Integer?
9311
+ def transactions_included_per_month: () -> Integer?
9312
+ end
9313
+
9087
9314
  class QuestionnaireDetail < Didit::Model
9088
9315
  def questionnaire_id: () -> String?
9089
9316
  def title: () -> String?
@@ -0,0 +1,40 @@
1
+ # Code generated by codegen from openapi/*.json. DO NOT EDIT.
2
+
3
+ module Didit
4
+ module Types
5
+ module MessagesListParamsChannel
6
+ SMS: String
7
+ WHATSAPP: String
8
+ EMAIL: String
9
+
10
+ VALUES: Array[String]
11
+ end
12
+
13
+ module MessagesListParamsStatus
14
+ SCHEDULED: String
15
+ QUEUED: String
16
+ SENDING: String
17
+ SENT: String
18
+ DELIVERED: String
19
+ READ: String
20
+ FAILED: String
21
+ CANCELLED: String
22
+
23
+ VALUES: Array[String]
24
+ end
25
+
26
+ module MessagesSendParamsChannels
27
+ SMS: String
28
+ WHATSAPP: String
29
+ EMAIL: String
30
+
31
+ VALUES: Array[String]
32
+ end
33
+
34
+ type messages_send_params = { to: String, ?to_email: String, ?channels: Array[String], ?body: String, ?template_id: String, ?variables: Hash[String | Symbol, String], ?locale: String, ?subject: String, ?schedule_at: Time | String, ?expires_at: Time | String, ?correlation_id: String, ?options: Didit::Types::messages_send_params_options }
35
+
36
+ type messages_send_params_options = { ?append_opt_out_line: bool }
37
+
38
+ type messages_update_settings_params = { retention_days: Integer }
39
+ end
40
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: didit-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.27.0
4
+ version: 2.29.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Didit
@@ -96,6 +96,7 @@ files:
96
96
  - lib/didit/resources/ip.rb
97
97
  - lib/didit/resources/kyb.rb
98
98
  - lib/didit/resources/lists.rb
99
+ - lib/didit/resources/messages.rb
99
100
  - lib/didit/resources/monitoring_events.rb
100
101
  - lib/didit/resources/networks.rb
101
102
  - lib/didit/resources/passive_liveness.rb
@@ -143,6 +144,7 @@ files:
143
144
  - lib/didit/types/ip.rb
144
145
  - lib/didit/types/kyb.rb
145
146
  - lib/didit/types/lists.rb
147
+ - lib/didit/types/messages.rb
146
148
  - lib/didit/types/monitoring_events.rb
147
149
  - lib/didit/types/networks.rb
148
150
  - lib/didit/types/passive_liveness.rb
@@ -214,6 +216,7 @@ files:
214
216
  - sig/didit/resources/ip.rbs
215
217
  - sig/didit/resources/kyb.rbs
216
218
  - sig/didit/resources/lists.rbs
219
+ - sig/didit/resources/messages.rbs
217
220
  - sig/didit/resources/monitoring_events.rbs
218
221
  - sig/didit/resources/networks.rbs
219
222
  - sig/didit/resources/passive_liveness.rbs
@@ -260,6 +263,7 @@ files:
260
263
  - sig/didit/types/ip.rbs
261
264
  - sig/didit/types/kyb.rbs
262
265
  - sig/didit/types/lists.rbs
266
+ - sig/didit/types/messages.rbs
263
267
  - sig/didit/types/monitoring_events.rbs
264
268
  - sig/didit/types/networks.rbs
265
269
  - sig/didit/types/passive_liveness.rbs