Class: Io::Flow::V0::Models::PriceBookUpserted
- 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.
-
#organization ⇒ Object
readonly
Returns the value of attribute organization.
-
#price_book ⇒ Object
readonly
Returns the value of attribute price_book.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
Attributes inherited from Event
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ PriceBookUpserted
constructor
A new instance of PriceBookUpserted.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from Event
Constructor Details
#initialize(incoming = {}) ⇒ PriceBookUpserted
Returns a new instance of PriceBookUpserted.
53140 53141 53142 53143 53144 53145 53146 53147 53148 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53140 def initialize(incoming={}) super(:discriminator => Event::Types::PRICE_BOOK_UPSERTED) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :price_book], 'PriceBookUpserted') @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) @price_book = (x = opts.delete(:price_book); x.is_a?(::Io::Flow::V0::Models::PriceBook) ? x : ::Io::Flow::V0::Models::PriceBook.new(x)) end |
Instance Attribute Details
#event_id ⇒ Object (readonly)
Returns the value of attribute event_id.
53138 53139 53140 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53138 def event_id @event_id end |
#organization ⇒ Object (readonly)
Returns the value of attribute organization.
53138 53139 53140 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53138 def organization @organization end |
#price_book ⇒ Object (readonly)
Returns the value of attribute price_book.
53138 53139 53140 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53138 def price_book @price_book end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
53138 53139 53140 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53138 def end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
53154 53155 53156 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53154 def copy(incoming={}) PriceBookUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
53158 53159 53160 53161 53162 53163 53164 53165 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53158 def subtype_to_hash { :event_id => event_id, :timestamp => , :organization => organization, :price_book => price_book.to_hash } end |
#to_json ⇒ Object
53150 53151 53152 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53150 def to_json JSON.dump(to_hash) end |