Class: Io::Flow::V0::Models::ThreedsIdentifyAction
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::ThreedsIdentifyAction
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Different version sets of 3ds identify actions.
Direct Known Subclasses
Defined Under Namespace
Modules: Types
Instance Attribute Summary collapse
-
#discriminator ⇒ Object
readonly
Returns the value of attribute discriminator.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(incoming = {}) ⇒ ThreedsIdentifyAction
constructor
A new instance of ThreedsIdentifyAction.
- #subtype_to_hash ⇒ Object
- #to_hash ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ ThreedsIdentifyAction
Returns a new instance of ThreedsIdentifyAction.
12139 12140 12141 12142 12143 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12139 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:discriminator], 'ThreedsIdentifyAction') @discriminator = HttpClient::Preconditions.assert_class('discriminator', opts.delete(:discriminator), String) end |
Instance Attribute Details
#discriminator ⇒ Object (readonly)
Returns the value of attribute discriminator.
12137 12138 12139 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12137 def discriminator @discriminator end |
Class Method Details
.from_json(hash) ⇒ Object
12153 12154 12155 12156 12157 12158 12159 12160 12161 12162 12163 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12153 def ThreedsIdentifyAction.from_json(hash) HttpClient::Preconditions.assert_class('hash', hash, Hash) discriminator = HttpClient::Helper.symbolize_keys(hash)[:discriminator].to_s.strip if discriminator.empty? raise "Union type[threeds_identify_action] requires a field named 'discriminator'" end case discriminator when Types::THREEDS_TWO_METHOD; ThreedsTwoMethod.new(hash) else ThreedsIdentifyActionUndefinedType.new(:discriminator => discriminator) end end |
Instance Method Details
#subtype_to_hash ⇒ Object
12145 12146 12147 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12145 def subtype_to_hash raise 'Cannot serialize an instance of threeds_identify_action directly - must use one of the specific types: threeds_two_method' end |
#to_hash ⇒ Object
12149 12150 12151 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12149 def to_hash subtype_to_hash.merge(:discriminator => @discriminator) end |