class Io::Flow::V0::Models::PayoutStatus
Attributes
code[R]
Public Class Methods
from_json(hash)
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 14422 def PayoutStatus.from_json(hash) HttpClient::Preconditions.assert_class('hash', hash, Hash) discriminator = HttpClient::Helper.symbolize_keys(hash)[:code].to_s.strip if discriminator.empty? raise "Union type[payout_status] requires a field named 'code'" end case discriminator when Types::PAYOUT_STATUS_SCHEDULED; PayoutStatusScheduled.new(hash) when Types::PAYOUT_STATUS_SENT; PayoutStatusSent.new(hash) when Types::PAYOUT_STATUS_FAILED; PayoutStatusFailed.new(hash) else PayoutStatusUndefinedType.new(:code => discriminator) end end
new(incoming={})
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 14408 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:code], 'PayoutStatus') @code = HttpClient::Preconditions.assert_class('code', opts.delete(:code), String) end
Public Instance Methods
subtype_to_hash()
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 14414 def subtype_to_hash raise 'Cannot serialize an instance of payout_status directly - must use one of the specific types: payout_status_scheduled, payout_status_sent, payout_status_failed' end
to_hash()
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 14418 def to_hash subtype_to_hash.merge(:code => @code) end