class Io::Flow::V0::Models::MerchantOfRecordEntity
The merchant of record entity provides the legal name and address of the specific Flow
entity serving as merchant of record.
Attributes
city[R]
country[R]
email[R]
identifiers[R]
name[R]
organization[R]
phone[R]
postal[R]
province[R]
streets[R]
vat[R]
Public Class Methods
new(incoming={})
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 50258 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:organization, :name, :streets, :city, :country], 'MerchantOfRecordEntity') @organization = (x = opts.delete(:organization); x.is_a?(::Io::Flow::V0::Models::OrganizationReference) ? x : ::Io::Flow::V0::Models::OrganizationReference.new(x)) @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String) @vat = (x = opts.delete(:vat); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::MerchantOfRecordEntityRegistration) ? x : ::Io::Flow::V0::Models::MerchantOfRecordEntityRegistration.new(x))) @identifiers = (x = opts.delete(:identifiers); x.nil? ? nil : HttpClient::Preconditions.assert_class('identifiers', x, Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::EntityIdentifier) ? x : ::Io::Flow::V0::Models::EntityIdentifier.new(x)) }) @streets = HttpClient::Preconditions.assert_class('streets', opts.delete(:streets), Array).map { |v| HttpClient::Preconditions.assert_class('streets', v, String) } @city = HttpClient::Preconditions.assert_class('city', opts.delete(:city), String) @province = (x = opts.delete(:province); x.nil? ? nil : HttpClient::Preconditions.assert_class('province', x, String)) @postal = (x = opts.delete(:postal); x.nil? ? nil : HttpClient::Preconditions.assert_class('postal', x, String)) @country = HttpClient::Preconditions.assert_class('country', opts.delete(:country), String) @phone = (x = opts.delete(:phone); x.nil? ? nil : HttpClient::Preconditions.assert_class('phone', x, String)) @email = (x = opts.delete(:email); x.nil? ? nil : HttpClient::Preconditions.assert_class('email', x, String)) end
Public Instance Methods
copy(incoming={})
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 50278 def copy(incoming={}) MerchantOfRecordEntity.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 50282 def to_hash { :organization => organization.to_hash, :name => name, :vat => vat.nil? ? nil : vat.to_hash, :identifiers => identifiers.nil? ? nil : identifiers.map { |o| o.to_hash }, :streets => streets, :city => city, :province => province, :postal => postal, :country => country, :phone => phone, :email => email } end
to_json()
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 50274 def to_json JSON.dump(to_hash) end