Class: Io::Flow::V0::Models::ThreedsChallengeAction
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::ThreedsChallengeAction
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Different version sets of 3ds challenge actions.
Direct Known Subclasses
ThreedsChallengeActionUndefinedType, ThreedsTwoChallengeRequest
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 = {}) ⇒ ThreedsChallengeAction
constructor
A new instance of ThreedsChallengeAction.
- #subtype_to_hash ⇒ Object
- #to_hash ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ ThreedsChallengeAction
Returns a new instance of ThreedsChallengeAction.
15871 15872 15873 15874 15875 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15871 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:discriminator], 'ThreedsChallengeAction') @discriminator = HttpClient::Preconditions.assert_class('discriminator', opts.delete(:discriminator), String) end |
Instance Attribute Details
#discriminator ⇒ Object (readonly)
Returns the value of attribute discriminator.
15869 15870 15871 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15869 def discriminator @discriminator end |
Class Method Details
.from_json(hash) ⇒ Object
15885 15886 15887 15888 15889 15890 15891 15892 15893 15894 15895 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15885 def ThreedsChallengeAction.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_challenge_action] requires a field named 'discriminator'" end case discriminator when Types::THREEDS_TWO_CHALLENGE_REQUEST; ThreedsTwoChallengeRequest.new(hash) else ThreedsChallengeActionUndefinedType.new(:discriminator => discriminator) end end |
Instance Method Details
#subtype_to_hash ⇒ Object
15877 15878 15879 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15877 def subtype_to_hash raise 'Cannot serialize an instance of threeds_challenge_action directly - must use one of the specific types: threeds_two_challenge_request' end |
#to_hash ⇒ Object
15881 15882 15883 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15881 def to_hash subtype_to_hash.merge(:discriminator => @discriminator) end |