twilio-ruby 5.0.0.rc19 → 5.0.0.rc20
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +8 -0
- data/README.md +2 -2
- data/VERSIONS.md +64 -0
- data/lib/twilio-ruby/framework/{exception.rb → error.rb} +3 -2
- data/lib/twilio-ruby/framework/page.rb +3 -3
- data/lib/twilio-ruby/framework/serialize.rb +9 -0
- data/lib/twilio-ruby/framework/version.rb +1 -1
- data/lib/twilio-ruby/http/http_client.rb +1 -0
- data/lib/twilio-ruby/jwt/access_token.rb +28 -0
- data/lib/twilio-ruby/rest/client.rb +64 -42
- data/lib/twilio-ruby/rest/fax/v1/fax/fax_media.rb +303 -0
- data/lib/twilio-ruby/rest/fax/v1/fax.rb +80 -6
- data/lib/twilio-ruby/rest/messaging/v1/service.rb +50 -3
- data/lib/twilio-ruby/rest/notify/v1/service/notification.rb +1 -1
- data/lib/twilio-ruby/rest/preview/marketplace/installed_add_on.rb +2 -2
- data/lib/twilio-ruby/rest/preview/sync/service/document.rb +2 -2
- data/lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb +2 -2
- data/lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_item.rb +2 -2
- data/lib/twilio-ruby/rest/preview/wireless/rate_plan.rb +38 -17
- data/lib/twilio-ruby/rest/preview/wireless/sim.rb +74 -2
- data/lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb +377 -0
- data/lib/twilio-ruby/rest/sync/v1/service/document.rb +415 -0
- data/lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_item.rb +409 -0
- data/lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.rb +377 -0
- data/lib/twilio-ruby/rest/sync/v1/service/sync_list.rb +407 -0
- data/lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_item.rb +411 -0
- data/lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb +377 -0
- data/lib/twilio-ruby/rest/sync/v1/service/sync_map.rb +407 -0
- data/lib/twilio-ruby/rest/sync/v1/service.rb +469 -0
- data/lib/twilio-ruby/rest/sync/v1.rb +35 -0
- data/lib/twilio-ruby/rest/sync.rb +40 -0
- data/lib/twilio-ruby/rest/video/v1/room/recording.rb +324 -0
- data/lib/twilio-ruby/rest/video/v1/room.rb +37 -0
- data/lib/twilio-ruby/rest/wireless/v1/command.rb +344 -0
- data/lib/twilio-ruby/rest/wireless/v1/rate_plan.rb +399 -0
- data/lib/twilio-ruby/rest/wireless/v1/sim/usage_record.rb +222 -0
- data/lib/twilio-ruby/rest/wireless/v1/sim.rb +502 -0
- data/lib/twilio-ruby/rest/wireless/v1.rb +53 -0
- data/lib/twilio-ruby/rest/wireless.rb +48 -0
- data/lib/twilio-ruby/security/request_validator.rb +19 -1
- data/lib/twilio-ruby/version.rb +1 -1
- data/spec/framework/serialize_spec.rb +20 -1
- data/spec/integration/accounts/v1/credential/public_key_spec.rb +5 -5
- data/spec/integration/api/v2010/account/address/dependent_phone_number_spec.rb +1 -1
- data/spec/integration/api/v2010/account/address_spec.rb +5 -5
- data/spec/integration/api/v2010/account/application_spec.rb +5 -5
- data/spec/integration/api/v2010/account/authorized_connect_app_spec.rb +2 -2
- data/spec/integration/api/v2010/account/available_phone_number/local_spec.rb +1 -1
- data/spec/integration/api/v2010/account/available_phone_number/mobile_spec.rb +1 -1
- data/spec/integration/api/v2010/account/available_phone_number/toll_free_spec.rb +1 -1
- data/spec/integration/api/v2010/account/available_phone_number_spec.rb +2 -2
- data/spec/integration/api/v2010/account/call/feedback_spec.rb +3 -3
- data/spec/integration/api/v2010/account/call/feedback_summary_spec.rb +3 -3
- data/spec/integration/api/v2010/account/call/notification_spec.rb +3 -3
- data/spec/integration/api/v2010/account/call/recording_spec.rb +3 -3
- data/spec/integration/api/v2010/account/call_spec.rb +5 -5
- data/spec/integration/api/v2010/account/conference/participant_spec.rb +5 -5
- data/spec/integration/api/v2010/account/conference_spec.rb +3 -3
- data/spec/integration/api/v2010/account/connect_app_spec.rb +3 -3
- data/spec/integration/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension_spec.rb +2 -2
- data/spec/integration/api/v2010/account/incoming_phone_number/assigned_add_on_spec.rb +4 -4
- data/spec/integration/api/v2010/account/incoming_phone_number/local_spec.rb +2 -2
- data/spec/integration/api/v2010/account/incoming_phone_number/mobile_spec.rb +2 -2
- data/spec/integration/api/v2010/account/incoming_phone_number/toll_free_spec.rb +2 -2
- data/spec/integration/api/v2010/account/incoming_phone_number_spec.rb +5 -5
- data/spec/integration/api/v2010/account/key_spec.rb +4 -4
- data/spec/integration/api/v2010/account/message/feedback_spec.rb +1 -1
- data/spec/integration/api/v2010/account/message/media_spec.rb +3 -3
- data/spec/integration/api/v2010/account/message_spec.rb +5 -5
- data/spec/integration/api/v2010/account/new_key_spec.rb +1 -1
- data/spec/integration/api/v2010/account/new_signing_key_spec.rb +1 -1
- data/spec/integration/api/v2010/account/notification_spec.rb +3 -3
- data/spec/integration/api/v2010/account/outgoing_caller_id_spec.rb +4 -4
- data/spec/integration/api/v2010/account/queue/member_spec.rb +3 -3
- data/spec/integration/api/v2010/account/queue_spec.rb +5 -5
- data/spec/integration/api/v2010/account/recording/add_on_result/payload_spec.rb +3 -3
- data/spec/integration/api/v2010/account/recording/add_on_result_spec.rb +3 -3
- data/spec/integration/api/v2010/account/recording/transcription_spec.rb +3 -3
- data/spec/integration/api/v2010/account/recording_spec.rb +3 -3
- data/spec/integration/api/v2010/account/short_code_spec.rb +3 -3
- data/spec/integration/api/v2010/account/signing_key_spec.rb +4 -4
- data/spec/integration/api/v2010/account/sip/credential_list/credential_spec.rb +5 -5
- data/spec/integration/api/v2010/account/sip/credential_list_spec.rb +5 -5
- data/spec/integration/api/v2010/account/sip/domain/credential_list_mapping_spec.rb +4 -4
- data/spec/integration/api/v2010/account/sip/domain/ip_access_control_list_mapping_spec.rb +4 -4
- data/spec/integration/api/v2010/account/sip/domain_spec.rb +5 -5
- data/spec/integration/api/v2010/account/sip/ip_access_control_list/ip_address_spec.rb +5 -5
- data/spec/integration/api/v2010/account/sip/ip_access_control_list_spec.rb +5 -5
- data/spec/integration/api/v2010/account/token_spec.rb +1 -1
- data/spec/integration/api/v2010/account/transcription_spec.rb +3 -3
- data/spec/integration/api/v2010/account/usage/record/all_time_spec.rb +1 -1
- data/spec/integration/api/v2010/account/usage/record/daily_spec.rb +1 -1
- data/spec/integration/api/v2010/account/usage/record/last_month_spec.rb +1 -1
- data/spec/integration/api/v2010/account/usage/record/monthly_spec.rb +1 -1
- data/spec/integration/api/v2010/account/usage/record/this_month_spec.rb +1 -1
- data/spec/integration/api/v2010/account/usage/record/today_spec.rb +1 -1
- data/spec/integration/api/v2010/account/usage/record/yearly_spec.rb +1 -1
- data/spec/integration/api/v2010/account/usage/record/yesterday_spec.rb +1 -1
- data/spec/integration/api/v2010/account/usage/record_spec.rb +1 -1
- data/spec/integration/api/v2010/account/usage/trigger_spec.rb +5 -5
- data/spec/integration/api/v2010/account/validation_request_spec.rb +1 -1
- data/spec/integration/api/v2010/account_spec.rb +4 -4
- data/spec/integration/chat/v1/credential_spec.rb +5 -5
- data/spec/integration/chat/v1/service/channel/invite_spec.rb +4 -4
- data/spec/integration/chat/v1/service/channel/member_spec.rb +5 -5
- data/spec/integration/chat/v1/service/channel/message_spec.rb +5 -5
- data/spec/integration/chat/v1/service/channel_spec.rb +5 -5
- data/spec/integration/chat/v1/service/role_spec.rb +5 -5
- data/spec/integration/chat/v1/service/user/user_channel_spec.rb +1 -1
- data/spec/integration/chat/v1/service/user_spec.rb +5 -5
- data/spec/integration/chat/v1/service_spec.rb +5 -5
- data/spec/integration/chat/v2/credential_spec.rb +5 -5
- data/spec/integration/chat/v2/service/channel/invite_spec.rb +4 -4
- data/spec/integration/chat/v2/service/channel/member_spec.rb +5 -5
- data/spec/integration/chat/v2/service/channel/message_spec.rb +5 -5
- data/spec/integration/chat/v2/service/channel_spec.rb +5 -5
- data/spec/integration/chat/v2/service/role_spec.rb +5 -5
- data/spec/integration/chat/v2/service/user/user_channel_spec.rb +1 -1
- data/spec/integration/chat/v2/service/user_spec.rb +5 -5
- data/spec/integration/chat/v2/service_spec.rb +5 -5
- data/spec/integration/fax/v1/fax/fax_media_spec.rb +126 -0
- data/spec/integration/fax/v1/fax_spec.rb +48 -7
- data/spec/integration/ip_messaging/v1/credential_spec.rb +5 -5
- data/spec/integration/ip_messaging/v1/service/channel/invite_spec.rb +4 -4
- data/spec/integration/ip_messaging/v1/service/channel/member_spec.rb +5 -5
- data/spec/integration/ip_messaging/v1/service/channel/message_spec.rb +5 -5
- data/spec/integration/ip_messaging/v1/service/channel_spec.rb +5 -5
- data/spec/integration/ip_messaging/v1/service/role_spec.rb +5 -5
- data/spec/integration/ip_messaging/v1/service/user/user_channel_spec.rb +1 -1
- data/spec/integration/ip_messaging/v1/service/user_spec.rb +5 -5
- data/spec/integration/ip_messaging/v1/service_spec.rb +5 -5
- data/spec/integration/ip_messaging/v2/credential_spec.rb +5 -5
- data/spec/integration/ip_messaging/v2/service/channel/invite_spec.rb +4 -4
- data/spec/integration/ip_messaging/v2/service/channel/member_spec.rb +5 -5
- data/spec/integration/ip_messaging/v2/service/channel/message_spec.rb +5 -5
- data/spec/integration/ip_messaging/v2/service/channel_spec.rb +5 -5
- data/spec/integration/ip_messaging/v2/service/role_spec.rb +5 -5
- data/spec/integration/ip_messaging/v2/service/user/user_channel_spec.rb +1 -1
- data/spec/integration/ip_messaging/v2/service/user_spec.rb +5 -5
- data/spec/integration/ip_messaging/v2/service_spec.rb +5 -5
- data/spec/integration/lookups/v1/phone_number_spec.rb +1 -1
- data/spec/integration/messaging/v1/service/alpha_sender_spec.rb +4 -4
- data/spec/integration/messaging/v1/service/phone_number_spec.rb +4 -4
- data/spec/integration/messaging/v1/service/short_code_spec.rb +4 -4
- data/spec/integration/messaging/v1/service_spec.rb +21 -5
- data/spec/integration/monitor/v1/alert_spec.rb +3 -3
- data/spec/integration/monitor/v1/event_spec.rb +2 -2
- data/spec/integration/notify/v1/credential_spec.rb +5 -5
- data/spec/integration/notify/v1/service/binding_spec.rb +4 -4
- data/spec/integration/notify/v1/service/notification_spec.rb +1 -1
- data/spec/integration/notify/v1/service/segment_spec.rb +1 -1
- data/spec/integration/notify/v1/service/user/segment_memberships_spec.rb +3 -3
- data/spec/integration/notify/v1/service/user/user_binding_spec.rb +4 -4
- data/spec/integration/notify/v1/service/user_spec.rb +4 -4
- data/spec/integration/notify/v1/service_spec.rb +5 -5
- data/spec/integration/preview/marketplace/available_add_on/available_add_on_extension_spec.rb +2 -2
- data/spec/integration/preview/marketplace/available_add_on_spec.rb +2 -2
- data/spec/integration/preview/marketplace/installed_add_on/installed_add_on_extension_spec.rb +3 -3
- data/spec/integration/preview/marketplace/installed_add_on_spec.rb +5 -5
- data/spec/integration/preview/sync/service/document/document_permission_spec.rb +4 -4
- data/spec/integration/preview/sync/service/document_spec.rb +6 -6
- data/spec/integration/preview/sync/service/sync_list/sync_list_item_spec.rb +7 -7
- data/spec/integration/preview/sync/service/sync_list/sync_list_permission_spec.rb +4 -4
- data/spec/integration/preview/sync/service/sync_list_spec.rb +4 -4
- data/spec/integration/preview/sync/service/sync_map/sync_map_item_spec.rb +7 -7
- data/spec/integration/preview/sync/service/sync_map/sync_map_permission_spec.rb +4 -4
- data/spec/integration/preview/sync/service/sync_map_spec.rb +4 -4
- data/spec/integration/preview/sync/service_spec.rb +5 -5
- data/spec/integration/preview/wireless/command_spec.rb +3 -3
- data/spec/integration/preview/wireless/rate_plan_spec.rb +45 -45
- data/spec/integration/preview/wireless/sim/usage_spec.rb +1 -1
- data/spec/integration/preview/wireless/sim_spec.rb +27 -3
- data/spec/integration/pricing/v1/messaging/country_spec.rb +2 -2
- data/spec/integration/pricing/v1/phone_number/country_spec.rb +2 -2
- data/spec/integration/pricing/v1/voice/country_spec.rb +2 -2
- data/spec/integration/pricing/v1/voice/number_spec.rb +1 -1
- data/spec/integration/sync/v1/service/document/document_permission_spec.rb +206 -0
- data/spec/integration/sync/v1/service/document_spec.rb +254 -0
- data/spec/integration/sync/v1/service/sync_list/sync_list_item_spec.rb +256 -0
- data/spec/integration/sync/v1/service/sync_list/sync_list_permission_spec.rb +206 -0
- data/spec/integration/sync/v1/service/sync_list_spec.rb +207 -0
- data/spec/integration/sync/v1/service/sync_map/sync_map_item_spec.rb +257 -0
- data/spec/integration/sync/v1/service/sync_map/sync_map_permission_spec.rb +206 -0
- data/spec/integration/sync/v1/service/sync_map_spec.rb +207 -0
- data/spec/integration/sync/v1/service_spec.rb +244 -0
- data/spec/integration/taskrouter/v1/workspace/activity_spec.rb +5 -5
- data/spec/integration/taskrouter/v1/workspace/event_spec.rb +2 -2
- data/spec/integration/taskrouter/v1/workspace/task/reservation_spec.rb +3 -3
- data/spec/integration/taskrouter/v1/workspace/task_channel_spec.rb +2 -2
- data/spec/integration/taskrouter/v1/workspace/task_queue/task_queue_statistics_spec.rb +1 -1
- data/spec/integration/taskrouter/v1/workspace/task_queue/task_queues_statistics_spec.rb +1 -1
- data/spec/integration/taskrouter/v1/workspace/task_queue_spec.rb +5 -5
- data/spec/integration/taskrouter/v1/workspace/task_spec.rb +5 -5
- data/spec/integration/taskrouter/v1/workspace/worker/reservation_spec.rb +3 -3
- data/spec/integration/taskrouter/v1/workspace/worker/worker_channel_spec.rb +3 -3
- data/spec/integration/taskrouter/v1/workspace/worker/worker_statistics_spec.rb +1 -1
- data/spec/integration/taskrouter/v1/workspace/worker/workers_statistics_spec.rb +1 -1
- data/spec/integration/taskrouter/v1/workspace/worker_spec.rb +5 -5
- data/spec/integration/taskrouter/v1/workspace/workflow/workflow_statistics_spec.rb +1 -1
- data/spec/integration/taskrouter/v1/workspace/workflow_spec.rb +5 -5
- data/spec/integration/taskrouter/v1/workspace/workspace_statistics_spec.rb +1 -1
- data/spec/integration/taskrouter/v1/workspace_spec.rb +5 -5
- data/spec/integration/trunking/v1/trunk/credential_list_spec.rb +4 -4
- data/spec/integration/trunking/v1/trunk/ip_access_control_list_spec.rb +4 -4
- data/spec/integration/trunking/v1/trunk/origination_url_spec.rb +5 -5
- data/spec/integration/trunking/v1/trunk/phone_number_spec.rb +4 -4
- data/spec/integration/trunking/v1/trunk_spec.rb +5 -5
- data/spec/integration/video/v1/recording_spec.rb +3 -3
- data/spec/integration/video/v1/room/recording_spec.rb +145 -0
- data/spec/integration/video/v1/room_spec.rb +20 -8
- data/spec/integration/wireless/v1/command_spec.rb +166 -0
- data/spec/integration/wireless/v1/rate_plan_spec.rb +260 -0
- data/spec/integration/wireless/v1/sim/usage_record_spec.rb +65 -0
- data/spec/integration/wireless/v1/sim_spec.rb +208 -0
- data/twilio-ruby.gemspec +1 -1
- metadata +55 -5
@@ -14,7 +14,7 @@ describe 'UserChannel' do
|
|
14
14
|
@client.chat.v2.services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
15
15
|
.users("USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
16
16
|
.user_channels.list()
|
17
|
-
}.to raise_exception(Twilio::REST::
|
17
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
18
18
|
|
19
19
|
values = {}
|
20
20
|
expect(
|
@@ -13,7 +13,7 @@ describe 'User' do
|
|
13
13
|
expect {
|
14
14
|
@client.chat.v2.services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
15
15
|
.users("USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").fetch()
|
16
|
-
}.to raise_exception(Twilio::REST::
|
16
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
17
17
|
|
18
18
|
values = {}
|
19
19
|
expect(
|
@@ -60,7 +60,7 @@ describe 'User' do
|
|
60
60
|
expect {
|
61
61
|
@client.chat.v2.services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
62
62
|
.users("USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").delete()
|
63
|
-
}.to raise_exception(Twilio::REST::
|
63
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
64
64
|
|
65
65
|
values = {}
|
66
66
|
expect(
|
@@ -88,7 +88,7 @@ describe 'User' do
|
|
88
88
|
expect {
|
89
89
|
@client.chat.v2.services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
90
90
|
.users.create(identity: "identity")
|
91
|
-
}.to raise_exception(Twilio::REST::
|
91
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
92
92
|
|
93
93
|
values = {
|
94
94
|
'Identity' => "identity",
|
@@ -138,7 +138,7 @@ describe 'User' do
|
|
138
138
|
expect {
|
139
139
|
@client.chat.v2.services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
140
140
|
.users.list()
|
141
|
-
}.to raise_exception(Twilio::REST::
|
141
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
142
142
|
|
143
143
|
values = {}
|
144
144
|
expect(
|
@@ -223,7 +223,7 @@ describe 'User' do
|
|
223
223
|
expect {
|
224
224
|
@client.chat.v2.services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
225
225
|
.users("USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").update()
|
226
|
-
}.to raise_exception(Twilio::REST::
|
226
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
227
227
|
|
228
228
|
values = {}
|
229
229
|
expect(
|
@@ -12,7 +12,7 @@ describe 'Service' do
|
|
12
12
|
|
13
13
|
expect {
|
14
14
|
@client.chat.v2.services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").fetch()
|
15
|
-
}.to raise_exception(Twilio::REST::
|
15
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
16
16
|
|
17
17
|
values = {}
|
18
18
|
expect(
|
@@ -70,7 +70,7 @@ describe 'Service' do
|
|
70
70
|
|
71
71
|
expect {
|
72
72
|
@client.chat.v2.services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").delete()
|
73
|
-
}.to raise_exception(Twilio::REST::
|
73
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
74
74
|
|
75
75
|
values = {}
|
76
76
|
expect(
|
@@ -96,7 +96,7 @@ describe 'Service' do
|
|
96
96
|
|
97
97
|
expect {
|
98
98
|
@client.chat.v2.services.create(friendly_name: "friendly_name")
|
99
|
-
}.to raise_exception(Twilio::REST::
|
99
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
100
100
|
|
101
101
|
values = {
|
102
102
|
'FriendlyName' => "friendly_name",
|
@@ -157,7 +157,7 @@ describe 'Service' do
|
|
157
157
|
|
158
158
|
expect {
|
159
159
|
@client.chat.v2.services.list()
|
160
|
-
}.to raise_exception(Twilio::REST::
|
160
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
161
161
|
|
162
162
|
values = {}
|
163
163
|
expect(
|
@@ -252,7 +252,7 @@ describe 'Service' do
|
|
252
252
|
|
253
253
|
expect {
|
254
254
|
@client.chat.v2.services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").update()
|
255
|
-
}.to raise_exception(Twilio::REST::
|
255
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
256
256
|
|
257
257
|
values = {}
|
258
258
|
expect(
|
@@ -0,0 +1,126 @@
|
|
1
|
+
##
|
2
|
+
# This code was generated by
|
3
|
+
# \ / _ _ _| _ _
|
4
|
+
# | (_)\/(_)(_|\/| |(/_ v1.0.0
|
5
|
+
# / /
|
6
|
+
|
7
|
+
require 'spec_helper.rb'
|
8
|
+
|
9
|
+
describe 'FaxMedia' do
|
10
|
+
it "can fetch" do
|
11
|
+
@holodeck.mock(Twilio::TwilioResponse.new(500, ''))
|
12
|
+
|
13
|
+
expect {
|
14
|
+
@client.fax.v1.faxes("FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
15
|
+
.media("MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").fetch()
|
16
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
17
|
+
|
18
|
+
values = {}
|
19
|
+
expect(
|
20
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
21
|
+
method: 'get',
|
22
|
+
url: 'https://fax.twilio.com/v1/Faxes/FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media/MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
|
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
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
32
|
+
"content_type": "application/pdf",
|
33
|
+
"date_created": "2015-07-30T20:00:00Z",
|
34
|
+
"date_updated": "2015-07-30T20:00:00Z",
|
35
|
+
"fax_sid": "FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
36
|
+
"sid": "MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
37
|
+
"url": "https://fax.twilio.com/v1/Faxes/FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media/MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
38
|
+
}
|
39
|
+
]
|
40
|
+
))
|
41
|
+
|
42
|
+
actual = @client.fax.v1.faxes("FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
43
|
+
.media("MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").fetch()
|
44
|
+
|
45
|
+
expect(actual).to_not eq(nil)
|
46
|
+
end
|
47
|
+
|
48
|
+
it "can read" do
|
49
|
+
@holodeck.mock(Twilio::TwilioResponse.new(500, ''))
|
50
|
+
|
51
|
+
expect {
|
52
|
+
@client.fax.v1.faxes("FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
53
|
+
.media.list()
|
54
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
55
|
+
|
56
|
+
values = {}
|
57
|
+
expect(
|
58
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
59
|
+
method: 'get',
|
60
|
+
url: 'https://fax.twilio.com/v1/Faxes/FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media',
|
61
|
+
))).to eq(true)
|
62
|
+
end
|
63
|
+
|
64
|
+
it "receives read responses" do
|
65
|
+
@holodeck.mock(Twilio::TwilioResponse.new(
|
66
|
+
200,
|
67
|
+
%q[
|
68
|
+
{
|
69
|
+
"media": [
|
70
|
+
{
|
71
|
+
"sid": "MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
72
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
73
|
+
"fax_sid": "FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
74
|
+
"content_type": "application/pdf",
|
75
|
+
"date_created": "2015-07-30T20:00:00Z",
|
76
|
+
"date_updated": "2015-07-30T20:00:00Z",
|
77
|
+
"url": "https://fax.twilio.com/v1/Faxes/FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media/MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
78
|
+
}
|
79
|
+
],
|
80
|
+
"meta": {
|
81
|
+
"first_page_url": "https://fax.twilio.com/v1/Faxes/FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media?PageSize=50&Page=0",
|
82
|
+
"key": "media",
|
83
|
+
"next_page_url": null,
|
84
|
+
"page": 0,
|
85
|
+
"page_size": 50,
|
86
|
+
"previous_page_url": null,
|
87
|
+
"url": "https://fax.twilio.com/v1/Faxes/FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media?PageSize=50&Page=0"
|
88
|
+
}
|
89
|
+
}
|
90
|
+
]
|
91
|
+
))
|
92
|
+
|
93
|
+
actual = @client.fax.v1.faxes("FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
94
|
+
.media.list()
|
95
|
+
|
96
|
+
expect(actual).to_not eq(nil)
|
97
|
+
end
|
98
|
+
|
99
|
+
it "can delete" do
|
100
|
+
@holodeck.mock(Twilio::TwilioResponse.new(500, ''))
|
101
|
+
|
102
|
+
expect {
|
103
|
+
@client.fax.v1.faxes("FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
104
|
+
.media("MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").delete()
|
105
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
106
|
+
|
107
|
+
values = {}
|
108
|
+
expect(
|
109
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
110
|
+
method: 'delete',
|
111
|
+
url: 'https://fax.twilio.com/v1/Faxes/FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media/MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
|
112
|
+
))).to eq(true)
|
113
|
+
end
|
114
|
+
|
115
|
+
it "receives delete responses" do
|
116
|
+
@holodeck.mock(Twilio::TwilioResponse.new(
|
117
|
+
204,
|
118
|
+
nil,
|
119
|
+
))
|
120
|
+
|
121
|
+
actual = @client.fax.v1.faxes("FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
122
|
+
.media("MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").delete()
|
123
|
+
|
124
|
+
expect(actual).to eq(true)
|
125
|
+
end
|
126
|
+
end
|
@@ -12,7 +12,7 @@ describe 'Fax' do
|
|
12
12
|
|
13
13
|
expect {
|
14
14
|
@client.fax.v1.faxes("FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").fetch()
|
15
|
-
}.to raise_exception(Twilio::REST::
|
15
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
16
16
|
|
17
17
|
values = {}
|
18
18
|
expect(
|
@@ -34,6 +34,7 @@ describe 'Fax' do
|
|
34
34
|
"direction": "outbound",
|
35
35
|
"from": "+14155551234",
|
36
36
|
"media_url": "https://www.example.com/fax.pdf",
|
37
|
+
"media_sid": "MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
37
38
|
"num_pages": null,
|
38
39
|
"price": null,
|
39
40
|
"price_unit": null,
|
@@ -42,6 +43,9 @@ describe 'Fax' do
|
|
42
43
|
"status": "queued",
|
43
44
|
"to": "+14155554321",
|
44
45
|
"duration": null,
|
46
|
+
"links": {
|
47
|
+
"media": "https://fax.twilio.com/v1/Faxes/FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media"
|
48
|
+
},
|
45
49
|
"url": "https://fax.twilio.com/v1/Faxes/FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
46
50
|
}
|
47
51
|
]
|
@@ -57,7 +61,7 @@ describe 'Fax' do
|
|
57
61
|
|
58
62
|
expect {
|
59
63
|
@client.fax.v1.faxes.list()
|
60
|
-
}.to raise_exception(Twilio::REST::
|
64
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
61
65
|
|
62
66
|
values = {}
|
63
67
|
expect(
|
@@ -105,6 +109,7 @@ describe 'Fax' do
|
|
105
109
|
"direction": "outbound",
|
106
110
|
"from": "+14155551234",
|
107
111
|
"media_url": "https://www.example.com/fax.pdf",
|
112
|
+
"media_sid": "MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
108
113
|
"num_pages": null,
|
109
114
|
"price": null,
|
110
115
|
"price_unit": null,
|
@@ -113,6 +118,9 @@ describe 'Fax' do
|
|
113
118
|
"status": "queued",
|
114
119
|
"to": "+14155554321",
|
115
120
|
"duration": null,
|
121
|
+
"links": {
|
122
|
+
"media": "https://fax.twilio.com/v1/Faxes/FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media"
|
123
|
+
},
|
116
124
|
"url": "https://fax.twilio.com/v1/Faxes/FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
117
125
|
}
|
118
126
|
],
|
@@ -138,11 +146,10 @@ describe 'Fax' do
|
|
138
146
|
@holodeck.mock(Twilio::TwilioResponse.new(500, ''))
|
139
147
|
|
140
148
|
expect {
|
141
|
-
@client.fax.v1.faxes.create(
|
142
|
-
}.to raise_exception(Twilio::REST::
|
149
|
+
@client.fax.v1.faxes.create(to: "to", media_url: "https://example.com")
|
150
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
143
151
|
|
144
152
|
values = {
|
145
|
-
'From' => "from",
|
146
153
|
'To' => "to",
|
147
154
|
'MediaUrl' => "https://example.com",
|
148
155
|
}
|
@@ -166,6 +173,7 @@ describe 'Fax' do
|
|
166
173
|
"direction": "outbound",
|
167
174
|
"from": "+14155551234",
|
168
175
|
"media_url": null,
|
176
|
+
"media_sid": null,
|
169
177
|
"num_pages": null,
|
170
178
|
"price": null,
|
171
179
|
"price_unit": null,
|
@@ -174,12 +182,15 @@ describe 'Fax' do
|
|
174
182
|
"status": "queued",
|
175
183
|
"to": "+14155554321",
|
176
184
|
"duration": null,
|
185
|
+
"links": {
|
186
|
+
"media": "https://fax.twilio.com/v1/Faxes/FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media"
|
187
|
+
},
|
177
188
|
"url": "https://fax.twilio.com/v1/Faxes/FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
178
189
|
}
|
179
190
|
]
|
180
191
|
))
|
181
192
|
|
182
|
-
actual = @client.fax.v1.faxes.create(
|
193
|
+
actual = @client.fax.v1.faxes.create(to: "to", media_url: "https://example.com")
|
183
194
|
|
184
195
|
expect(actual).to_not eq(nil)
|
185
196
|
end
|
@@ -189,7 +200,7 @@ describe 'Fax' do
|
|
189
200
|
|
190
201
|
expect {
|
191
202
|
@client.fax.v1.faxes("FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").update()
|
192
|
-
}.to raise_exception(Twilio::REST::
|
203
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
193
204
|
|
194
205
|
values = {}
|
195
206
|
expect(
|
@@ -211,6 +222,7 @@ describe 'Fax' do
|
|
211
222
|
"direction": "outbound",
|
212
223
|
"from": "+14155551234",
|
213
224
|
"media_url": null,
|
225
|
+
"media_sid": null,
|
214
226
|
"num_pages": null,
|
215
227
|
"price": null,
|
216
228
|
"price_unit": null,
|
@@ -219,6 +231,9 @@ describe 'Fax' do
|
|
219
231
|
"status": "canceled",
|
220
232
|
"to": "+14155554321",
|
221
233
|
"duration": null,
|
234
|
+
"links": {
|
235
|
+
"media": "https://fax.twilio.com/v1/Faxes/FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media"
|
236
|
+
},
|
222
237
|
"url": "https://fax.twilio.com/v1/Faxes/FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
223
238
|
}
|
224
239
|
]
|
@@ -228,4 +243,30 @@ describe 'Fax' do
|
|
228
243
|
|
229
244
|
expect(actual).to_not eq(nil)
|
230
245
|
end
|
246
|
+
|
247
|
+
it "can delete" do
|
248
|
+
@holodeck.mock(Twilio::TwilioResponse.new(500, ''))
|
249
|
+
|
250
|
+
expect {
|
251
|
+
@client.fax.v1.faxes("FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").delete()
|
252
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
253
|
+
|
254
|
+
values = {}
|
255
|
+
expect(
|
256
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
257
|
+
method: 'delete',
|
258
|
+
url: 'https://fax.twilio.com/v1/Faxes/FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
|
259
|
+
))).to eq(true)
|
260
|
+
end
|
261
|
+
|
262
|
+
it "receives delete responses" do
|
263
|
+
@holodeck.mock(Twilio::TwilioResponse.new(
|
264
|
+
204,
|
265
|
+
nil,
|
266
|
+
))
|
267
|
+
|
268
|
+
actual = @client.fax.v1.faxes("FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").delete()
|
269
|
+
|
270
|
+
expect(actual).to eq(true)
|
271
|
+
end
|
231
272
|
end
|
@@ -12,7 +12,7 @@ describe 'Credential' do
|
|
12
12
|
|
13
13
|
expect {
|
14
14
|
@client.ip_messaging.v1.credentials.list()
|
15
|
-
}.to raise_exception(Twilio::REST::
|
15
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
16
16
|
|
17
17
|
values = {}
|
18
18
|
expect(
|
@@ -86,7 +86,7 @@ describe 'Credential' do
|
|
86
86
|
|
87
87
|
expect {
|
88
88
|
@client.ip_messaging.v1.credentials.create(type: "gcm")
|
89
|
-
}.to raise_exception(Twilio::REST::
|
89
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
90
90
|
|
91
91
|
values = {
|
92
92
|
'Type' => "gcm",
|
@@ -126,7 +126,7 @@ describe 'Credential' do
|
|
126
126
|
|
127
127
|
expect {
|
128
128
|
@client.ip_messaging.v1.credentials("CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").fetch()
|
129
|
-
}.to raise_exception(Twilio::REST::
|
129
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
130
130
|
|
131
131
|
values = {}
|
132
132
|
expect(
|
@@ -163,7 +163,7 @@ describe 'Credential' do
|
|
163
163
|
|
164
164
|
expect {
|
165
165
|
@client.ip_messaging.v1.credentials("CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").update()
|
166
|
-
}.to raise_exception(Twilio::REST::
|
166
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
167
167
|
|
168
168
|
values = {}
|
169
169
|
expect(
|
@@ -200,7 +200,7 @@ describe 'Credential' do
|
|
200
200
|
|
201
201
|
expect {
|
202
202
|
@client.ip_messaging.v1.credentials("CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").delete()
|
203
|
-
}.to raise_exception(Twilio::REST::
|
203
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
204
204
|
|
205
205
|
values = {}
|
206
206
|
expect(
|
@@ -14,7 +14,7 @@ describe 'Invite' do
|
|
14
14
|
@client.ip_messaging.v1.services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
15
15
|
.channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
16
16
|
.invites("INaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").fetch()
|
17
|
-
}.to raise_exception(Twilio::REST::
|
17
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
18
18
|
|
19
19
|
values = {}
|
20
20
|
expect(
|
@@ -57,7 +57,7 @@ describe 'Invite' do
|
|
57
57
|
@client.ip_messaging.v1.services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
58
58
|
.channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
59
59
|
.invites.create(identity: "identity")
|
60
|
-
}.to raise_exception(Twilio::REST::
|
60
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
61
61
|
|
62
62
|
values = {
|
63
63
|
'Identity' => "identity",
|
@@ -103,7 +103,7 @@ describe 'Invite' do
|
|
103
103
|
@client.ip_messaging.v1.services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
104
104
|
.channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
105
105
|
.invites.list()
|
106
|
-
}.to raise_exception(Twilio::REST::
|
106
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
107
107
|
|
108
108
|
values = {}
|
109
109
|
expect(
|
@@ -185,7 +185,7 @@ describe 'Invite' do
|
|
185
185
|
@client.ip_messaging.v1.services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
186
186
|
.channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
187
187
|
.invites("INaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").delete()
|
188
|
-
}.to raise_exception(Twilio::REST::
|
188
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
189
189
|
|
190
190
|
values = {}
|
191
191
|
expect(
|