twilio-ruby 5.41.0 → 5.45.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +99 -0
- data/{LICENSE.md → LICENSE} +0 -0
- data/PULL_REQUEST_TEMPLATE.md +3 -3
- data/README.md +18 -2
- data/lib/twilio-ruby.rb +1 -1
- data/lib/twilio-ruby/jwt/access_token.rb +7 -2
- data/lib/twilio-ruby/rest/api/v2010/account/call.rb +26 -1
- data/lib/twilio-ruby/rest/api/v2010/account/call/event.rb +201 -0
- data/lib/twilio-ruby/rest/api/v2010/account/call/recording.rb +13 -1
- data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +6 -1
- data/lib/twilio-ruby/rest/bulkexports/v1/export/day.rb +5 -22
- data/lib/twilio-ruby/rest/bulkexports/v1/export/export_custom_job.rb +25 -40
- data/lib/twilio-ruby/rest/client.rb +29 -3
- data/lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb +32 -2
- data/lib/twilio-ruby/rest/conversations/v1/service/configuration.rb +17 -2
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation/participant.rb +32 -2
- 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/subscription.rb +12 -5
- 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/flex_flow.rb +88 -76
- data/lib/twilio-ruby/rest/flex_api/v1/web_channel.rb +2 -2
- data/lib/twilio-ruby/rest/insights.rb +8 -0
- data/lib/twilio-ruby/rest/insights/v1.rb +15 -0
- data/lib/twilio-ruby/rest/insights/v1/room.rb +487 -0
- data/lib/twilio-ruby/rest/insights/v1/room/participant.rb +378 -0
- data/lib/twilio-ruby/rest/ip_messaging.rb +8 -10
- data/lib/twilio-ruby/rest/ip_messaging/v1.rb +6 -8
- data/lib/twilio-ruby/rest/ip_messaging/v1/credential.rb +29 -68
- data/lib/twilio-ruby/rest/ip_messaging/v1/service.rb +198 -313
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb +32 -59
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/invite.rb +23 -55
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/member.rb +28 -71
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/message.rb +31 -59
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/role.rb +19 -39
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/user.rb +29 -51
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/user/user_channel.rb +12 -18
- data/lib/twilio-ruby/rest/ip_messaging/v2.rb +6 -6
- data/lib/twilio-ruby/rest/ip_messaging/v2/credential.rb +29 -66
- data/lib/twilio-ruby/rest/ip_messaging/v2/service.rb +116 -205
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/binding.rb +23 -50
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb +41 -91
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/invite.rb +23 -50
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/member.rb +42 -118
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/message.rb +46 -100
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/webhook.rb +36 -89
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/role.rb +19 -41
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/user.rb +29 -53
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/user/user_binding.rb +23 -53
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/user/user_channel.rb +27 -56
- data/lib/twilio-ruby/rest/preview.rb +0 -21
- data/lib/twilio-ruby/rest/preview/bulk_exports/export/day.rb +5 -22
- data/lib/twilio-ruby/rest/preview/bulk_exports/export/export_custom_job.rb +21 -39
- data/lib/twilio-ruby/rest/preview/trusted_comms.rb +0 -30
- data/lib/twilio-ruby/rest/serverless/v1/service.rb +5 -5
- data/lib/twilio-ruby/rest/serverless/v1/service/asset.rb +4 -4
- data/lib/twilio-ruby/rest/serverless/v1/service/asset/asset_version.rb +4 -4
- data/lib/twilio-ruby/rest/serverless/v1/service/build.rb +4 -4
- data/lib/twilio-ruby/rest/serverless/v1/service/build/build_status.rb +4 -4
- data/lib/twilio-ruby/rest/serverless/v1/service/environment.rb +4 -4
- data/lib/twilio-ruby/rest/serverless/v1/service/environment/deployment.rb +4 -4
- data/lib/twilio-ruby/rest/serverless/v1/service/environment/log.rb +4 -4
- data/lib/twilio-ruby/rest/serverless/v1/service/environment/variable.rb +4 -4
- data/lib/twilio-ruby/rest/serverless/v1/service/function.rb +4 -4
- data/lib/twilio-ruby/rest/serverless/v1/service/function/function_version.rb +4 -4
- data/lib/twilio-ruby/rest/serverless/v1/service/function/function_version/function_version_content.rb +4 -4
- data/lib/twilio-ruby/rest/sync/v1/service/document.rb +15 -5
- data/lib/twilio-ruby/rest/sync/v1/service/sync_list.rb +15 -5
- data/lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_item.rb +28 -5
- data/lib/twilio-ruby/rest/sync/v1/service/sync_map.rb +15 -5
- data/lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_item.rb +28 -5
- data/lib/twilio-ruby/rest/sync/v1/service/sync_stream.rb +15 -5
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb +12 -9
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_channel.rb +16 -16
- data/lib/twilio-ruby/rest/trunking/v1/trunk/recording.rb +21 -24
- data/lib/twilio-ruby/rest/verify/v2/form.rb +4 -4
- data/lib/twilio-ruby/rest/verify/v2/service.rb +3 -3
- data/lib/twilio-ruby/rest/verify/v2/service/access_token.rb +3 -3
- data/lib/twilio-ruby/rest/verify/v2/service/entity.rb +23 -35
- data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb +27 -49
- data/lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb +24 -42
- data/lib/twilio-ruby/rest/verify/v2/service/webhook.rb +4 -4
- data/lib/twilio-ruby/rest/video/v1/composition_settings.rb +6 -6
- data/lib/twilio-ruby/rest/video/v1/recording_settings.rb +6 -6
- data/lib/twilio-ruby/rest/video/v1/room.rb +20 -0
- data/lib/twilio-ruby/rest/video/v1/room/room_recording_rule.rb +150 -0
- data/lib/twilio-ruby/twiml/voice_response.rb +8 -4
- data/lib/twilio-ruby/util/configuration.rb +5 -1
- data/lib/twilio-ruby/version.rb +1 -1
- data/spec/integration/api/v2010/account/call/event_spec.rb +102 -0
- data/spec/integration/api/v2010/account/call/recording_spec.rb +4 -0
- data/spec/integration/api/v2010/account/call_spec.rb +20 -10
- data/spec/integration/api/v2010/account/conference/participant_spec.rb +30 -0
- data/spec/integration/bulkexports/v1/export/export_custom_job_spec.rb +4 -2
- 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/sink_test_spec.rb +1 -1
- data/spec/integration/events/v1/subscription_spec.rb +49 -0
- data/spec/integration/insights/v1/room/participant_spec.rb +147 -0
- data/spec/integration/insights/v1/room_spec.rb +164 -0
- data/spec/integration/ip_messaging/v1/credential_spec.rb +13 -13
- data/spec/integration/ip_messaging/v1/service/channel/invite_spec.rb +11 -11
- data/spec/integration/ip_messaging/v1/service/channel/member_spec.rb +14 -14
- data/spec/integration/ip_messaging/v1/service/channel/message_spec.rb +14 -14
- data/spec/integration/ip_messaging/v1/service/channel_spec.rb +25 -25
- data/spec/integration/ip_messaging/v1/service/role_spec.rb +13 -13
- data/spec/integration/ip_messaging/v1/service/user/user_channel_spec.rb +7 -7
- data/spec/integration/ip_messaging/v1/service/user_spec.rb +17 -17
- data/spec/integration/ip_messaging/v1/service_spec.rb +9 -9
- data/spec/integration/ip_messaging/v2/credential_spec.rb +13 -13
- data/spec/integration/ip_messaging/v2/service/binding_spec.rb +11 -11
- data/spec/integration/ip_messaging/v2/service/channel/invite_spec.rb +11 -11
- data/spec/integration/ip_messaging/v2/service/channel/member_spec.rb +13 -13
- data/spec/integration/ip_messaging/v2/service/channel/message_spec.rb +17 -17
- data/spec/integration/ip_messaging/v2/service/channel/webhook_spec.rb +15 -15
- data/spec/integration/ip_messaging/v2/service/channel_spec.rb +29 -29
- data/spec/integration/ip_messaging/v2/service/role_spec.rb +13 -13
- data/spec/integration/ip_messaging/v2/service/user/user_binding_spec.rb +9 -9
- data/spec/integration/ip_messaging/v2/service/user/user_channel_spec.rb +20 -20
- data/spec/integration/ip_messaging/v2/service/user_spec.rb +21 -21
- data/spec/integration/ip_messaging/v2/service_spec.rb +29 -29
- data/spec/integration/lookups/v1/phone_number_spec.rb +7 -7
- data/spec/integration/preview/bulk_exports/export/export_custom_job_spec.rb +4 -2
- 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/verify/v2/service/entity/challenge_spec.rb +4 -12
- data/spec/integration/verify/v2/service/entity/factor_spec.rb +5 -15
- data/spec/integration/verify/v2/service/entity_spec.rb +4 -12
- data/spec/integration/video/v1/room/room_recording_rule_spec.rb +89 -0
- data/spec/integration/video/v1/room_spec.rb +10 -5
- data/spec/jwt/access_token_spec.rb +9 -1
- data/spec/rest/client_spec.rb +24 -2
- data/twilio-ruby.gemspec +2 -1
- metadata +30 -19
- 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,342 +0,0 @@
|
|
1
|
-
##
|
2
|
-
# This code was generated by
|
3
|
-
# \ / _ _ _| _ _
|
4
|
-
# | (_)\/(_)(_|\/| |(/_ v1.0.0
|
5
|
-
# / /
|
6
|
-
#
|
7
|
-
# frozen_string_literal: true
|
8
|
-
|
9
|
-
module Twilio
|
10
|
-
module REST
|
11
|
-
class Preview < Domain
|
12
|
-
class TrustedComms < Version
|
13
|
-
##
|
14
|
-
# PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
|
15
|
-
class PhoneCallList < ListResource
|
16
|
-
##
|
17
|
-
# Initialize the PhoneCallList
|
18
|
-
# @param [Version] version Version that contains the resource
|
19
|
-
# @return [PhoneCallList] PhoneCallList
|
20
|
-
def initialize(version)
|
21
|
-
super(version)
|
22
|
-
|
23
|
-
# Path Solution
|
24
|
-
@solution = {}
|
25
|
-
@uri = "/Business/PhoneCalls"
|
26
|
-
end
|
27
|
-
|
28
|
-
##
|
29
|
-
# Create the PhoneCallInstance
|
30
|
-
# @param [String] from The phone number to use as the caller id, given in {E.164
|
31
|
-
# format}[https://www.twilio.com/docs/glossary/what-e164]. It must be a Twilio
|
32
|
-
# number that has been set up as a Branded Number in the Business Profile section
|
33
|
-
# for your account.
|
34
|
-
# @param [String] to The terminating Phone Number, given in {E.164
|
35
|
-
# format}[https://www.twilio.com/docs/glossary/what-e164].
|
36
|
-
# @param [String] reason The business reason for this phone call that will appear
|
37
|
-
# in the terminating device's screen. Max 50 characters.
|
38
|
-
# @param [String] application_sid Refers to the parameter with the same name when
|
39
|
-
# {initiating a call via Voice
|
40
|
-
# API}[https://www.twilio.com/docs/voice/api/call#create-a-call-resource]
|
41
|
-
# @param [String] caller_id Refers to the parameter with the same name when
|
42
|
-
# {initiating a call via Voice
|
43
|
-
# API}[https://www.twilio.com/docs/voice/api/call#create-a-call-resource]
|
44
|
-
# @param [String] fallback_method Refers to the parameter with the same name when
|
45
|
-
# {initiating a call via Voice
|
46
|
-
# API}[https://www.twilio.com/docs/voice/api/call#create-a-call-resource]
|
47
|
-
# @param [String] fallback_url Refers to the parameter with the same name when
|
48
|
-
# {initiating a call via Voice
|
49
|
-
# API}[https://www.twilio.com/docs/voice/api/call#create-a-call-resource]
|
50
|
-
# @param [String] machine_detection Refers to the parameter with the same name
|
51
|
-
# when {initiating a call via Voice
|
52
|
-
# API}[https://www.twilio.com/docs/voice/api/call#create-a-call-resource]
|
53
|
-
# @param [String] machine_detection_silence_timeout Refers to the parameter with
|
54
|
-
# the same name when {initiating a call via Voice
|
55
|
-
# API}[https://www.twilio.com/docs/voice/api/call#create-a-call-resource]
|
56
|
-
# @param [String] machine_detection_speech_end_threshold Refers to the parameter
|
57
|
-
# with the same name when {initiating a call via Voice
|
58
|
-
# API}[https://www.twilio.com/docs/voice/api/call#create-a-call-resource]
|
59
|
-
# @param [String] machine_detection_speech_threshold Refers to the parameter with
|
60
|
-
# the same name when {initiating a call via Voice
|
61
|
-
# API}[https://www.twilio.com/docs/voice/api/call#create-a-call-resource]
|
62
|
-
# @param [String] machine_detection_timeout Refers to the parameter with the same
|
63
|
-
# name when {initiating a call via Voice
|
64
|
-
# API}[https://www.twilio.com/docs/voice/api/call#create-a-call-resource]
|
65
|
-
# @param [String] method Refers to the parameter with the same name when
|
66
|
-
# {initiating a call via Voice
|
67
|
-
# API}[https://www.twilio.com/docs/voice/api/call#create-a-call-resource]
|
68
|
-
# @param [Boolean] record Refers to the parameter with the same name when
|
69
|
-
# {initiating a call via Voice
|
70
|
-
# API}[https://www.twilio.com/docs/voice/api/call#create-a-call-resource]
|
71
|
-
# @param [String] recording_channels Refers to the parameter with the same name
|
72
|
-
# when {initiating a call via Voice
|
73
|
-
# API}[https://www.twilio.com/docs/voice/api/call#create-a-call-resource]
|
74
|
-
# @param [String] recording_status_callback Refers to the parameter with the same
|
75
|
-
# name when {initiating a call via Voice
|
76
|
-
# API}[https://www.twilio.com/docs/voice/api/call#create-a-call-resource]
|
77
|
-
# @param [String] recording_status_callback_event Refers to the parameter with the
|
78
|
-
# same name when {initiating a call via Voice
|
79
|
-
# API}[https://www.twilio.com/docs/voice/api/call#create-a-call-resource]
|
80
|
-
# @param [String] recording_status_callback_method Refers to the parameter with
|
81
|
-
# the same name when {initiating a call via Voice
|
82
|
-
# API}[https://www.twilio.com/docs/voice/api/call#create-a-call-resource]
|
83
|
-
# @param [String] send_digits Refers to the parameter with the same name when
|
84
|
-
# {initiating a call via Voice
|
85
|
-
# API}[https://www.twilio.com/docs/voice/api/call#create-a-call-resource]
|
86
|
-
# @param [String] sip_auth_password Refers to the parameter with the same name
|
87
|
-
# when {initiating a call via Voice
|
88
|
-
# API}[https://www.twilio.com/docs/voice/api/call#create-a-call-resource]
|
89
|
-
# @param [String] sip_auth_username Refers to the parameter with the same name
|
90
|
-
# when {initiating a call via Voice
|
91
|
-
# API}[https://www.twilio.com/docs/voice/api/call#create-a-call-resource]
|
92
|
-
# @param [String] status_callback Refers to the parameter with the same name when
|
93
|
-
# {initiating a call via Voice
|
94
|
-
# API}[https://www.twilio.com/docs/voice/api/call#create-a-call-resource]
|
95
|
-
# @param [String] status_callback_event Refers to the parameter with the same name
|
96
|
-
# when {initiating a call via Voice
|
97
|
-
# API}[https://www.twilio.com/docs/voice/api/call#create-a-call-resource]
|
98
|
-
# @param [String] status_callback_method Refers to the parameter with the same
|
99
|
-
# name when {initiating a call via Voice
|
100
|
-
# API}[https://www.twilio.com/docs/voice/api/call#create-a-call-resource]
|
101
|
-
# @param [String] timeout Refers to the parameter with the same name when
|
102
|
-
# {initiating a call via Voice
|
103
|
-
# API}[https://www.twilio.com/docs/voice/api/call#create-a-call-resource]
|
104
|
-
# @param [String] trim Refers to the parameter with the same name when {initiating
|
105
|
-
# a call via Voice
|
106
|
-
# API}[https://www.twilio.com/docs/voice/api/call#create-a-call-resource]
|
107
|
-
# @param [String] url Refers to the parameter with the same name when {initiating
|
108
|
-
# a call via Voice
|
109
|
-
# API}[https://www.twilio.com/docs/voice/api/call#create-a-call-resource]
|
110
|
-
# @return [PhoneCallInstance] Created PhoneCallInstance
|
111
|
-
def create(from: nil, to: nil, reason: :unset, application_sid: :unset, caller_id: :unset, fallback_method: :unset, fallback_url: :unset, machine_detection: :unset, machine_detection_silence_timeout: :unset, machine_detection_speech_end_threshold: :unset, machine_detection_speech_threshold: :unset, machine_detection_timeout: :unset, method: :unset, record: :unset, recording_channels: :unset, recording_status_callback: :unset, recording_status_callback_event: :unset, recording_status_callback_method: :unset, send_digits: :unset, sip_auth_password: :unset, sip_auth_username: :unset, status_callback: :unset, status_callback_event: :unset, status_callback_method: :unset, timeout: :unset, trim: :unset, url: :unset)
|
112
|
-
data = Twilio::Values.of({
|
113
|
-
'From' => from,
|
114
|
-
'To' => to,
|
115
|
-
'Reason' => reason,
|
116
|
-
'ApplicationSid' => application_sid,
|
117
|
-
'CallerId' => caller_id,
|
118
|
-
'FallbackMethod' => fallback_method,
|
119
|
-
'FallbackUrl' => fallback_url,
|
120
|
-
'MachineDetection' => machine_detection,
|
121
|
-
'MachineDetectionSilenceTimeout' => machine_detection_silence_timeout,
|
122
|
-
'MachineDetectionSpeechEndThreshold' => machine_detection_speech_end_threshold,
|
123
|
-
'MachineDetectionSpeechThreshold' => machine_detection_speech_threshold,
|
124
|
-
'MachineDetectionTimeout' => machine_detection_timeout,
|
125
|
-
'Method' => method,
|
126
|
-
'Record' => record,
|
127
|
-
'RecordingChannels' => recording_channels,
|
128
|
-
'RecordingStatusCallback' => recording_status_callback,
|
129
|
-
'RecordingStatusCallbackEvent' => Twilio.serialize_list(recording_status_callback_event) { |e| e },
|
130
|
-
'RecordingStatusCallbackMethod' => recording_status_callback_method,
|
131
|
-
'SendDigits' => send_digits,
|
132
|
-
'SipAuthPassword' => sip_auth_password,
|
133
|
-
'SipAuthUsername' => sip_auth_username,
|
134
|
-
'StatusCallback' => status_callback,
|
135
|
-
'StatusCallbackEvent' => Twilio.serialize_list(status_callback_event) { |e| e },
|
136
|
-
'StatusCallbackMethod' => status_callback_method,
|
137
|
-
'Timeout' => timeout,
|
138
|
-
'Trim' => trim,
|
139
|
-
'Url' => url,
|
140
|
-
})
|
141
|
-
|
142
|
-
payload = @version.create('POST', @uri, data: data)
|
143
|
-
|
144
|
-
PhoneCallInstance.new(@version, payload, )
|
145
|
-
end
|
146
|
-
|
147
|
-
##
|
148
|
-
# Provide a user friendly representation
|
149
|
-
def to_s
|
150
|
-
'#<Twilio.Preview.TrustedComms.PhoneCallList>'
|
151
|
-
end
|
152
|
-
end
|
153
|
-
|
154
|
-
##
|
155
|
-
# PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
|
156
|
-
class PhoneCallPage < Page
|
157
|
-
##
|
158
|
-
# Initialize the PhoneCallPage
|
159
|
-
# @param [Version] version Version that contains the resource
|
160
|
-
# @param [Response] response Response from the API
|
161
|
-
# @param [Hash] solution Path solution for the resource
|
162
|
-
# @return [PhoneCallPage] PhoneCallPage
|
163
|
-
def initialize(version, response, solution)
|
164
|
-
super(version, response)
|
165
|
-
|
166
|
-
# Path Solution
|
167
|
-
@solution = solution
|
168
|
-
end
|
169
|
-
|
170
|
-
##
|
171
|
-
# Build an instance of PhoneCallInstance
|
172
|
-
# @param [Hash] payload Payload response from the API
|
173
|
-
# @return [PhoneCallInstance] PhoneCallInstance
|
174
|
-
def get_instance(payload)
|
175
|
-
PhoneCallInstance.new(@version, payload, )
|
176
|
-
end
|
177
|
-
|
178
|
-
##
|
179
|
-
# Provide a user friendly representation
|
180
|
-
def to_s
|
181
|
-
'<Twilio.Preview.TrustedComms.PhoneCallPage>'
|
182
|
-
end
|
183
|
-
end
|
184
|
-
|
185
|
-
##
|
186
|
-
# PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
|
187
|
-
class PhoneCallInstance < InstanceResource
|
188
|
-
##
|
189
|
-
# Initialize the PhoneCallInstance
|
190
|
-
# @param [Version] version Version that contains the resource
|
191
|
-
# @param [Hash] payload payload that contains response from Twilio
|
192
|
-
# @return [PhoneCallInstance] PhoneCallInstance
|
193
|
-
def initialize(version, payload)
|
194
|
-
super(version)
|
195
|
-
|
196
|
-
# Marshaled Properties
|
197
|
-
@properties = {
|
198
|
-
'account_sid' => payload['account_sid'],
|
199
|
-
'bg_color' => payload['bg_color'],
|
200
|
-
'brand_sid' => payload['brand_sid'],
|
201
|
-
'branded_channel_sid' => payload['branded_channel_sid'],
|
202
|
-
'business_sid' => payload['business_sid'],
|
203
|
-
'call_sid' => payload['call_sid'],
|
204
|
-
'caller' => payload['caller'],
|
205
|
-
'created_at' => Twilio.deserialize_iso8601_datetime(payload['created_at']),
|
206
|
-
'font_color' => payload['font_color'],
|
207
|
-
'from' => payload['from'],
|
208
|
-
'logo' => payload['logo'],
|
209
|
-
'phone_number_sid' => payload['phone_number_sid'],
|
210
|
-
'reason' => payload['reason'],
|
211
|
-
'sid' => payload['sid'],
|
212
|
-
'status' => payload['status'],
|
213
|
-
'to' => payload['to'],
|
214
|
-
'url' => payload['url'],
|
215
|
-
'use_case' => payload['use_case'],
|
216
|
-
}
|
217
|
-
end
|
218
|
-
|
219
|
-
##
|
220
|
-
# @return [String] Account Sid.
|
221
|
-
def account_sid
|
222
|
-
@properties['account_sid']
|
223
|
-
end
|
224
|
-
|
225
|
-
##
|
226
|
-
# @return [String] Background color of the current phone call
|
227
|
-
def bg_color
|
228
|
-
@properties['bg_color']
|
229
|
-
end
|
230
|
-
|
231
|
-
##
|
232
|
-
# @return [String] Brand Sid.
|
233
|
-
def brand_sid
|
234
|
-
@properties['brand_sid']
|
235
|
-
end
|
236
|
-
|
237
|
-
##
|
238
|
-
# @return [String] Branded Channel Sid.
|
239
|
-
def branded_channel_sid
|
240
|
-
@properties['branded_channel_sid']
|
241
|
-
end
|
242
|
-
|
243
|
-
##
|
244
|
-
# @return [String] Business Sid.
|
245
|
-
def business_sid
|
246
|
-
@properties['business_sid']
|
247
|
-
end
|
248
|
-
|
249
|
-
##
|
250
|
-
# @return [String] A string that uniquely identifies this phone call.
|
251
|
-
def call_sid
|
252
|
-
@properties['call_sid']
|
253
|
-
end
|
254
|
-
|
255
|
-
##
|
256
|
-
# @return [String] Caller name of the current phone call
|
257
|
-
def caller
|
258
|
-
@properties['caller']
|
259
|
-
end
|
260
|
-
|
261
|
-
##
|
262
|
-
# @return [Time] The date this Current Call was created
|
263
|
-
def created_at
|
264
|
-
@properties['created_at']
|
265
|
-
end
|
266
|
-
|
267
|
-
##
|
268
|
-
# @return [String] Font color of the current phone call
|
269
|
-
def font_color
|
270
|
-
@properties['font_color']
|
271
|
-
end
|
272
|
-
|
273
|
-
##
|
274
|
-
# @return [String] The originating Phone Number
|
275
|
-
def from
|
276
|
-
@properties['from']
|
277
|
-
end
|
278
|
-
|
279
|
-
##
|
280
|
-
# @return [String] Logo URL of the caller
|
281
|
-
def logo
|
282
|
-
@properties['logo']
|
283
|
-
end
|
284
|
-
|
285
|
-
##
|
286
|
-
# @return [String] Phone Number Sid.
|
287
|
-
def phone_number_sid
|
288
|
-
@properties['phone_number_sid']
|
289
|
-
end
|
290
|
-
|
291
|
-
##
|
292
|
-
# @return [String] The business reason for this phone call
|
293
|
-
def reason
|
294
|
-
@properties['reason']
|
295
|
-
end
|
296
|
-
|
297
|
-
##
|
298
|
-
# @return [String] A string that uniquely identifies this current branded phone call.
|
299
|
-
def sid
|
300
|
-
@properties['sid']
|
301
|
-
end
|
302
|
-
|
303
|
-
##
|
304
|
-
# @return [String] The status of the current phone call
|
305
|
-
def status
|
306
|
-
@properties['status']
|
307
|
-
end
|
308
|
-
|
309
|
-
##
|
310
|
-
# @return [String] The terminating Phone Number
|
311
|
-
def to
|
312
|
-
@properties['to']
|
313
|
-
end
|
314
|
-
|
315
|
-
##
|
316
|
-
# @return [String] The URL of this resource.
|
317
|
-
def url
|
318
|
-
@properties['url']
|
319
|
-
end
|
320
|
-
|
321
|
-
##
|
322
|
-
# @return [String] The use case for the current phone call
|
323
|
-
def use_case
|
324
|
-
@properties['use_case']
|
325
|
-
end
|
326
|
-
|
327
|
-
##
|
328
|
-
# Provide a user friendly representation
|
329
|
-
def to_s
|
330
|
-
"<Twilio.Preview.TrustedComms.PhoneCallInstance>"
|
331
|
-
end
|
332
|
-
|
333
|
-
##
|
334
|
-
# Provide a detailed, user friendly representation
|
335
|
-
def inspect
|
336
|
-
"<Twilio.Preview.TrustedComms.PhoneCallInstance>"
|
337
|
-
end
|
338
|
-
end
|
339
|
-
end
|
340
|
-
end
|
341
|
-
end
|
342
|
-
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 '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
|