Class: Io::Flow::V0::Models::RateUpserted
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#base ⇒ Object
readonly
Returns the value of attribute base.
-
#effective_at ⇒ Object
readonly
Returns the value of attribute effective_at.
-
#event_id ⇒ Object
readonly
Returns the value of attribute event_id.
-
#organization_id ⇒ Object
readonly
Returns the value of attribute organization_id.
-
#rate_id ⇒ Object
readonly
Returns the value of attribute rate_id.
-
#target ⇒ Object
readonly
Returns the value of attribute target.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Attributes inherited from Event
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ RateUpserted
constructor
A new instance of RateUpserted.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from Event
Constructor Details
#initialize(incoming = {}) ⇒ RateUpserted
29490 29491 29492 29493 29494 29495 29496 29497 29498 29499 29500 29501 29502 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29490 def initialize(incoming={}) super(:discriminator => Event::Types::RATE_UPSERTED) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :rate_id, :organization_id, :base, :target, :effective_at, :value], 'RateUpserted') @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) @rate_id = HttpClient::Preconditions.assert_class('rate_id', opts.delete(:rate_id), String) @organization_id = HttpClient::Preconditions.assert_class('organization_id', opts.delete(:organization_id), String) @base = HttpClient::Preconditions.assert_class('base', opts.delete(:base), String) @target = HttpClient::Preconditions.assert_class('target', opts.delete(:target), String) @effective_at = HttpClient::Preconditions.assert_class('effective_at', HttpClient::Helper.to_date_time_iso8601(opts.delete(:effective_at)), DateTime) @value = HttpClient::Preconditions.assert_class('value', HttpClient::Helper.to_big_decimal(opts.delete(:value)), BigDecimal) end |
Instance Attribute Details
#base ⇒ Object (readonly)
Returns the value of attribute base.
29488 29489 29490 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29488 def base @base end |
#effective_at ⇒ Object (readonly)
Returns the value of attribute effective_at.
29488 29489 29490 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29488 def effective_at @effective_at end |
#event_id ⇒ Object (readonly)
Returns the value of attribute event_id.
29488 29489 29490 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29488 def event_id @event_id end |
#organization_id ⇒ Object (readonly)
Returns the value of attribute organization_id.
29488 29489 29490 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29488 def organization_id @organization_id end |
#rate_id ⇒ Object (readonly)
Returns the value of attribute rate_id.
29488 29489 29490 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29488 def rate_id @rate_id end |
#target ⇒ Object (readonly)
Returns the value of attribute target.
29488 29489 29490 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29488 def target @target end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
29488 29489 29490 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29488 def end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
29488 29489 29490 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29488 def value @value end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
29508 29509 29510 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29508 def copy(incoming={}) RateUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
29512 29513 29514 29515 29516 29517 29518 29519 29520 29521 29522 29523 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29512 def subtype_to_hash { :event_id => event_id, :timestamp => , :rate_id => rate_id, :organization_id => organization_id, :base => base, :target => target, :effective_at => effective_at, :value => value } end |
#to_json ⇒ Object
29504 29505 29506 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29504 def to_json JSON.dump(to_hash) end |