Class: Io::Flow::V0::Models::DeviceDetailsBrowser

Inherits:
DeviceDetails
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Attributes inherited from DeviceDetails

#type

Instance Method Summary collapse

Methods inherited from DeviceDetails

from_json, #to_hash

Constructor Details

#initialize(incoming = {}) ⇒ DeviceDetailsBrowser

Returns a new instance of DeviceDetailsBrowser.



39627
39628
39629
39630
39631
39632
39633
39634
39635
39636
39637
39638
39639
39640
39641
39642
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39627

def initialize(incoming={})
  super(:type => DeviceDetails::Types::DEVICE_DETAILS_BROWSER)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:user_agent, :origin], 'DeviceDetailsBrowser')
  @user_agent = HttpClient::Preconditions.assert_class('user_agent', opts.delete(:user_agent), String)
  @origin = HttpClient::Preconditions.assert_class('origin', opts.delete(:origin), String)
  @accept_language = (x = opts.delete(:accept_language); x.nil? ? nil : HttpClient::Preconditions.assert_class('accept_language', x, String))
  @ip = (x = opts.delete(:ip); x.nil? ? nil : HttpClient::Preconditions.assert_class('ip', x, String))
  @time_zone_offset = (x = opts.delete(:time_zone_offset); x.nil? ? nil : HttpClient::Preconditions.assert_class('time_zone_offset', x, Integer))
  @date_string = (x = opts.delete(:date_string); x.nil? ? nil : HttpClient::Preconditions.assert_class('date_string', x, String))
  @navigator_language = (x = opts.delete(:navigator_language); x.nil? ? nil : HttpClient::Preconditions.assert_class('navigator_language', x, String))
  @navigator_hardware_concurrency = (x = opts.delete(:navigator_hardware_concurrency); x.nil? ? nil : HttpClient::Preconditions.assert_class('navigator_hardware_concurrency', x, Integer))
  @cookie_created_at = (x = opts.delete(:cookie_created_at); x.nil? ? nil : HttpClient::Preconditions.assert_class('cookie_created_at', x, Integer))
  @session_duration = (x = opts.delete(:session_duration); x.nil? ? nil : HttpClient::Preconditions.assert_class('session_duration', x, Integer))
  @fingerprint = (x = opts.delete(:fingerprint); x.nil? ? nil : HttpClient::Preconditions.assert_class('fingerprint', x, String))
end

Instance Attribute Details

#accept_languageObject (readonly)

Returns the value of attribute accept_language.



39625
39626
39627
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39625

def accept_language
  @accept_language
end

Returns the value of attribute cookie_created_at.



39625
39626
39627
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39625

def cookie_created_at
  @cookie_created_at
end

#date_stringObject (readonly)

Returns the value of attribute date_string.



39625
39626
39627
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39625

def date_string
  @date_string
end

#fingerprintObject (readonly)

Returns the value of attribute fingerprint.



39625
39626
39627
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39625

def fingerprint
  @fingerprint
end

#ipObject (readonly)

Returns the value of attribute ip.



39625
39626
39627
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39625

def ip
  @ip
end

Returns the value of attribute navigator_hardware_concurrency.



39625
39626
39627
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39625

def navigator_hardware_concurrency
  @navigator_hardware_concurrency
end

Returns the value of attribute navigator_language.



39625
39626
39627
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39625

def navigator_language
  @navigator_language
end

#originObject (readonly)

Returns the value of attribute origin.



39625
39626
39627
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39625

def origin
  @origin
end

#session_durationObject (readonly)

Returns the value of attribute session_duration.



39625
39626
39627
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39625

def session_duration
  @session_duration
end

#time_zone_offsetObject (readonly)

Returns the value of attribute time_zone_offset.



39625
39626
39627
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39625

def time_zone_offset
  @time_zone_offset
end

#user_agentObject (readonly)

Returns the value of attribute user_agent.



39625
39626
39627
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39625

def user_agent
  @user_agent
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



39648
39649
39650
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39648

def copy(incoming={})
  DeviceDetailsBrowser.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#subtype_to_hashObject



39652
39653
39654
39655
39656
39657
39658
39659
39660
39661
39662
39663
39664
39665
39666
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39652

def subtype_to_hash
  {
    :user_agent => user_agent,
    :origin => origin,
    :accept_language => accept_language,
    :ip => ip,
    :time_zone_offset => time_zone_offset,
    :date_string => date_string,
    :navigator_language => navigator_language,
    :navigator_hardware_concurrency => navigator_hardware_concurrency,
    :cookie_created_at => cookie_created_at,
    :session_duration => session_duration,
    :fingerprint => fingerprint
  }
end

#to_jsonObject



39644
39645
39646
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39644

def to_json
  JSON.dump(to_hash)
end