class Io::Flow::V0::Models::AuthorizationResultActionDetails

Attributes

discriminator[R]

Public Class Methods

from_json(hash) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 9871
def AuthorizationResultActionDetails.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[authorization_result_action_details] requires a field named 'discriminator'"
  end
  case discriminator
    when Types::ADYEN_NATIVE_ACTION_DETAILS; AdyenNativeActionDetails.new(hash)
    when Types::STRIPE_AUTHORIZATION_RESULT_ACTION_DETAILS; StripeAuthorizationResultActionDetails.new(hash)
    when Types::THREEDS_IDENTIFY_ACTION_DETAILS; ThreedsIdentifyActionDetails.new(hash)
    when Types::THREEDS_CHALLENGE_ACTION_DETAILS; ThreedsChallengeActionDetails.new(hash)
    when Types::APPLEPAY_SDK_CREATE_RESULT_ACTION_DETAILS; ApplepaySdkCreateResultActionDetails.new(hash)
    when Types::APPLEPAY_SDK_VALIDATE_RESULT_ACTION_DETAILS; ApplepaySdkValidateResultActionDetails.new(hash)
    when Types::KLARNA_SDK_AUTHORIZATION_RESULT_ACTION_DETAILS; KlarnaSdkAuthorizationResultActionDetails.new(hash)
    when Types::SELECT_ISSUER_OPTION_ACTION_DETAILS; SelectIssuerOptionActionDetails.new(hash)
    else AuthorizationResultActionDetailsUndefinedType.new(:discriminator => discriminator)
  end
end
new(incoming={}) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 9857
def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:discriminator], 'AuthorizationResultActionDetails')
  @discriminator = HttpClient::Preconditions.assert_class('discriminator', opts.delete(:discriminator), String)
end

Public Instance Methods

subtype_to_hash() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 9863
def subtype_to_hash
  raise 'Cannot serialize an instance of authorization_result_action_details directly - must use one of the specific types: adyen_native_action_details, stripe_authorization_result_action_details, threeds_identify_action_details, threeds_challenge_action_details, applepay_sdk_create_result_action_details, applepay_sdk_validate_result_action_details, klarna_sdk_authorization_result_action_details, select_issuer_option_action_details'
end
to_hash() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 9867
def to_hash
  subtype_to_hash.merge(:discriminator => @discriminator)
end