Class: Io::Flow::V0::Models::SdkAdyenV3AuthenticationToken

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Defined Under Namespace

Modules: Types

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#typeObject (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_hashObject



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_hashObject



13502
13503
13504
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13502

def to_hash
  subtype_to_hash.merge(:type => @type)
end