# bandwidth # # This file was automatically generated by APIMATIC v2.0 # ( https://apimatic.io ). module Bandwidth # ModifyCallRequest Model. class ModifyCallRequest < BaseModel # TODO: Write general description for this method # @return [StateEnum] attr_accessor :state # Required if state is 'active' # @return [String] attr_accessor :redirect_url # Required if state is 'active' # @return [String] attr_accessor :redirect_fallback_url # Required if state is 'active' # @return [RedirectMethodEnum] attr_accessor :redirect_method # Required if state is 'active' # @return [RedirectFallbackMethodEnum] attr_accessor :redirect_fallback_method # Required if state is 'active' # @return [String] attr_accessor :username # Required if state is 'active' # @return [String] attr_accessor :password # Required if state is 'active' # @return [String] attr_accessor :fallback_username # Required if state is 'active' # @return [String] attr_accessor :fallback_password # Required if state is 'active' # @return [String] attr_accessor :tag # A mapping from model property names to API property names. def self.names @_hash = {} if @_hash.nil? @_hash['state'] = 'state' @_hash['redirect_url'] = 'redirectUrl' @_hash['redirect_fallback_url'] = 'redirectFallbackUrl' @_hash['redirect_method'] = 'redirectMethod' @_hash['redirect_fallback_method'] = 'redirectFallbackMethod' @_hash['username'] = 'username' @_hash['password'] = 'password' @_hash['fallback_username'] = 'fallbackUsername' @_hash['fallback_password'] = 'fallbackPassword' @_hash['tag'] = 'tag' @_hash end def initialize(state = StateEnum::ACTIVE, redirect_url = nil, redirect_fallback_url = nil, redirect_method = nil, redirect_fallback_method = nil, username = nil, password = nil, fallback_username = nil, fallback_password = nil, tag = nil) @state = state @redirect_url = redirect_url @redirect_fallback_url = redirect_fallback_url @redirect_method = redirect_method @redirect_fallback_method = redirect_fallback_method @username = username @password = password @fallback_username = fallback_username @fallback_password = fallback_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. state = hash['state'] ||= StateEnum::ACTIVE redirect_url = hash['redirectUrl'] redirect_fallback_url = hash['redirectFallbackUrl'] redirect_method = hash['redirectMethod'] redirect_fallback_method = hash['redirectFallbackMethod'] username = hash['username'] password = hash['password'] fallback_username = hash['fallbackUsername'] fallback_password = hash['fallbackPassword'] tag = hash['tag'] # Create object from extracted values. ModifyCallRequest.new(state, redirect_url, redirect_fallback_url, redirect_method, redirect_fallback_method, username, password, fallback_username, fallback_password, tag) end end end