twilio-ruby 5.0.0.rc24 → 5.0.0.rc25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +32 -12
  3. data/LICENSE.md +12 -12
  4. data/README.md +28 -29
  5. data/examples/examples.rb +47 -58
  6. data/examples/print-call-log.rb +6 -6
  7. data/lib/twilio-ruby/jwt/jwt.rb +2 -2
  8. data/lib/twilio-ruby/rest/accounts/v1.rb +3 -1
  9. data/lib/twilio-ruby/rest/accounts/v1/credential.rb +4 -1
  10. data/lib/twilio-ruby/rest/api/v2010.rb +3 -1
  11. data/lib/twilio-ruby/rest/api/v2010/account.rb +80 -23
  12. data/lib/twilio-ruby/rest/api/v2010/account/address.rb +2 -1
  13. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb +6 -3
  14. data/lib/twilio-ruby/rest/api/v2010/account/call.rb +14 -4
  15. data/lib/twilio-ruby/rest/api/v2010/account/call/recording.rb +10 -0
  16. data/lib/twilio-ruby/rest/api/v2010/account/conference.rb +4 -1
  17. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number.rb +10 -4
  18. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb +4 -1
  19. data/lib/twilio-ruby/rest/api/v2010/account/message.rb +6 -2
  20. data/lib/twilio-ruby/rest/api/v2010/account/queue.rb +4 -1
  21. data/lib/twilio-ruby/rest/api/v2010/account/recording.rb +18 -2
  22. data/lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result.rb +4 -1
  23. data/lib/twilio-ruby/rest/api/v2010/account/sip.rb +14 -4
  24. data/lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb +4 -1
  25. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb +8 -2
  26. data/lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb +4 -1
  27. data/lib/twilio-ruby/rest/api/v2010/account/usage.rb +6 -2
  28. data/lib/twilio-ruby/rest/api/v2010/account/usage/record.rb +16 -8
  29. data/lib/twilio-ruby/rest/chat/v1.rb +6 -2
  30. data/lib/twilio-ruby/rest/chat/v1/service.rb +12 -3
  31. data/lib/twilio-ruby/rest/chat/v1/service/channel.rb +12 -3
  32. data/lib/twilio-ruby/rest/chat/v1/service/user.rb +2 -1
  33. data/lib/twilio-ruby/rest/chat/v2.rb +6 -2
  34. data/lib/twilio-ruby/rest/chat/v2/service.rb +12 -3
  35. data/lib/twilio-ruby/rest/chat/v2/service/channel.rb +12 -3
  36. data/lib/twilio-ruby/rest/chat/v2/service/user.rb +2 -1
  37. data/lib/twilio-ruby/rest/fax/v1.rb +3 -1
  38. data/lib/twilio-ruby/rest/fax/v1/fax.rb +4 -1
  39. data/lib/twilio-ruby/rest/ip_messaging/v1.rb +6 -2
  40. data/lib/twilio-ruby/rest/ip_messaging/v1/service.rb +12 -3
  41. data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb +12 -3
  42. data/lib/twilio-ruby/rest/ip_messaging/v1/service/user.rb +2 -1
  43. data/lib/twilio-ruby/rest/ip_messaging/v2.rb +6 -2
  44. data/lib/twilio-ruby/rest/ip_messaging/v2/service.rb +12 -3
  45. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb +12 -3
  46. data/lib/twilio-ruby/rest/ip_messaging/v2/service/user.rb +2 -1
  47. data/lib/twilio-ruby/rest/lookups/v1.rb +3 -1
  48. data/lib/twilio-ruby/rest/messaging/v1.rb +3 -1
  49. data/lib/twilio-ruby/rest/messaging/v1/service.rb +26 -6
  50. data/lib/twilio-ruby/rest/monitor/v1.rb +6 -2
  51. data/lib/twilio-ruby/rest/notify/v1.rb +6 -2
  52. data/lib/twilio-ruby/rest/notify/v1/service.rb +12 -4
  53. data/lib/twilio-ruby/rest/notify/v1/service/notification.rb +3 -1
  54. data/lib/twilio-ruby/rest/notify/v1/service/user.rb +8 -2
  55. data/lib/twilio-ruby/rest/preview/bulk_exports.rb +6 -2
  56. data/lib/twilio-ruby/rest/preview/bulk_exports/export.rb +2 -1
  57. data/lib/twilio-ruby/rest/preview/hosted_numbers.rb +3 -1
  58. data/lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb +18 -12
  59. data/lib/twilio-ruby/rest/preview/marketplace.rb +6 -2
  60. data/lib/twilio-ruby/rest/preview/marketplace/available_add_on.rb +4 -1
  61. data/lib/twilio-ruby/rest/preview/marketplace/installed_add_on.rb +4 -1
  62. data/lib/twilio-ruby/rest/preview/proxy.rb +3 -1
  63. data/lib/twilio-ruby/rest/preview/proxy/service.rb +12 -3
  64. data/lib/twilio-ruby/rest/preview/proxy/service/session.rb +8 -2
  65. data/lib/twilio-ruby/rest/preview/proxy/service/session/participant.rb +4 -1
  66. data/lib/twilio-ruby/rest/preview/sync.rb +3 -1
  67. data/lib/twilio-ruby/rest/preview/sync/service.rb +12 -3
  68. data/lib/twilio-ruby/rest/preview/sync/service/document.rb +4 -1
  69. data/lib/twilio-ruby/rest/preview/sync/service/sync_list.rb +8 -2
  70. data/lib/twilio-ruby/rest/preview/sync/service/sync_map.rb +8 -2
  71. data/lib/twilio-ruby/rest/preview/wireless.rb +9 -3
  72. data/lib/twilio-ruby/rest/preview/wireless/sim.rb +2 -1
  73. data/lib/twilio-ruby/rest/pricing/v1.rb +9 -3
  74. data/lib/twilio-ruby/rest/pricing/v1/messaging.rb +4 -1
  75. data/lib/twilio-ruby/rest/pricing/v1/phone_number.rb +4 -1
  76. data/lib/twilio-ruby/rest/pricing/v1/voice.rb +8 -2
  77. data/lib/twilio-ruby/rest/sync/v1.rb +3 -1
  78. data/lib/twilio-ruby/rest/sync/v1/service.rb +12 -3
  79. data/lib/twilio-ruby/rest/sync/v1/service/document.rb +4 -1
  80. data/lib/twilio-ruby/rest/sync/v1/service/sync_list.rb +8 -2
  81. data/lib/twilio-ruby/rest/sync/v1/service/sync_map.rb +8 -2
  82. data/lib/twilio-ruby/rest/taskrouter/v1.rb +3 -1
  83. data/lib/twilio-ruby/rest/taskrouter/v1/workspace.rb +30 -8
  84. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb +4 -1
  85. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb +4 -2
  86. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker.rb +12 -4
  87. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb +2 -1
  88. data/lib/twilio-ruby/rest/trunking/v1.rb +3 -1
  89. data/lib/twilio-ruby/rest/trunking/v1/trunk.rb +16 -4
  90. data/lib/twilio-ruby/rest/video/v1.rb +6 -2
  91. data/lib/twilio-ruby/rest/video/v1/recording.rb +17 -3
  92. data/lib/twilio-ruby/rest/video/v1/room.rb +4 -1
  93. data/lib/twilio-ruby/rest/video/v1/room/recording.rb +31 -3
  94. data/lib/twilio-ruby/rest/wireless/v1.rb +9 -3
  95. data/lib/twilio-ruby/rest/wireless/v1/rate_plan.rb +16 -1
  96. data/lib/twilio-ruby/rest/wireless/v1/sim.rb +2 -1
  97. data/lib/twilio-ruby/twiml/messaging_response.rb +8 -2
  98. data/lib/twilio-ruby/twiml/twiml.rb +3 -5
  99. data/lib/twilio-ruby/twiml/voice_response.rb +60 -42
  100. data/lib/twilio-ruby/version.rb +1 -1
  101. data/spec/integration/api/v2010/account/call/recording_spec.rb +14 -2
  102. data/spec/integration/api/v2010/account/recording_spec.rb +14 -2
  103. data/spec/integration/messaging/v1/service/phone_number_spec.rb +28 -0
  104. data/spec/integration/messaging/v1/service_spec.rb +4 -0
  105. data/spec/integration/notify/v1/service/notification_spec.rb +35 -0
  106. data/spec/integration/video/v1/recording_spec.rb +45 -0
  107. data/spec/integration/video/v1/room/recording_spec.rb +4 -3
  108. data/spec/integration/wireless/v1/rate_plan_spec.rb +8 -0
  109. data/spec/twiml/messaging_response_spec.rb +28 -0
  110. data/spec/twiml/voice_response_spec.rb +9 -0
  111. metadata +2 -2
@@ -10,6 +10,8 @@ module Twilio
10
10
  attr_accessor :name
11
11
  attr_accessor :indent
12
12
 
13
+ alias_method :to_xml, :to_s
14
+
13
15
  def initialize(indent: false, **keyword_args)
14
16
  @name = self.class.name.split('::').last
15
17
  @indent = indent
@@ -30,11 +32,7 @@ module Twilio
30
32
  result[0].downcase + result[1..result.length]
31
33
  end
32
34
 
33
- def to_s()
34
- self.to_xml_str
35
- end
36
-
37
- def to_xml_str(xml_declaration = true)
35
+ def to_s(xml_declaration = true)
38
36
  xml = self.xml.to_s(:indent => self.indent)
39
37
 
40
38
  return ('<?xml version="1.0" encoding="UTF-8"?>' + xml) if xml_declaration
@@ -7,6 +7,7 @@ module Twilio
7
7
  def initialize()
8
8
  super()
9
9
  self.name = 'Response'
10
+ yield(self) if block_given?
10
11
  end
11
12
 
12
13
  # Create a <Dial> element
@@ -28,33 +29,37 @@ module Twilio
28
29
  # == Returns:
29
30
  # A <Response> element with a <Dial> child element
30
31
  def dial(
31
- number,
32
- action: nil,
33
- method: nil,
34
- timeout: nil,
35
- hangup_on_star: nil,
36
- time_limit: nil,
37
- caller_id: nil,
38
- record: nil,
39
- trim: nil,
40
- recording_status_callback: nil,
41
- recording_status_callback_method: nil,
42
- **keyword_args)
43
-
44
- self.append(Dial.new(
45
- number: number,
46
- action: action,
47
- method: method,
48
- timeout: timeout,
49
- hangup_on_star: hangup_on_star,
50
- time_limit: time_limit,
51
- caller_id: caller_id,
52
- record: record,
53
- trim: trim,
54
- recording_status_callback: recording_status_callback,
55
- recording_status_callback_method: recording_status_callback_method,
56
- **keyword_args
57
- ))
32
+ number,
33
+ action: nil,
34
+ method: nil,
35
+ timeout: nil,
36
+ hangup_on_star: nil,
37
+ time_limit: nil,
38
+ caller_id: nil,
39
+ record: nil,
40
+ trim: nil,
41
+ recording_status_callback: nil,
42
+ recording_status_callback_method: nil,
43
+ **keyword_args)
44
+
45
+ dial = Dial.new(
46
+ number: number,
47
+ action: action,
48
+ method: method,
49
+ timeout: timeout,
50
+ hangup_on_star: hangup_on_star,
51
+ time_limit: time_limit,
52
+ caller_id: caller_id,
53
+ record: record,
54
+ trim: trim,
55
+ recording_status_callback: recording_status_callback,
56
+ recording_status_callback_method: recording_status_callback_method,
57
+ **keyword_args
58
+ )
59
+
60
+ yield(dial) if block_given?
61
+
62
+ self.append(dial)
58
63
  end
59
64
 
60
65
  # Create an <Echo> element
@@ -90,7 +95,7 @@ module Twilio
90
95
  workflow_sid: nil,
91
96
  **keyword_args)
92
97
 
93
- self.append(Enqueue.new(
98
+ enqueue = Enqueue.new(
94
99
  name,
95
100
  action: action,
96
101
  method: method,
@@ -98,7 +103,11 @@ module Twilio
98
103
  wait_url_method: wait_url_method,
99
104
  workflow_sid: workflow_sid,
100
105
  **keyword_args
101
- ))
106
+ )
107
+
108
+ yield(enqueue) if block_given?
109
+
110
+ self.append(enqueue)
102
111
  end
103
112
 
104
113
  # Create a <Gather> element
@@ -133,7 +142,7 @@ module Twilio
133
142
  acknowledge_sound_url: nil,
134
143
  **keyword_args)
135
144
 
136
- self.append(Gather.new(
145
+ gather = Gather.new(
137
146
  action: action,
138
147
  method: method,
139
148
  timeout: timeout,
@@ -146,7 +155,11 @@ module Twilio
146
155
  barge_in: barge_in,
147
156
  acknowledge_sound_url: acknowledge_sound_url,
148
157
  **keyword_args
149
- ))
158
+ )
159
+
160
+ yield(gather) if block_given?
161
+
162
+ self.append(gather)
150
163
  end
151
164
 
152
165
  # Create a <Hangup> element
@@ -187,7 +200,12 @@ module Twilio
187
200
  # == Returns:
188
201
  # A <Response> element with a <Play> child element
189
202
  def play(url: nil, loop: nil, digits: nil, **keyword_args)
190
- append(Play.new(url: url, loop: loop, digits: digits, **keyword_args))
203
+ self.append(Play.new(
204
+ url: url,
205
+ loop: loop,
206
+ digits: digits,
207
+ **keyword_args
208
+ ))
191
209
  end
192
210
 
193
211
  # Create a <Record> element
@@ -221,7 +239,6 @@ module Twilio
221
239
  transcribe: nil,
222
240
  transcribe_callback: nil,
223
241
  **keyword_args)
224
-
225
242
  self.append(Record.new(
226
243
  action: action,
227
244
  method: method,
@@ -305,7 +322,6 @@ module Twilio
305
322
  action: nil,
306
323
  status_callback: nil,
307
324
  **keyword_args)
308
-
309
325
  self.append(Sms.new(
310
326
  body,
311
327
  to: to,
@@ -333,6 +349,7 @@ module Twilio
333
349
  if !(number.nil?)
334
350
  @value = number
335
351
  end
352
+ yield(self) if block_given?
336
353
  end
337
354
 
338
355
  # Create a <Client> element
@@ -356,7 +373,6 @@ module Twilio
356
373
  status_callback_method: nil,
357
374
  status_callback: nil,
358
375
  **keyword_args)
359
-
360
376
  self.append(Client.new(
361
377
  name,
362
378
  method: method,
@@ -409,7 +425,6 @@ module Twilio
409
425
  recording_status_callback: nil,
410
426
  recording_status_callback_method: nil,
411
427
  **keyword_args)
412
-
413
428
  self.append(Conference.new(
414
429
  name,
415
430
  muted: muted,
@@ -454,7 +469,6 @@ module Twilio
454
469
  status_callback_event: nil,
455
470
  status_callback_method: nil,
456
471
  **keyword_args)
457
-
458
472
  self.append(Number.new(
459
473
  number,
460
474
  send_digits: send_digits,
@@ -486,7 +500,6 @@ module Twilio
486
500
  reservation_sid: nil,
487
501
  post_work_activity_sid: nil,
488
502
  **keyword_args)
489
-
490
503
  self.append(Queue.new(
491
504
  queue_name,
492
505
  url: url,
@@ -506,7 +519,7 @@ module Twilio
506
519
  # == Returns:
507
520
  # A <Dial> element with a <Sim> child element
508
521
  def sim(sid, **keyword_args)
509
- self.append(Sim.new(sid,**keyword_args))
522
+ self.append(Sim.new(sid, **keyword_args))
510
523
  end
511
524
 
512
525
  # Create a <Sip> element
@@ -534,7 +547,6 @@ module Twilio
534
547
  status_callback_event: nil,
535
548
  status_callback_method: nil,
536
549
  **keyword_args)
537
-
538
550
  self.append(Sip.new(
539
551
  uri,
540
552
  username: username,
@@ -671,6 +683,7 @@ module Twilio
671
683
  def initialize(name, **keyword_args)
672
684
  super(**keyword_args)
673
685
  @value = name
686
+ yield(self) if block_given?
674
687
  end
675
688
 
676
689
  # Create a <Task> element
@@ -717,6 +730,7 @@ module Twilio
717
730
  # A <Gather> element
718
731
  def initialize(**keyword_args)
719
732
  super(**keyword_args)
733
+ yield(self) if block_given?
720
734
  end
721
735
 
722
736
  # Create a <Say> element
@@ -737,7 +751,6 @@ module Twilio
737
751
  language: nil,
738
752
  voice: nil,
739
753
  **keyword_args)
740
-
741
754
  self.append(Say.new(
742
755
  body,
743
756
  loop: loop,
@@ -758,7 +771,12 @@ module Twilio
758
771
  # == Returns:
759
772
  # A <Gather> element with a <Play> child element
760
773
  def play(url: nil, loop: nil, digits: nil, **keyword_args)
761
- append(Play.new(url: url, loop: loop, digits: digits, **keyword_args))
774
+ self.append(Play.new(
775
+ url: url,
776
+ loop: loop,
777
+ digits: digits,
778
+ **keyword_args
779
+ ))
762
780
  end
763
781
 
764
782
  # Create a <Pause> element
@@ -1,3 +1,3 @@
1
1
  module Twilio
2
- VERSION = '5.0.0.rc24'
2
+ VERSION = '5.0.0.rc25'
3
3
  end
@@ -37,7 +37,13 @@ describe 'Recording' do
37
37
  "duration": "6",
38
38
  "price": null,
39
39
  "sid": "REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
40
- "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json"
40
+ "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",
41
+ "encryption_type": "public-key",
42
+ "encryption_details": {
43
+ "encryption_public_key_sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
44
+ "encryption_cek": "OV4h6zrsxMIW7h0Zfqwfn6TI2GCNl54KALlg8wn8YB8KYZhXt6HlgvBWAmQTlfYVeLWydMiCewY0YkDDT1xmNe5huEo9vjuKBS5OmYK4CZkSx1NVv3XOGrZHpd2Pl/5WJHVhUK//AUO87uh5qnUP2E0KoLh1nyCLeGcEkXU0RfpPn/6nxjof/n6m6OzZOyeIRK4Oed5+rEtjqFDfqT0EVKjs6JAxv+f0DCc1xYRHl2yV8bahUPVKs+bHYdy4PVszFKa76M/Uae4jFA9Lv233JqWcxj+K2UoghuGhAFbV/JQIIswY2CBYI8JlVSifSqNEl9vvsTJ8bkVMm3MKbG2P7Q==",
45
+ "encryption_iv": "8I2hhNIYNTrwxfHk"
46
+ }
41
47
  }
42
48
  ]
43
49
  ))
@@ -119,7 +125,13 @@ describe 'Recording' do
119
125
  "duration": "6",
120
126
  "price": null,
121
127
  "sid": "REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
122
- "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json"
128
+ "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",
129
+ "encryption_type": "public-key",
130
+ "encryption_details": {
131
+ "encryption_public_key_sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
132
+ "encryption_cek": "OV4h6zrsxMIW7h0Zfqwfn6TI2GCNl54KALlg8wn8YB8KYZhXt6HlgvBWAmQTlfYVeLWydMiCewY0YkDDT1xmNe5huEo9vjuKBS5OmYK4CZkSx1NVv3XOGrZHpd2Pl/5WJHVhUK//AUO87uh5qnUP2E0KoLh1nyCLeGcEkXU0RfpPn/6nxjof/n6m6OzZOyeIRK4Oed5+rEtjqFDfqT0EVKjs6JAxv+f0DCc1xYRHl2yV8bahUPVKs+bHYdy4PVszFKa76M/Uae4jFA9Lv233JqWcxj+K2UoghuGhAFbV/JQIIswY2CBYI8JlVSifSqNEl9vvsTJ8bkVMm3MKbG2P7Q==",
133
+ "encryption_iv": "8I2hhNIYNTrwxfHk"
134
+ }
123
135
  }
124
136
  ],
125
137
  "start": 0,
@@ -40,7 +40,13 @@ describe 'Recording' do
40
40
  "status": "completed",
41
41
  "channels": 1,
42
42
  "source": "Trunking",
43
- "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json"
43
+ "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",
44
+ "encryption_type": "public-key",
45
+ "encryption_details": {
46
+ "encryption_public_key_sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
47
+ "encryption_cek": "OV4h6zrsxMIW7h0Zfqwfn6TI2GCNl54KALlg8wn8YB8KYZhXt6HlgvBWAmQTlfYVeLWydMiCewY0YkDDT1xmNe5huEo9vjuKBS5OmYK4CZkSx1NVv3XOGrZHpd2Pl/5WJHVhUK//AUO87uh5qnUP2E0KoLh1nyCLeGcEkXU0RfpPn/6nxjof/n6m6OzZOyeIRK4Oed5+rEtjqFDfqT0EVKjs6JAxv+f0DCc1xYRHl2yV8bahUPVKs+bHYdy4PVszFKa76M/Uae4jFA9Lv233JqWcxj+K2UoghuGhAFbV/JQIIswY2CBYI8JlVSifSqNEl9vvsTJ8bkVMm3MKbG2P7Q==",
48
+ "encryption_iv": "8I2hhNIYNTrwxfHk"
49
+ }
44
50
  }
45
51
  ]
46
52
  ))
@@ -122,7 +128,13 @@ describe 'Recording' do
122
128
  "status": "completed",
123
129
  "channels": 1,
124
130
  "source": "Trunking",
125
- "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json"
131
+ "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",
132
+ "encryption_type": "public-key",
133
+ "encryption_details": {
134
+ "encryption_public_key_sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
135
+ "encryption_cek": "OV4h6zrsxMIW7h0Zfqwfn6TI2GCNl54KALlg8wn8YB8KYZhXt6HlgvBWAmQTlfYVeLWydMiCewY0YkDDT1xmNe5huEo9vjuKBS5OmYK4CZkSx1NVv3XOGrZHpd2Pl/5WJHVhUK//AUO87uh5qnUP2E0KoLh1nyCLeGcEkXU0RfpPn/6nxjof/n6m6OzZOyeIRK4Oed5+rEtjqFDfqT0EVKjs6JAxv+f0DCc1xYRHl2yV8bahUPVKs+bHYdy4PVszFKa76M/Uae4jFA9Lv233JqWcxj+K2UoghuGhAFbV/JQIIswY2CBYI8JlVSifSqNEl9vvsTJ8bkVMm3MKbG2P7Q==",
136
+ "encryption_iv": "8I2hhNIYNTrwxfHk"
137
+ }
126
138
  }
127
139
  ],
128
140
  "start": 0,
@@ -50,6 +50,34 @@ describe 'PhoneNumber' do
50
50
  expect(actual).to_not eq(nil)
51
51
  end
52
52
 
53
+ it "receives create_with_capabilities responses" do
54
+ @holodeck.mock(Twilio::TwilioResponse.new(
55
+ 201,
56
+ %q[
57
+ {
58
+ "sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
59
+ "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
60
+ "service_sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
61
+ "date_created": "2015-07-30T20:12:31Z",
62
+ "date_updated": "2015-07-30T20:12:33Z",
63
+ "phone_number": "+987654321",
64
+ "country_code": "US",
65
+ "capabilities": [
66
+ "MMS",
67
+ "SMS",
68
+ "Voice"
69
+ ],
70
+ "url": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
71
+ }
72
+ ]
73
+ ))
74
+
75
+ actual = @client.messaging.v1.services("MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
76
+ .phone_numbers.create(phone_number_sid: "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
77
+
78
+ expect(actual).to_not eq(nil)
79
+ end
80
+
53
81
  it "can delete" do
54
82
  @holodeck.mock(Twilio::TwilioResponse.new(500, ''))
55
83
 
@@ -47,6 +47,7 @@ describe 'Service' do
47
47
  "scan_message_content": "inherit",
48
48
  "area_code_geomatch": true,
49
49
  "validity_period": 600,
50
+ "synchronous_validation": true,
50
51
  "links": {
51
52
  "phone_numbers": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers",
52
53
  "short_codes": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ShortCodes",
@@ -92,6 +93,7 @@ describe 'Service' do
92
93
  "smart_encoding": false,
93
94
  "fallback_to_long_code": true,
94
95
  "scan_message_content": "inherit",
96
+ "synchronous_validation": true,
95
97
  "area_code_geomatch": true,
96
98
  "validity_period": 600,
97
99
  "inbound_request_url": "https://www.example.com",
@@ -157,6 +159,7 @@ describe 'Service' do
157
159
  "area_code_geomatch": true,
158
160
  "validity_period": 600,
159
161
  "scan_message_content": "inherit",
162
+ "synchronous_validation": true,
160
163
  "inbound_request_url": "https://www.example.com/",
161
164
  "inbound_method": "POST",
162
165
  "fallback_url": null,
@@ -216,6 +219,7 @@ describe 'Service' do
216
219
  "area_code_geomatch": true,
217
220
  "validity_period": 600,
218
221
  "scan_message_content": "inherit",
222
+ "synchronous_validation": true,
219
223
  "links": {
220
224
  "phone_numbers": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers",
221
225
  "short_codes": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ShortCodes",
@@ -59,4 +59,39 @@ describe 'Notification' do
59
59
 
60
60
  expect(actual).to_not eq(nil)
61
61
  end
62
+
63
+ it "receives create_direct_notification responses" do
64
+ @holodeck.mock(Twilio::TwilioResponse.new(
65
+ 201,
66
+ %q[
67
+ {
68
+ "sid": "NOb8021351170b4e1286adaac3fdd6d082",
69
+ "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
70
+ "service_sid": "IS699b53e02da45a1ba9d13b7d7d2766af",
71
+ "date_created": "2016-03-24T23:42:28Z",
72
+ "identities": [],
73
+ "tags": [],
74
+ "segments": [],
75
+ "priority": "high",
76
+ "ttl": 2419200,
77
+ "title": null,
78
+ "body": "body",
79
+ "sound": null,
80
+ "action": null,
81
+ "data": null,
82
+ "apn": null,
83
+ "fcm": null,
84
+ "gcm": null,
85
+ "sms": null,
86
+ "facebook_messenger": null,
87
+ "alexa": null
88
+ }
89
+ ]
90
+ ))
91
+
92
+ actual = @client.notify.v1.services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
93
+ .notifications.create()
94
+
95
+ expect(actual).to_not eq(nil)
96
+ end
62
97
  end
@@ -92,6 +92,51 @@ describe 'Recording' do
92
92
  expect(actual).to_not eq(nil)
93
93
  end
94
94
 
95
+ it "receives read_results responses" do
96
+ @holodeck.mock(Twilio::TwilioResponse.new(
97
+ 200,
98
+ %q[
99
+ {
100
+ "recordings": [
101
+ {
102
+ "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
103
+ "status": "completed",
104
+ "date_created": "2015-07-30T20:00:00Z",
105
+ "sid": "RTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
106
+ "source_sid": "MTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
107
+ "size": 23,
108
+ "type": "audio",
109
+ "duration": 10,
110
+ "container_format": "mka",
111
+ "codec": "OPUS",
112
+ "grouping_sids": {
113
+ "room_sid": "RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
114
+ "participant_sid": "PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
115
+ },
116
+ "url": "https://video.twilio.com/v1/Recordings/RTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
117
+ "links": {
118
+ "media": "https://video.twilio.com/v1/Recordings/RTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media"
119
+ }
120
+ }
121
+ ],
122
+ "meta": {
123
+ "page": 0,
124
+ "page_size": 50,
125
+ "first_page_url": "https://video.twilio.com/v1/Recordings?PageSize=50&Page=0",
126
+ "previous_page_url": null,
127
+ "url": "https://video.twilio.com/v1/Recordings?PageSize=50&Page=0",
128
+ "next_page_url": null,
129
+ "key": "recordings"
130
+ }
131
+ }
132
+ ]
133
+ ))
134
+
135
+ actual = @client.video.v1.recordings.list()
136
+
137
+ expect(actual).to_not eq(nil)
138
+ end
139
+
95
140
  it "can delete" do
96
141
  @holodeck.mock(Twilio::TwilioResponse.new(500, ''))
97
142