Class: Io::Flow::V0::Models::PricingUpserted
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#duty ⇒ Object
readonly
Returns the value of attribute duty.
-
#event_id ⇒ Object
readonly
Returns the value of attribute event_id.
-
#experience_key ⇒ Object
readonly
Returns the value of attribute experience_key.
-
#organization ⇒ Object
readonly
Returns the value of attribute organization.
-
#rounding_method ⇒ Object
readonly
Returns the value of attribute rounding_method.
-
#rounding_type ⇒ Object
readonly
Returns the value of attribute rounding_type.
-
#rounding_value ⇒ Object
readonly
Returns the value of attribute rounding_value.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
-
#vat ⇒ Object
readonly
Returns the value of attribute vat.
Attributes inherited from Event
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ PricingUpserted
constructor
A new instance of PricingUpserted.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from Event
Constructor Details
#initialize(incoming = {}) ⇒ PricingUpserted
Returns a new instance of PricingUpserted.
19943 19944 19945 19946 19947 19948 19949 19950 19951 19952 19953 19954 19955 19956 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19943 def initialize(incoming={}) super(:discriminator => Event::Types::PRICING_UPSERTED) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :experience_key, :vat, :duty], 'PricingUpserted') @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) @experience_key = HttpClient::Preconditions.assert_class('experience_key', opts.delete(:experience_key), String) @vat = HttpClient::Preconditions.assert_class('vat', opts.delete(:vat), String) @duty = HttpClient::Preconditions.assert_class('duty', opts.delete(:duty), String) @rounding_type = (x = opts.delete(:rounding_type); x.nil? ? nil : HttpClient::Preconditions.assert_class('rounding_type', x, String)) @rounding_method = (x = opts.delete(:rounding_method); x.nil? ? nil : HttpClient::Preconditions.assert_class('rounding_method', x, String)) @rounding_value = (x = opts.delete(:rounding_value); x.nil? ? nil : HttpClient::Preconditions.assert_class('rounding_value', HttpClient::Helper.to_big_decimal(x), BigDecimal)) end |
Instance Attribute Details
#duty ⇒ Object (readonly)
Returns the value of attribute duty.
19941 19942 19943 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19941 def duty @duty end |
#event_id ⇒ Object (readonly)
Returns the value of attribute event_id.
19941 19942 19943 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19941 def event_id @event_id end |
#experience_key ⇒ Object (readonly)
Returns the value of attribute experience_key.
19941 19942 19943 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19941 def experience_key @experience_key end |
#organization ⇒ Object (readonly)
Returns the value of attribute organization.
19941 19942 19943 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19941 def organization @organization end |
#rounding_method ⇒ Object (readonly)
Returns the value of attribute rounding_method.
19941 19942 19943 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19941 def rounding_method @rounding_method end |
#rounding_type ⇒ Object (readonly)
Returns the value of attribute rounding_type.
19941 19942 19943 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19941 def rounding_type @rounding_type end |
#rounding_value ⇒ Object (readonly)
Returns the value of attribute rounding_value.
19941 19942 19943 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19941 def rounding_value @rounding_value end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
19941 19942 19943 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19941 def end |
#vat ⇒ Object (readonly)
Returns the value of attribute vat.
19941 19942 19943 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19941 def vat @vat end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
19962 19963 19964 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19962 def copy(incoming={}) PricingUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
19966 19967 19968 19969 19970 19971 19972 19973 19974 19975 19976 19977 19978 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19966 def subtype_to_hash { :event_id => event_id, :timestamp => , :organization => organization, :experience_key => experience_key, :vat => vat, :duty => duty, :rounding_type => rounding_type, :rounding_method => rounding_method, :rounding_value => rounding_value } end |
#to_json ⇒ Object
19958 19959 19960 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19958 def to_json JSON.dump(to_hash) end |