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.
-
#organization ⇒ Object
readonly
Returns the value of attribute organization.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
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.
14639 14640 14641 14642 14643 14644 14645 14646 14647 14648 14649 14650 14651 14652 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14639 def initialize(incoming={}) super(:name => 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) @timestamp = 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) @authorization_key = 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) end |
Instance Attribute Details
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
14637 14638 14639 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14637 def amount @amount end |
#authorization_key ⇒ Object (readonly)
Returns the value of attribute authorization_key.
14637 14638 14639 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14637 def @authorization_key end |
#captures ⇒ Object (readonly)
Returns the value of attribute captures.
14637 14638 14639 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14637 def captures @captures end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
14637 14638 14639 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14637 def created_at @created_at end |
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
14637 14638 14639 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14637 def currency @currency end |
#event_id ⇒ Object (readonly)
Returns the value of attribute event_id.
14637 14638 14639 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14637 def event_id @event_id end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
14637 14638 14639 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14637 def key @key end |
#organization ⇒ Object (readonly)
Returns the value of attribute organization.
14637 14638 14639 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14637 def organization @organization end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
14637 14638 14639 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14637 def @timestamp end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
14658 14659 14660 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14658 def copy(incoming={}) RefundUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
14662 14663 14664 14665 14666 14667 14668 14669 14670 14671 14672 14673 14674 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14662 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 } end |
#to_json ⇒ Object
14654 14655 14656 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14654 def to_json JSON.dump(to_hash) end |