Class: Io::Flow::V0::Models::EcommercePlatformDeleted

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 = {}) ⇒ EcommercePlatformDeleted

Returns a new instance of EcommercePlatformDeleted.



29594
29595
29596
29597
29598
29599
29600
29601
29602
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29594

def initialize(incoming={})
  super(:discriminator => Event::Types::ECOMMERCE_PLATFORM_DELETED)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :ecommerce_platform], 'EcommercePlatformDeleted')
  @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.



29592
29593
29594
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29592

def ecommerce_platform
  @ecommerce_platform
end

#event_idObject (readonly)

Returns the value of attribute event_id.



29592
29593
29594
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29592

def event_id
  @event_id
end

#organizationObject (readonly)

Returns the value of attribute organization.



29592
29593
29594
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29592

def organization
  @organization
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



29592
29593
29594
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29592

def timestamp
  @timestamp
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



29608
29609
29610
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29608

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

#subtype_to_hashObject



29612
29613
29614
29615
29616
29617
29618
29619
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29612

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

#to_jsonObject



29604
29605
29606
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29604

def to_json
  JSON.dump(to_hash)
end