twilio-ruby 5.0.0.rc9 → 5.0.0.rc10
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/lib/twilio-ruby/rest/api/v2010/account/address/dependent_phone_number.rb +2 -9
- data/lib/twilio-ruby/rest/api/v2010/account/address.rb +13 -24
- data/lib/twilio-ruby/rest/api/v2010/account/application.rb +12 -23
- data/lib/twilio-ruby/rest/api/v2010/account/authorized_connect_app.rb +6 -15
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/local.rb +2 -9
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/mobile.rb +2 -9
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/toll_free.rb +2 -9
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb +9 -18
- data/lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb +15 -23
- data/lib/twilio-ruby/rest/api/v2010/account/call/feedback_summary.rb +8 -15
- data/lib/twilio-ruby/rest/api/v2010/account/call/notification.rb +9 -18
- data/lib/twilio-ruby/rest/api/v2010/account/call/recording.rb +9 -18
- data/lib/twilio-ruby/rest/api/v2010/account/call.rb +20 -28
- data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +15 -24
- data/lib/twilio-ruby/rest/api/v2010/account/conference.rb +7 -16
- data/lib/twilio-ruby/rest/api/v2010/account/connect_app.rb +10 -20
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/local.rb +2 -10
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/mobile.rb +2 -10
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/toll_free.rb +2 -10
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number.rb +12 -23
- data/lib/twilio-ruby/rest/api/v2010/account/key.rb +324 -0
- data/lib/twilio-ruby/rest/api/v2010/account/message/feedback.rb +4 -9
- data/lib/twilio-ruby/rest/api/v2010/account/message/media.rb +9 -18
- data/lib/twilio-ruby/rest/api/v2010/account/message.rb +23 -29
- data/lib/twilio-ruby/rest/api/v2010/account/new_key.rb +145 -0
- data/lib/twilio-ruby/rest/api/v2010/account/new_signing_key.rb +145 -0
- data/lib/twilio-ruby/rest/api/v2010/account/notification.rb +7 -16
- data/lib/twilio-ruby/rest/api/v2010/account/outgoing_caller_id.rb +12 -21
- data/lib/twilio-ruby/rest/api/v2010/account/queue/member.rb +13 -23
- data/lib/twilio-ruby/rest/api/v2010/account/queue.rb +13 -24
- data/lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb +9 -18
- data/lib/twilio-ruby/rest/api/v2010/account/recording.rb +8 -17
- data/lib/twilio-ruby/rest/api/v2010/account/sandbox.rb +8 -15
- data/lib/twilio-ruby/rest/api/v2010/account/signing_key.rb +324 -0
- data/lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb +16 -27
- data/lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb +14 -24
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/credential_list_mapping.rb +11 -21
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.rb +11 -21
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb +23 -31
- data/lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb +16 -27
- data/lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb +14 -24
- data/lib/twilio-ruby/rest/api/v2010/account/sip.rb +1 -8
- data/lib/twilio-ruby/rest/api/v2010/account/sms/short_code.rb +10 -20
- data/lib/twilio-ruby/rest/api/v2010/account/sms/sms_message.rb +13 -23
- data/lib/twilio-ruby/rest/api/v2010/account/sms.rb +1 -7
- data/lib/twilio-ruby/rest/api/v2010/account/token.rb +2 -7
- data/lib/twilio-ruby/rest/api/v2010/account/transcription.rb +7 -16
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/all_time.rb +1 -8
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/daily.rb +1 -8
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/last_month.rb +1 -8
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/monthly.rb +1 -8
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/this_month.rb +1 -8
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/today.rb +1 -8
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yearly.rb +1 -8
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yesterday.rb +1 -8
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record.rb +1 -8
- data/lib/twilio-ruby/rest/api/v2010/account/usage/trigger.rb +12 -23
- data/lib/twilio-ruby/rest/api/v2010/account/usage.rb +1 -6
- data/lib/twilio-ruby/rest/api/v2010/account/validation_request.rb +2 -7
- data/lib/twilio-ruby/rest/api/v2010/account.rb +131 -38
- data/lib/twilio-ruby/rest/api/v2010.rb +17 -1
- data/lib/twilio-ruby/rest/api.rb +16 -0
- data/lib/twilio-ruby/rest/client.rb +16 -0
- data/lib/twilio-ruby/rest/ip_messaging/v1/credential.rb +13 -28
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/member.rb +11 -21
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/message.rb +62 -20
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb +17 -28
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/role.rb +12 -23
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/user.rb +23 -25
- data/lib/twilio-ruby/rest/ip_messaging/v1/service.rb +13 -24
- data/lib/twilio-ruby/rest/ip_messaging/v1.rb +1 -1
- data/lib/twilio-ruby/rest/lookups/v1/phone_number.rb +5 -12
- data/lib/twilio-ruby/rest/lookups/v1.rb +1 -1
- data/lib/twilio-ruby/rest/monitor/v1/alert.rb +5 -14
- data/lib/twilio-ruby/rest/monitor/v1/event.rb +4 -13
- data/lib/twilio-ruby/rest/monitor/v1.rb +1 -1
- data/lib/twilio-ruby/rest/notifications/v1/credential.rb +13 -28
- data/lib/twilio-ruby/rest/notifications/v1/service/binding.rb +8 -18
- data/lib/twilio-ruby/rest/notifications/v1/service/notification.rb +8 -8
- data/lib/twilio-ruby/rest/notifications/v1/service.rb +10 -21
- data/lib/twilio-ruby/rest/notifications/v1.rb +1 -1
- data/lib/twilio-ruby/rest/preview/wireless/command.rb +4 -14
- data/lib/twilio-ruby/rest/preview/wireless/device/usage.rb +6 -13
- data/lib/twilio-ruby/rest/preview/wireless/device.rb +8 -19
- data/lib/twilio-ruby/rest/preview/wireless/rate_plan.rb +4 -13
- data/lib/twilio-ruby/rest/preview/wireless.rb +1 -1
- data/lib/twilio-ruby/rest/pricing/v1/messaging/country.rb +4 -13
- data/lib/twilio-ruby/rest/pricing/v1/messaging.rb +0 -5
- data/lib/twilio-ruby/rest/pricing/v1/phone_number/country.rb +4 -13
- data/lib/twilio-ruby/rest/pricing/v1/phone_number.rb +0 -5
- data/lib/twilio-ruby/rest/pricing/v1/voice/country.rb +4 -13
- data/lib/twilio-ruby/rest/pricing/v1/voice/number.rb +4 -10
- data/lib/twilio-ruby/rest/pricing/v1/voice.rb +0 -6
- data/lib/twilio-ruby/rest/pricing/v1.rb +1 -1
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb +13 -23
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb +6 -15
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb +13 -23
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb +13 -24
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_statistics.rb +8 -15
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queues_statistics.rb +1 -8
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb +13 -24
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_statistics.rb +8 -15
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_statistics.rb +6 -13
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker.rb +13 -24
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_statistics.rb +8 -15
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb +13 -24
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_statistics.rb +6 -13
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace.rb +15 -26
- data/lib/twilio-ruby/rest/taskrouter/v1.rb +1 -1
- data/lib/twilio-ruby/rest/trunking/v1/trunk/credential_list.rb +8 -18
- data/lib/twilio-ruby/rest/trunking/v1/trunk/ip_access_control_list.rb +8 -18
- data/lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb +12 -23
- data/lib/twilio-ruby/rest/trunking/v1/trunk/phone_number.rb +8 -18
- data/lib/twilio-ruby/rest/trunking/v1/trunk.rb +12 -23
- data/lib/twilio-ruby/rest/trunking/v1.rb +1 -1
- data/lib/twilio-ruby/version.rb +1 -1
- data/spec/integration/api/v2010/account/key_spec.rb +178 -0
- data/spec/integration/api/v2010/account/message_spec.rb +2 -3
- data/spec/integration/api/v2010/account/new_key_spec.rb +45 -0
- data/spec/integration/api/v2010/account/new_signing_key_spec.rb +45 -0
- data/spec/integration/api/v2010/account/signing_key_spec.rb +178 -0
- data/spec/integration/api/v2010/account/sip/ip_access_control_list/ip_address_spec.rb +3 -7
- data/spec/integration/ip_messaging/v1/credential_spec.rb +5 -10
- data/spec/integration/ip_messaging/v1/service/channel/message_spec.rb +37 -0
- data/spec/integration/ip_messaging/v1/service/channel_spec.rb +3 -7
- data/spec/integration/ip_messaging/v1/service/user_spec.rb +3 -6
- data/spec/integration/notifications/v1/credential_spec.rb +5 -10
- data/spec/integration/notifications/v1/service/notification_spec.rb +1 -0
- data/spec/integration/preview/wireless/device_spec.rb +4 -4
- data/spec/integration/taskrouter/v1/workspace/task/reservation_spec.rb +3 -6
- metadata +15 -3
|
@@ -12,7 +12,6 @@ module Twilio
|
|
|
12
12
|
##
|
|
13
13
|
# Initialize the TrunkList
|
|
14
14
|
# @param [Version] version Version that contains the resource
|
|
15
|
-
|
|
16
15
|
# @return [TrunkList] TrunkList
|
|
17
16
|
def initialize(version)
|
|
18
17
|
super(version)
|
|
@@ -31,7 +30,6 @@ module Twilio
|
|
|
31
30
|
# @param [String] disaster_recovery_method The disaster_recovery_method
|
|
32
31
|
# @param [String] recording The recording
|
|
33
32
|
# @param [Boolean] secure The secure
|
|
34
|
-
|
|
35
33
|
# @return [TrunkInstance] Newly created TrunkInstance
|
|
36
34
|
def create(friendly_name: nil, domain_name: nil, disaster_recovery_url: nil, disaster_recovery_method: nil, recording: nil, secure: nil)
|
|
37
35
|
data = {
|
|
@@ -65,7 +63,6 @@ module Twilio
|
|
|
65
63
|
# the default value of 50 records. If no page_size is defined
|
|
66
64
|
# but a limit is defined, stream() will attempt to read the
|
|
67
65
|
# limit with the most efficient page size, i.e. min(limit, 1000)
|
|
68
|
-
|
|
69
66
|
# @return [Array] Array of up to limit results
|
|
70
67
|
def list(limit: nil, page_size: nil)
|
|
71
68
|
self.stream(
|
|
@@ -84,7 +81,6 @@ module Twilio
|
|
|
84
81
|
# the default value of 50 records. If no page_size is defined
|
|
85
82
|
# but a limit is defined, stream() will attempt to read the
|
|
86
83
|
# limit with the most efficient page size, i.e. min(limit, 1000)
|
|
87
|
-
|
|
88
84
|
# @return [Enumerable] Enumerable that will yield up to limit results
|
|
89
85
|
def stream(limit: nil, page_size: nil)
|
|
90
86
|
limits = @version.read_limits(limit, page_size)
|
|
@@ -124,7 +120,6 @@ module Twilio
|
|
|
124
120
|
# @param [String] page_token PageToken provided by the API
|
|
125
121
|
# @param [Integer] page_number Page Number, this value is simply for client state
|
|
126
122
|
# @param [Integer] page_size Number of records to return, defaults to 50
|
|
127
|
-
|
|
128
123
|
# @return [Page] Page of TrunkInstance
|
|
129
124
|
def page(page_token: nil, page_number: nil, page_size: nil)
|
|
130
125
|
params = {
|
|
@@ -153,7 +148,6 @@ module Twilio
|
|
|
153
148
|
# @param [Version] version Version that contains the resource
|
|
154
149
|
# @param [Response] response Response from the API
|
|
155
150
|
# @param [Hash] solution Path solution for the resource
|
|
156
|
-
|
|
157
151
|
# @return [TrunkPage] TrunkPage
|
|
158
152
|
def initialize(version, response, solution)
|
|
159
153
|
super(version, response)
|
|
@@ -165,7 +159,6 @@ module Twilio
|
|
|
165
159
|
##
|
|
166
160
|
# Build an instance of TrunkInstance
|
|
167
161
|
# @param [Hash] payload Payload response from the API
|
|
168
|
-
|
|
169
162
|
# @return [TrunkInstance] TrunkInstance
|
|
170
163
|
def get_instance(payload)
|
|
171
164
|
return TrunkInstance.new(
|
|
@@ -186,7 +179,6 @@ module Twilio
|
|
|
186
179
|
# Initialize the TrunkContext
|
|
187
180
|
# @param [Version] version Version that contains the resource
|
|
188
181
|
# @param [String] sid The sid
|
|
189
|
-
|
|
190
182
|
# @return [TrunkContext] TrunkContext
|
|
191
183
|
def initialize(version, sid)
|
|
192
184
|
super(version)
|
|
@@ -219,7 +211,7 @@ module Twilio
|
|
|
219
211
|
return TrunkInstance.new(
|
|
220
212
|
@version,
|
|
221
213
|
payload,
|
|
222
|
-
sid: @solution[
|
|
214
|
+
sid: @solution[:sid],
|
|
223
215
|
)
|
|
224
216
|
end
|
|
225
217
|
|
|
@@ -238,7 +230,6 @@ module Twilio
|
|
|
238
230
|
# @param [String] disaster_recovery_method The disaster_recovery_method
|
|
239
231
|
# @param [String] recording The recording
|
|
240
232
|
# @param [Boolean] secure The secure
|
|
241
|
-
|
|
242
233
|
# @return [TrunkInstance] Updated TrunkInstance
|
|
243
234
|
def update(friendly_name: nil, domain_name: nil, disaster_recovery_url: nil, disaster_recovery_method: nil, recording: nil, secure: nil)
|
|
244
235
|
data = {
|
|
@@ -259,7 +250,7 @@ module Twilio
|
|
|
259
250
|
return TrunkInstance.new(
|
|
260
251
|
@version,
|
|
261
252
|
payload,
|
|
262
|
-
sid: @solution[
|
|
253
|
+
sid: @solution[:sid],
|
|
263
254
|
)
|
|
264
255
|
end
|
|
265
256
|
|
|
@@ -365,7 +356,6 @@ module Twilio
|
|
|
365
356
|
# @param [Version] version Version that contains the resource
|
|
366
357
|
# @param [Hash] payload payload that contains response from Twilio
|
|
367
358
|
# @param [String] sid The sid
|
|
368
|
-
|
|
369
359
|
# @return [TrunkInstance] TrunkInstance
|
|
370
360
|
def initialize(version, payload, sid: nil)
|
|
371
361
|
super(version)
|
|
@@ -399,7 +389,6 @@ module Twilio
|
|
|
399
389
|
# Generate an instance context for the instance, the context is capable of
|
|
400
390
|
# performing various actions. All instance actions are proxied to the context
|
|
401
391
|
# @param [Version] version Version that contains the resource
|
|
402
|
-
|
|
403
392
|
# @return [TrunkContext] TrunkContext for this TrunkInstance
|
|
404
393
|
def context
|
|
405
394
|
unless @instance_context
|
|
@@ -471,14 +460,14 @@ module Twilio
|
|
|
471
460
|
# Fetch a TrunkInstance
|
|
472
461
|
# @return [TrunkInstance] Fetched TrunkInstance
|
|
473
462
|
def fetch
|
|
474
|
-
|
|
463
|
+
context.fetch
|
|
475
464
|
end
|
|
476
465
|
|
|
477
466
|
##
|
|
478
467
|
# Deletes the TrunkInstance
|
|
479
468
|
# @return [Boolean] true if delete succeeds, true otherwise
|
|
480
469
|
def delete
|
|
481
|
-
|
|
470
|
+
context.delete
|
|
482
471
|
end
|
|
483
472
|
|
|
484
473
|
##
|
|
@@ -489,10 +478,10 @@ module Twilio
|
|
|
489
478
|
# @param [String] disaster_recovery_method The disaster_recovery_method
|
|
490
479
|
# @param [String] recording The recording
|
|
491
480
|
# @param [Boolean] secure The secure
|
|
492
|
-
|
|
493
481
|
# @return [TrunkInstance] Updated TrunkInstance
|
|
494
482
|
def update(friendly_name: nil, domain_name: nil, disaster_recovery_url: nil, disaster_recovery_method: nil, recording: nil, secure: nil)
|
|
495
|
-
|
|
483
|
+
context.update(
|
|
484
|
+
friendly_name: friendly_name,
|
|
496
485
|
domain_name: domain_name,
|
|
497
486
|
disaster_recovery_url: disaster_recovery_url,
|
|
498
487
|
disaster_recovery_method: disaster_recovery_method,
|
|
@@ -505,35 +494,35 @@ module Twilio
|
|
|
505
494
|
# Access the origination_urls
|
|
506
495
|
# @return [origination_urls] origination_urls
|
|
507
496
|
def origination_urls
|
|
508
|
-
|
|
497
|
+
context.origination_urls
|
|
509
498
|
end
|
|
510
499
|
|
|
511
500
|
##
|
|
512
501
|
# Access the credentials_lists
|
|
513
502
|
# @return [credentials_lists] credentials_lists
|
|
514
503
|
def credentials_lists
|
|
515
|
-
|
|
504
|
+
context.credentials_lists
|
|
516
505
|
end
|
|
517
506
|
|
|
518
507
|
##
|
|
519
508
|
# Access the ip_access_control_lists
|
|
520
509
|
# @return [ip_access_control_lists] ip_access_control_lists
|
|
521
510
|
def ip_access_control_lists
|
|
522
|
-
|
|
511
|
+
context.ip_access_control_lists
|
|
523
512
|
end
|
|
524
513
|
|
|
525
514
|
##
|
|
526
515
|
# Access the phone_numbers
|
|
527
516
|
# @return [phone_numbers] phone_numbers
|
|
528
517
|
def phone_numbers
|
|
529
|
-
|
|
518
|
+
context.phone_numbers
|
|
530
519
|
end
|
|
531
520
|
|
|
532
521
|
##
|
|
533
522
|
# Provide a user friendly representation
|
|
534
523
|
def to_s
|
|
535
|
-
|
|
536
|
-
"<Twilio.Trunking.V1.TrunkInstance #{
|
|
524
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
|
525
|
+
"<Twilio.Trunking.V1.TrunkInstance #{values}>"
|
|
537
526
|
end
|
|
538
527
|
end
|
|
539
528
|
end
|
data/lib/twilio-ruby/version.rb
CHANGED
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
##
|
|
2
|
+
# This code was generated by
|
|
3
|
+
# \ / _ _ _| _ _
|
|
4
|
+
# | (_)\/(_)(_|\/| |(/_ v1.0.0
|
|
5
|
+
# / /
|
|
6
|
+
|
|
7
|
+
require 'spec_helper.rb'
|
|
8
|
+
|
|
9
|
+
describe 'Key' do
|
|
10
|
+
it "can fetch" do
|
|
11
|
+
@holodeck.mock(Twilio::TwilioResponse.new(500, ''))
|
|
12
|
+
|
|
13
|
+
expect {
|
|
14
|
+
@client.api.v2010.accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
|
15
|
+
.keys("SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").fetch()
|
|
16
|
+
}.to raise_exception(Twilio::REST::TwilioException)
|
|
17
|
+
|
|
18
|
+
values = {}
|
|
19
|
+
expect(
|
|
20
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
|
21
|
+
method: 'get',
|
|
22
|
+
url: 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys/SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json',
|
|
23
|
+
))).to eq(true)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
it "receives fetch responses" do
|
|
27
|
+
@holodeck.mock(Twilio::TwilioResponse.new(
|
|
28
|
+
200,
|
|
29
|
+
%q[
|
|
30
|
+
{
|
|
31
|
+
"sid": "SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
32
|
+
"friendly_name": "foo",
|
|
33
|
+
"date_created": "Mon, 13 Jun 2016 22:50:08 +0000",
|
|
34
|
+
"date_updated": "Mon, 13 Jun 2016 22:50:08 +0000"
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
))
|
|
38
|
+
|
|
39
|
+
actual = @client.api.v2010.accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
|
40
|
+
.keys("SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").fetch()
|
|
41
|
+
|
|
42
|
+
expect(actual).to_not eq(nil)
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
it "can update" do
|
|
46
|
+
@holodeck.mock(Twilio::TwilioResponse.new(500, ''))
|
|
47
|
+
|
|
48
|
+
expect {
|
|
49
|
+
@client.api.v2010.accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
|
50
|
+
.keys("SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").update()
|
|
51
|
+
}.to raise_exception(Twilio::REST::TwilioException)
|
|
52
|
+
|
|
53
|
+
values = {}
|
|
54
|
+
expect(
|
|
55
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
|
56
|
+
method: 'post',
|
|
57
|
+
url: 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys/SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json',
|
|
58
|
+
))).to eq(true)
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
it "receives update responses" do
|
|
62
|
+
@holodeck.mock(Twilio::TwilioResponse.new(
|
|
63
|
+
200,
|
|
64
|
+
%q[
|
|
65
|
+
{
|
|
66
|
+
"sid": "SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
67
|
+
"friendly_name": "foo",
|
|
68
|
+
"date_created": "Mon, 13 Jun 2016 22:50:08 +0000",
|
|
69
|
+
"date_updated": "Mon, 13 Jun 2016 22:50:08 +0000"
|
|
70
|
+
}
|
|
71
|
+
]
|
|
72
|
+
))
|
|
73
|
+
|
|
74
|
+
actual = @client.api.v2010.accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
|
75
|
+
.keys("SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").update()
|
|
76
|
+
|
|
77
|
+
expect(actual).to_not eq(nil)
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
it "can delete" do
|
|
81
|
+
@holodeck.mock(Twilio::TwilioResponse.new(500, ''))
|
|
82
|
+
|
|
83
|
+
expect {
|
|
84
|
+
@client.api.v2010.accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
|
85
|
+
.keys("SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").delete()
|
|
86
|
+
}.to raise_exception(Twilio::REST::TwilioException)
|
|
87
|
+
|
|
88
|
+
values = {}
|
|
89
|
+
expect(
|
|
90
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
|
91
|
+
method: 'delete',
|
|
92
|
+
url: 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys/SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json',
|
|
93
|
+
))).to eq(true)
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
it "receives delete responses" do
|
|
97
|
+
@holodeck.mock(Twilio::TwilioResponse.new(
|
|
98
|
+
204,
|
|
99
|
+
nil,
|
|
100
|
+
))
|
|
101
|
+
|
|
102
|
+
actual = @client.api.v2010.accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
|
103
|
+
.keys("SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").delete()
|
|
104
|
+
|
|
105
|
+
expect(actual).to eq(true)
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
it "can read" do
|
|
109
|
+
@holodeck.mock(Twilio::TwilioResponse.new(500, ''))
|
|
110
|
+
|
|
111
|
+
expect {
|
|
112
|
+
@client.api.v2010.accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
|
113
|
+
.keys.list()
|
|
114
|
+
}.to raise_exception(Twilio::REST::TwilioException)
|
|
115
|
+
|
|
116
|
+
values = {}
|
|
117
|
+
expect(
|
|
118
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
|
119
|
+
method: 'get',
|
|
120
|
+
url: 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys.json',
|
|
121
|
+
))).to eq(true)
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
it "receives read_full responses" do
|
|
125
|
+
@holodeck.mock(Twilio::TwilioResponse.new(
|
|
126
|
+
200,
|
|
127
|
+
%q[
|
|
128
|
+
{
|
|
129
|
+
"keys": [
|
|
130
|
+
{
|
|
131
|
+
"sid": "SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
132
|
+
"friendly_name": "foo",
|
|
133
|
+
"date_created": "Mon, 13 Jun 2016 22:50:08 +0000",
|
|
134
|
+
"date_updated": "Mon, 13 Jun 2016 22:50:08 +0000"
|
|
135
|
+
}
|
|
136
|
+
],
|
|
137
|
+
"first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys.json?PageSize=50&Page=0",
|
|
138
|
+
"end": 3,
|
|
139
|
+
"previous_page_uri": null,
|
|
140
|
+
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys.json?PageSize=50&Page=0",
|
|
141
|
+
"page_size": 50,
|
|
142
|
+
"start": 0,
|
|
143
|
+
"next_page_uri": null,
|
|
144
|
+
"page": 0
|
|
145
|
+
}
|
|
146
|
+
]
|
|
147
|
+
))
|
|
148
|
+
|
|
149
|
+
actual = @client.api.v2010.accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
|
150
|
+
.keys.list()
|
|
151
|
+
|
|
152
|
+
expect(actual).to_not eq(nil)
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
it "receives read_empty responses" do
|
|
156
|
+
@holodeck.mock(Twilio::TwilioResponse.new(
|
|
157
|
+
200,
|
|
158
|
+
%q[
|
|
159
|
+
{
|
|
160
|
+
"keys": [],
|
|
161
|
+
"first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys.json?PageSize=50&Page=0",
|
|
162
|
+
"end": 3,
|
|
163
|
+
"previous_page_uri": null,
|
|
164
|
+
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys.json?PageSize=50&Page=0",
|
|
165
|
+
"page_size": 50,
|
|
166
|
+
"start": 0,
|
|
167
|
+
"next_page_uri": null,
|
|
168
|
+
"page": 0
|
|
169
|
+
}
|
|
170
|
+
]
|
|
171
|
+
))
|
|
172
|
+
|
|
173
|
+
actual = @client.api.v2010.accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
|
174
|
+
.keys.list()
|
|
175
|
+
|
|
176
|
+
expect(actual).to_not eq(nil)
|
|
177
|
+
end
|
|
178
|
+
end
|
|
@@ -12,12 +12,11 @@ describe 'Message' do
|
|
|
12
12
|
|
|
13
13
|
expect {
|
|
14
14
|
@client.api.v2010.accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
|
15
|
-
.messages.create(to: "+123456789"
|
|
15
|
+
.messages.create(to: "+123456789")
|
|
16
16
|
}.to raise_exception(Twilio::REST::TwilioException)
|
|
17
17
|
|
|
18
18
|
values = {
|
|
19
19
|
'To' => "+123456789",
|
|
20
|
-
'From' => "+987654321",
|
|
21
20
|
}
|
|
22
21
|
expect(
|
|
23
22
|
@holodeck.has_request?(Holodeck::Request.new(
|
|
@@ -58,7 +57,7 @@ describe 'Message' do
|
|
|
58
57
|
))
|
|
59
58
|
|
|
60
59
|
actual = @client.api.v2010.accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
|
61
|
-
.messages.create(to: "+123456789"
|
|
60
|
+
.messages.create(to: "+123456789")
|
|
62
61
|
|
|
63
62
|
expect(actual).to_not eq(nil)
|
|
64
63
|
end
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
##
|
|
2
|
+
# This code was generated by
|
|
3
|
+
# \ / _ _ _| _ _
|
|
4
|
+
# | (_)\/(_)(_|\/| |(/_ v1.0.0
|
|
5
|
+
# / /
|
|
6
|
+
|
|
7
|
+
require 'spec_helper.rb'
|
|
8
|
+
|
|
9
|
+
describe 'NewKey' do
|
|
10
|
+
it "can create" do
|
|
11
|
+
@holodeck.mock(Twilio::TwilioResponse.new(500, ''))
|
|
12
|
+
|
|
13
|
+
expect {
|
|
14
|
+
@client.api.v2010.accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
|
15
|
+
.new_keys.create()
|
|
16
|
+
}.to raise_exception(Twilio::REST::TwilioException)
|
|
17
|
+
|
|
18
|
+
values = {}
|
|
19
|
+
expect(
|
|
20
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
|
21
|
+
method: 'post',
|
|
22
|
+
url: 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys.json',
|
|
23
|
+
))).to eq(true)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
it "receives create responses" do
|
|
27
|
+
@holodeck.mock(Twilio::TwilioResponse.new(
|
|
28
|
+
201,
|
|
29
|
+
%q[
|
|
30
|
+
{
|
|
31
|
+
"sid": "SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
32
|
+
"friendly_name": "foo",
|
|
33
|
+
"date_created": "Mon, 13 Jun 2016 22:50:08 +0000",
|
|
34
|
+
"date_updated": "Mon, 13 Jun 2016 22:50:08 +0000",
|
|
35
|
+
"secret": "foobar"
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
))
|
|
39
|
+
|
|
40
|
+
actual = @client.api.v2010.accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
|
41
|
+
.new_keys.create()
|
|
42
|
+
|
|
43
|
+
expect(actual).to_not eq(nil)
|
|
44
|
+
end
|
|
45
|
+
end
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
##
|
|
2
|
+
# This code was generated by
|
|
3
|
+
# \ / _ _ _| _ _
|
|
4
|
+
# | (_)\/(_)(_|\/| |(/_ v1.0.0
|
|
5
|
+
# / /
|
|
6
|
+
|
|
7
|
+
require 'spec_helper.rb'
|
|
8
|
+
|
|
9
|
+
describe 'NewSigningKey' do
|
|
10
|
+
it "can create" do
|
|
11
|
+
@holodeck.mock(Twilio::TwilioResponse.new(500, ''))
|
|
12
|
+
|
|
13
|
+
expect {
|
|
14
|
+
@client.api.v2010.accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
|
15
|
+
.new_signing_keys.create()
|
|
16
|
+
}.to raise_exception(Twilio::REST::TwilioException)
|
|
17
|
+
|
|
18
|
+
values = {}
|
|
19
|
+
expect(
|
|
20
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
|
21
|
+
method: 'post',
|
|
22
|
+
url: 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SigningKeys.json',
|
|
23
|
+
))).to eq(true)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
it "receives create responses" do
|
|
27
|
+
@holodeck.mock(Twilio::TwilioResponse.new(
|
|
28
|
+
201,
|
|
29
|
+
%q[
|
|
30
|
+
{
|
|
31
|
+
"sid": "SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
32
|
+
"friendly_name": "foo",
|
|
33
|
+
"date_created": "Mon, 13 Jun 2016 22:50:08 +0000",
|
|
34
|
+
"date_updated": "Mon, 13 Jun 2016 22:50:08 +0000",
|
|
35
|
+
"secret": "foobar"
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
))
|
|
39
|
+
|
|
40
|
+
actual = @client.api.v2010.accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
|
41
|
+
.new_signing_keys.create()
|
|
42
|
+
|
|
43
|
+
expect(actual).to_not eq(nil)
|
|
44
|
+
end
|
|
45
|
+
end
|