twilio-ruby 5.43.0 → 5.46.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/CHANGES.md +83 -0
- data/LICENSE +1 -1
- data/README.md +16 -2
- data/lib/twilio-ruby/rest/api/v2010/account/authorized_connect_app.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/call.rb +14 -9
- data/lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb +13 -13
- data/lib/twilio-ruby/rest/api/v2010/account/call/feedback_summary.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/call/recording.rb +17 -5
- data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +17 -12
- data/lib/twilio-ruby/rest/api/v2010/account/connect_app.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/message.rb +5 -5
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb +6 -3
- data/lib/twilio-ruby/rest/api/v2010/account/token.rb +1 -1
- data/lib/twilio-ruby/rest/bulkexports.rb +4 -2
- data/lib/twilio-ruby/rest/bulkexports/v1.rb +4 -2
- data/lib/twilio-ruby/rest/bulkexports/v1/export.rb +7 -4
- data/lib/twilio-ruby/rest/bulkexports/v1/export/day.rb +7 -4
- data/lib/twilio-ruby/rest/bulkexports/v1/export/export_custom_job.rb +5 -3
- data/lib/twilio-ruby/rest/bulkexports/v1/export/job.rb +5 -3
- data/lib/twilio-ruby/rest/bulkexports/v1/export_configuration.rb +5 -3
- data/lib/twilio-ruby/rest/chat/v1/service.rb +5 -5
- data/lib/twilio-ruby/rest/chat/v1/service/channel.rb +6 -6
- data/lib/twilio-ruby/rest/chat/v1/service/channel/invite.rb +3 -3
- data/lib/twilio-ruby/rest/chat/v1/service/channel/member.rb +3 -3
- data/lib/twilio-ruby/rest/chat/v1/service/role.rb +9 -9
- data/lib/twilio-ruby/rest/chat/v2/service.rb +5 -5
- data/lib/twilio-ruby/rest/chat/v2/service/binding.rb +7 -7
- data/lib/twilio-ruby/rest/chat/v2/service/channel.rb +6 -6
- data/lib/twilio-ruby/rest/chat/v2/service/channel/invite.rb +3 -3
- data/lib/twilio-ruby/rest/chat/v2/service/channel/member.rb +3 -3
- data/lib/twilio-ruby/rest/chat/v2/service/channel/webhook.rb +27 -24
- data/lib/twilio-ruby/rest/chat/v2/service/role.rb +9 -9
- data/lib/twilio-ruby/rest/chat/v2/service/user/user_binding.rb +10 -10
- data/lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb +9 -9
- data/lib/twilio-ruby/rest/conversations/v1/conversation/message.rb +1 -1
- data/lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb +32 -2
- data/lib/twilio-ruby/rest/conversations/v1/conversation/webhook.rb +9 -9
- data/lib/twilio-ruby/rest/conversations/v1/role.rb +9 -9
- data/lib/twilio-ruby/rest/conversations/v1/service/binding.rb +7 -7
- data/lib/twilio-ruby/rest/conversations/v1/service/configuration.rb +17 -2
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message.rb +1 -1
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation/participant.rb +32 -2
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation/webhook.rb +9 -9
- data/lib/twilio-ruby/rest/conversations/v1/service/role.rb +9 -9
- data/lib/twilio-ruby/rest/conversations/v1/service/user.rb +8 -1
- data/lib/twilio-ruby/rest/conversations/v1/user.rb +8 -1
- data/lib/twilio-ruby/rest/events/v1/sink.rb +2 -1
- data/lib/twilio-ruby/rest/events/v1/subscription.rb +2 -2
- data/lib/twilio-ruby/rest/flex_api.rb +1 -1
- data/lib/twilio-ruby/rest/flex_api/v1.rb +1 -1
- data/lib/twilio-ruby/rest/flex_api/v1/channel.rb +5 -5
- data/lib/twilio-ruby/rest/flex_api/v1/configuration.rb +4 -4
- data/lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb +88 -76
- data/lib/twilio-ruby/rest/flex_api/v1/web_channel.rb +2 -2
- data/lib/twilio-ruby/rest/insights/v1/call/summary.rb +8 -9
- data/lib/twilio-ruby/rest/insights/v1/room.rb +7 -7
- data/lib/twilio-ruby/rest/insights/v1/room/participant.rb +1 -1
- data/lib/twilio-ruby/rest/ip_messaging/v1/service.rb +3 -3
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb +3 -3
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/invite.rb +3 -3
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/member.rb +3 -3
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/role.rb +4 -4
- data/lib/twilio-ruby/rest/ip_messaging/v2/service.rb +3 -3
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/binding.rb +7 -7
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb +3 -3
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/invite.rb +3 -3
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/member.rb +3 -3
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/webhook.rb +6 -6
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/role.rb +4 -4
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/user/user_binding.rb +4 -4
- data/lib/twilio-ruby/rest/lookups/v1/phone_number.rb +16 -16
- data/lib/twilio-ruby/rest/messaging/v1/service/alpha_sender.rb +1 -1
- data/lib/twilio-ruby/rest/messaging/v1/service/phone_number.rb +1 -1
- data/lib/twilio-ruby/rest/messaging/v1/service/short_code.rb +1 -1
- data/lib/twilio-ruby/rest/notify/v1/service/binding.rb +16 -15
- data/lib/twilio-ruby/rest/notify/v1/service/notification.rb +18 -18
- data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/evaluation.rb +1 -1
- data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/end_user_type.rb +1 -1
- data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/supporting_document_type.rb +1 -1
- data/lib/twilio-ruby/rest/preview.rb +4 -23
- data/lib/twilio-ruby/rest/preview/bulk_exports.rb +4 -2
- data/lib/twilio-ruby/rest/preview/bulk_exports/export.rb +7 -4
- data/lib/twilio-ruby/rest/preview/bulk_exports/export/day.rb +7 -4
- data/lib/twilio-ruby/rest/preview/bulk_exports/export/export_custom_job.rb +5 -3
- data/lib/twilio-ruby/rest/preview/bulk_exports/export/job.rb +5 -3
- data/lib/twilio-ruby/rest/preview/bulk_exports/export_configuration.rb +5 -3
- data/lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document.rb +13 -13
- data/lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document/dependent_hosted_number_order.rb +2 -2
- data/lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb +8 -8
- data/lib/twilio-ruby/rest/preview/trusted_comms.rb +0 -30
- data/lib/twilio-ruby/rest/preview/wireless/rate_plan.rb +2 -2
- data/lib/twilio-ruby/rest/pricing/v1/messaging/country.rb +2 -2
- data/lib/twilio-ruby/rest/pricing/v1/phone_number/country.rb +1 -1
- data/lib/twilio-ruby/rest/pricing/v1/voice/country.rb +2 -2
- data/lib/twilio-ruby/rest/pricing/v2/voice/country.rb +2 -2
- data/lib/twilio-ruby/rest/pricing/v2/voice/number.rb +1 -1
- data/lib/twilio-ruby/rest/proxy/v1/service/session.rb +1 -1
- data/lib/twilio-ruby/rest/proxy/v1/service/session/participant/message_interaction.rb +1 -1
- data/lib/twilio-ruby/rest/serverless/v1/service/build.rb +6 -6
- data/lib/twilio-ruby/rest/studio/v2/flow.rb +6 -14
- data/lib/twilio-ruby/rest/studio/v2/flow/execution.rb +0 -8
- data/lib/twilio-ruby/rest/studio/v2/flow/execution/execution_context.rb +0 -8
- data/lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step.rb +0 -8
- data/lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step/execution_step_context.rb +0 -8
- data/lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb +2 -10
- data/lib/twilio-ruby/rest/studio/v2/flow/test_user.rb +10 -16
- data/lib/twilio-ruby/rest/studio/v2/flow_validate.rb +6 -11
- data/lib/twilio-ruby/rest/supersim/v1/command.rb +4 -4
- data/lib/twilio-ruby/rest/supersim/v1/fleet.rb +32 -11
- data/lib/twilio-ruby/rest/supersim/v1/network.rb +5 -5
- data/lib/twilio-ruby/rest/supersim/v1/network_access_profile.rb +6 -6
- data/lib/twilio-ruby/rest/supersim/v1/network_access_profile/network_access_profile_network.rb +5 -5
- data/lib/twilio-ruby/rest/supersim/v1/sim.rb +4 -4
- data/lib/twilio-ruby/rest/supersim/v1/usage_record.rb +3 -3
- data/lib/twilio-ruby/rest/sync/v1/service/document.rb +12 -20
- data/lib/twilio-ruby/rest/sync/v1/service/sync_list.rb +9 -17
- data/lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_item.rb +8 -31
- data/lib/twilio-ruby/rest/sync/v1/service/sync_map.rb +9 -17
- data/lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_item.rb +9 -32
- data/lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb +1 -1
- data/lib/twilio-ruby/rest/sync/v1/service/sync_stream.rb +5 -15
- data/lib/twilio-ruby/rest/sync/v1/service/sync_stream/stream_message.rb +1 -1
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb +17 -17
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb +10 -10
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.rb +1 -1
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb +10 -10
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_cumulative_statistics.rb +1 -1
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_real_time_statistics.rb +1 -1
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_real_time_statistics.rb +1 -1
- data/lib/twilio-ruby/rest/trunking/v1/trunk.rb +1 -1
- data/lib/twilio-ruby/rest/trunking/v1/trunk/recording.rb +21 -24
- data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb +3 -3
- data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +1 -1
- data/lib/twilio-ruby/rest/verify/v2/service/webhook.rb +10 -10
- data/lib/twilio-ruby/rest/video/v1/composition.rb +16 -15
- data/lib/twilio-ruby/rest/video/v1/composition_hook.rb +26 -26
- data/lib/twilio-ruby/rest/video/v1/composition_settings.rb +6 -6
- data/lib/twilio-ruby/rest/video/v1/recording.rb +6 -6
- data/lib/twilio-ruby/rest/video/v1/recording_settings.rb +6 -6
- data/lib/twilio-ruby/rest/video/v1/room.rb +10 -3
- data/lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_subscribe_rule.rb +1 -1
- data/lib/twilio-ruby/rest/video/v1/room/room_recording_rule.rb +1 -1
- data/lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb +1 -1
- data/lib/twilio-ruby/rest/wireless/v1/rate_plan.rb +4 -4
- data/lib/twilio-ruby/twiml/voice_response.rb +20 -10
- data/lib/twilio-ruby/version.rb +1 -1
- data/spec/integration/api/v2010/account/call/recording_spec.rb +4 -0
- data/spec/integration/api/v2010/account/conference/participant_spec.rb +30 -0
- data/spec/integration/conversations/v1/conversation/participant_spec.rb +30 -10
- data/spec/integration/conversations/v1/service/configuration_spec.rb +2 -0
- data/spec/integration/conversations/v1/service/conversation/participant_spec.rb +30 -10
- data/spec/integration/conversations/v1/service/user_spec.rb +9 -4
- data/spec/integration/conversations/v1/user_spec.rb +9 -4
- data/spec/integration/events/v1/sink_spec.rb +14 -0
- data/spec/integration/insights/v1/call/summary_spec.rb +1 -0
- data/spec/integration/lookups/v1/phone_number_spec.rb +7 -7
- data/spec/integration/taskrouter/v1/workspace/worker/worker_channel_spec.rb +1 -1
- data/spec/integration/trunking/v1/trunk/recording_spec.rb +2 -6
- data/spec/integration/video/v1/room_spec.rb +5 -0
- data/spec/twiml/voice_response_spec.rb +1 -1
- metadata +2 -17
- data/lib/twilio-ruby/rest/preview/trusted_comms/branded_call.rb +0 -243
- data/lib/twilio-ruby/rest/preview/trusted_comms/business.rb +0 -213
- data/lib/twilio-ruby/rest/preview/trusted_comms/business/insights.rb +0 -108
- data/lib/twilio-ruby/rest/preview/trusted_comms/business/insights/impressions_rate.rb +0 -260
- data/lib/twilio-ruby/rest/preview/trusted_comms/phone_call.rb +0 -342
- data/spec/integration/preview/trusted_comms/branded_call_spec.rb +0 -59
- data/spec/integration/preview/trusted_comms/business/insights/impressions_rate_spec.rb +0 -56
- data/spec/integration/preview/trusted_comms/business/insights_spec.rb +0 -12
- data/spec/integration/preview/trusted_comms/business_spec.rb +0 -45
- data/spec/integration/preview/trusted_comms/phone_call_spec.rb +0 -59
@@ -1,59 +0,0 @@
|
|
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 'BrandedCall' do
|
12
|
-
it "can create" do
|
13
|
-
@holodeck.mock(Twilio::Response.new(500, ''))
|
14
|
-
|
15
|
-
expect {
|
16
|
-
@client.preview.trusted_comms.branded_calls.create(from: 'from', to: 'to', reason: 'reason')
|
17
|
-
}.to raise_exception(Twilio::REST::TwilioError)
|
18
|
-
|
19
|
-
values = {'From' => 'from', 'To' => 'to', 'Reason' => 'reason', }
|
20
|
-
expect(
|
21
|
-
@holodeck.has_request?(Holodeck::Request.new(
|
22
|
-
method: 'post',
|
23
|
-
url: 'https://preview.twilio.com/TrustedComms/Business/BrandedCalls',
|
24
|
-
data: values,
|
25
|
-
))).to eq(true)
|
26
|
-
end
|
27
|
-
|
28
|
-
it "receives create responses" do
|
29
|
-
@holodeck.mock(Twilio::Response.new(
|
30
|
-
201,
|
31
|
-
%q[
|
32
|
-
{
|
33
|
-
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
34
|
-
"bg_color": "#fff",
|
35
|
-
"brand_sid": "BZaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
36
|
-
"branded_channel_sid": "BWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
37
|
-
"business_sid": "BXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
38
|
-
"call_sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
39
|
-
"caller": "Owl Bank",
|
40
|
-
"created_at": "2019-05-01T20:00:00Z",
|
41
|
-
"font_color": "#000",
|
42
|
-
"from": "+15000000000",
|
43
|
-
"logo": "https://www.twilio.com/marketing/bundles/company/img/logos/red/twilio-logo-red.png",
|
44
|
-
"phone_number_sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
45
|
-
"reason": "Hello Jhon, your appointment has been confirmed.",
|
46
|
-
"sid": "CQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
47
|
-
"status": "unknown",
|
48
|
-
"to": "+573000000000",
|
49
|
-
"use_case": "conversational",
|
50
|
-
"url": "https://preview.twilio.com/TrustedComms/Business/BrandedCalls"
|
51
|
-
}
|
52
|
-
]
|
53
|
-
))
|
54
|
-
|
55
|
-
actual = @client.preview.trusted_comms.branded_calls.create(from: 'from', to: 'to', reason: 'reason')
|
56
|
-
|
57
|
-
expect(actual).to_not eq(nil)
|
58
|
-
end
|
59
|
-
end
|
@@ -1,56 +0,0 @@
|
|
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 'ImpressionsRate' do
|
12
|
-
it "can fetch" do
|
13
|
-
@holodeck.mock(Twilio::Response.new(500, ''))
|
14
|
-
|
15
|
-
expect {
|
16
|
-
@client.preview.trusted_comms.businesses('BXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
17
|
-
.insights \
|
18
|
-
.impressions_rate().fetch()
|
19
|
-
}.to raise_exception(Twilio::REST::TwilioError)
|
20
|
-
|
21
|
-
expect(
|
22
|
-
@holodeck.has_request?(Holodeck::Request.new(
|
23
|
-
method: 'get',
|
24
|
-
url: 'https://preview.twilio.com/TrustedComms/Businesses/BXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Insights/ImpressionsRate',
|
25
|
-
))).to eq(true)
|
26
|
-
end
|
27
|
-
|
28
|
-
it "receives fetch responses" do
|
29
|
-
@holodeck.mock(Twilio::Response.new(
|
30
|
-
200,
|
31
|
-
%q[
|
32
|
-
{
|
33
|
-
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
34
|
-
"business_sid": "BXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
35
|
-
"start": "2015-07-30T20:00:00Z",
|
36
|
-
"end": "2015-07-30T21:00:00Z",
|
37
|
-
"interval": "minute",
|
38
|
-
"reports": {
|
39
|
-
"impressions_rate": {
|
40
|
-
"timestamp": "2015-07-30T20:00:00",
|
41
|
-
"calls": 1200,
|
42
|
-
"impressions": 800
|
43
|
-
}
|
44
|
-
},
|
45
|
-
"url": "https://preview.twilio.com/TrustedComms/Businesses/BXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Insights/ImpressionsRate"
|
46
|
-
}
|
47
|
-
]
|
48
|
-
))
|
49
|
-
|
50
|
-
actual = @client.preview.trusted_comms.businesses('BXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
51
|
-
.insights \
|
52
|
-
.impressions_rate().fetch()
|
53
|
-
|
54
|
-
expect(actual).to_not eq(nil)
|
55
|
-
end
|
56
|
-
end
|
@@ -1,45 +0,0 @@
|
|
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 'Business' do
|
12
|
-
it "can fetch" do
|
13
|
-
@holodeck.mock(Twilio::Response.new(500, ''))
|
14
|
-
|
15
|
-
expect {
|
16
|
-
@client.preview.trusted_comms.businesses('BXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
|
17
|
-
}.to raise_exception(Twilio::REST::TwilioError)
|
18
|
-
|
19
|
-
expect(
|
20
|
-
@holodeck.has_request?(Holodeck::Request.new(
|
21
|
-
method: 'get',
|
22
|
-
url: 'https://preview.twilio.com/TrustedComms/Businesses/BXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
|
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
|
-
"sid": "BXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
33
|
-
"url": "https://preview.twilio.com/TrustedComms/Businesses/BXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
34
|
-
"links": {
|
35
|
-
"insights": "https://preview.twilio.com/TrustedComms/Businesses/BXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Insights"
|
36
|
-
}
|
37
|
-
}
|
38
|
-
]
|
39
|
-
))
|
40
|
-
|
41
|
-
actual = @client.preview.trusted_comms.businesses('BXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
|
42
|
-
|
43
|
-
expect(actual).to_not eq(nil)
|
44
|
-
end
|
45
|
-
end
|
@@ -1,59 +0,0 @@
|
|
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 'PhoneCall' do
|
12
|
-
it "can create" do
|
13
|
-
@holodeck.mock(Twilio::Response.new(500, ''))
|
14
|
-
|
15
|
-
expect {
|
16
|
-
@client.preview.trusted_comms.phone_calls.create(from: 'from', to: 'to')
|
17
|
-
}.to raise_exception(Twilio::REST::TwilioError)
|
18
|
-
|
19
|
-
values = {'From' => 'from', 'To' => 'to', }
|
20
|
-
expect(
|
21
|
-
@holodeck.has_request?(Holodeck::Request.new(
|
22
|
-
method: 'post',
|
23
|
-
url: 'https://preview.twilio.com/TrustedComms/Business/PhoneCalls',
|
24
|
-
data: values,
|
25
|
-
))).to eq(true)
|
26
|
-
end
|
27
|
-
|
28
|
-
it "receives create responses" do
|
29
|
-
@holodeck.mock(Twilio::Response.new(
|
30
|
-
201,
|
31
|
-
%q[
|
32
|
-
{
|
33
|
-
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
34
|
-
"bg_color": "#fff",
|
35
|
-
"brand_sid": "BZaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
36
|
-
"branded_channel_sid": "BWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
37
|
-
"business_sid": "BXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
38
|
-
"call_sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
39
|
-
"caller": "Owl Bank",
|
40
|
-
"created_at": "2019-05-01T20:00:00Z",
|
41
|
-
"font_color": "#000",
|
42
|
-
"from": "+15000000000",
|
43
|
-
"logo": "https://www.twilio.com/marketing/bundles/company/img/logos/red/twilio-logo-red.png",
|
44
|
-
"phone_number_sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
45
|
-
"reason": "Hello Jhon, your appointment has been confirmed.",
|
46
|
-
"sid": "CQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
47
|
-
"status": "unknown",
|
48
|
-
"to": "+573000000000",
|
49
|
-
"url": "https://preview.twilio.com/TrustedComms/Business/PhoneCalls",
|
50
|
-
"use_case": "conversational"
|
51
|
-
}
|
52
|
-
]
|
53
|
-
))
|
54
|
-
|
55
|
-
actual = @client.preview.trusted_comms.phone_calls.create(from: 'from', to: 'to')
|
56
|
-
|
57
|
-
expect(actual).to_not eq(nil)
|
58
|
-
end
|
59
|
-
end
|