Class: Io::Flow::V0::Models::ItemMarginUpserted
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#event_id ⇒ Object
readonly
Returns the value of attribute event_id.
-
#experience_key ⇒ Object
readonly
Returns the value of attribute experience_key.
-
#fixed ⇒ Object
readonly
Returns the value of attribute fixed.
-
#item_margin_id ⇒ Object
readonly
Returns the value of attribute item_margin_id.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#organization_id ⇒ Object
readonly
Returns the value of attribute organization_id.
-
#percent ⇒ Object
readonly
Returns the value of attribute percent.
-
#position ⇒ Object
readonly
Returns the value of attribute position.
-
#q ⇒ Object
readonly
Returns the value of attribute q.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
Attributes inherited from Event
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ ItemMarginUpserted
constructor
A new instance of ItemMarginUpserted.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from Event
Constructor Details
#initialize(incoming = {}) ⇒ ItemMarginUpserted
Returns a new instance of ItemMarginUpserted.
37094 37095 37096 37097 37098 37099 37100 37101 37102 37103 37104 37105 37106 37107 37108 37109 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37094 def initialize(incoming={}) super(:discriminator => Event::Types::ITEM_MARGIN_UPSERTED) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :item_margin_id, :organization_id, :experience_key, :name, :q, :fixed, :percent, :position], 'ItemMarginUpserted') @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) @item_margin_id = HttpClient::Preconditions.assert_class('item_margin_id', opts.delete(:item_margin_id), String) @organization_id = HttpClient::Preconditions.assert_class('organization_id', opts.delete(:organization_id), String) @experience_key = HttpClient::Preconditions.assert_class('experience_key', opts.delete(:experience_key), String) @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String) @q = HttpClient::Preconditions.assert_class('q', opts.delete(:q), String) @fixed = HttpClient::Preconditions.assert_class('fixed', HttpClient::Helper.to_big_decimal(opts.delete(:fixed)), BigDecimal) @percent = HttpClient::Preconditions.assert_class('percent', HttpClient::Helper.to_big_decimal(opts.delete(:percent)), BigDecimal) @position = HttpClient::Preconditions.assert_class('position', opts.delete(:position), Integer) @key = (x = opts.delete(:key); x.nil? ? nil : HttpClient::Preconditions.assert_class('key', x, String)) end |
Instance Attribute Details
#event_id ⇒ Object (readonly)
Returns the value of attribute event_id.
37092 37093 37094 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37092 def event_id @event_id end |
#experience_key ⇒ Object (readonly)
Returns the value of attribute experience_key.
37092 37093 37094 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37092 def experience_key @experience_key end |
#fixed ⇒ Object (readonly)
Returns the value of attribute fixed.
37092 37093 37094 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37092 def fixed @fixed end |
#item_margin_id ⇒ Object (readonly)
Returns the value of attribute item_margin_id.
37092 37093 37094 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37092 def item_margin_id @item_margin_id end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
37092 37093 37094 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37092 def key @key end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
37092 37093 37094 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37092 def name @name end |
#organization_id ⇒ Object (readonly)
Returns the value of attribute organization_id.
37092 37093 37094 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37092 def organization_id @organization_id end |
#percent ⇒ Object (readonly)
Returns the value of attribute percent.
37092 37093 37094 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37092 def percent @percent end |
#position ⇒ Object (readonly)
Returns the value of attribute position.
37092 37093 37094 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37092 def position @position end |
#q ⇒ Object (readonly)
Returns the value of attribute q.
37092 37093 37094 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37092 def q @q end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
37092 37093 37094 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37092 def @timestamp end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
37115 37116 37117 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37115 def copy(incoming={}) ItemMarginUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
37119 37120 37121 37122 37123 37124 37125 37126 37127 37128 37129 37130 37131 37132 37133 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37119 def subtype_to_hash { :event_id => event_id, :timestamp => , :item_margin_id => item_margin_id, :organization_id => organization_id, :experience_key => experience_key, :name => name, :q => q, :fixed => fixed.to_f.to_s, :percent => percent.to_f.to_s, :position => position, :key => key } end |
#to_json ⇒ Object
37111 37112 37113 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37111 def to_json JSON.dump(to_hash) end |