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.
13492 13493 13494 13495 13496 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13492 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.
13490 13491 13492 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13490 def type @type end |
Class Method Details
.from_json(hash) ⇒ Object
13506 13507 13508 13509 13510 13511 13512 13513 13514 13515 13516 13517 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13506 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
13498 13499 13500 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13498 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
13502 13503 13504 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13502 def to_hash subtype_to_hash.merge(:type => @type) end |