Class: Io::Flow::V0::Models::SdkAdyenV3AuthenticationToken
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::SdkAdyenV3AuthenticationToken
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Direct Known Subclasses
AdyenV3ChallengeToken, AdyenV3FingerprintToken, SdkAdyenV3AuthenticationTokenUndefinedType
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 = {}) ⇒ SdkAdyenV3AuthenticationToken
constructor
A new instance of SdkAdyenV3AuthenticationToken.
- #subtype_to_hash ⇒ Object
- #to_hash ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ SdkAdyenV3AuthenticationToken
Returns a new instance of SdkAdyenV3AuthenticationToken.
15119 15120 15121 15122 15123 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15119 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:type], 'SdkAdyenV3AuthenticationToken') @type = HttpClient::Preconditions.assert_class('type', opts.delete(:type), String) end |
Instance Attribute Details
#type ⇒ Object (readonly)
Returns the value of attribute type.
15117 15118 15119 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15117 def type @type end |
Class Method Details
.from_json(hash) ⇒ Object
15133 15134 15135 15136 15137 15138 15139 15140 15141 15142 15143 15144 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15133 def SdkAdyenV3AuthenticationToken.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[sdk_adyen_v3_authentication_token] requires a field named 'type'" end case discriminator when Types::ADYEN_V3_FINGERPRINT_TOKEN; AdyenV3FingerprintToken.new(hash) when Types::ADYEN_V3_CHALLENGE_TOKEN; AdyenV3ChallengeToken.new(hash) else SdkAdyenV3AuthenticationTokenUndefinedType.new(:type => discriminator) end end |
Instance Method Details
#subtype_to_hash ⇒ Object
15125 15126 15127 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15125 def subtype_to_hash raise 'Cannot serialize an instance of sdk_adyen_v3_authentication_token directly - must use one of the specific types: adyen_v3_fingerprint_token, adyen_v3_challenge_token' end |
#to_hash ⇒ Object
15129 15130 15131 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15129 def to_hash subtype_to_hash.merge(:type => @type) end |