twilio-ruby 5.25.3 → 5.25.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +26 -0
  3. data/README.md +2 -2
  4. data/lib/twilio-ruby/rest/api/v2010/account/message.rb +1 -8
  5. data/lib/twilio-ruby/rest/autopilot/v1/assistant/field_type/field_value.rb +4 -4
  6. data/lib/twilio-ruby/rest/flex_api.rb +16 -0
  7. data/lib/twilio-ruby/rest/flex_api/v1.rb +30 -0
  8. data/lib/twilio-ruby/rest/flex_api/v1/channel.rb +352 -0
  9. data/lib/twilio-ruby/rest/flex_api/v1/configuration.rb +7 -0
  10. data/lib/twilio-ruby/rest/flex_api/v1/web_channel.rb +358 -0
  11. data/lib/twilio-ruby/rest/insights/v1/summary.rb +0 -14
  12. data/lib/twilio-ruby/rest/ip_messaging.rb +2 -2
  13. data/lib/twilio-ruby/rest/sync/v1/service.rb +22 -3
  14. data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +5 -5
  15. data/lib/twilio-ruby/rest/verify/v2/service/verification_check.rb +2 -2
  16. data/lib/twilio-ruby/twiml/voice_response.rb +19 -7
  17. data/lib/twilio-ruby/version.rb +1 -1
  18. data/spec/integration/conversations/v1/conversation_spec.rb +1 -1
  19. data/spec/integration/flex_api/v1/channel_spec.rb +191 -0
  20. data/spec/integration/flex_api/v1/configuration_spec.rb +24 -0
  21. data/spec/integration/flex_api/v1/web_channel_spec.rb +220 -0
  22. data/spec/integration/insights/v1/summary_spec.rb +0 -2
  23. data/spec/integration/ip_messaging/v1/credential_spec.rb +5 -5
  24. data/spec/integration/ip_messaging/v1/service/channel/invite_spec.rb +4 -4
  25. data/spec/integration/ip_messaging/v1/service/channel/member_spec.rb +5 -5
  26. data/spec/integration/ip_messaging/v1/service/channel/message_spec.rb +5 -5
  27. data/spec/integration/ip_messaging/v1/service/channel_spec.rb +5 -5
  28. data/spec/integration/ip_messaging/v1/service/role_spec.rb +5 -5
  29. data/spec/integration/ip_messaging/v1/service/user/user_channel_spec.rb +1 -1
  30. data/spec/integration/ip_messaging/v1/service/user_spec.rb +5 -5
  31. data/spec/integration/ip_messaging/v1/service_spec.rb +5 -5
  32. data/spec/integration/ip_messaging/v2/credential_spec.rb +5 -5
  33. data/spec/integration/ip_messaging/v2/service/binding_spec.rb +3 -3
  34. data/spec/integration/ip_messaging/v2/service/channel/invite_spec.rb +4 -4
  35. data/spec/integration/ip_messaging/v2/service/channel/member_spec.rb +5 -5
  36. data/spec/integration/ip_messaging/v2/service/channel/message_spec.rb +5 -5
  37. data/spec/integration/ip_messaging/v2/service/channel/webhook_spec.rb +5 -5
  38. data/spec/integration/ip_messaging/v2/service/channel_spec.rb +5 -5
  39. data/spec/integration/ip_messaging/v2/service/role_spec.rb +5 -5
  40. data/spec/integration/ip_messaging/v2/service/user/user_binding_spec.rb +3 -3
  41. data/spec/integration/ip_messaging/v2/service/user/user_channel_spec.rb +3 -3
  42. data/spec/integration/ip_messaging/v2/service/user_spec.rb +5 -5
  43. data/spec/integration/ip_messaging/v2/service_spec.rb +5 -5
  44. data/spec/integration/monitor/v1/alert_spec.rb +8 -8
  45. data/spec/integration/sync/v1/service_spec.rb +4 -0
  46. data/spec/integration/wireless/v1/rate_plan_spec.rb +8 -0
  47. metadata +8 -2
@@ -18,7 +18,7 @@ module Twilio
18
18
  # Initialize the VerificationList
19
19
  # @param [Version] version Version that contains the resource
20
20
  # @param [String] service_sid The SID of the
21
- # [Service](https://www.twilio.com/docs/chat/rest/services) the resource is
21
+ # [Service](https://www.twilio.com/docs/verify/api/service) the resource is
22
22
  # associated with.
23
23
  # @return [VerificationList] VerificationList
24
24
  def initialize(version, service_sid: nil)
@@ -122,7 +122,7 @@ module Twilio
122
122
  # Initialize the VerificationContext
123
123
  # @param [Version] version Version that contains the resource
124
124
  # @param [String] service_sid The SID of the verification
125
- # [Service](https://www.twilio.com/docs/chat/rest/services) to fetch the resource
125
+ # [Service](https://www.twilio.com/docs/verify/api/service) to fetch the resource
126
126
  # from.
127
127
  # @param [String] sid The Twilio-provided string that uniquely identifies the
128
128
  # Verification resource to fetch.
@@ -138,7 +138,7 @@ module Twilio
138
138
  ##
139
139
  # Update the VerificationInstance
140
140
  # @param [verification.Status] status The new status of the resource. Can be:
141
- # `pending`, `approved`, `denied`, or `expired`.
141
+ # `canceled` or `approved`.
142
142
  # @return [VerificationInstance] Updated VerificationInstance
143
143
  def update(status: nil)
144
144
  data = Twilio::Values.of({'Status' => status, })
@@ -200,7 +200,7 @@ module Twilio
200
200
  # @param [Version] version Version that contains the resource
201
201
  # @param [Hash] payload payload that contains response from Twilio
202
202
  # @param [String] service_sid The SID of the
203
- # [Service](https://www.twilio.com/docs/chat/rest/services) the resource is
203
+ # [Service](https://www.twilio.com/docs/verify/api/service) the resource is
204
204
  # associated with.
205
205
  # @param [String] sid The Twilio-provided string that uniquely identifies the
206
206
  # Verification resource to fetch.
@@ -322,7 +322,7 @@ module Twilio
322
322
  ##
323
323
  # Update the VerificationInstance
324
324
  # @param [verification.Status] status The new status of the resource. Can be:
325
- # `pending`, `approved`, `denied`, or `expired`.
325
+ # `canceled` or `approved`.
326
326
  # @return [VerificationInstance] Updated VerificationInstance
327
327
  def update(status: nil)
328
328
  context.update(status: status, )
@@ -18,7 +18,7 @@ module Twilio
18
18
  # Initialize the VerificationCheckList
19
19
  # @param [Version] version Version that contains the resource
20
20
  # @param [String] service_sid The SID of the
21
- # [Service](https://www.twilio.com/docs/chat/rest/services) the resource is
21
+ # [Service](https://www.twilio.com/docs/verify/api/service) the resource is
22
22
  # associated with.
23
23
  # @return [VerificationCheckList] VerificationCheckList
24
24
  def initialize(version, service_sid: nil)
@@ -106,7 +106,7 @@ module Twilio
106
106
  # @param [Version] version Version that contains the resource
107
107
  # @param [Hash] payload payload that contains response from Twilio
108
108
  # @param [String] service_sid The SID of the
109
- # [Service](https://www.twilio.com/docs/chat/rest/services) the resource is
109
+ # [Service](https://www.twilio.com/docs/verify/api/service) the resource is
110
110
  # associated with.
111
111
  # @return [VerificationCheckInstance] VerificationCheckInstance
112
112
  def initialize(version, payload, service_sid: nil)
@@ -214,13 +214,16 @@ module Twilio
214
214
  # Create a new <Pay> element
215
215
  # input:: Input type Twilio should accept
216
216
  # action:: Action URL
217
+ # bank_account_type:: Bank account type for ach transactions. If set, payment method attribute must be provided and value should be set to ach-debit. defaults to consumer-checking
217
218
  # status_callback:: Status callback URL
218
219
  # status_callback_method:: Status callback method
219
220
  # timeout:: Time to wait to gather input
220
221
  # max_attempts:: Maximum number of allowed retries when gathering input
221
222
  # security_code:: Prompt for security code
222
223
  # postal_code:: Prompt for postal code and it should be true/false or default postal code
224
+ # min_postal_code_length:: Prompt for minimum postal code length
223
225
  # payment_connector:: Unique name for payment connector
226
+ # payment_method:: Payment method to be used. defaults to credit-card
224
227
  # token_type:: Type of token
225
228
  # charge_amount:: Amount to process. If value is greater than 0 then make the payment else create a payment token
226
229
  # currency:: Currency of the amount attribute
@@ -228,8 +231,8 @@ module Twilio
228
231
  # valid_card_types:: Comma separated accepted card types
229
232
  # language:: Language to use
230
233
  # keyword_args:: additional attributes
231
- def pay(input: nil, action: nil, status_callback: nil, status_callback_method: nil, timeout: nil, max_attempts: nil, security_code: nil, postal_code: nil, payment_connector: nil, token_type: nil, charge_amount: nil, currency: nil, description: nil, valid_card_types: nil, language: nil, **keyword_args)
232
- pay = Pay.new(input: input, action: action, status_callback: status_callback, status_callback_method: status_callback_method, timeout: timeout, max_attempts: max_attempts, security_code: security_code, postal_code: postal_code, payment_connector: payment_connector, token_type: token_type, charge_amount: charge_amount, currency: currency, description: description, valid_card_types: valid_card_types, language: language, **keyword_args)
234
+ def pay(input: nil, action: nil, bank_account_type: nil, status_callback: nil, status_callback_method: nil, timeout: nil, max_attempts: nil, security_code: nil, postal_code: nil, min_postal_code_length: nil, payment_connector: nil, payment_method: nil, token_type: nil, charge_amount: nil, currency: nil, description: nil, valid_card_types: nil, language: nil, **keyword_args)
235
+ pay = Pay.new(input: input, action: action, bank_account_type: bank_account_type, status_callback: status_callback, status_callback_method: status_callback_method, timeout: timeout, max_attempts: max_attempts, security_code: security_code, postal_code: postal_code, min_postal_code_length: min_postal_code_length, payment_connector: payment_connector, payment_method: payment_method, token_type: token_type, charge_amount: charge_amount, currency: currency, description: description, valid_card_types: valid_card_types, language: language, **keyword_args)
233
236
 
234
237
  yield(pay) if block_given?
235
238
  append(pay)
@@ -237,7 +240,7 @@ module Twilio
237
240
 
238
241
  ##
239
242
  # Create a new <Prompt> element
240
- # for_:: Name of the credit card data element
243
+ # for_:: Name of the payment source data element
241
244
  # error_type:: Type of error
242
245
  # card_type:: Type of the credit card
243
246
  # attempt:: Current attempt count
@@ -493,7 +496,7 @@ module Twilio
493
496
  ##
494
497
  # Create a new <Lang> element
495
498
  # words:: Words to speak
496
- # xml:lang:: Specify the language
499
+ # xmlLang:: Specify the language
497
500
  # keyword_args:: additional attributes
498
501
  def lang(words, xmlLang: nil, **keyword_args)
499
502
  append(SsmlLang.new(words, xmlLang: xmlLang, **keyword_args))
@@ -539,7 +542,7 @@ module Twilio
539
542
  ##
540
543
  # Create a new <Say-As> element
541
544
  # words:: Words to be interpreted
542
- # interpret-as:: Specify the type of words are spoken
545
+ # interpretAs:: Specify the type of words are spoken
543
546
  # role:: Specify the format of the date when interpret-as is set to date
544
547
  # keyword_args:: additional attributes
545
548
  def say_as(words, interpretAs: nil, role: nil, **keyword_args)
@@ -549,7 +552,7 @@ module Twilio
549
552
  ##
550
553
  # Create a new <Sub> element
551
554
  # words:: Words to be substituted
552
- # alias:: Substitute a different word (or pronunciation) for selected text such as an acronym or abbreviation
555
+ # aliasAttribute:: Substitute a different word (or pronunciation) for selected text such as an acronym or abbreviation
553
556
  # keyword_args:: additional attributes
554
557
  def sub(words, aliasAttribute: nil, **keyword_args)
555
558
  append(SsmlSub.new(words, aliasAttribute: aliasAttribute, **keyword_args))
@@ -687,7 +690,7 @@ module Twilio
687
690
 
688
691
  ##
689
692
  # Create a new <Prompt> element
690
- # for_:: Name of the credit card data element
693
+ # for_:: Name of the payment source data element
691
694
  # error_type:: Type of error
692
695
  # card_type:: Type of the credit card
693
696
  # attempt:: Current attempt count
@@ -698,6 +701,15 @@ module Twilio
698
701
  yield(prompt) if block_given?
699
702
  append(prompt)
700
703
  end
704
+
705
+ ##
706
+ # Create a new <Parameter> element
707
+ # name:: The name of the custom parameter
708
+ # value:: The value of the custom parameter
709
+ # keyword_args:: additional attributes
710
+ def parameter(name: nil, value: nil, **keyword_args)
711
+ append(Parameter.new(name: name, value: value, **keyword_args))
712
+ end
701
713
  end
702
714
 
703
715
  ##
@@ -1,3 +1,3 @@
1
1
  module Twilio
2
- VERSION = '5.25.3'
2
+ VERSION = '5.25.4'
3
3
  end
@@ -143,7 +143,7 @@ describe 'Conversation' do
143
143
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
144
144
  "chat_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
145
145
  "messaging_service_sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
146
- "friendly_name": "Sartorial Consultation",
146
+ "friendly_name": "My First Conversation",
147
147
  "date_created": "2015-12-16T22:18:37Z",
148
148
  "date_updated": "2015-12-16T22:18:38Z",
149
149
  "url": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
@@ -0,0 +1,191 @@
1
+ ##
2
+ # This code was generated by
3
+ # \ / _ _ _| _ _
4
+ # | (_)\/(_)(_|\/| |(/_ v1.0.0
5
+ # / /
6
+ #
7
+ # frozen_string_literal: true
8
+
9
+ require 'spec_helper.rb'
10
+
11
+ describe 'Channel' do
12
+ it "can read" do
13
+ @holodeck.mock(Twilio::Response.new(500, ''))
14
+
15
+ expect {
16
+ @client.flex_api.v1.channel.list()
17
+ }.to raise_exception(Twilio::REST::TwilioError)
18
+
19
+ values = {}
20
+ expect(
21
+ @holodeck.has_request?(Holodeck::Request.new(
22
+ method: 'get',
23
+ url: 'https://flex-api.twilio.com/v1/Channels',
24
+ ))).to eq(true)
25
+ end
26
+
27
+ it "receives read_full responses" do
28
+ @holodeck.mock(Twilio::Response.new(
29
+ 200,
30
+ %q[
31
+ {
32
+ "meta": {
33
+ "page": 0,
34
+ "page_size": 50,
35
+ "first_page_url": "https://flex-api.twilio.com/v1/Channels?PageSize=50&Page=0",
36
+ "previous_page_url": null,
37
+ "url": "https://flex-api.twilio.com/v1/Channels?PageSize=50&Page=0",
38
+ "next_page_url": null,
39
+ "key": "flex_chat_channels"
40
+ },
41
+ "flex_chat_channels": [
42
+ {
43
+ "flex_flow_sid": "FOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
44
+ "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
45
+ "sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
46
+ "task_sid": "WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
47
+ "user_sid": "USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
48
+ "date_created": "2016-08-01T22:10:40Z",
49
+ "date_updated": "2016-08-01T22:10:40Z",
50
+ "url": "https://flex-api.twilio.com/v1/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
51
+ }
52
+ ]
53
+ }
54
+ ]
55
+ ))
56
+
57
+ actual = @client.flex_api.v1.channel.list()
58
+
59
+ expect(actual).to_not eq(nil)
60
+ end
61
+
62
+ it "receives read_empty responses" do
63
+ @holodeck.mock(Twilio::Response.new(
64
+ 200,
65
+ %q[
66
+ {
67
+ "meta": {
68
+ "page": 0,
69
+ "page_size": 50,
70
+ "first_page_url": "https://flex-api.twilio.com/v1/Channels?PageSize=50&Page=0",
71
+ "previous_page_url": null,
72
+ "url": "https://flex-api.twilio.com/v1/Channels?PageSize=50&Page=0",
73
+ "next_page_url": null,
74
+ "key": "flex_chat_channels"
75
+ },
76
+ "flex_chat_channels": []
77
+ }
78
+ ]
79
+ ))
80
+
81
+ actual = @client.flex_api.v1.channel.list()
82
+
83
+ expect(actual).to_not eq(nil)
84
+ end
85
+
86
+ it "can fetch" do
87
+ @holodeck.mock(Twilio::Response.new(500, ''))
88
+
89
+ expect {
90
+ @client.flex_api.v1.channel('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
91
+ }.to raise_exception(Twilio::REST::TwilioError)
92
+
93
+ values = {}
94
+ expect(
95
+ @holodeck.has_request?(Holodeck::Request.new(
96
+ method: 'get',
97
+ url: 'https://flex-api.twilio.com/v1/Channels/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
98
+ ))).to eq(true)
99
+ end
100
+
101
+ it "receives fetch responses" do
102
+ @holodeck.mock(Twilio::Response.new(
103
+ 200,
104
+ %q[
105
+ {
106
+ "flex_flow_sid": "FOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
107
+ "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
108
+ "sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
109
+ "task_sid": "WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
110
+ "user_sid": "USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
111
+ "date_created": "2016-08-01T22:10:40Z",
112
+ "date_updated": "2016-08-01T22:10:40Z",
113
+ "url": "https://flex-api.twilio.com/v1/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
114
+ }
115
+ ]
116
+ ))
117
+
118
+ actual = @client.flex_api.v1.channel('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
119
+
120
+ expect(actual).to_not eq(nil)
121
+ end
122
+
123
+ it "can create" do
124
+ @holodeck.mock(Twilio::Response.new(500, ''))
125
+
126
+ expect {
127
+ @client.flex_api.v1.channel.create(flex_flow_sid: 'FOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', identity: 'identity', chat_user_friendly_name: 'chat_user_friendly_name', chat_friendly_name: 'chat_friendly_name')
128
+ }.to raise_exception(Twilio::REST::TwilioError)
129
+
130
+ values = {
131
+ 'FlexFlowSid' => 'FOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
132
+ 'Identity' => 'identity',
133
+ 'ChatUserFriendlyName' => 'chat_user_friendly_name',
134
+ 'ChatFriendlyName' => 'chat_friendly_name',
135
+ }
136
+ expect(
137
+ @holodeck.has_request?(Holodeck::Request.new(
138
+ method: 'post',
139
+ url: 'https://flex-api.twilio.com/v1/Channels',
140
+ data: values,
141
+ ))).to eq(true)
142
+ end
143
+
144
+ it "receives create responses" do
145
+ @holodeck.mock(Twilio::Response.new(
146
+ 201,
147
+ %q[
148
+ {
149
+ "flex_flow_sid": "FOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
150
+ "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
151
+ "sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
152
+ "task_sid": "WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
153
+ "user_sid": "USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
154
+ "date_created": "2016-08-01T22:10:40Z",
155
+ "date_updated": "2016-08-01T22:10:40Z",
156
+ "url": "https://flex-api.twilio.com/v1/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
157
+ }
158
+ ]
159
+ ))
160
+
161
+ actual = @client.flex_api.v1.channel.create(flex_flow_sid: 'FOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', identity: 'identity', chat_user_friendly_name: 'chat_user_friendly_name', chat_friendly_name: 'chat_friendly_name')
162
+
163
+ expect(actual).to_not eq(nil)
164
+ end
165
+
166
+ it "can delete" do
167
+ @holodeck.mock(Twilio::Response.new(500, ''))
168
+
169
+ expect {
170
+ @client.flex_api.v1.channel('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').delete()
171
+ }.to raise_exception(Twilio::REST::TwilioError)
172
+
173
+ values = {}
174
+ expect(
175
+ @holodeck.has_request?(Holodeck::Request.new(
176
+ method: 'delete',
177
+ url: 'https://flex-api.twilio.com/v1/Channels/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
178
+ ))).to eq(true)
179
+ end
180
+
181
+ it "receives delete responses" do
182
+ @holodeck.mock(Twilio::Response.new(
183
+ 204,
184
+ nil,
185
+ ))
186
+
187
+ actual = @client.flex_api.v1.channel('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').delete()
188
+
189
+ expect(actual).to eq(true)
190
+ end
191
+ end
@@ -133,6 +133,14 @@ describe 'Configuration' do
133
133
  "config": "{\\"callback\\":\\"twilio.com/cb\\",\\"allowed_methods\\":[\\"GET\\",\\"POST\\"]}"
134
134
  }
135
135
  ],
136
+ "outbound_call_flows": {
137
+ "default": {
138
+ "caller_id": "+12345",
139
+ "queue_sid": "WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
140
+ "location": "EE",
141
+ "workflow_sid": "WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
142
+ }
143
+ },
136
144
  "url": "https://flex-api.twilio.com/v1/Configuration"
137
145
  }
138
146
  ]
@@ -267,6 +275,14 @@ describe 'Configuration' do
267
275
  "config": "{\\"callback\\":\\"twilio.com/cb\\",\\"allowed_methods\\":[\\"GET\\",\\"POST\\"]}"
268
276
  }
269
277
  ],
278
+ "outbound_call_flows": {
279
+ "default": {
280
+ "caller_id": "+12345",
281
+ "queue_sid": "WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
282
+ "location": "EE",
283
+ "workflow_sid": "WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
284
+ }
285
+ },
270
286
  "url": "https://flex-api.twilio.com/v1/Configuration"
271
287
  }
272
288
  ]
@@ -401,6 +417,14 @@ describe 'Configuration' do
401
417
  "config": "{\\"callback\\":\\"twilio.com/cb\\",\\"allowed_methods\\":[\\"GET\\",\\"POST\\"]}"
402
418
  }
403
419
  ],
420
+ "outbound_call_flows": {
421
+ "default": {
422
+ "caller_id": "+12345",
423
+ "queue_sid": "WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
424
+ "location": "EE",
425
+ "workflow_sid": "WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
426
+ }
427
+ },
404
428
  "url": "https://flex-api.twilio.com/v1/Configuration"
405
429
  }
406
430
  ]
@@ -0,0 +1,220 @@
1
+ ##
2
+ # This code was generated by
3
+ # \ / _ _ _| _ _
4
+ # | (_)\/(_)(_|\/| |(/_ v1.0.0
5
+ # / /
6
+ #
7
+ # frozen_string_literal: true
8
+
9
+ require 'spec_helper.rb'
10
+
11
+ describe 'WebChannel' do
12
+ it "can read" do
13
+ @holodeck.mock(Twilio::Response.new(500, ''))
14
+
15
+ expect {
16
+ @client.flex_api.v1.web_channel.list()
17
+ }.to raise_exception(Twilio::REST::TwilioError)
18
+
19
+ values = {}
20
+ expect(
21
+ @holodeck.has_request?(Holodeck::Request.new(
22
+ method: 'get',
23
+ url: 'https://flex-api.twilio.com/v1/WebChannels',
24
+ ))).to eq(true)
25
+ end
26
+
27
+ it "receives read_full responses" do
28
+ @holodeck.mock(Twilio::Response.new(
29
+ 200,
30
+ %q[
31
+ {
32
+ "meta": {
33
+ "page": 0,
34
+ "page_size": 50,
35
+ "first_page_url": "https://flex-api.twilio.com/v1/WebChannels?PageSize=50&Page=0",
36
+ "previous_page_url": null,
37
+ "url": "https://flex-api.twilio.com/v1/WebChannels?PageSize=50&Page=0",
38
+ "next_page_url": null,
39
+ "key": "flex_chat_channels"
40
+ },
41
+ "flex_chat_channels": [
42
+ {
43
+ "flex_flow_sid": "FOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
44
+ "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
45
+ "sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
46
+ "date_created": "2016-08-01T22:10:40Z",
47
+ "date_updated": "2016-08-01T22:10:40Z",
48
+ "url": "https://flex-api.twilio.com/v1/WebChannels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
49
+ }
50
+ ]
51
+ }
52
+ ]
53
+ ))
54
+
55
+ actual = @client.flex_api.v1.web_channel.list()
56
+
57
+ expect(actual).to_not eq(nil)
58
+ end
59
+
60
+ it "receives read_empty responses" do
61
+ @holodeck.mock(Twilio::Response.new(
62
+ 200,
63
+ %q[
64
+ {
65
+ "meta": {
66
+ "page": 0,
67
+ "page_size": 50,
68
+ "first_page_url": "https://flex-api.twilio.com/v1/WebChannels?PageSize=50&Page=0",
69
+ "previous_page_url": null,
70
+ "url": "https://flex-api.twilio.com/v1/WebChannels?PageSize=50&Page=0",
71
+ "next_page_url": null,
72
+ "key": "flex_chat_channels"
73
+ },
74
+ "flex_chat_channels": []
75
+ }
76
+ ]
77
+ ))
78
+
79
+ actual = @client.flex_api.v1.web_channel.list()
80
+
81
+ expect(actual).to_not eq(nil)
82
+ end
83
+
84
+ it "can fetch" do
85
+ @holodeck.mock(Twilio::Response.new(500, ''))
86
+
87
+ expect {
88
+ @client.flex_api.v1.web_channel('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
89
+ }.to raise_exception(Twilio::REST::TwilioError)
90
+
91
+ values = {}
92
+ expect(
93
+ @holodeck.has_request?(Holodeck::Request.new(
94
+ method: 'get',
95
+ url: 'https://flex-api.twilio.com/v1/WebChannels/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
96
+ ))).to eq(true)
97
+ end
98
+
99
+ it "receives fetch responses" do
100
+ @holodeck.mock(Twilio::Response.new(
101
+ 200,
102
+ %q[
103
+ {
104
+ "flex_flow_sid": "FOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
105
+ "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
106
+ "sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
107
+ "date_created": "2016-08-01T22:10:40Z",
108
+ "date_updated": "2016-08-01T22:10:40Z",
109
+ "url": "https://flex-api.twilio.com/v1/WebChannels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
110
+ }
111
+ ]
112
+ ))
113
+
114
+ actual = @client.flex_api.v1.web_channel('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
115
+
116
+ expect(actual).to_not eq(nil)
117
+ end
118
+
119
+ it "can create" do
120
+ @holodeck.mock(Twilio::Response.new(500, ''))
121
+
122
+ expect {
123
+ @client.flex_api.v1.web_channel.create(flex_flow_sid: 'FOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', identity: 'identity', customer_friendly_name: 'customer_friendly_name', chat_friendly_name: 'chat_friendly_name')
124
+ }.to raise_exception(Twilio::REST::TwilioError)
125
+
126
+ values = {
127
+ 'FlexFlowSid' => 'FOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
128
+ 'Identity' => 'identity',
129
+ 'CustomerFriendlyName' => 'customer_friendly_name',
130
+ 'ChatFriendlyName' => 'chat_friendly_name',
131
+ }
132
+ expect(
133
+ @holodeck.has_request?(Holodeck::Request.new(
134
+ method: 'post',
135
+ url: 'https://flex-api.twilio.com/v1/WebChannels',
136
+ data: values,
137
+ ))).to eq(true)
138
+ end
139
+
140
+ it "receives create responses" do
141
+ @holodeck.mock(Twilio::Response.new(
142
+ 201,
143
+ %q[
144
+ {
145
+ "flex_flow_sid": "FOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
146
+ "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
147
+ "sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
148
+ "date_created": "2016-08-01T22:10:40Z",
149
+ "date_updated": "2016-08-01T22:10:40Z",
150
+ "url": "https://flex-api.twilio.com/v1/WebChannels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
151
+ }
152
+ ]
153
+ ))
154
+
155
+ actual = @client.flex_api.v1.web_channel.create(flex_flow_sid: 'FOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', identity: 'identity', customer_friendly_name: 'customer_friendly_name', chat_friendly_name: 'chat_friendly_name')
156
+
157
+ expect(actual).to_not eq(nil)
158
+ end
159
+
160
+ it "can update" do
161
+ @holodeck.mock(Twilio::Response.new(500, ''))
162
+
163
+ expect {
164
+ @client.flex_api.v1.web_channel('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update()
165
+ }.to raise_exception(Twilio::REST::TwilioError)
166
+
167
+ values = {}
168
+ expect(
169
+ @holodeck.has_request?(Holodeck::Request.new(
170
+ method: 'post',
171
+ url: 'https://flex-api.twilio.com/v1/WebChannels/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
172
+ ))).to eq(true)
173
+ end
174
+
175
+ it "receives update responses" do
176
+ @holodeck.mock(Twilio::Response.new(
177
+ 200,
178
+ %q[
179
+ {
180
+ "flex_flow_sid": "FOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
181
+ "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
182
+ "sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
183
+ "date_created": "2016-08-01T22:10:40Z",
184
+ "date_updated": "2016-08-01T22:10:40Z",
185
+ "url": "https://flex-api.twilio.com/v1/WebChannels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
186
+ }
187
+ ]
188
+ ))
189
+
190
+ actual = @client.flex_api.v1.web_channel('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update()
191
+
192
+ expect(actual).to_not eq(nil)
193
+ end
194
+
195
+ it "can delete" do
196
+ @holodeck.mock(Twilio::Response.new(500, ''))
197
+
198
+ expect {
199
+ @client.flex_api.v1.web_channel('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').delete()
200
+ }.to raise_exception(Twilio::REST::TwilioError)
201
+
202
+ values = {}
203
+ expect(
204
+ @holodeck.has_request?(Holodeck::Request.new(
205
+ method: 'delete',
206
+ url: 'https://flex-api.twilio.com/v1/WebChannels/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
207
+ ))).to eq(true)
208
+ end
209
+
210
+ it "receives delete responses" do
211
+ @holodeck.mock(Twilio::Response.new(
212
+ 204,
213
+ nil,
214
+ ))
215
+
216
+ actual = @client.flex_api.v1.web_channel('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').delete()
217
+
218
+ expect(actual).to eq(true)
219
+ end
220
+ end