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.
12233 12234 12235 12236 12237 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12233 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.
12231 12232 12233 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12231 def discriminator @discriminator end |
Class Method Details
.from_json(hash) ⇒ Object
12247 12248 12249 12250 12251 12252 12253 12254 12255 12256 12257 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12247 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
12239 12240 12241 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12239 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
12243 12244 12245 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12243 def to_hash subtype_to_hash.merge(:discriminator => @discriminator) end |