Class: Io::Flow::V0::Models::EcommercePlatformUpserted
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#ecommerce_platform ⇒ Object
readonly
Returns the value of attribute ecommerce_platform.
-
#event_id ⇒ Object
readonly
Returns the value of attribute event_id.
-
#organization ⇒ Object
readonly
Returns the value of attribute organization.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
Attributes inherited from Event
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ EcommercePlatformUpserted
constructor
A new instance of EcommercePlatformUpserted.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from Event
Constructor Details
#initialize(incoming = {}) ⇒ EcommercePlatformUpserted
Returns a new instance of EcommercePlatformUpserted.
35683 35684 35685 35686 35687 35688 35689 35690 35691 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35683 def initialize(incoming={}) super(:discriminator => Event::Types::ECOMMERCE_PLATFORM_UPSERTED) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :ecommerce_platform], 'EcommercePlatformUpserted') @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) @ecommerce_platform = (x = opts.delete(:ecommerce_platform); x.is_a?(::Io::Flow::V0::Models::EcommercePlatform) ? x : ::Io::Flow::V0::Models::EcommercePlatform.new(x)) end |
Instance Attribute Details
#ecommerce_platform ⇒ Object (readonly)
Returns the value of attribute ecommerce_platform.
35681 35682 35683 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35681 def ecommerce_platform @ecommerce_platform end |
#event_id ⇒ Object (readonly)
Returns the value of attribute event_id.
35681 35682 35683 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35681 def event_id @event_id end |
#organization ⇒ Object (readonly)
Returns the value of attribute organization.
35681 35682 35683 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35681 def organization @organization end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
35681 35682 35683 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35681 def @timestamp end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
35697 35698 35699 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35697 def copy(incoming={}) EcommercePlatformUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
35701 35702 35703 35704 35705 35706 35707 35708 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35701 def subtype_to_hash { :event_id => event_id, :timestamp => , :organization => organization, :ecommerce_platform => ecommerce_platform.to_hash } end |
#to_json ⇒ Object
35693 35694 35695 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35693 def to_json JSON.dump(to_hash) end |