Class: Io::Flow::V0::Models::RefundUpserted
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#authorization_key ⇒ Object
readonly
Returns the value of attribute authorization_key.
-
#captures ⇒ Object
readonly
Returns the value of attribute captures.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#currency ⇒ Object
readonly
Returns the value of attribute currency.
-
#event_id ⇒ Object
readonly
Returns the value of attribute event_id.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#order_number ⇒ Object
readonly
Returns the value of attribute order_number.
-
#organization ⇒ Object
readonly
Returns the value of attribute organization.
-
#rma_key ⇒ Object
readonly
Returns the value of attribute rma_key.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
Attributes inherited from Event
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ RefundUpserted
constructor
A new instance of RefundUpserted.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from Event
Constructor Details
#initialize(incoming = {}) ⇒ RefundUpserted
Returns a new instance of RefundUpserted.
19377 19378 19379 19380 19381 19382 19383 19384 19385 19386 19387 19388 19389 19390 19391 19392 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19377 def initialize(incoming={}) super(:discriminator => Event::Types::REFUND_UPSERTED) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :key, :authorization_key, :amount, :currency, :captures, :created_at], 'RefundUpserted') @event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String) = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime) @organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String) @key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String) = HttpClient::Preconditions.assert_class('authorization_key', opts.delete(:authorization_key), String) @amount = HttpClient::Preconditions.assert_class('amount', HttpClient::Helper.to_big_decimal(opts.delete(:amount)), BigDecimal) @currency = HttpClient::Preconditions.assert_class('currency', opts.delete(:currency), String) @captures = HttpClient::Preconditions.assert_class('captures', opts.delete(:captures), Array).map { |v| HttpClient::Preconditions.assert_class('captures', HttpClient::Helper.to_object(v), Hash) } @created_at = HttpClient::Preconditions.assert_class('created_at', HttpClient::Helper.to_date_time_iso8601(opts.delete(:created_at)), DateTime) @order_number = (x = opts.delete(:order_number); x.nil? ? nil : HttpClient::Preconditions.assert_class('order_number', x, String)) @rma_key = (x = opts.delete(:rma_key); x.nil? ? nil : HttpClient::Preconditions.assert_class('rma_key', x, String)) end |
Instance Attribute Details
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
19375 19376 19377 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19375 def amount @amount end |
#authorization_key ⇒ Object (readonly)
Returns the value of attribute authorization_key.
19375 19376 19377 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19375 def end |
#captures ⇒ Object (readonly)
Returns the value of attribute captures.
19375 19376 19377 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19375 def captures @captures end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
19375 19376 19377 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19375 def created_at @created_at end |
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
19375 19376 19377 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19375 def currency @currency end |
#event_id ⇒ Object (readonly)
Returns the value of attribute event_id.
19375 19376 19377 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19375 def event_id @event_id end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
19375 19376 19377 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19375 def key @key end |
#order_number ⇒ Object (readonly)
Returns the value of attribute order_number.
19375 19376 19377 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19375 def order_number @order_number end |
#organization ⇒ Object (readonly)
Returns the value of attribute organization.
19375 19376 19377 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19375 def organization @organization end |
#rma_key ⇒ Object (readonly)
Returns the value of attribute rma_key.
19375 19376 19377 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19375 def rma_key @rma_key end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
19375 19376 19377 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19375 def end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
19398 19399 19400 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19398 def copy(incoming={}) RefundUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
19402 19403 19404 19405 19406 19407 19408 19409 19410 19411 19412 19413 19414 19415 19416 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19402 def subtype_to_hash { :event_id => event_id, :timestamp => , :organization => organization, :key => key, :authorization_key => , :amount => amount, :currency => currency, :captures => captures, :created_at => created_at, :order_number => order_number, :rma_key => rma_key } end |
#to_json ⇒ Object
19394 19395 19396 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19394 def to_json JSON.dump(to_hash) end |