class Io::Flow::V0::Models::DeviceFingerprintDetails

Attributes

type[R]

Public Class Methods

from_json(hash) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 10690
def DeviceFingerprintDetails.from_json(hash)
  HttpClient::Preconditions.assert_class('hash', hash, Hash)
  discriminator = HttpClient::Helper.symbolize_keys(hash)[:type].to_s.strip
  if discriminator.empty?
    raise "Union type[device_fingerprint_details] requires a field named 'type'"
  end
  case discriminator
    when Types::DEVICE_FINGERPRINT_DETAILS_BROWSER; DeviceFingerprintDetailsBrowser.new(hash)
    else DeviceFingerprintDetailsUndefinedType.new(:type => discriminator)
  end
end
new(incoming={}) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 10676
def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:type], 'DeviceFingerprintDetails')
  @type = HttpClient::Preconditions.assert_class('type', opts.delete(:type), String)
end

Public Instance Methods

subtype_to_hash() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 10682
def subtype_to_hash
  raise 'Cannot serialize an instance of device_fingerprint_details directly - must use one of the specific types: device_fingerprint_details_browser'
end
to_hash() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 10686
def to_hash
  subtype_to_hash.merge(:type => @type)
end