Class: Io::Flow::V0::Models::EcommercePlatformUpserted

Inherits:
Event
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Attributes inherited from Event

#discriminator

Instance Method Summary collapse

Methods inherited from Event

from_json, #to_hash

Constructor Details

#initialize(incoming = {}) ⇒ EcommercePlatformUpserted

Returns a new instance of EcommercePlatformUpserted.



40687
40688
40689
40690
40691
40692
40693
40694
40695
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40687

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_platformObject (readonly)

Returns the value of attribute ecommerce_platform.



40685
40686
40687
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40685

def ecommerce_platform
  @ecommerce_platform
end

#event_idObject (readonly)

Returns the value of attribute event_id.



40685
40686
40687
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40685

def event_id
  @event_id
end

#organizationObject (readonly)

Returns the value of attribute organization.



40685
40686
40687
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40685

def organization
  @organization
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



40685
40686
40687
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40685

def timestamp
  @timestamp
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



40701
40702
40703
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40701

def copy(incoming={})
  EcommercePlatformUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#subtype_to_hashObject



40705
40706
40707
40708
40709
40710
40711
40712
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40705

def subtype_to_hash
  {
    :event_id => event_id,
    :timestamp => timestamp,
    :organization => organization,
    :ecommerce_platform => ecommerce_platform.to_hash
  }
end

#to_jsonObject



40697
40698
40699
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40697

def to_json
  JSON.dump(to_hash)
end