twilio-ruby 7.8.6 → 7.8.7
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/CHANGES.md +7 -0
- data/README.md +2 -2
- data/lib/twilio-ruby/rest/content/v1/content.rb +677 -1
- data/lib/twilio-ruby/rest/numbers/v2/application.rb +378 -0
- data/lib/twilio-ruby/rest/numbers/v2.rb +15 -0
- data/lib/twilio-ruby/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e58c5c7fea368238c55e9d246f2b29d8d32a2cff
|
|
4
|
+
data.tar.gz: 523009baf572426ed7527001b64da58bd57090d2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8dc7972e9d85581aebea205b76fe0a9d05c636637d3c64d48d387ab4f4a588e9a8d57d23eb717b7c59fbdfa3f047b7b564e70070a2885854de73f108132a4432
|
|
7
|
+
data.tar.gz: cc3b10c122b8ff2ec6b3fae9752f272ac09d3cbe6da8de62cd1cc1bee4d06b23be280dbb921c8e29cd20d2e22c4da51448b4e8720a98f615591c14477d48f243
|
data/CHANGES.md
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
twilio-ruby changelog
|
|
2
2
|
=====================
|
|
3
3
|
|
|
4
|
+
[2025-11-20] Version 7.8.7
|
|
5
|
+
--------------------------
|
|
6
|
+
**Memory**
|
|
7
|
+
- # Memory API Changes
|
|
8
|
+
- Added initial Memory API endpoints with darkseagreen badge status
|
|
9
|
+
|
|
10
|
+
|
|
4
11
|
[2025-11-11] Version 7.8.6
|
|
5
12
|
--------------------------
|
|
6
13
|
**Twiml**
|
data/README.md
CHANGED
|
@@ -39,13 +39,13 @@ This library supports the following Ruby implementations:
|
|
|
39
39
|
To install using [Bundler][bundler] grab the latest stable version:
|
|
40
40
|
|
|
41
41
|
```ruby
|
|
42
|
-
gem 'twilio-ruby', '~> 7.8.
|
|
42
|
+
gem 'twilio-ruby', '~> 7.8.7'
|
|
43
43
|
```
|
|
44
44
|
|
|
45
45
|
To manually install `twilio-ruby` via [Rubygems][rubygems] simply gem install:
|
|
46
46
|
|
|
47
47
|
```bash
|
|
48
|
-
gem install twilio-ruby -v 7.8.
|
|
48
|
+
gem install twilio-ruby -v 7.8.7
|
|
49
49
|
```
|
|
50
50
|
|
|
51
51
|
To build and install the development branch yourself from the latest source:
|
|
@@ -191,6 +191,650 @@ module Twilio
|
|
|
191
191
|
end
|
|
192
192
|
end
|
|
193
193
|
|
|
194
|
+
class ContentUpdateRequest
|
|
195
|
+
# @param [friendly_name]: [String] User defined name of the content
|
|
196
|
+
# @param [variables]: [Hash<String, String>] Key value pairs of variable name to value
|
|
197
|
+
# @param [language]: [String] Language code for the content
|
|
198
|
+
# @param [types]: [ContentList.Types]
|
|
199
|
+
attr_accessor :friendly_name, :variables, :language, :types
|
|
200
|
+
def initialize(payload)
|
|
201
|
+
@friendly_name = payload["friendly_name"]
|
|
202
|
+
@variables = payload["variables"]
|
|
203
|
+
@language = payload["language"]
|
|
204
|
+
@types = payload["types"]
|
|
205
|
+
end
|
|
206
|
+
def to_json(options = {})
|
|
207
|
+
{
|
|
208
|
+
"friendly_name": @friendly_name,
|
|
209
|
+
"variables": @variables,
|
|
210
|
+
"language": @language,
|
|
211
|
+
"types": @types,
|
|
212
|
+
}.to_json(options)
|
|
213
|
+
end
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
class FlowsPage
|
|
217
|
+
# @param [id]: [String]
|
|
218
|
+
# @param [next_page_id]: [String]
|
|
219
|
+
# @param [title]: [String]
|
|
220
|
+
# @param [subtitle]: [String]
|
|
221
|
+
# @param [layout]: [Array<ContentList.FlowsPageComponent>]
|
|
222
|
+
attr_accessor :id, :next_page_id, :title, :subtitle, :layout
|
|
223
|
+
def initialize(payload)
|
|
224
|
+
@id = payload["id"]
|
|
225
|
+
@next_page_id = payload["next_page_id"]
|
|
226
|
+
@title = payload["title"]
|
|
227
|
+
@subtitle = payload["subtitle"]
|
|
228
|
+
@layout = payload["layout"]
|
|
229
|
+
end
|
|
230
|
+
def to_json(options = {})
|
|
231
|
+
{
|
|
232
|
+
"id": @id,
|
|
233
|
+
"next_page_id": @next_page_id,
|
|
234
|
+
"title": @title,
|
|
235
|
+
"subtitle": @subtitle,
|
|
236
|
+
"layout": @layout,
|
|
237
|
+
}.to_json(options)
|
|
238
|
+
end
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
class FlowsPageComponent
|
|
242
|
+
# @param [label]: [String]
|
|
243
|
+
# @param [type]: [String]
|
|
244
|
+
attr_accessor :label, :type
|
|
245
|
+
def initialize(payload)
|
|
246
|
+
@label = payload["label"]
|
|
247
|
+
@type = payload["type"]
|
|
248
|
+
end
|
|
249
|
+
def to_json(options = {})
|
|
250
|
+
{
|
|
251
|
+
"label": @label,
|
|
252
|
+
"type": @type,
|
|
253
|
+
}.to_json(options)
|
|
254
|
+
end
|
|
255
|
+
end
|
|
256
|
+
|
|
257
|
+
class ListItem
|
|
258
|
+
# @param [id]: [String]
|
|
259
|
+
# @param [item]: [String]
|
|
260
|
+
# @param [description]: [String]
|
|
261
|
+
attr_accessor :id, :item, :description
|
|
262
|
+
def initialize(payload)
|
|
263
|
+
@id = payload["id"]
|
|
264
|
+
@item = payload["item"]
|
|
265
|
+
@description = payload["description"]
|
|
266
|
+
end
|
|
267
|
+
def to_json(options = {})
|
|
268
|
+
{
|
|
269
|
+
"id": @id,
|
|
270
|
+
"item": @item,
|
|
271
|
+
"description": @description,
|
|
272
|
+
}.to_json(options)
|
|
273
|
+
end
|
|
274
|
+
end
|
|
275
|
+
|
|
276
|
+
class QuickReplyAction
|
|
277
|
+
# @param [type]: [QuickReplyActionType]
|
|
278
|
+
# @param [title]: [String]
|
|
279
|
+
# @param [id]: [String]
|
|
280
|
+
attr_accessor :type, :title, :id
|
|
281
|
+
def initialize(payload)
|
|
282
|
+
@type = payload["type"]
|
|
283
|
+
@title = payload["title"]
|
|
284
|
+
@id = payload["id"]
|
|
285
|
+
end
|
|
286
|
+
def to_json(options = {})
|
|
287
|
+
{
|
|
288
|
+
"type": @type,
|
|
289
|
+
"title": @title,
|
|
290
|
+
"id": @id,
|
|
291
|
+
}.to_json(options)
|
|
292
|
+
end
|
|
293
|
+
end
|
|
294
|
+
|
|
295
|
+
class TwilioCallToAction
|
|
296
|
+
# @param [body]: [String]
|
|
297
|
+
# @param [actions]: [Array<ContentList.CallToActionAction>]
|
|
298
|
+
attr_accessor :body, :actions
|
|
299
|
+
def initialize(payload)
|
|
300
|
+
@body = payload["body"]
|
|
301
|
+
@actions = payload["actions"]
|
|
302
|
+
end
|
|
303
|
+
def to_json(options = {})
|
|
304
|
+
{
|
|
305
|
+
"body": @body,
|
|
306
|
+
"actions": @actions,
|
|
307
|
+
}.to_json(options)
|
|
308
|
+
end
|
|
309
|
+
end
|
|
310
|
+
|
|
311
|
+
class TwilioCard
|
|
312
|
+
# @param [title]: [String]
|
|
313
|
+
# @param [subtitle]: [String]
|
|
314
|
+
# @param [media]: [Array<String>]
|
|
315
|
+
# @param [actions]: [Array<ContentList.CardAction>]
|
|
316
|
+
attr_accessor :title, :subtitle, :media, :actions
|
|
317
|
+
def initialize(payload)
|
|
318
|
+
@title = payload["title"]
|
|
319
|
+
@subtitle = payload["subtitle"]
|
|
320
|
+
@media = payload["media"]
|
|
321
|
+
@actions = payload["actions"]
|
|
322
|
+
end
|
|
323
|
+
def to_json(options = {})
|
|
324
|
+
{
|
|
325
|
+
"title": @title,
|
|
326
|
+
"subtitle": @subtitle,
|
|
327
|
+
"media": @media,
|
|
328
|
+
"actions": @actions,
|
|
329
|
+
}.to_json(options)
|
|
330
|
+
end
|
|
331
|
+
end
|
|
332
|
+
|
|
333
|
+
class TwilioCarousel
|
|
334
|
+
# @param [body]: [String]
|
|
335
|
+
# @param [cards]: [Array<ContentList.CarouselCard>]
|
|
336
|
+
attr_accessor :body, :cards
|
|
337
|
+
def initialize(payload)
|
|
338
|
+
@body = payload["body"]
|
|
339
|
+
@cards = payload["cards"]
|
|
340
|
+
end
|
|
341
|
+
def to_json(options = {})
|
|
342
|
+
{
|
|
343
|
+
"body": @body,
|
|
344
|
+
"cards": @cards,
|
|
345
|
+
}.to_json(options)
|
|
346
|
+
end
|
|
347
|
+
end
|
|
348
|
+
|
|
349
|
+
class TwilioCatalog
|
|
350
|
+
# @param [title]: [String]
|
|
351
|
+
# @param [body]: [String]
|
|
352
|
+
# @param [subtitle]: [String]
|
|
353
|
+
# @param [id]: [String]
|
|
354
|
+
# @param [items]: [Array<ContentList.CatalogItem>]
|
|
355
|
+
# @param [dynamic_items]: [String]
|
|
356
|
+
attr_accessor :title, :body, :subtitle, :id, :items, :dynamic_items
|
|
357
|
+
def initialize(payload)
|
|
358
|
+
@title = payload["title"]
|
|
359
|
+
@body = payload["body"]
|
|
360
|
+
@subtitle = payload["subtitle"]
|
|
361
|
+
@id = payload["id"]
|
|
362
|
+
@items = payload["items"]
|
|
363
|
+
@dynamic_items = payload["dynamic_items"]
|
|
364
|
+
end
|
|
365
|
+
def to_json(options = {})
|
|
366
|
+
{
|
|
367
|
+
"title": @title,
|
|
368
|
+
"body": @body,
|
|
369
|
+
"subtitle": @subtitle,
|
|
370
|
+
"id": @id,
|
|
371
|
+
"items": @items,
|
|
372
|
+
"dynamic_items": @dynamic_items,
|
|
373
|
+
}.to_json(options)
|
|
374
|
+
end
|
|
375
|
+
end
|
|
376
|
+
|
|
377
|
+
class TwilioFlows
|
|
378
|
+
# @param [body]: [String]
|
|
379
|
+
# @param [button_text]: [String]
|
|
380
|
+
# @param [subtitle]: [String]
|
|
381
|
+
# @param [media_url]: [String]
|
|
382
|
+
# @param [pages]: [Array<ContentList.FlowsPage>]
|
|
383
|
+
# @param [type]: [String]
|
|
384
|
+
attr_accessor :body, :button_text, :subtitle, :media_url, :pages, :type
|
|
385
|
+
def initialize(payload)
|
|
386
|
+
@body = payload["body"]
|
|
387
|
+
@button_text = payload["button_text"]
|
|
388
|
+
@subtitle = payload["subtitle"]
|
|
389
|
+
@media_url = payload["media_url"]
|
|
390
|
+
@pages = payload["pages"]
|
|
391
|
+
@type = payload["type"]
|
|
392
|
+
end
|
|
393
|
+
def to_json(options = {})
|
|
394
|
+
{
|
|
395
|
+
"body": @body,
|
|
396
|
+
"button_text": @button_text,
|
|
397
|
+
"subtitle": @subtitle,
|
|
398
|
+
"media_url": @media_url,
|
|
399
|
+
"pages": @pages,
|
|
400
|
+
"type": @type,
|
|
401
|
+
}.to_json(options)
|
|
402
|
+
end
|
|
403
|
+
end
|
|
404
|
+
|
|
405
|
+
class TwilioListPicker
|
|
406
|
+
# @param [body]: [String]
|
|
407
|
+
# @param [button]: [String]
|
|
408
|
+
# @param [items]: [Array<ContentList.ListItem>]
|
|
409
|
+
attr_accessor :body, :button, :items
|
|
410
|
+
def initialize(payload)
|
|
411
|
+
@body = payload["body"]
|
|
412
|
+
@button = payload["button"]
|
|
413
|
+
@items = payload["items"]
|
|
414
|
+
end
|
|
415
|
+
def to_json(options = {})
|
|
416
|
+
{
|
|
417
|
+
"body": @body,
|
|
418
|
+
"button": @button,
|
|
419
|
+
"items": @items,
|
|
420
|
+
}.to_json(options)
|
|
421
|
+
end
|
|
422
|
+
end
|
|
423
|
+
|
|
424
|
+
class TwilioLocation
|
|
425
|
+
# @param [latitude]: [Float]
|
|
426
|
+
# @param [longitude]: [Float]
|
|
427
|
+
# @param [label]: [String]
|
|
428
|
+
# @param [id]: [String]
|
|
429
|
+
# @param [address]: [String]
|
|
430
|
+
attr_accessor :latitude, :longitude, :label, :id, :address
|
|
431
|
+
def initialize(payload)
|
|
432
|
+
@latitude = payload["latitude"]
|
|
433
|
+
@longitude = payload["longitude"]
|
|
434
|
+
@label = payload["label"]
|
|
435
|
+
@id = payload["id"]
|
|
436
|
+
@address = payload["address"]
|
|
437
|
+
end
|
|
438
|
+
def to_json(options = {})
|
|
439
|
+
{
|
|
440
|
+
"latitude": @latitude,
|
|
441
|
+
"longitude": @longitude,
|
|
442
|
+
"label": @label,
|
|
443
|
+
"id": @id,
|
|
444
|
+
"address": @address,
|
|
445
|
+
}.to_json(options)
|
|
446
|
+
end
|
|
447
|
+
end
|
|
448
|
+
|
|
449
|
+
class TwilioMedia
|
|
450
|
+
# @param [body]: [String]
|
|
451
|
+
# @param [media]: [Array<String>]
|
|
452
|
+
attr_accessor :body, :media
|
|
453
|
+
def initialize(payload)
|
|
454
|
+
@body = payload["body"]
|
|
455
|
+
@media = payload["media"]
|
|
456
|
+
end
|
|
457
|
+
def to_json(options = {})
|
|
458
|
+
{
|
|
459
|
+
"body": @body,
|
|
460
|
+
"media": @media,
|
|
461
|
+
}.to_json(options)
|
|
462
|
+
end
|
|
463
|
+
end
|
|
464
|
+
|
|
465
|
+
class TwilioQuickReply
|
|
466
|
+
# @param [body]: [String]
|
|
467
|
+
# @param [actions]: [Array<ContentList.QuickReplyAction>]
|
|
468
|
+
attr_accessor :body, :actions
|
|
469
|
+
def initialize(payload)
|
|
470
|
+
@body = payload["body"]
|
|
471
|
+
@actions = payload["actions"]
|
|
472
|
+
end
|
|
473
|
+
def to_json(options = {})
|
|
474
|
+
{
|
|
475
|
+
"body": @body,
|
|
476
|
+
"actions": @actions,
|
|
477
|
+
}.to_json(options)
|
|
478
|
+
end
|
|
479
|
+
end
|
|
480
|
+
|
|
481
|
+
class TwilioSchedule
|
|
482
|
+
# @param [id]: [String]
|
|
483
|
+
# @param [title]: [String]
|
|
484
|
+
# @param [time_slots]: [String]
|
|
485
|
+
attr_accessor :id, :title, :time_slots
|
|
486
|
+
def initialize(payload)
|
|
487
|
+
@id = payload["id"]
|
|
488
|
+
@title = payload["title"]
|
|
489
|
+
@time_slots = payload["time_slots"]
|
|
490
|
+
end
|
|
491
|
+
def to_json(options = {})
|
|
492
|
+
{
|
|
493
|
+
"id": @id,
|
|
494
|
+
"title": @title,
|
|
495
|
+
"timeSlots": @time_slots,
|
|
496
|
+
}.to_json(options)
|
|
497
|
+
end
|
|
498
|
+
end
|
|
499
|
+
|
|
500
|
+
class TwilioText
|
|
501
|
+
# @param [body]: [String]
|
|
502
|
+
attr_accessor :body
|
|
503
|
+
def initialize(payload)
|
|
504
|
+
@body = payload["body"]
|
|
505
|
+
end
|
|
506
|
+
def to_json(options = {})
|
|
507
|
+
{
|
|
508
|
+
"body": @body,
|
|
509
|
+
}.to_json(options)
|
|
510
|
+
end
|
|
511
|
+
end
|
|
512
|
+
|
|
513
|
+
class Types
|
|
514
|
+
# @param [twilio_text]: [ContentList.TwilioText]
|
|
515
|
+
# @param [twilio_media]: [ContentList.TwilioMedia]
|
|
516
|
+
# @param [twilio_location]: [ContentList.TwilioLocation]
|
|
517
|
+
# @param [twilio_list_picker]: [ContentList.TwilioListPicker]
|
|
518
|
+
# @param [twilio_call_to_action]: [ContentList.TwilioCallToAction]
|
|
519
|
+
# @param [twilio_quick_reply]: [ContentList.TwilioQuickReply]
|
|
520
|
+
# @param [twilio_card]: [ContentList.TwilioCard]
|
|
521
|
+
# @param [twilio_catalog]: [ContentList.TwilioCatalog]
|
|
522
|
+
# @param [twilio_carousel]: [ContentList.TwilioCarousel]
|
|
523
|
+
# @param [twilio_flows]: [ContentList.TwilioFlows]
|
|
524
|
+
# @param [twilio_schedule]: [ContentList.TwilioSchedule]
|
|
525
|
+
# @param [whatsapp_card]: [ContentList.WhatsappCard]
|
|
526
|
+
# @param [whatsapp_authentication]: [ContentList.WhatsappAuthentication]
|
|
527
|
+
# @param [whatsapp_flows]: [ContentList.WhatsappFlows]
|
|
528
|
+
attr_accessor :twilio_text, :twilio_media, :twilio_location, :twilio_list_picker, :twilio_call_to_action, :twilio_quick_reply, :twilio_card, :twilio_catalog, :twilio_carousel, :twilio_flows, :twilio_schedule, :whatsapp_card, :whatsapp_authentication, :whatsapp_flows
|
|
529
|
+
def initialize(payload)
|
|
530
|
+
@twilio_text = payload["twilio_text"]
|
|
531
|
+
@twilio_media = payload["twilio_media"]
|
|
532
|
+
@twilio_location = payload["twilio_location"]
|
|
533
|
+
@twilio_list_picker = payload["twilio_list_picker"]
|
|
534
|
+
@twilio_call_to_action = payload["twilio_call_to_action"]
|
|
535
|
+
@twilio_quick_reply = payload["twilio_quick_reply"]
|
|
536
|
+
@twilio_card = payload["twilio_card"]
|
|
537
|
+
@twilio_catalog = payload["twilio_catalog"]
|
|
538
|
+
@twilio_carousel = payload["twilio_carousel"]
|
|
539
|
+
@twilio_flows = payload["twilio_flows"]
|
|
540
|
+
@twilio_schedule = payload["twilio_schedule"]
|
|
541
|
+
@whatsapp_card = payload["whatsapp_card"]
|
|
542
|
+
@whatsapp_authentication = payload["whatsapp_authentication"]
|
|
543
|
+
@whatsapp_flows = payload["whatsapp_flows"]
|
|
544
|
+
end
|
|
545
|
+
def to_json(options = {})
|
|
546
|
+
{
|
|
547
|
+
"twilio/text": @twilio_text,
|
|
548
|
+
"twilio/media": @twilio_media,
|
|
549
|
+
"twilio/location": @twilio_location,
|
|
550
|
+
"twilio/list-picker": @twilio_list_picker,
|
|
551
|
+
"twilio/call-to-action": @twilio_call_to_action,
|
|
552
|
+
"twilio/quick-reply": @twilio_quick_reply,
|
|
553
|
+
"twilio/card": @twilio_card,
|
|
554
|
+
"twilio/catalog": @twilio_catalog,
|
|
555
|
+
"twilio/carousel": @twilio_carousel,
|
|
556
|
+
"twilio/flows": @twilio_flows,
|
|
557
|
+
"twilio/schedule": @twilio_schedule,
|
|
558
|
+
"whatsapp/card": @whatsapp_card,
|
|
559
|
+
"whatsapp/authentication": @whatsapp_authentication,
|
|
560
|
+
"whatsapp/flows": @whatsapp_flows,
|
|
561
|
+
}.to_json(options)
|
|
562
|
+
end
|
|
563
|
+
end
|
|
564
|
+
|
|
565
|
+
class WhatsappAuthentication
|
|
566
|
+
# @param [add_security_recommendation]: [Boolean]
|
|
567
|
+
# @param [code_expiration_minutes]: [Float]
|
|
568
|
+
# @param [actions]: [Array<ContentList.AuthenticationAction>]
|
|
569
|
+
attr_accessor :add_security_recommendation, :code_expiration_minutes, :actions
|
|
570
|
+
def initialize(payload)
|
|
571
|
+
@add_security_recommendation = payload["add_security_recommendation"]
|
|
572
|
+
@code_expiration_minutes = payload["code_expiration_minutes"]
|
|
573
|
+
@actions = payload["actions"]
|
|
574
|
+
end
|
|
575
|
+
def to_json(options = {})
|
|
576
|
+
{
|
|
577
|
+
"add_security_recommendation": @add_security_recommendation,
|
|
578
|
+
"code_expiration_minutes": @code_expiration_minutes,
|
|
579
|
+
"actions": @actions,
|
|
580
|
+
}.to_json(options)
|
|
581
|
+
end
|
|
582
|
+
end
|
|
583
|
+
|
|
584
|
+
class WhatsappCard
|
|
585
|
+
# @param [body]: [String]
|
|
586
|
+
# @param [footer]: [String]
|
|
587
|
+
# @param [media]: [Array<String>]
|
|
588
|
+
# @param [header_text]: [String]
|
|
589
|
+
# @param [actions]: [Array<ContentList.CardAction>]
|
|
590
|
+
attr_accessor :body, :footer, :media, :header_text, :actions
|
|
591
|
+
def initialize(payload)
|
|
592
|
+
@body = payload["body"]
|
|
593
|
+
@footer = payload["footer"]
|
|
594
|
+
@media = payload["media"]
|
|
595
|
+
@header_text = payload["header_text"]
|
|
596
|
+
@actions = payload["actions"]
|
|
597
|
+
end
|
|
598
|
+
def to_json(options = {})
|
|
599
|
+
{
|
|
600
|
+
"body": @body,
|
|
601
|
+
"footer": @footer,
|
|
602
|
+
"media": @media,
|
|
603
|
+
"header_text": @header_text,
|
|
604
|
+
"actions": @actions,
|
|
605
|
+
}.to_json(options)
|
|
606
|
+
end
|
|
607
|
+
end
|
|
608
|
+
|
|
609
|
+
class WhatsappFlows
|
|
610
|
+
# @param [body]: [String]
|
|
611
|
+
# @param [button_text]: [String]
|
|
612
|
+
# @param [subtitle]: [String]
|
|
613
|
+
# @param [media_url]: [String]
|
|
614
|
+
# @param [flow_id]: [String]
|
|
615
|
+
# @param [flow_token]: [String]
|
|
616
|
+
# @param [flow_first_page_id]: [String]
|
|
617
|
+
# @param [is_flow_first_page_endpoint]: [Boolean]
|
|
618
|
+
attr_accessor :body, :button_text, :subtitle, :media_url, :flow_id, :flow_token, :flow_first_page_id, :is_flow_first_page_endpoint
|
|
619
|
+
def initialize(payload)
|
|
620
|
+
@body = payload["body"]
|
|
621
|
+
@button_text = payload["button_text"]
|
|
622
|
+
@subtitle = payload["subtitle"]
|
|
623
|
+
@media_url = payload["media_url"]
|
|
624
|
+
@flow_id = payload["flow_id"]
|
|
625
|
+
@flow_token = payload["flow_token"]
|
|
626
|
+
@flow_first_page_id = payload["flow_first_page_id"]
|
|
627
|
+
@is_flow_first_page_endpoint = payload["is_flow_first_page_endpoint"]
|
|
628
|
+
end
|
|
629
|
+
def to_json(options = {})
|
|
630
|
+
{
|
|
631
|
+
"body": @body,
|
|
632
|
+
"button_text": @button_text,
|
|
633
|
+
"subtitle": @subtitle,
|
|
634
|
+
"media_url": @media_url,
|
|
635
|
+
"flow_id": @flow_id,
|
|
636
|
+
"flow_token": @flow_token,
|
|
637
|
+
"flow_first_page_id": @flow_first_page_id,
|
|
638
|
+
"is_flow_first_page_endpoint": @is_flow_first_page_endpoint,
|
|
639
|
+
}.to_json(options)
|
|
640
|
+
end
|
|
641
|
+
end
|
|
642
|
+
|
|
643
|
+
|
|
644
|
+
class AuthenticationAction
|
|
645
|
+
# @param [type]: [AuthenticationActionType]
|
|
646
|
+
# @param [copy_code_text]: [String]
|
|
647
|
+
attr_accessor :type, :copy_code_text
|
|
648
|
+
def initialize(payload)
|
|
649
|
+
@type = payload["type"]
|
|
650
|
+
@copy_code_text = payload["copy_code_text"]
|
|
651
|
+
end
|
|
652
|
+
def to_json(options = {})
|
|
653
|
+
{
|
|
654
|
+
"type": @type,
|
|
655
|
+
"copy_code_text": @copy_code_text,
|
|
656
|
+
}.to_json(options)
|
|
657
|
+
end
|
|
658
|
+
end
|
|
659
|
+
|
|
660
|
+
class CallToActionAction
|
|
661
|
+
# @param [type]: [CallToActionActionType]
|
|
662
|
+
# @param [title]: [String]
|
|
663
|
+
# @param [url]: [String]
|
|
664
|
+
# @param [phone]: [String]
|
|
665
|
+
# @param [code]: [String]
|
|
666
|
+
# @param [id]: [String]
|
|
667
|
+
attr_accessor :type, :title, :url, :phone, :code, :id
|
|
668
|
+
def initialize(payload)
|
|
669
|
+
@type = payload["type"]
|
|
670
|
+
@title = payload["title"]
|
|
671
|
+
@url = payload["url"]
|
|
672
|
+
@phone = payload["phone"]
|
|
673
|
+
@code = payload["code"]
|
|
674
|
+
@id = payload["id"]
|
|
675
|
+
end
|
|
676
|
+
def to_json(options = {})
|
|
677
|
+
{
|
|
678
|
+
"type": @type,
|
|
679
|
+
"title": @title,
|
|
680
|
+
"url": @url,
|
|
681
|
+
"phone": @phone,
|
|
682
|
+
"code": @code,
|
|
683
|
+
"id": @id,
|
|
684
|
+
}.to_json(options)
|
|
685
|
+
end
|
|
686
|
+
end
|
|
687
|
+
|
|
688
|
+
class CardAction
|
|
689
|
+
# @param [type]: [CardActionType]
|
|
690
|
+
# @param [title]: [String]
|
|
691
|
+
# @param [url]: [String]
|
|
692
|
+
# @param [phone]: [String]
|
|
693
|
+
# @param [id]: [String]
|
|
694
|
+
# @param [code]: [String]
|
|
695
|
+
# @param [webview_size]: [WebviewSizeType]
|
|
696
|
+
attr_accessor :type, :title, :url, :phone, :id, :code, :webview_size
|
|
697
|
+
def initialize(payload)
|
|
698
|
+
@type = payload["type"]
|
|
699
|
+
@title = payload["title"]
|
|
700
|
+
@url = payload["url"]
|
|
701
|
+
@phone = payload["phone"]
|
|
702
|
+
@id = payload["id"]
|
|
703
|
+
@code = payload["code"]
|
|
704
|
+
@webview_size = payload["webview_size"]
|
|
705
|
+
end
|
|
706
|
+
def to_json(options = {})
|
|
707
|
+
{
|
|
708
|
+
"type": @type,
|
|
709
|
+
"title": @title,
|
|
710
|
+
"url": @url,
|
|
711
|
+
"phone": @phone,
|
|
712
|
+
"id": @id,
|
|
713
|
+
"code": @code,
|
|
714
|
+
"webview_size": @webview_size,
|
|
715
|
+
}.to_json(options)
|
|
716
|
+
end
|
|
717
|
+
end
|
|
718
|
+
|
|
719
|
+
class CarouselAction
|
|
720
|
+
# @param [type]: [CarouselActionType]
|
|
721
|
+
# @param [title]: [String]
|
|
722
|
+
# @param [url]: [String]
|
|
723
|
+
# @param [phone]: [String]
|
|
724
|
+
# @param [id]: [String]
|
|
725
|
+
attr_accessor :type, :title, :url, :phone, :id
|
|
726
|
+
def initialize(payload)
|
|
727
|
+
@type = payload["type"]
|
|
728
|
+
@title = payload["title"]
|
|
729
|
+
@url = payload["url"]
|
|
730
|
+
@phone = payload["phone"]
|
|
731
|
+
@id = payload["id"]
|
|
732
|
+
end
|
|
733
|
+
def to_json(options = {})
|
|
734
|
+
{
|
|
735
|
+
"type": @type,
|
|
736
|
+
"title": @title,
|
|
737
|
+
"url": @url,
|
|
738
|
+
"phone": @phone,
|
|
739
|
+
"id": @id,
|
|
740
|
+
}.to_json(options)
|
|
741
|
+
end
|
|
742
|
+
end
|
|
743
|
+
|
|
744
|
+
class CarouselCard
|
|
745
|
+
# @param [title]: [String]
|
|
746
|
+
# @param [body]: [String]
|
|
747
|
+
# @param [media]: [String]
|
|
748
|
+
# @param [actions]: [Array<ContentList.CarouselAction>]
|
|
749
|
+
attr_accessor :title, :body, :media, :actions
|
|
750
|
+
def initialize(payload)
|
|
751
|
+
@title = payload["title"]
|
|
752
|
+
@body = payload["body"]
|
|
753
|
+
@media = payload["media"]
|
|
754
|
+
@actions = payload["actions"]
|
|
755
|
+
end
|
|
756
|
+
def to_json(options = {})
|
|
757
|
+
{
|
|
758
|
+
"title": @title,
|
|
759
|
+
"body": @body,
|
|
760
|
+
"media": @media,
|
|
761
|
+
"actions": @actions,
|
|
762
|
+
}.to_json(options)
|
|
763
|
+
end
|
|
764
|
+
end
|
|
765
|
+
|
|
766
|
+
class CatalogItem
|
|
767
|
+
# @param [id]: [String]
|
|
768
|
+
# @param [section_title]: [String]
|
|
769
|
+
# @param [name]: [String]
|
|
770
|
+
# @param [media_url]: [String]
|
|
771
|
+
# @param [price]: [Float]
|
|
772
|
+
# @param [description]: [String]
|
|
773
|
+
attr_accessor :id, :section_title, :name, :media_url, :price, :description
|
|
774
|
+
def initialize(payload)
|
|
775
|
+
@id = payload["id"]
|
|
776
|
+
@section_title = payload["section_title"]
|
|
777
|
+
@name = payload["name"]
|
|
778
|
+
@media_url = payload["media_url"]
|
|
779
|
+
@price = payload["price"]
|
|
780
|
+
@description = payload["description"]
|
|
781
|
+
end
|
|
782
|
+
def to_json(options = {})
|
|
783
|
+
{
|
|
784
|
+
"id": @id,
|
|
785
|
+
"section_title": @section_title,
|
|
786
|
+
"name": @name,
|
|
787
|
+
"media_url": @media_url,
|
|
788
|
+
"price": @price,
|
|
789
|
+
"description": @description,
|
|
790
|
+
}.to_json(options)
|
|
791
|
+
end
|
|
792
|
+
end
|
|
793
|
+
|
|
794
|
+
class ContentCreateRequest
|
|
795
|
+
# @param [friendly_name]: [String] User defined name of the content
|
|
796
|
+
# @param [variables]: [Hash<String, String>] Key value pairs of variable name to value
|
|
797
|
+
# @param [language]: [String] Language code for the content
|
|
798
|
+
# @param [types]: [ContentList.Types]
|
|
799
|
+
attr_accessor :friendly_name, :variables, :language, :types
|
|
800
|
+
def initialize(payload)
|
|
801
|
+
@friendly_name = payload["friendly_name"]
|
|
802
|
+
@variables = payload["variables"]
|
|
803
|
+
@language = payload["language"]
|
|
804
|
+
@types = payload["types"]
|
|
805
|
+
end
|
|
806
|
+
def to_json(options = {})
|
|
807
|
+
{
|
|
808
|
+
"friendly_name": @friendly_name,
|
|
809
|
+
"variables": @variables,
|
|
810
|
+
"language": @language,
|
|
811
|
+
"types": @types,
|
|
812
|
+
}.to_json(options)
|
|
813
|
+
end
|
|
814
|
+
end
|
|
815
|
+
|
|
816
|
+
class ContentUpdateRequest
|
|
817
|
+
# @param [friendly_name]: [String] User defined name of the content
|
|
818
|
+
# @param [variables]: [Hash<String, String>] Key value pairs of variable name to value
|
|
819
|
+
# @param [language]: [String] Language code for the content
|
|
820
|
+
# @param [types]: [ContentList.Types]
|
|
821
|
+
attr_accessor :friendly_name, :variables, :language, :types
|
|
822
|
+
def initialize(payload)
|
|
823
|
+
@friendly_name = payload["friendly_name"]
|
|
824
|
+
@variables = payload["variables"]
|
|
825
|
+
@language = payload["language"]
|
|
826
|
+
@types = payload["types"]
|
|
827
|
+
end
|
|
828
|
+
def to_json(options = {})
|
|
829
|
+
{
|
|
830
|
+
"friendly_name": @friendly_name,
|
|
831
|
+
"variables": @variables,
|
|
832
|
+
"language": @language,
|
|
833
|
+
"types": @types,
|
|
834
|
+
}.to_json(options)
|
|
835
|
+
end
|
|
836
|
+
end
|
|
837
|
+
|
|
194
838
|
class FlowsPage
|
|
195
839
|
# @param [id]: [String]
|
|
196
840
|
# @param [next_page_id]: [String]
|
|
@@ -751,7 +1395,7 @@ module Twilio
|
|
|
751
1395
|
##
|
|
752
1396
|
# Initialize the ContentContext
|
|
753
1397
|
# @param [Version] version Version that contains the resource
|
|
754
|
-
# @param [String] sid The Twilio-provided string that uniquely identifies the Content resource to
|
|
1398
|
+
# @param [String] sid The Twilio-provided string that uniquely identifies the Content resource to update.
|
|
755
1399
|
# @return [ContentContext] ContentContext
|
|
756
1400
|
def initialize(version, sid)
|
|
757
1401
|
super(version)
|
|
@@ -795,6 +1439,27 @@ module Twilio
|
|
|
795
1439
|
)
|
|
796
1440
|
end
|
|
797
1441
|
|
|
1442
|
+
##
|
|
1443
|
+
# Update the ContentInstance
|
|
1444
|
+
# @param [ContentUpdateRequest] content_update_request
|
|
1445
|
+
# @return [ContentInstance] Updated ContentInstance
|
|
1446
|
+
def update(content_update_request: nil
|
|
1447
|
+
)
|
|
1448
|
+
|
|
1449
|
+
headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
|
|
1450
|
+
headers['Content-Type'] = 'application/json'
|
|
1451
|
+
|
|
1452
|
+
|
|
1453
|
+
|
|
1454
|
+
|
|
1455
|
+
payload = @version.update('PUT', @uri, headers: headers, data: content_update_request.to_json)
|
|
1456
|
+
ContentInstance.new(
|
|
1457
|
+
@version,
|
|
1458
|
+
payload,
|
|
1459
|
+
sid: @solution[:sid],
|
|
1460
|
+
)
|
|
1461
|
+
end
|
|
1462
|
+
|
|
798
1463
|
##
|
|
799
1464
|
# Access the approval_create
|
|
800
1465
|
# @return [ApprovalCreateList]
|
|
@@ -979,6 +1644,17 @@ module Twilio
|
|
|
979
1644
|
context.fetch
|
|
980
1645
|
end
|
|
981
1646
|
|
|
1647
|
+
##
|
|
1648
|
+
# Update the ContentInstance
|
|
1649
|
+
# @param [ContentUpdateRequest] content_update_request
|
|
1650
|
+
# @return [ContentInstance] Updated ContentInstance
|
|
1651
|
+
def update(content_update_request: nil
|
|
1652
|
+
)
|
|
1653
|
+
|
|
1654
|
+
context.update(
|
|
1655
|
+
)
|
|
1656
|
+
end
|
|
1657
|
+
|
|
982
1658
|
##
|
|
983
1659
|
# Access the approval_create
|
|
984
1660
|
# @return [approval_create] approval_create
|
|
@@ -0,0 +1,378 @@
|
|
|
1
|
+
##
|
|
2
|
+
# This code was generated by
|
|
3
|
+
# ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
|
4
|
+
# | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
|
5
|
+
# | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
|
6
|
+
#
|
|
7
|
+
# Twilio - Numbers
|
|
8
|
+
# This is the public Twilio REST API.
|
|
9
|
+
#
|
|
10
|
+
# NOTE: This class is auto generated by OpenAPI Generator.
|
|
11
|
+
# https://openapi-generator.tech
|
|
12
|
+
# Do not edit the class manually.
|
|
13
|
+
#
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
module Twilio
|
|
17
|
+
module REST
|
|
18
|
+
class Numbers < NumbersBase
|
|
19
|
+
class V2 < Version
|
|
20
|
+
class ApplicationList < ListResource
|
|
21
|
+
|
|
22
|
+
class CreateShortCodeApplicationRequest
|
|
23
|
+
# @param [friendly_name]: [String] The friendly name for the short code application.
|
|
24
|
+
# @param [iso_country]: [String] The ISO country code.
|
|
25
|
+
# @param [business_information]: [ApplicationList.CreateShortCodeApplicationRequestBusinessInformation]
|
|
26
|
+
# @param [setup]: [ApplicationList.CreateShortCodeApplicationRequestSetup]
|
|
27
|
+
attr_accessor :friendly_name, :iso_country, :business_information, :setup
|
|
28
|
+
def initialize(payload)
|
|
29
|
+
@friendly_name = payload["friendly_name"]
|
|
30
|
+
@iso_country = payload["iso_country"]
|
|
31
|
+
@business_information = payload["business_information"]
|
|
32
|
+
@setup = payload["setup"]
|
|
33
|
+
end
|
|
34
|
+
def to_json(options = {})
|
|
35
|
+
{
|
|
36
|
+
"friendly_name": @friendly_name,
|
|
37
|
+
"iso_country": @iso_country,
|
|
38
|
+
"business_information": @business_information,
|
|
39
|
+
"setup": @setup,
|
|
40
|
+
}.to_json(options)
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
class CreateShortCodeApplicationRequestBusinessInformation
|
|
45
|
+
# @param [customer_facing_profile]: [String] The Compliance Profile SID for the customer-facing business profile.
|
|
46
|
+
attr_accessor :customer_facing_profile
|
|
47
|
+
def initialize(payload)
|
|
48
|
+
@customer_facing_profile = payload["customer_facing_profile"]
|
|
49
|
+
end
|
|
50
|
+
def to_json(options = {})
|
|
51
|
+
{
|
|
52
|
+
"customer_facing_profile": @customer_facing_profile,
|
|
53
|
+
}.to_json(options)
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
class CreateShortCodeApplicationRequestSetup
|
|
58
|
+
# @param [charges_apply]: [Boolean]
|
|
59
|
+
attr_accessor :charges_apply
|
|
60
|
+
def initialize(payload)
|
|
61
|
+
@charges_apply = payload["charges_apply"]
|
|
62
|
+
end
|
|
63
|
+
def to_json(options = {})
|
|
64
|
+
{
|
|
65
|
+
"charges_apply": @charges_apply,
|
|
66
|
+
}.to_json(options)
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
##
|
|
72
|
+
# Initialize the ApplicationList
|
|
73
|
+
# @param [Version] version Version that contains the resource
|
|
74
|
+
# @return [ApplicationList] ApplicationList
|
|
75
|
+
def initialize(version)
|
|
76
|
+
super(version)
|
|
77
|
+
# Path Solution
|
|
78
|
+
@solution = { }
|
|
79
|
+
@uri = "/ShortCodes/Applications"
|
|
80
|
+
|
|
81
|
+
end
|
|
82
|
+
##
|
|
83
|
+
# Create the ApplicationInstance
|
|
84
|
+
# @param [CreateShortCodeApplicationRequest] create_short_code_application_request
|
|
85
|
+
# @return [ApplicationInstance] Created ApplicationInstance
|
|
86
|
+
def create(create_short_code_application_request: nil
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
|
|
90
|
+
headers['Content-Type'] = 'application/json'
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
payload = @version.create('POST', @uri, headers: headers, data: create_short_code_application_request.to_json)
|
|
96
|
+
ApplicationInstance.new(
|
|
97
|
+
@version,
|
|
98
|
+
payload,
|
|
99
|
+
)
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
##
|
|
104
|
+
# Lists ApplicationInstance records from the API as a list.
|
|
105
|
+
# Unlike stream(), this operation is eager and will load `limit` records into
|
|
106
|
+
# memory before returning.
|
|
107
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
|
108
|
+
# guarantees to never return more than limit. Default is no limit
|
|
109
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
|
110
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
|
111
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
|
112
|
+
# efficient page size, i.e. min(limit, 1000)
|
|
113
|
+
# @return [Array] Array of up to limit results
|
|
114
|
+
def list(limit: nil, page_size: nil)
|
|
115
|
+
self.stream(
|
|
116
|
+
limit: limit,
|
|
117
|
+
page_size: page_size
|
|
118
|
+
).entries
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
##
|
|
122
|
+
# Streams Instance records from the API as an Enumerable.
|
|
123
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
|
124
|
+
# is reached.
|
|
125
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
|
126
|
+
# guarantees to never return more than limit. Default is no limit
|
|
127
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
|
128
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
|
129
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
|
130
|
+
# efficient page size, i.e. min(limit, 1000)
|
|
131
|
+
# @return [Enumerable] Enumerable that will yield up to limit results
|
|
132
|
+
def stream(limit: nil, page_size: nil)
|
|
133
|
+
limits = @version.read_limits(limit, page_size)
|
|
134
|
+
|
|
135
|
+
page = self.page(
|
|
136
|
+
page_size: limits[:page_size], )
|
|
137
|
+
|
|
138
|
+
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
##
|
|
142
|
+
# When passed a block, yields ApplicationInstance records from the API.
|
|
143
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
|
144
|
+
# is reached.
|
|
145
|
+
def each
|
|
146
|
+
limits = @version.read_limits
|
|
147
|
+
|
|
148
|
+
page = self.page(page_size: limits[:page_size], )
|
|
149
|
+
|
|
150
|
+
@version.stream(page,
|
|
151
|
+
limit: limits[:limit],
|
|
152
|
+
page_limit: limits[:page_limit]).each {|x| yield x}
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
##
|
|
156
|
+
# Retrieve a single page of ApplicationInstance records from the API.
|
|
157
|
+
# Request is executed immediately.
|
|
158
|
+
# @param [String] page_token PageToken provided by the API
|
|
159
|
+
# @param [Integer] page_number Page Number, this value is simply for client state
|
|
160
|
+
# @param [Integer] page_size Number of records to return, defaults to 50
|
|
161
|
+
# @return [Page] Page of ApplicationInstance
|
|
162
|
+
def page(page_token: :unset, page_number: :unset, page_size: :unset)
|
|
163
|
+
params = Twilio::Values.of({
|
|
164
|
+
'PageToken' => page_token,
|
|
165
|
+
'Page' => page_number,
|
|
166
|
+
'PageSize' => page_size,
|
|
167
|
+
})
|
|
168
|
+
headers = Twilio::Values.of({})
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
response = @version.page('GET', @uri, params: params, headers: headers)
|
|
173
|
+
|
|
174
|
+
ApplicationPage.new(@version, response, @solution)
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
##
|
|
178
|
+
# Retrieve a single page of ApplicationInstance records from the API.
|
|
179
|
+
# Request is executed immediately.
|
|
180
|
+
# @param [String] target_url API-generated URL for the requested results page
|
|
181
|
+
# @return [Page] Page of ApplicationInstance
|
|
182
|
+
def get_page(target_url)
|
|
183
|
+
response = @version.domain.request(
|
|
184
|
+
'GET',
|
|
185
|
+
target_url
|
|
186
|
+
)
|
|
187
|
+
ApplicationPage.new(@version, response, @solution)
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
# Provide a user friendly representation
|
|
193
|
+
def to_s
|
|
194
|
+
'#<Twilio.Numbers.V2.ApplicationList>'
|
|
195
|
+
end
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
class ApplicationContext < InstanceContext
|
|
200
|
+
##
|
|
201
|
+
# Initialize the ApplicationContext
|
|
202
|
+
# @param [Version] version Version that contains the resource
|
|
203
|
+
# @param [String] sid The unique string that identifies the Short Code Application resource.
|
|
204
|
+
# @return [ApplicationContext] ApplicationContext
|
|
205
|
+
def initialize(version, sid)
|
|
206
|
+
super(version)
|
|
207
|
+
|
|
208
|
+
# Path Solution
|
|
209
|
+
@solution = { sid: sid, }
|
|
210
|
+
@uri = "/ShortCodes/Applications/#{@solution[:sid]}"
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
end
|
|
214
|
+
##
|
|
215
|
+
# Fetch the ApplicationInstance
|
|
216
|
+
# @return [ApplicationInstance] Fetched ApplicationInstance
|
|
217
|
+
def fetch
|
|
218
|
+
|
|
219
|
+
headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
payload = @version.fetch('GET', @uri, headers: headers)
|
|
226
|
+
ApplicationInstance.new(
|
|
227
|
+
@version,
|
|
228
|
+
payload,
|
|
229
|
+
sid: @solution[:sid],
|
|
230
|
+
)
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
##
|
|
235
|
+
# Provide a user friendly representation
|
|
236
|
+
def to_s
|
|
237
|
+
context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
|
|
238
|
+
"#<Twilio.Numbers.V2.ApplicationContext #{context}>"
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
##
|
|
242
|
+
# Provide a detailed, user friendly representation
|
|
243
|
+
def inspect
|
|
244
|
+
context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
|
|
245
|
+
"#<Twilio.Numbers.V2.ApplicationContext #{context}>"
|
|
246
|
+
end
|
|
247
|
+
end
|
|
248
|
+
|
|
249
|
+
class ApplicationPage < Page
|
|
250
|
+
##
|
|
251
|
+
# Initialize the ApplicationPage
|
|
252
|
+
# @param [Version] version Version that contains the resource
|
|
253
|
+
# @param [Response] response Response from the API
|
|
254
|
+
# @param [Hash] solution Path solution for the resource
|
|
255
|
+
# @return [ApplicationPage] ApplicationPage
|
|
256
|
+
def initialize(version, response, solution)
|
|
257
|
+
super(version, response)
|
|
258
|
+
|
|
259
|
+
# Path Solution
|
|
260
|
+
@solution = solution
|
|
261
|
+
end
|
|
262
|
+
|
|
263
|
+
##
|
|
264
|
+
# Build an instance of ApplicationInstance
|
|
265
|
+
# @param [Hash] payload Payload response from the API
|
|
266
|
+
# @return [ApplicationInstance] ApplicationInstance
|
|
267
|
+
def get_instance(payload)
|
|
268
|
+
ApplicationInstance.new(@version, payload)
|
|
269
|
+
end
|
|
270
|
+
|
|
271
|
+
##
|
|
272
|
+
# Provide a user friendly representation
|
|
273
|
+
def to_s
|
|
274
|
+
'<Twilio.Numbers.V2.ApplicationPage>'
|
|
275
|
+
end
|
|
276
|
+
end
|
|
277
|
+
class ApplicationInstance < InstanceResource
|
|
278
|
+
##
|
|
279
|
+
# Initialize the ApplicationInstance
|
|
280
|
+
# @param [Version] version Version that contains the resource
|
|
281
|
+
# @param [Hash] payload payload that contains response from Twilio
|
|
282
|
+
# @param [String] account_sid The SID of the
|
|
283
|
+
# {Account}[https://www.twilio.com/docs/iam/api/account] that created this Application
|
|
284
|
+
# resource.
|
|
285
|
+
# @param [String] sid The SID of the Call resource to fetch.
|
|
286
|
+
# @return [ApplicationInstance] ApplicationInstance
|
|
287
|
+
def initialize(version, payload , sid: nil)
|
|
288
|
+
super(version)
|
|
289
|
+
|
|
290
|
+
# Marshaled Properties
|
|
291
|
+
@properties = {
|
|
292
|
+
'sid' => payload['sid'],
|
|
293
|
+
'bundle_sid' => payload['bundle_sid'],
|
|
294
|
+
'application_requirements_sid' => payload['application_requirements_sid'],
|
|
295
|
+
'friendly_name' => payload['friendly_name'],
|
|
296
|
+
'iso_country' => payload['iso_country'],
|
|
297
|
+
'state' => payload['state'],
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
# Context
|
|
301
|
+
@instance_context = nil
|
|
302
|
+
@params = { 'sid' => sid || @properties['sid'] , }
|
|
303
|
+
end
|
|
304
|
+
|
|
305
|
+
##
|
|
306
|
+
# Generate an instance context for the instance, the context is capable of
|
|
307
|
+
# performing various actions. All instance actions are proxied to the context
|
|
308
|
+
# @return [ApplicationContext] CallContext for this CallInstance
|
|
309
|
+
def context
|
|
310
|
+
unless @instance_context
|
|
311
|
+
@instance_context = ApplicationContext.new(@version , @params['sid'])
|
|
312
|
+
end
|
|
313
|
+
@instance_context
|
|
314
|
+
end
|
|
315
|
+
|
|
316
|
+
##
|
|
317
|
+
# @return [String] The unique identifier of the Short Code Application.
|
|
318
|
+
def sid
|
|
319
|
+
@properties['sid']
|
|
320
|
+
end
|
|
321
|
+
|
|
322
|
+
##
|
|
323
|
+
# @return [String] The Bundle SID for regulatory compliance.
|
|
324
|
+
def bundle_sid
|
|
325
|
+
@properties['bundle_sid']
|
|
326
|
+
end
|
|
327
|
+
|
|
328
|
+
##
|
|
329
|
+
# @return [String] The Application Requirements SID.
|
|
330
|
+
def application_requirements_sid
|
|
331
|
+
@properties['application_requirements_sid']
|
|
332
|
+
end
|
|
333
|
+
|
|
334
|
+
##
|
|
335
|
+
# @return [String] The friendly name of the application.
|
|
336
|
+
def friendly_name
|
|
337
|
+
@properties['friendly_name']
|
|
338
|
+
end
|
|
339
|
+
|
|
340
|
+
##
|
|
341
|
+
# @return [String] The ISO country code.
|
|
342
|
+
def iso_country
|
|
343
|
+
@properties['iso_country']
|
|
344
|
+
end
|
|
345
|
+
|
|
346
|
+
##
|
|
347
|
+
# @return [String] The state of the application.
|
|
348
|
+
def state
|
|
349
|
+
@properties['state']
|
|
350
|
+
end
|
|
351
|
+
|
|
352
|
+
##
|
|
353
|
+
# Fetch the ApplicationInstance
|
|
354
|
+
# @return [ApplicationInstance] Fetched ApplicationInstance
|
|
355
|
+
def fetch
|
|
356
|
+
|
|
357
|
+
context.fetch
|
|
358
|
+
end
|
|
359
|
+
|
|
360
|
+
##
|
|
361
|
+
# Provide a user friendly representation
|
|
362
|
+
def to_s
|
|
363
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
|
364
|
+
"<Twilio.Numbers.V2.ApplicationInstance #{values}>"
|
|
365
|
+
end
|
|
366
|
+
|
|
367
|
+
##
|
|
368
|
+
# Provide a detailed, user friendly representation
|
|
369
|
+
def inspect
|
|
370
|
+
values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
|
|
371
|
+
"<Twilio.Numbers.V2.ApplicationInstance #{values}>"
|
|
372
|
+
end
|
|
373
|
+
end
|
|
374
|
+
|
|
375
|
+
end
|
|
376
|
+
end
|
|
377
|
+
end
|
|
378
|
+
end
|
|
@@ -21,6 +21,7 @@ module Twilio
|
|
|
21
21
|
def initialize(domain)
|
|
22
22
|
super
|
|
23
23
|
@version = 'v2'
|
|
24
|
+
@applications = nil
|
|
24
25
|
@authorization_documents = nil
|
|
25
26
|
@bulk_hosted_number_orders = nil
|
|
26
27
|
@bundle_clone = nil
|
|
@@ -28,6 +29,20 @@ module Twilio
|
|
|
28
29
|
@regulatory_compliance = nil
|
|
29
30
|
end
|
|
30
31
|
|
|
32
|
+
##
|
|
33
|
+
# @param [String] sid The unique string that identifies the Short Code Application resource.
|
|
34
|
+
# @return [Twilio::REST::Numbers::V2::ApplicationContext] if sid was passed.
|
|
35
|
+
# @return [Twilio::REST::Numbers::V2::ApplicationList]
|
|
36
|
+
def applications(sid=:unset)
|
|
37
|
+
if sid.nil?
|
|
38
|
+
raise ArgumentError, 'sid cannot be nil'
|
|
39
|
+
end
|
|
40
|
+
if sid == :unset
|
|
41
|
+
@applications ||= ApplicationList.new self
|
|
42
|
+
else
|
|
43
|
+
ApplicationContext.new(self, sid)
|
|
44
|
+
end
|
|
45
|
+
end
|
|
31
46
|
##
|
|
32
47
|
# @param [String] sid A 34 character string that uniquely identifies this AuthorizationDocument.
|
|
33
48
|
# @return [Twilio::REST::Numbers::V2::AuthorizationDocumentContext] if sid was passed.
|
data/lib/twilio-ruby/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: twilio-ruby
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 7.8.
|
|
4
|
+
version: 7.8.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Twilio API Team
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2025-11-
|
|
11
|
+
date: 2025-11-20 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: jwt
|
|
@@ -635,6 +635,7 @@ files:
|
|
|
635
635
|
- lib/twilio-ruby/rest/numbers/v1/signing_request_configuration.rb
|
|
636
636
|
- lib/twilio-ruby/rest/numbers/v1/webhook.rb
|
|
637
637
|
- lib/twilio-ruby/rest/numbers/v2.rb
|
|
638
|
+
- lib/twilio-ruby/rest/numbers/v2/application.rb
|
|
638
639
|
- lib/twilio-ruby/rest/numbers/v2/authorization_document.rb
|
|
639
640
|
- lib/twilio-ruby/rest/numbers/v2/authorization_document/dependent_hosted_number_order.rb
|
|
640
641
|
- lib/twilio-ruby/rest/numbers/v2/bulk_hosted_number_order.rb
|