Class: Io::Flow::V0::Models::CatalogStatisticsUpserted
- 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.
-
#statistics ⇒ Object
readonly
Returns the value of attribute statistics.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
Attributes inherited from Event
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ CatalogStatisticsUpserted
constructor
A new instance of CatalogStatisticsUpserted.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from Event
Constructor Details
#initialize(incoming = {}) ⇒ CatalogStatisticsUpserted
Returns a new instance of CatalogStatisticsUpserted.
34405 34406 34407 34408 34409 34410 34411 34412 34413 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34405 def initialize(incoming={}) super(:discriminator => Event::Types::CATALOG_STATISTICS_UPSERTED) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :statistics], 'CatalogStatisticsUpserted') @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) @organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String) @statistics = (x = opts.delete(:statistics); x.is_a?(::Io::Flow::V0::Models::CatalogStatistics) ? x : ::Io::Flow::V0::Models::CatalogStatistics.new(x)) end |
Instance Attribute Details
#event_id ⇒ Object (readonly)
Returns the value of attribute event_id.
34403 34404 34405 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34403 def event_id @event_id end |
#organization ⇒ Object (readonly)
Returns the value of attribute organization.
34403 34404 34405 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34403 def organization @organization end |
#statistics ⇒ Object (readonly)
Returns the value of attribute statistics.
34403 34404 34405 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34403 def statistics @statistics end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
34403 34404 34405 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34403 def @timestamp end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
34419 34420 34421 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34419 def copy(incoming={}) CatalogStatisticsUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
34423 34424 34425 34426 34427 34428 34429 34430 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34423 def subtype_to_hash { :event_id => event_id, :timestamp => , :organization => organization, :statistics => statistics.to_hash } end |
#to_json ⇒ Object
34415 34416 34417 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34415 def to_json JSON.dump(to_hash) end |