class Beaver::TokensRequest

TokensRequest Model.

Attributes

payment_methods[RW]

TODO: Write general description for this method @return [PaymentMethodReq]

payout_methods[RW]

TODO: Write general description for this method @return [PayoutMethodReq]

resource[RW]

TODO: Write general description for this method @return [Resource2Enum]

Public Class Methods

from_hash(hash) click to toggle source

Creates an instance of the object from a hash.

# File lib/beaver/models/tokens_request.rb, line 46
def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  resource = hash['resource']
  legal_entities = LegalEntity.from_hash(hash['legal_entities']) if
    hash['legal_entities']
  payment_methods = PaymentMethodReq.from_hash(hash['payment_methods']) if
    hash['payment_methods']
  payout_methods = PayoutMethodReq.from_hash(hash['payout_methods']) if
    hash['payout_methods']

  # Create object from extracted values.
  TokensRequest.new(resource,
                    legal_entities,
                    payment_methods,
                    payout_methods)
end
names() click to toggle source

A mapping from model property names to API property names.

# File lib/beaver/models/tokens_request.rb, line 26
def self.names
  @_hash = {} if @_hash.nil?
  @_hash['legal_entities'] = 'legal_entities'
  @_hash['payment_methods'] = 'payment_methods'
  @_hash['payout_methods'] = 'payout_methods'
  @_hash['resource'] = 'resource'
  @_hash
end
new(resource = nil, legal_entities = nil, payment_methods = nil, payout_methods = nil) click to toggle source
# File lib/beaver/models/tokens_request.rb, line 35
def initialize(resource = nil,
               legal_entities = nil,
               payment_methods = nil,
               payout_methods = nil)
  @legal_entities = legal_entities
  @payment_methods = payment_methods
  @payout_methods = payout_methods
  @resource = resource
end