# bandwidth # # This file was automatically generated by APIMATIC v2.0 # ( https://apimatic.io ). require 'date' module Bandwidth # ApiCallResponse Model. class ApiCallResponse < BaseModel # TODO: Write general description for this method # @return [String] attr_accessor :account_id # TODO: Write general description for this method # @return [String] attr_accessor :call_id # TODO: Write general description for this method # @return [String] attr_accessor :application_id # TODO: Write general description for this method # @return [String] attr_accessor :to # TODO: Write general description for this method # @return [String] attr_accessor :from # TODO: Write general description for this method # @return [DateTime] attr_accessor :start_time # TODO: Write general description for this method # @return [String] attr_accessor :call_url # TODO: Write general description for this method # @return [Float] attr_accessor :call_timeout # TODO: Write general description for this method # @return [String] attr_accessor :answer_url # TODO: Write general description for this method # @return [AnswerMethodEnum] attr_accessor :answer_method # TODO: Write general description for this method # @return [String] attr_accessor :disconnect_url # TODO: Write general description for this method # @return [DisconnectMethodEnum] attr_accessor :disconnect_method # TODO: Write general description for this method # @return [String] attr_accessor :username # TODO: Write general description for this method # @return [String] attr_accessor :password # TODO: Write general description for this method # @return [String] attr_accessor :tag # A mapping from model property names to API property names. def self.names @_hash = {} if @_hash.nil? @_hash['account_id'] = 'accountId' @_hash['call_id'] = 'callId' @_hash['application_id'] = 'applicationId' @_hash['to'] = 'to' @_hash['from'] = 'from' @_hash['start_time'] = 'startTime' @_hash['call_url'] = 'callUrl' @_hash['call_timeout'] = 'callTimeout' @_hash['answer_url'] = 'answerUrl' @_hash['answer_method'] = 'answerMethod' @_hash['disconnect_url'] = 'disconnectUrl' @_hash['disconnect_method'] = 'disconnectMethod' @_hash['username'] = 'username' @_hash['password'] = 'password' @_hash['tag'] = 'tag' @_hash end def initialize(account_id = nil, call_id = nil, application_id = nil, to = nil, from = nil, call_url = nil, answer_url = nil, answer_method = nil, disconnect_method = nil, start_time = nil, call_timeout = nil, disconnect_url = nil, username = nil, password = nil, tag = nil) @account_id = account_id @call_id = call_id @application_id = application_id @to = to @from = from @start_time = start_time @call_url = call_url @call_timeout = call_timeout @answer_url = answer_url @answer_method = answer_method @disconnect_url = disconnect_url @disconnect_method = disconnect_method @username = username @password = password @tag = tag end # Creates an instance of the object from a hash. def self.from_hash(hash) return nil unless hash # Extract variables from the hash. account_id = hash['accountId'] call_id = hash['callId'] application_id = hash['applicationId'] to = hash['to'] from = hash['from'] call_url = hash['callUrl'] answer_url = hash['answerUrl'] answer_method = hash['answerMethod'] disconnect_method = hash['disconnectMethod'] start_time = APIHelper.rfc3339(hash['startTime']) if hash['startTime'] call_timeout = hash['callTimeout'] disconnect_url = hash['disconnectUrl'] username = hash['username'] password = hash['password'] tag = hash['tag'] # Create object from extracted values. ApiCallResponse.new(account_id, call_id, application_id, to, from, call_url, answer_url, answer_method, disconnect_method, start_time, call_timeout, disconnect_url, username, password, tag) end end end