Class: Io::Flow::V0::Models::CaptureUpserted
- 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.
-
#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.
Attributes inherited from Event
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ CaptureUpserted
constructor
A new instance of CaptureUpserted.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from Event
Constructor Details
#initialize(incoming = {}) ⇒ CaptureUpserted
Returns a new instance of CaptureUpserted.
13457 13458 13459 13460 13461 13462 13463 13464 13465 13466 13467 13468 13469 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13457 def initialize(incoming={}) super(:discriminator => Event::Types::CAPTURE_UPSERTED) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :key, :authorization_key, :amount, :currency, :created_at], 'CaptureUpserted') @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) @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.
13455 13456 13457 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13455 def amount @amount end |
#authorization_key ⇒ Object (readonly)
Returns the value of attribute authorization_key.
13455 13456 13457 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13455 def @authorization_key end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
13455 13456 13457 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13455 def created_at @created_at end |
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
13455 13456 13457 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13455 def currency @currency end |
#event_id ⇒ Object (readonly)
Returns the value of attribute event_id.
13455 13456 13457 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13455 def event_id @event_id end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
13455 13456 13457 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13455 def key @key end |
#organization ⇒ Object (readonly)
Returns the value of attribute organization.
13455 13456 13457 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13455 def organization @organization end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
13455 13456 13457 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13455 def @timestamp end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
13475 13476 13477 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13475 def copy(incoming={}) CaptureUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
13479 13480 13481 13482 13483 13484 13485 13486 13487 13488 13489 13490 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13479 def subtype_to_hash { :event_id => event_id, :timestamp => , :organization => organization, :key => key, :authorization_key => , :amount => amount, :currency => currency, :created_at => created_at } end |
#to_json ⇒ Object
13471 13472 13473 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13471 def to_json JSON.dump(to_hash) end |