## # This code was generated by # \ / _ _ _| _ _ # | (_)\/(_)(_|\/| |(/_ v1.0.0 # / / # # frozen_string_literal: true module Twilio module REST class Preview < Domain class TrustedComms < Version ## # 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. class PhoneCallList < ListResource ## # Initialize the PhoneCallList # @param [Version] version Version that contains the resource # @return [PhoneCallList] PhoneCallList def initialize(version) super(version) # Path Solution @solution = {} @uri = "/Business/PhoneCalls" end ## # Create the PhoneCallInstance # @param [String] from The phone number to use as the caller id, given in {E.164 # format}[https://www.twilio.com/docs/glossary/what-e164]. It must be a Twilio # number that has been set up as a Branded Number in the Business Profile section # for your account. # @param [String] to The terminating Phone Number, given in {E.164 # format}[https://www.twilio.com/docs/glossary/what-e164]. # @param [String] reason The business reason for this phone call that will appear # in the terminating device's screen. Max 50 characters. # @param [String] application_sid Refers to the parameter with the same name when # {initiating a call via Voice # API}[https://www.twilio.com/docs/voice/api/call#create-a-call-resource] # @param [String] caller_id Refers to the parameter with the same name when # {initiating a call via Voice # API}[https://www.twilio.com/docs/voice/api/call#create-a-call-resource] # @param [String] fallback_method Refers to the parameter with the same name when # {initiating a call via Voice # API}[https://www.twilio.com/docs/voice/api/call#create-a-call-resource] # @param [String] fallback_url Refers to the parameter with the same name when # {initiating a call via Voice # API}[https://www.twilio.com/docs/voice/api/call#create-a-call-resource] # @param [String] machine_detection Refers to the parameter with the same name # when {initiating a call via Voice # API}[https://www.twilio.com/docs/voice/api/call#create-a-call-resource] # @param [String] machine_detection_silence_timeout Refers to the parameter with # the same name when {initiating a call via Voice # API}[https://www.twilio.com/docs/voice/api/call#create-a-call-resource] # @param [String] machine_detection_speech_end_threshold Refers to the parameter # with the same name when {initiating a call via Voice # API}[https://www.twilio.com/docs/voice/api/call#create-a-call-resource] # @param [String] machine_detection_speech_threshold Refers to the parameter with # the same name when {initiating a call via Voice # API}[https://www.twilio.com/docs/voice/api/call#create-a-call-resource] # @param [String] machine_detection_timeout Refers to the parameter with the same # name when {initiating a call via Voice # API}[https://www.twilio.com/docs/voice/api/call#create-a-call-resource] # @param [String] method Refers to the parameter with the same name when # {initiating a call via Voice # API}[https://www.twilio.com/docs/voice/api/call#create-a-call-resource] # @param [Boolean] record Refers to the parameter with the same name when # {initiating a call via Voice # API}[https://www.twilio.com/docs/voice/api/call#create-a-call-resource] # @param [String] recording_channels Refers to the parameter with the same name # when {initiating a call via Voice # API}[https://www.twilio.com/docs/voice/api/call#create-a-call-resource] # @param [String] recording_status_callback Refers to the parameter with the same # name when {initiating a call via Voice # API}[https://www.twilio.com/docs/voice/api/call#create-a-call-resource] # @param [String] recording_status_callback_event Refers to the parameter with the # same name when {initiating a call via Voice # API}[https://www.twilio.com/docs/voice/api/call#create-a-call-resource] # @param [String] recording_status_callback_method Refers to the parameter with # the same name when {initiating a call via Voice # API}[https://www.twilio.com/docs/voice/api/call#create-a-call-resource] # @param [String] send_digits Refers to the parameter with the same name when # {initiating a call via Voice # API}[https://www.twilio.com/docs/voice/api/call#create-a-call-resource] # @param [String] sip_auth_password Refers to the parameter with the same name # when {initiating a call via Voice # API}[https://www.twilio.com/docs/voice/api/call#create-a-call-resource] # @param [String] sip_auth_username Refers to the parameter with the same name # when {initiating a call via Voice # API}[https://www.twilio.com/docs/voice/api/call#create-a-call-resource] # @param [String] status_callback Refers to the parameter with the same name when # {initiating a call via Voice # API}[https://www.twilio.com/docs/voice/api/call#create-a-call-resource] # @param [String] status_callback_event Refers to the parameter with the same name # when {initiating a call via Voice # API}[https://www.twilio.com/docs/voice/api/call#create-a-call-resource] # @param [String] status_callback_method Refers to the parameter with the same # name when {initiating a call via Voice # API}[https://www.twilio.com/docs/voice/api/call#create-a-call-resource] # @param [String] timeout Refers to the parameter with the same name when # {initiating a call via Voice # API}[https://www.twilio.com/docs/voice/api/call#create-a-call-resource] # @param [String] trim Refers to the parameter with the same name when {initiating # a call via Voice # API}[https://www.twilio.com/docs/voice/api/call#create-a-call-resource] # @param [String] url Refers to the parameter with the same name when {initiating # a call via Voice # API}[https://www.twilio.com/docs/voice/api/call#create-a-call-resource] # @return [PhoneCallInstance] Created PhoneCallInstance 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) data = Twilio::Values.of({ 'From' => from, 'To' => to, 'Reason' => reason, 'ApplicationSid' => application_sid, 'CallerId' => caller_id, 'FallbackMethod' => fallback_method, 'FallbackUrl' => fallback_url, 'MachineDetection' => machine_detection, 'MachineDetectionSilenceTimeout' => machine_detection_silence_timeout, 'MachineDetectionSpeechEndThreshold' => machine_detection_speech_end_threshold, 'MachineDetectionSpeechThreshold' => machine_detection_speech_threshold, 'MachineDetectionTimeout' => machine_detection_timeout, 'Method' => method, 'Record' => record, 'RecordingChannels' => recording_channels, 'RecordingStatusCallback' => recording_status_callback, 'RecordingStatusCallbackEvent' => Twilio.serialize_list(recording_status_callback_event) { |e| e }, 'RecordingStatusCallbackMethod' => recording_status_callback_method, 'SendDigits' => send_digits, 'SipAuthPassword' => sip_auth_password, 'SipAuthUsername' => sip_auth_username, 'StatusCallback' => status_callback, 'StatusCallbackEvent' => Twilio.serialize_list(status_callback_event) { |e| e }, 'StatusCallbackMethod' => status_callback_method, 'Timeout' => timeout, 'Trim' => trim, 'Url' => url, }) payload = @version.create('POST', @uri, data: data) PhoneCallInstance.new(@version, payload, ) end ## # Provide a user friendly representation def to_s '#' end end ## # 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. class PhoneCallPage < Page ## # Initialize the PhoneCallPage # @param [Version] version Version that contains the resource # @param [Response] response Response from the API # @param [Hash] solution Path solution for the resource # @return [PhoneCallPage] PhoneCallPage def initialize(version, response, solution) super(version, response) # Path Solution @solution = solution end ## # Build an instance of PhoneCallInstance # @param [Hash] payload Payload response from the API # @return [PhoneCallInstance] PhoneCallInstance def get_instance(payload) PhoneCallInstance.new(@version, payload, ) end ## # Provide a user friendly representation def to_s '' end end ## # 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. class PhoneCallInstance < InstanceResource ## # Initialize the PhoneCallInstance # @param [Version] version Version that contains the resource # @param [Hash] payload payload that contains response from Twilio # @return [PhoneCallInstance] PhoneCallInstance def initialize(version, payload) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'bg_color' => payload['bg_color'], 'brand_sid' => payload['brand_sid'], 'branded_channel_sid' => payload['branded_channel_sid'], 'business_sid' => payload['business_sid'], 'call_sid' => payload['call_sid'], 'caller' => payload['caller'], 'created_at' => Twilio.deserialize_iso8601_datetime(payload['created_at']), 'font_color' => payload['font_color'], 'from' => payload['from'], 'logo' => payload['logo'], 'phone_number_sid' => payload['phone_number_sid'], 'reason' => payload['reason'], 'sid' => payload['sid'], 'status' => payload['status'], 'to' => payload['to'], 'url' => payload['url'], 'use_case' => payload['use_case'], } end ## # @return [String] Account Sid. def account_sid @properties['account_sid'] end ## # @return [String] Background color of the current phone call def bg_color @properties['bg_color'] end ## # @return [String] Brand Sid. def brand_sid @properties['brand_sid'] end ## # @return [String] Branded Channel Sid. def branded_channel_sid @properties['branded_channel_sid'] end ## # @return [String] Business Sid. def business_sid @properties['business_sid'] end ## # @return [String] A string that uniquely identifies this phone call. def call_sid @properties['call_sid'] end ## # @return [String] Caller name of the current phone call def caller @properties['caller'] end ## # @return [Time] The date this Current Call was created def created_at @properties['created_at'] end ## # @return [String] Font color of the current phone call def font_color @properties['font_color'] end ## # @return [String] The originating Phone Number def from @properties['from'] end ## # @return [String] Logo URL of the caller def logo @properties['logo'] end ## # @return [String] Phone Number Sid. def phone_number_sid @properties['phone_number_sid'] end ## # @return [String] The business reason for this phone call def reason @properties['reason'] end ## # @return [String] A string that uniquely identifies this current branded phone call. def sid @properties['sid'] end ## # @return [String] The status of the current phone call def status @properties['status'] end ## # @return [String] The terminating Phone Number def to @properties['to'] end ## # @return [String] The URL of this resource. def url @properties['url'] end ## # @return [String] The use case for the current phone call def use_case @properties['use_case'] end ## # Provide a user friendly representation def to_s "" end ## # Provide a detailed, user friendly representation def inspect "" end end end end end end