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.
10213 10214 10215 10216 10217 10218 10219 10220 10221 10222 10223 10224 10225 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10213 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) = 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) @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.
10211 10212 10213 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10211 def amount @amount end |
#authorization_key ⇒ Object (readonly)
Returns the value of attribute authorization_key.
10211 10212 10213 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10211 def end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
10211 10212 10213 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10211 def created_at @created_at end |
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
10211 10212 10213 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10211 def currency @currency end |
#event_id ⇒ Object (readonly)
Returns the value of attribute event_id.
10211 10212 10213 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10211 def event_id @event_id end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
10211 10212 10213 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10211 def key @key end |
#organization ⇒ Object (readonly)
Returns the value of attribute organization.
10211 10212 10213 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10211 def organization @organization end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
10211 10212 10213 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10211 def end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
10231 10232 10233 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10231 def copy(incoming={}) CaptureUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
10235 10236 10237 10238 10239 10240 10241 10242 10243 10244 10245 10246 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10235 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
10227 10228 10229 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10227 def to_json JSON.dump(to_hash) end |