twilio-ruby 5.40.1 → 5.40.2
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 +27 -0
- data/README.md +2 -2
- data/lib/twilio-ruby/framework/version.rb +2 -7
- data/lib/twilio-ruby/rest/conversations.rb +52 -0
- data/lib/twilio-ruby/rest/conversations/v1.rb +88 -1
- data/lib/twilio-ruby/rest/conversations/v1/configuration.rb +258 -0
- data/lib/twilio-ruby/rest/conversations/v1/conversation.rb +15 -4
- data/lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb +19 -10
- data/lib/twilio-ruby/rest/conversations/v1/credential.rb +427 -0
- data/lib/twilio-ruby/rest/conversations/v1/notification.rb +310 -0
- data/lib/twilio-ruby/rest/conversations/v1/role.rb +372 -0
- data/lib/twilio-ruby/rest/conversations/v1/service.rb +442 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/binding.rb +385 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/configuration.rb +259 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation.rb +586 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message.rb +546 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb +388 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation/participant.rb +513 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation/webhook.rb +454 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/role.rb +393 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/user.rb +419 -0
- data/lib/twilio-ruby/rest/conversations/v1/user.rb +398 -0
- data/lib/twilio-ruby/rest/events.rb +8 -0
- data/lib/twilio-ruby/rest/events/v1.rb +15 -0
- data/lib/twilio-ruby/rest/events/v1/event_type.rb +291 -0
- data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance.rb +2 -2
- data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/supporting_document.rb +18 -4
- data/lib/twilio-ruby/rest/proxy/v1/service/session.rb +27 -24
- data/lib/twilio-ruby/rest/proxy/v1/service/session/participant.rb +12 -11
- data/lib/twilio-ruby/rest/serverless/v1/service.rb +13 -13
- data/lib/twilio-ruby/rest/serverless/v1/service/asset.rb +6 -6
- data/lib/twilio-ruby/rest/serverless/v1/service/asset/asset_version.rb +5 -5
- data/lib/twilio-ruby/rest/serverless/v1/service/build.rb +8 -8
- data/lib/twilio-ruby/rest/serverless/v1/service/environment.rb +6 -8
- data/lib/twilio-ruby/rest/serverless/v1/service/environment/deployment.rb +8 -8
- data/lib/twilio-ruby/rest/serverless/v1/service/environment/variable.rb +14 -14
- data/lib/twilio-ruby/rest/serverless/v1/service/function.rb +4 -4
- data/lib/twilio-ruby/rest/serverless/v1/service/function/function_version.rb +7 -7
- data/lib/twilio-ruby/rest/serverless/v1/service/function/function_version/function_version_content.rb +1 -1
- data/lib/twilio-ruby/rest/supersim/v1/sim.rb +17 -7
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb +2 -1
- data/lib/twilio-ruby/version.rb +1 -1
- data/spec/framework/version_spec.rb +42 -0
- data/spec/holodeck/holodeck.rb +3 -3
- data/spec/integration/conversations/v1/configuration_spec.rb +85 -0
- data/spec/integration/conversations/v1/conversation/message/delivery_receipt_spec.rb +4 -0
- data/spec/integration/conversations/v1/conversation/participant_spec.rb +6 -6
- data/spec/integration/conversations/v1/conversation_spec.rb +5 -0
- data/spec/integration/conversations/v1/credential_spec.rb +219 -0
- data/spec/integration/conversations/v1/notification_spec.rb +107 -0
- data/spec/integration/conversations/v1/role_spec.rb +249 -0
- data/spec/integration/conversations/v1/service/binding_spec.rb +166 -0
- data/spec/integration/conversations/v1/service/configuration_spec.rb +87 -0
- data/spec/integration/conversations/v1/service/conversation/message/delivery_receipt_spec.rb +144 -0
- data/spec/integration/conversations/v1/service/conversation/message_spec.rb +429 -0
- data/spec/integration/conversations/v1/service/conversation/participant_spec.rb +407 -0
- data/spec/integration/conversations/v1/service/conversation/webhook_spec.rb +299 -0
- data/spec/integration/conversations/v1/service/conversation_spec.rb +289 -0
- data/spec/integration/conversations/v1/service/role_spec.rb +260 -0
- data/spec/integration/conversations/v1/service/user_spec.rb +230 -0
- data/spec/integration/conversations/v1/service_spec.rb +174 -0
- data/spec/integration/conversations/v1/user_spec.rb +220 -0
- data/spec/integration/events/v1/event_type_spec.rb +133 -0
- data/spec/integration/numbers/v2/regulatory_compliance/supporting_document_spec.rb +27 -0
- data/spec/integration/supersim/v1/sim_spec.rb +23 -0
- metadata +50 -2
@@ -20,7 +20,7 @@ module Twilio
|
|
20
20
|
# @param [Version] version Version that contains the resource
|
21
21
|
# @param [String] service_sid The SID of the Service that the Variable resource is
|
22
22
|
# associated with.
|
23
|
-
# @param [String] environment_sid The SID of the
|
23
|
+
# @param [String] environment_sid The SID of the Environment in which the Variable
|
24
24
|
# exists.
|
25
25
|
# @return [VariableList] VariableList
|
26
26
|
def initialize(version, service_sid: nil, environment_sid: nil)
|
@@ -114,9 +114,9 @@ module Twilio
|
|
114
114
|
##
|
115
115
|
# Create the VariableInstance
|
116
116
|
# @param [String] key A string by which the Variable resource can be referenced.
|
117
|
-
#
|
118
|
-
# @param [String] value A string that contains the actual value of the
|
119
|
-
#
|
117
|
+
# It can be a maximum of 128 characters.
|
118
|
+
# @param [String] value A string that contains the actual value of the Variable.
|
119
|
+
# It can be a maximum of 450 bytes in size.
|
120
120
|
# @return [VariableInstance] Created VariableInstance
|
121
121
|
def create(key: nil, value: nil)
|
122
122
|
data = Twilio::Values.of({'Key' => key, 'Value' => value, })
|
@@ -182,7 +182,7 @@ module Twilio
|
|
182
182
|
# @param [Version] version Version that contains the resource
|
183
183
|
# @param [String] service_sid The SID of the Service to fetch the Variable
|
184
184
|
# resource from.
|
185
|
-
# @param [String] environment_sid The SID of the
|
185
|
+
# @param [String] environment_sid The SID of the Environment with the Variable
|
186
186
|
# resource to fetch.
|
187
187
|
# @param [String] sid The SID of the Variable resource to fetch.
|
188
188
|
# @return [VariableContext] VariableContext
|
@@ -212,9 +212,9 @@ module Twilio
|
|
212
212
|
##
|
213
213
|
# Update the VariableInstance
|
214
214
|
# @param [String] key A string by which the Variable resource can be referenced.
|
215
|
-
#
|
216
|
-
# @param [String] value A string that contains the actual value of the
|
217
|
-
#
|
215
|
+
# It can be a maximum of 128 characters.
|
216
|
+
# @param [String] value A string that contains the actual value of the Variable.
|
217
|
+
# It can be a maximum of 450 bytes in size.
|
218
218
|
# @return [VariableInstance] Updated VariableInstance
|
219
219
|
def update(key: :unset, value: :unset)
|
220
220
|
data = Twilio::Values.of({'Key' => key, 'Value' => value, })
|
@@ -261,7 +261,7 @@ module Twilio
|
|
261
261
|
# @param [Hash] payload payload that contains response from Twilio
|
262
262
|
# @param [String] service_sid The SID of the Service that the Variable resource is
|
263
263
|
# associated with.
|
264
|
-
# @param [String] environment_sid The SID of the
|
264
|
+
# @param [String] environment_sid The SID of the Environment in which the Variable
|
265
265
|
# exists.
|
266
266
|
# @param [String] sid The SID of the Variable resource to fetch.
|
267
267
|
# @return [VariableInstance] VariableInstance
|
@@ -325,7 +325,7 @@ module Twilio
|
|
325
325
|
end
|
326
326
|
|
327
327
|
##
|
328
|
-
# @return [String] The SID of the
|
328
|
+
# @return [String] The SID of the Environment in which the Variable exists
|
329
329
|
def environment_sid
|
330
330
|
@properties['environment_sid']
|
331
331
|
end
|
@@ -337,7 +337,7 @@ module Twilio
|
|
337
337
|
end
|
338
338
|
|
339
339
|
##
|
340
|
-
# @return [String] A string that contains the actual value of the
|
340
|
+
# @return [String] A string that contains the actual value of the Variable
|
341
341
|
def value
|
342
342
|
@properties['value']
|
343
343
|
end
|
@@ -370,9 +370,9 @@ module Twilio
|
|
370
370
|
##
|
371
371
|
# Update the VariableInstance
|
372
372
|
# @param [String] key A string by which the Variable resource can be referenced.
|
373
|
-
#
|
374
|
-
# @param [String] value A string that contains the actual value of the
|
375
|
-
#
|
373
|
+
# It can be a maximum of 128 characters.
|
374
|
+
# @param [String] value A string that contains the actual value of the Variable.
|
375
|
+
# It can be a maximum of 450 bytes in size.
|
376
376
|
# @return [VariableInstance] Updated VariableInstance
|
377
377
|
def update(key: :unset, value: :unset)
|
378
378
|
context.update(key: key, value: value, )
|
@@ -111,7 +111,7 @@ module Twilio
|
|
111
111
|
##
|
112
112
|
# Create the FunctionInstance
|
113
113
|
# @param [String] friendly_name A descriptive string that you create to describe
|
114
|
-
# the Function resource. It can be
|
114
|
+
# the Function resource. It can be a maximum of 255 characters.
|
115
115
|
# @return [FunctionInstance] Created FunctionInstance
|
116
116
|
def create(friendly_name: nil)
|
117
117
|
data = Twilio::Values.of({'FriendlyName' => friendly_name, })
|
@@ -199,7 +199,7 @@ module Twilio
|
|
199
199
|
##
|
200
200
|
# Update the FunctionInstance
|
201
201
|
# @param [String] friendly_name A descriptive string that you create to describe
|
202
|
-
# the Function resource. It can be
|
202
|
+
# the Function resource. It can be a maximum of 255 characters.
|
203
203
|
# @return [FunctionInstance] Updated FunctionInstance
|
204
204
|
def update(friendly_name: nil)
|
205
205
|
data = Twilio::Values.of({'FriendlyName' => friendly_name, })
|
@@ -331,7 +331,7 @@ module Twilio
|
|
331
331
|
end
|
332
332
|
|
333
333
|
##
|
334
|
-
# @return [String] The URLs of nested resources of the
|
334
|
+
# @return [String] The URLs of nested resources of the Function resource
|
335
335
|
def links
|
336
336
|
@properties['links']
|
337
337
|
end
|
@@ -353,7 +353,7 @@ module Twilio
|
|
353
353
|
##
|
354
354
|
# Update the FunctionInstance
|
355
355
|
# @param [String] friendly_name A descriptive string that you create to describe
|
356
|
-
# the Function resource. It can be
|
356
|
+
# the Function resource. It can be a maximum of 255 characters.
|
357
357
|
# @return [FunctionInstance] Updated FunctionInstance
|
358
358
|
def update(friendly_name: nil)
|
359
359
|
context.update(friendly_name: friendly_name, )
|
@@ -20,8 +20,8 @@ module Twilio
|
|
20
20
|
# @param [Version] version Version that contains the resource
|
21
21
|
# @param [String] service_sid The SID of the Service that the Function Version
|
22
22
|
# resource is associated with.
|
23
|
-
# @param [String] function_sid The SID of the
|
24
|
-
#
|
23
|
+
# @param [String] function_sid The SID of the Function resource that is the parent
|
24
|
+
# of the Function Version resource.
|
25
25
|
# @return [FunctionVersionList] FunctionVersionList
|
26
26
|
def initialize(version, service_sid: nil, function_sid: nil)
|
27
27
|
super(version)
|
@@ -229,8 +229,8 @@ module Twilio
|
|
229
229
|
# @param [Hash] payload payload that contains response from Twilio
|
230
230
|
# @param [String] service_sid The SID of the Service that the Function Version
|
231
231
|
# resource is associated with.
|
232
|
-
# @param [String] function_sid The SID of the
|
233
|
-
#
|
232
|
+
# @param [String] function_sid The SID of the Function resource that is the parent
|
233
|
+
# of the Function Version resource.
|
234
234
|
# @param [String] sid The SID of the Function Version resource to fetch.
|
235
235
|
# @return [FunctionVersionInstance] FunctionVersionInstance
|
236
236
|
def initialize(version, payload, service_sid: nil, function_sid: nil, sid: nil)
|
@@ -293,19 +293,19 @@ module Twilio
|
|
293
293
|
end
|
294
294
|
|
295
295
|
##
|
296
|
-
# @return [String] The SID of the
|
296
|
+
# @return [String] The SID of the Function resource that is the parent of the Function Version resource
|
297
297
|
def function_sid
|
298
298
|
@properties['function_sid']
|
299
299
|
end
|
300
300
|
|
301
301
|
##
|
302
|
-
# @return [String] The URL-friendly string by which the
|
302
|
+
# @return [String] The URL-friendly string by which the Function Version resource can be referenced
|
303
303
|
def path
|
304
304
|
@properties['path']
|
305
305
|
end
|
306
306
|
|
307
307
|
##
|
308
|
-
# @return [function_version.Visibility] The access control that determines how the
|
308
|
+
# @return [function_version.Visibility] The access control that determines how the Function Version resource can be accessed
|
309
309
|
def visibility
|
310
310
|
@properties['visibility']
|
311
311
|
end
|
@@ -85,7 +85,7 @@ module Twilio
|
|
85
85
|
# @param [Version] version Version that contains the resource
|
86
86
|
# @param [String] service_sid The SID of the Service to fetch the Function Version
|
87
87
|
# content from.
|
88
|
-
# @param [String] function_sid The SID of the
|
88
|
+
# @param [String] function_sid The SID of the Function that is the parent of the
|
89
89
|
# Function Version content to fetch.
|
90
90
|
# @param [String] sid The SID of the Function Version content to fetch.
|
91
91
|
# @return [FunctionVersionContentContext] FunctionVersionContentContext
|
@@ -30,7 +30,7 @@ module Twilio
|
|
30
30
|
# Unlike stream(), this operation is eager and will load `limit` records into
|
31
31
|
# memory before returning.
|
32
32
|
# @param [sim.Status] status The status of the Sim resources to read. Can be
|
33
|
-
# `new`, `active`, `inactive`, or `scheduled`.
|
33
|
+
# `new`, `ready`, `active`, `inactive`, or `scheduled`.
|
34
34
|
# @param [String] fleet The SID or unique name of the Fleet to which a list of
|
35
35
|
# Sims are assigned.
|
36
36
|
# @param [String] iccid The
|
@@ -53,7 +53,7 @@ module Twilio
|
|
53
53
|
# This operation lazily loads records as efficiently as possible until the limit
|
54
54
|
# is reached.
|
55
55
|
# @param [sim.Status] status The status of the Sim resources to read. Can be
|
56
|
-
# `new`, `active`, `inactive`, or `scheduled`.
|
56
|
+
# `new`, `ready`, `active`, `inactive`, or `scheduled`.
|
57
57
|
# @param [String] fleet The SID or unique name of the Fleet to which a list of
|
58
58
|
# Sims are assigned.
|
59
59
|
# @param [String] iccid The
|
@@ -93,7 +93,7 @@ module Twilio
|
|
93
93
|
# Retrieve a single page of SimInstance records from the API.
|
94
94
|
# Request is executed immediately.
|
95
95
|
# @param [sim.Status] status The status of the Sim resources to read. Can be
|
96
|
-
# `new`, `active`, `inactive`, or `scheduled`.
|
96
|
+
# `new`, `ready`, `active`, `inactive`, or `scheduled`.
|
97
97
|
# @param [String] fleet The SID or unique name of the Fleet to which a list of
|
98
98
|
# Sims are assigned.
|
99
99
|
# @param [String] iccid The
|
@@ -201,7 +201,7 @@ module Twilio
|
|
201
201
|
# identifies the resource. It can be used in place of the resource's `sid` in the
|
202
202
|
# URL to address the resource.
|
203
203
|
# @param [sim.StatusUpdate] status The new status of the resource. Can be:
|
204
|
-
# `active
|
204
|
+
# `ready`, `active`, or `inactive`. See the [Super SIM Status
|
205
205
|
# Values](https://www.twilio.com/docs/iot/supersim/api/sim-resource#status-values)
|
206
206
|
# for more info.
|
207
207
|
# @param [String] fleet The SID or unique name of the Fleet to which the SIM
|
@@ -210,14 +210,19 @@ module Twilio
|
|
210
210
|
# after an asynchronous update has finished.
|
211
211
|
# @param [String] callback_method The HTTP method we should use to call
|
212
212
|
# `callback_url`. Can be: `GET` or `POST` and the default is POST.
|
213
|
+
# @param [String] account_sid The SID of the Account to which the Sim resource
|
214
|
+
# should belong. The Account SID can only be that of the requesting Account or
|
215
|
+
# that of a Subaccount of the requesting Account. Only valid when the Sim
|
216
|
+
# resource's status is new.
|
213
217
|
# @return [SimInstance] Updated SimInstance
|
214
|
-
def update(unique_name: :unset, status: :unset, fleet: :unset, callback_url: :unset, callback_method: :unset)
|
218
|
+
def update(unique_name: :unset, status: :unset, fleet: :unset, callback_url: :unset, callback_method: :unset, account_sid: :unset)
|
215
219
|
data = Twilio::Values.of({
|
216
220
|
'UniqueName' => unique_name,
|
217
221
|
'Status' => status,
|
218
222
|
'Fleet' => fleet,
|
219
223
|
'CallbackUrl' => callback_url,
|
220
224
|
'CallbackMethod' => callback_method,
|
225
|
+
'AccountSid' => account_sid,
|
221
226
|
})
|
222
227
|
|
223
228
|
payload = @version.update('POST', @uri, data: data)
|
@@ -348,7 +353,7 @@ module Twilio
|
|
348
353
|
# identifies the resource. It can be used in place of the resource's `sid` in the
|
349
354
|
# URL to address the resource.
|
350
355
|
# @param [sim.StatusUpdate] status The new status of the resource. Can be:
|
351
|
-
# `active
|
356
|
+
# `ready`, `active`, or `inactive`. See the [Super SIM Status
|
352
357
|
# Values](https://www.twilio.com/docs/iot/supersim/api/sim-resource#status-values)
|
353
358
|
# for more info.
|
354
359
|
# @param [String] fleet The SID or unique name of the Fleet to which the SIM
|
@@ -357,14 +362,19 @@ module Twilio
|
|
357
362
|
# after an asynchronous update has finished.
|
358
363
|
# @param [String] callback_method The HTTP method we should use to call
|
359
364
|
# `callback_url`. Can be: `GET` or `POST` and the default is POST.
|
365
|
+
# @param [String] account_sid The SID of the Account to which the Sim resource
|
366
|
+
# should belong. The Account SID can only be that of the requesting Account or
|
367
|
+
# that of a Subaccount of the requesting Account. Only valid when the Sim
|
368
|
+
# resource's status is new.
|
360
369
|
# @return [SimInstance] Updated SimInstance
|
361
|
-
def update(unique_name: :unset, status: :unset, fleet: :unset, callback_url: :unset, callback_method: :unset)
|
370
|
+
def update(unique_name: :unset, status: :unset, fleet: :unset, callback_url: :unset, callback_method: :unset, account_sid: :unset)
|
362
371
|
context.update(
|
363
372
|
unique_name: unique_name,
|
364
373
|
status: status,
|
365
374
|
fleet: fleet,
|
366
375
|
callback_url: callback_url,
|
367
376
|
callback_method: callback_method,
|
377
|
+
account_sid: account_sid,
|
368
378
|
)
|
369
379
|
end
|
370
380
|
|
@@ -140,7 +140,8 @@ module Twilio
|
|
140
140
|
# `break`, and `email`.
|
141
141
|
# @param [Boolean] available Whether the Worker should be eligible to receive a
|
142
142
|
# Task when it occupies the Activity. A value of `true`, `1`, or `yes` specifies
|
143
|
-
# the Activity is available. All other values specify that it is not.
|
143
|
+
# the Activity is available. All other values specify that it is not. The value
|
144
|
+
# cannot be changed after the Activity is created.
|
144
145
|
# @return [ActivityInstance] Created ActivityInstance
|
145
146
|
def create(friendly_name: nil, available: :unset)
|
146
147
|
data = Twilio::Values.of({'FriendlyName' => friendly_name, 'Available' => available, })
|
data/lib/twilio-ruby/version.rb
CHANGED
@@ -21,6 +21,48 @@ describe 'Version Action Methods' do
|
|
21
21
|
expect(actual).to_not eq(nil)
|
22
22
|
end
|
23
23
|
|
24
|
+
describe 'stream' do
|
25
|
+
before(:each) do
|
26
|
+
@holodeck.mock(
|
27
|
+
Twilio::Response.new(
|
28
|
+
200,
|
29
|
+
'{
|
30
|
+
"next_page_uri": "/2010-04-01/Accounts/AC123/Messages.json?Page=1",
|
31
|
+
"messages": [{"body": "payload0"}, {"body": "payload1"}]
|
32
|
+
}'
|
33
|
+
)
|
34
|
+
)
|
35
|
+
@holodeck.mock(
|
36
|
+
Twilio::Response.new(
|
37
|
+
200,
|
38
|
+
'{
|
39
|
+
"next_page_uri": "/2010-04-01/Accounts/AC123/Messages.json?Page=2",
|
40
|
+
"messages": [{"body": "payload2"}, {"body": "payload3"}]
|
41
|
+
}'
|
42
|
+
)
|
43
|
+
)
|
44
|
+
@holodeck.mock(
|
45
|
+
Twilio::Response.new(
|
46
|
+
200,
|
47
|
+
'{
|
48
|
+
"next_page_uri": null,
|
49
|
+
"messages": [{"body": "payload4"}]
|
50
|
+
}'
|
51
|
+
)
|
52
|
+
)
|
53
|
+
end
|
54
|
+
|
55
|
+
it 'streams all results' do
|
56
|
+
actual = @client.messages.stream
|
57
|
+
expect(actual.count).to eq(5)
|
58
|
+
end
|
59
|
+
|
60
|
+
it 'limits results' do
|
61
|
+
actual = @client.messages.stream(limit: 3)
|
62
|
+
expect(actual.count).to eq(3)
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
24
66
|
it 'receives create responses' do
|
25
67
|
@holodeck.mock(
|
26
68
|
Twilio::Response.new(
|
data/spec/holodeck/holodeck.rb
CHANGED
@@ -40,12 +40,12 @@ class Holodeck
|
|
40
40
|
ANY = Request.new(any: true)
|
41
41
|
|
42
42
|
def initialize
|
43
|
-
@
|
43
|
+
@responses = []
|
44
44
|
@requests = []
|
45
45
|
end
|
46
46
|
|
47
47
|
def mock(response)
|
48
|
-
@
|
48
|
+
@responses << response
|
49
49
|
end
|
50
50
|
|
51
51
|
def request(host, port, method, url, params = {}, data = {}, headers = {}, auth = nil, _timeout = nil)
|
@@ -57,7 +57,7 @@ class Holodeck
|
|
57
57
|
headers: headers,
|
58
58
|
auth: auth
|
59
59
|
)
|
60
|
-
@
|
60
|
+
@responses.shift
|
61
61
|
end
|
62
62
|
|
63
63
|
def has_request?(request)
|
@@ -0,0 +1,85 @@
|
|
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 'Configuration' do
|
12
|
+
it "can fetch" do
|
13
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
14
|
+
|
15
|
+
expect {
|
16
|
+
@client.conversations.v1.configuration().fetch()
|
17
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
18
|
+
|
19
|
+
expect(
|
20
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
21
|
+
method: 'get',
|
22
|
+
url: 'https://conversations.twilio.com/v1/Configuration',
|
23
|
+
))).to eq(true)
|
24
|
+
end
|
25
|
+
|
26
|
+
it "receives fetch responses" do
|
27
|
+
@holodeck.mock(Twilio::Response.new(
|
28
|
+
200,
|
29
|
+
%q[
|
30
|
+
{
|
31
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
32
|
+
"default_chat_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
33
|
+
"default_messaging_service_sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
34
|
+
"default_inactive_timer": "PT1M",
|
35
|
+
"default_closed_timer": "PT10M",
|
36
|
+
"url": "https://conversations.twilio.com/v1/Configuration",
|
37
|
+
"links": {
|
38
|
+
"service": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Configuration"
|
39
|
+
}
|
40
|
+
}
|
41
|
+
]
|
42
|
+
))
|
43
|
+
|
44
|
+
actual = @client.conversations.v1.configuration().fetch()
|
45
|
+
|
46
|
+
expect(actual).to_not eq(nil)
|
47
|
+
end
|
48
|
+
|
49
|
+
it "can update" do
|
50
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
51
|
+
|
52
|
+
expect {
|
53
|
+
@client.conversations.v1.configuration().update()
|
54
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
55
|
+
|
56
|
+
expect(
|
57
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
58
|
+
method: 'post',
|
59
|
+
url: 'https://conversations.twilio.com/v1/Configuration',
|
60
|
+
))).to eq(true)
|
61
|
+
end
|
62
|
+
|
63
|
+
it "receives update responses" do
|
64
|
+
@holodeck.mock(Twilio::Response.new(
|
65
|
+
200,
|
66
|
+
%q[
|
67
|
+
{
|
68
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
69
|
+
"default_chat_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
70
|
+
"default_messaging_service_sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
71
|
+
"default_inactive_timer": "PT1M",
|
72
|
+
"default_closed_timer": "PT10M",
|
73
|
+
"url": "https://conversations.twilio.com/v1/Configuration",
|
74
|
+
"links": {
|
75
|
+
"service": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Configuration"
|
76
|
+
}
|
77
|
+
}
|
78
|
+
]
|
79
|
+
))
|
80
|
+
|
81
|
+
actual = @client.conversations.v1.configuration().update()
|
82
|
+
|
83
|
+
expect(actual).to_not eq(nil)
|
84
|
+
end
|
85
|
+
end
|
@@ -31,6 +31,7 @@ describe 'DeliveryReceipt' do
|
|
31
31
|
%q[
|
32
32
|
{
|
33
33
|
"sid": "DYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
34
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
34
35
|
"conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
35
36
|
"message_sid": "IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
36
37
|
"channel_message_sid": "SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
@@ -84,6 +85,7 @@ describe 'DeliveryReceipt' do
|
|
84
85
|
"delivery_receipts": [
|
85
86
|
{
|
86
87
|
"sid": "DYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
88
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
87
89
|
"conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
88
90
|
"message_sid": "IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
89
91
|
"channel_message_sid": "SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
@@ -96,6 +98,7 @@ describe 'DeliveryReceipt' do
|
|
96
98
|
},
|
97
99
|
{
|
98
100
|
"sid": "DYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
101
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
99
102
|
"conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
100
103
|
"message_sid": "IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
101
104
|
"channel_message_sid": "SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
@@ -108,6 +111,7 @@ describe 'DeliveryReceipt' do
|
|
108
111
|
},
|
109
112
|
{
|
110
113
|
"sid": "DYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
114
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
111
115
|
"conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
112
116
|
"message_sid": "IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
113
117
|
"channel_message_sid": "SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|