Class: Io::Flow::V0::Models::DeviceFingerprintDetails
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::DeviceFingerprintDetails
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Direct Known Subclasses
DeviceFingerprintDetailsBrowser, DeviceFingerprintDetailsUndefinedType
Defined Under Namespace
Modules: Types
Instance Attribute Summary collapse
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(incoming = {}) ⇒ DeviceFingerprintDetails
constructor
A new instance of DeviceFingerprintDetails.
- #subtype_to_hash ⇒ Object
- #to_hash ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ DeviceFingerprintDetails
Returns a new instance of DeviceFingerprintDetails.
10676 10677 10678 10679 10680 |
# 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 |
Instance Attribute Details
#type ⇒ Object (readonly)
Returns the value of attribute type.
10674 10675 10676 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10674 def type @type end |
Class Method Details
.from_json(hash) ⇒ Object
10690 10691 10692 10693 10694 10695 10696 10697 10698 10699 10700 |
# 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 |
Instance Method Details
#subtype_to_hash ⇒ Object
10682 10683 10684 |
# 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 ⇒ Object
10686 10687 10688 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10686 def to_hash subtype_to_hash.merge(:type => @type) end |