# bandwidth # # This file was automatically generated by APIMATIC v2.0 # ( https://apimatic.io ). module Bandwidth # CreateCallRequest Model. class CreateCallRequest < BaseModel SKIP = Object.new private_constant :SKIP # Format is E164 # @return [String] attr_accessor :from # Format is E164 or SIP URI # @return [String] attr_accessor :to # A comma-separated list of 'User-To-User' headers to be sent in the INVITE # when calling a SIP URI. Each value must end with an 'encoding' parameter # as described in https://tools.ietf.org/html/rfc7433. Only 'jwt' and # 'base64' encodings are allowed. The entire value cannot exceed 350 # characters, including parameters and separators. # @return [String] attr_accessor :uui # @return [Float] attr_accessor :call_timeout # @return [Float] attr_accessor :callback_timeout # @return [String] attr_accessor :answer_url # @return [String] attr_accessor :answer_fallback_url # @return [String] attr_accessor :username # @return [String] attr_accessor :password # @return [String] attr_accessor :fallback_username # @return [String] attr_accessor :fallback_password # @return [AnswerMethodEnum] attr_accessor :answer_method # @return [AnswerFallbackMethodEnum] attr_accessor :answer_fallback_method # @return [String] attr_accessor :disconnect_url # @return [DisconnectMethodEnum] attr_accessor :disconnect_method # @return [String] attr_accessor :tag # @return [String] attr_accessor :application_id # @return [MachineDetectionRequest] attr_accessor :machine_detection # @return [Integer] attr_accessor :priority # A mapping from model property names to API property names. def self.names @_hash = {} if @_hash.nil? @_hash['from'] = 'from' @_hash['to'] = 'to' @_hash['uui'] = 'uui' @_hash['call_timeout'] = 'callTimeout' @_hash['callback_timeout'] = 'callbackTimeout' @_hash['answer_url'] = 'answerUrl' @_hash['answer_fallback_url'] = 'answerFallbackUrl' @_hash['username'] = 'username' @_hash['password'] = 'password' @_hash['fallback_username'] = 'fallbackUsername' @_hash['fallback_password'] = 'fallbackPassword' @_hash['answer_method'] = 'answerMethod' @_hash['answer_fallback_method'] = 'answerFallbackMethod' @_hash['disconnect_url'] = 'disconnectUrl' @_hash['disconnect_method'] = 'disconnectMethod' @_hash['tag'] = 'tag' @_hash['application_id'] = 'applicationId' @_hash['machine_detection'] = 'machineDetection' @_hash['priority'] = 'priority' @_hash end # An array for optional fields def optionals %w[ uui call_timeout callback_timeout answer_fallback_url username password fallback_username fallback_password answer_method answer_fallback_method disconnect_url disconnect_method tag machine_detection priority ] end # An array for nullable fields def nullables %w[ uui call_timeout callback_timeout answer_fallback_url username password fallback_username fallback_password answer_method answer_fallback_method disconnect_url disconnect_method tag priority ] end def initialize(from = nil, to = nil, answer_url = nil, application_id = nil, uui = nil, call_timeout = nil, callback_timeout = nil, answer_fallback_url = nil, username = nil, password = nil, fallback_username = nil, fallback_password = nil, answer_method = nil, answer_fallback_method = nil, disconnect_url = nil, disconnect_method = nil, tag = nil, machine_detection = nil, priority = nil) @from = from unless from == SKIP @to = to unless to == SKIP @uui = uui unless uui == SKIP @call_timeout = call_timeout unless call_timeout == SKIP @callback_timeout = callback_timeout unless callback_timeout == SKIP @answer_url = answer_url unless answer_url == SKIP @answer_fallback_url = answer_fallback_url unless answer_fallback_url == SKIP @username = username unless username == SKIP @password = password unless password == SKIP @fallback_username = fallback_username unless fallback_username == SKIP @fallback_password = fallback_password unless fallback_password == SKIP @answer_method = answer_method unless answer_method == SKIP @answer_fallback_method = answer_fallback_method unless answer_fallback_method == SKIP @disconnect_url = disconnect_url unless disconnect_url == SKIP @disconnect_method = disconnect_method unless disconnect_method == SKIP @tag = tag unless tag == SKIP @application_id = application_id unless application_id == SKIP @machine_detection = machine_detection unless machine_detection == SKIP @priority = priority unless priority == SKIP end # Creates an instance of the object from a hash. def self.from_hash(hash) return nil unless hash # Extract variables from the hash. from = hash.key?('from') ? hash['from'] : SKIP to = hash.key?('to') ? hash['to'] : SKIP answer_url = hash.key?('answerUrl') ? hash['answerUrl'] : SKIP application_id = hash.key?('applicationId') ? hash['applicationId'] : SKIP uui = hash.key?('uui') ? hash['uui'] : SKIP call_timeout = hash.key?('callTimeout') ? hash['callTimeout'] : SKIP callback_timeout = hash.key?('callbackTimeout') ? hash['callbackTimeout'] : SKIP answer_fallback_url = hash.key?('answerFallbackUrl') ? hash['answerFallbackUrl'] : SKIP username = hash.key?('username') ? hash['username'] : SKIP password = hash.key?('password') ? hash['password'] : SKIP fallback_username = hash.key?('fallbackUsername') ? hash['fallbackUsername'] : SKIP fallback_password = hash.key?('fallbackPassword') ? hash['fallbackPassword'] : SKIP answer_method = hash.key?('answerMethod') ? hash['answerMethod'] : SKIP answer_fallback_method = hash.key?('answerFallbackMethod') ? hash['answerFallbackMethod'] : SKIP disconnect_url = hash.key?('disconnectUrl') ? hash['disconnectUrl'] : SKIP disconnect_method = hash.key?('disconnectMethod') ? hash['disconnectMethod'] : SKIP tag = hash.key?('tag') ? hash['tag'] : SKIP machine_detection = MachineDetectionConfiguration.from_hash(hash['machineDetection']) if hash['machineDetection'] priority = hash.key?('priority') ? hash['priority'] : SKIP # Create object from extracted values. CreateCallRequest.new(from, to, answer_url, application_id, uui, call_timeout, callback_timeout, answer_fallback_url, username, password, fallback_username, fallback_password, answer_method, answer_fallback_method, disconnect_url, disconnect_method, tag, machine_detection, priority) end end end