class Io::Flow::V0::Models::PaymentPaymentMethod
Attributes
brands[R]
id[R]
images[R]
merchant_of_record[R]
name[R]
possible_actions[R]
type[R]
Public Class Methods
new(incoming={})
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 58227 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:id, :name, :type, :brands, :merchant_of_record, :images, :possible_actions], 'PaymentPaymentMethod') @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String) @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String) @type = (x = opts.delete(:type); x.is_a?(::Io::Flow::V0::Models::PaymentType) ? x : ::Io::Flow::V0::Models::PaymentType.apply(x)) @brands = HttpClient::Preconditions.assert_class('brands', opts.delete(:brands), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::PaymentMethodBrand) ? x : ::Io::Flow::V0::Models::PaymentMethodBrand.new(x)) } @merchant_of_record = (x = opts.delete(:merchant_of_record); x.is_a?(::Io::Flow::V0::Models::MerchantOfRecord) ? x : ::Io::Flow::V0::Models::MerchantOfRecord.apply(x)) @images = (x = opts.delete(:images); x.is_a?(::Io::Flow::V0::Models::PaymentMethodImages) ? x : ::Io::Flow::V0::Models::PaymentMethodImages.new(x)) @possible_actions = HttpClient::Preconditions.assert_class('possible_actions', opts.delete(:possible_actions), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::PaymentActionType) ? x : ::Io::Flow::V0::Models::PaymentActionType.apply(x)) } end
Public Instance Methods
copy(incoming={})
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 58243 def copy(incoming={}) PaymentPaymentMethod.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end
to_hash()
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 58247 def to_hash { :id => id, :name => name, :type => type.value, :brands => brands.map { |o| o.to_hash }, :merchant_of_record => merchant_of_record.value, :images => images.to_hash, :possible_actions => possible_actions.map { |o| o.value } } end
to_json()
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 58239 def to_json JSON.dump(to_hash) end