Class: Io::Flow::V0::Models::OrganizationPayout
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::OrganizationPayout
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#account ⇒ Object
readonly
Returns the value of attribute account.
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#attachments ⇒ Object
readonly
Returns the value of attribute attachments.
-
#bank_account ⇒ Object
readonly
Returns the value of attribute bank_account.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#updated_at ⇒ Object
readonly
Returns the value of attribute updated_at.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ OrganizationPayout
constructor
A new instance of OrganizationPayout.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ OrganizationPayout
Returns a new instance of OrganizationPayout.
55146 55147 55148 55149 55150 55151 55152 55153 55154 55155 55156 55157 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55146 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:id, :account, :status, :amount, :attachments, :created_at, :updated_at], 'OrganizationPayout') @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String) @account = (x = opts.delete(:account); x.is_a?(::Io::Flow::V0::Models::AccountReference) ? x : ::Io::Flow::V0::Models::AccountReference.new(x)) @status = (x = opts.delete(:status); x.is_a?(::Io::Flow::V0::Models::PayoutStatus) ? x : ::Io::Flow::V0::Models::PayoutStatus.from_json(x)) @bank_account = (x = opts.delete(:bank_account); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::BankAccountSummary) ? x : ::Io::Flow::V0::Models::BankAccountSummary.new(x))) @amount = HttpClient::Preconditions.assert_class('amount', HttpClient::Helper.to_big_decimal(opts.delete(:amount)), BigDecimal) @attachments = HttpClient::Preconditions.assert_class('attachments', opts.delete(:attachments), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::PayoutAttachment) ? x : ::Io::Flow::V0::Models::PayoutAttachment.new(x)) } @created_at = HttpClient::Preconditions.assert_class('created_at', HttpClient::Helper.to_date_time_iso8601(opts.delete(:created_at)), DateTime) @updated_at = HttpClient::Preconditions.assert_class('updated_at', HttpClient::Helper.to_date_time_iso8601(opts.delete(:updated_at)), DateTime) end |
Instance Attribute Details
#account ⇒ Object (readonly)
Returns the value of attribute account.
55144 55145 55146 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55144 def account @account end |
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
55144 55145 55146 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55144 def amount @amount end |
#attachments ⇒ Object (readonly)
Returns the value of attribute attachments.
55144 55145 55146 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55144 def @attachments end |
#bank_account ⇒ Object (readonly)
Returns the value of attribute bank_account.
55144 55145 55146 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55144 def bank_account @bank_account end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
55144 55145 55146 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55144 def created_at @created_at end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
55144 55145 55146 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55144 def id @id end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
55144 55145 55146 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55144 def status @status end |
#updated_at ⇒ Object (readonly)
Returns the value of attribute updated_at.
55144 55145 55146 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55144 def updated_at @updated_at end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
55163 55164 55165 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55163 def copy(incoming={}) OrganizationPayout.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
55167 55168 55169 55170 55171 55172 55173 55174 55175 55176 55177 55178 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55167 def to_hash { :id => id, :account => account.to_hash, :status => status.to_hash, :bank_account => bank_account.nil? ? nil : bank_account.to_hash, :amount => amount.to_f.to_s, :attachments => .map { |o| o.to_hash }, :created_at => created_at, :updated_at => updated_at } end |
#to_json ⇒ Object
55159 55160 55161 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55159 def to_json JSON.dump(to_hash) end |