class Beaver::Payout
Payout
Model.
Attributes
TODO: Write general description for this method @return [Integer]
Owner structure to be used in any resource where an account is the owner @return [String]
TODO: Write general description for this method @return [Integer]
TODO: Write general description for this method @return [Integer]
TODO: Write general description for this method @return [CurrencyEnum]
TODO: Write general description for this method @return [Object]
TODO: Write general description for this method @return [PayoutFailureReason]
TODO: Write general description for this method @return [String]
Owner structure to be used in any resource where an account is the owner @return [OwnerIsAccount]
Owner structure to be used in any resource where an account is the owner @return [String]
Owner structure to be used in any resource where an account is the owner @return [PayoutMethodNonExpanded]
Owner structure to be used in any resource where an account is the owner @return [List of PayoutPendingReason]
Owner structure to be used in any resource where an account is the owner @return [String]
Owner structure to be used in any resource where an account is the owner @return [StatusEnum]
Owner structure to be used in any resource where an account is the owner @return [TransactionRecordNonExpanded]
Owner structure to be used in any resource where an account is the owner @return [TransactionRecordNonExpanded]
Public Class Methods
Creates an instance of the object from a hash.
# File lib/beaver/models/payout.rb, line 130 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. id = hash['id'] owner = OwnerIsAccount.from_hash(hash['owner']) if hash['owner'] path = hash['path'] resource = hash['resource'] amount = hash['amount'] complete_time = hash['complete_time'] create_time = hash['create_time'] currency = hash['currency'] custom_data = hash['custom_data'] failure_reason = PayoutFailureReason.from_hash(hash['failure_reason']) if hash['failure_reason'] if hash['payout_method'] payout_method = PayoutMethodNonExpanded.from_hash(hash['payout_method']) end # Parameter is an array, so we need to iterate through it pending_reasons = nil unless hash['pending_reasons'].nil? pending_reasons = [] hash['pending_reasons'].each do |structure| pending_reasons << (PayoutPendingReason.from_hash(structure) if structure) end end status = hash['status'] if hash['txnr_failure'] txnr_failure = TransactionRecordNonExpanded.from_hash(hash['txnr_failure']) end if hash['txnr_payout'] txnr_payout = TransactionRecordNonExpanded.from_hash(hash['txnr_payout']) end api_version = hash['api_version'] # Create object from extracted values. Payout.new(id, owner, path, resource, amount, complete_time, create_time, currency, custom_data, failure_reason, payout_method, pending_reasons, status, txnr_failure, txnr_payout, api_version) end
A mapping from model property names to API property names.
# File lib/beaver/models/payout.rb, line 74 def self.names @_hash = {} if @_hash.nil? @_hash['amount'] = 'amount' @_hash['complete_time'] = 'complete_time' @_hash['create_time'] = 'create_time' @_hash['currency'] = 'currency' @_hash['custom_data'] = 'custom_data' @_hash['failure_reason'] = 'failure_reason' @_hash['id'] = 'id' @_hash['owner'] = 'owner' @_hash['path'] = 'path' @_hash['payout_method'] = 'payout_method' @_hash['pending_reasons'] = 'pending_reasons' @_hash['resource'] = 'resource' @_hash['status'] = 'status' @_hash['txnr_failure'] = 'txnr_failure' @_hash['txnr_payout'] = 'txnr_payout' @_hash['api_version'] = 'api_version' @_hash end
# File lib/beaver/models/payout.rb, line 95 def initialize(id = nil, owner = nil, path = nil, resource = nil, amount = nil, complete_time = nil, create_time = nil, currency = nil, custom_data = nil, failure_reason = nil, payout_method = nil, pending_reasons = nil, status = nil, txnr_failure = nil, txnr_payout = nil, api_version = nil) @amount = amount @complete_time = complete_time @create_time = create_time @currency = currency @custom_data = custom_data @failure_reason = failure_reason @id = id @owner = owner @path = path @payout_method = payout_method @pending_reasons = pending_reasons @resource = resource @status = status @txnr_failure = txnr_failure @txnr_payout = txnr_payout @api_version = api_version end