Class: Io::Flow::V0::Models::ItemSalesMarginUpserted
- 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_sales_margin_id ⇒ Object
readonly
Returns the value of attribute item_sales_margin_id.
-
#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 = {}) ⇒ ItemSalesMarginUpserted
constructor
A new instance of ItemSalesMarginUpserted.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from Event
Constructor Details
#initialize(incoming = {}) ⇒ ItemSalesMarginUpserted
Returns a new instance of ItemSalesMarginUpserted.
19583 19584 19585 19586 19587 19588 19589 19590 19591 19592 19593 19594 19595 19596 19597 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19583 def initialize(incoming={}) super(:discriminator => Event::Types::ITEM_SALES_MARGIN_UPSERTED) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :item_sales_margin_id, :organization_id, :experience_key, :name, :q, :fixed, :percent, :position], 'ItemSalesMarginUpserted') @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_sales_margin_id = HttpClient::Preconditions.assert_class('item_sales_margin_id', opts.delete(:item_sales_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) end |
Instance Attribute Details
#event_id ⇒ Object (readonly)
Returns the value of attribute event_id.
19581 19582 19583 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19581 def event_id @event_id end |
#experience_key ⇒ Object (readonly)
Returns the value of attribute experience_key.
19581 19582 19583 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19581 def experience_key @experience_key end |
#fixed ⇒ Object (readonly)
Returns the value of attribute fixed.
19581 19582 19583 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19581 def fixed @fixed end |
#item_sales_margin_id ⇒ Object (readonly)
Returns the value of attribute item_sales_margin_id.
19581 19582 19583 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19581 def item_sales_margin_id @item_sales_margin_id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
19581 19582 19583 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19581 def name @name end |
#organization_id ⇒ Object (readonly)
Returns the value of attribute organization_id.
19581 19582 19583 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19581 def organization_id @organization_id end |
#percent ⇒ Object (readonly)
Returns the value of attribute percent.
19581 19582 19583 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19581 def percent @percent end |
#position ⇒ Object (readonly)
Returns the value of attribute position.
19581 19582 19583 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19581 def position @position end |
#q ⇒ Object (readonly)
Returns the value of attribute q.
19581 19582 19583 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19581 def q @q end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
19581 19582 19583 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19581 def @timestamp end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
19603 19604 19605 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19603 def copy(incoming={}) ItemSalesMarginUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
19607 19608 19609 19610 19611 19612 19613 19614 19615 19616 19617 19618 19619 19620 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19607 def subtype_to_hash { :event_id => event_id, :timestamp => , :item_sales_margin_id => item_sales_margin_id, :organization_id => organization_id, :experience_key => experience_key, :name => name, :q => q, :fixed => fixed, :percent => percent, :position => position } end |
#to_json ⇒ Object
19599 19600 19601 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19599 def to_json JSON.dump(to_hash) end |