Class: Io::Flow::V0::Models::ShippingConfigurationUpserted

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

Returns a new instance of ShippingConfigurationUpserted.



50575
50576
50577
50578
50579
50580
50581
50582
50583
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50575

def initialize(incoming={})
  super(:discriminator => Event::Types::SHIPPING_CONFIGURATION_UPSERTED)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :shipping_configuration], 'ShippingConfigurationUpserted')
  @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)
  @shipping_configuration = (x = opts.delete(:shipping_configuration); x.is_a?(::Io::Flow::V0::Models::ShippingConfiguration) ? x : ::Io::Flow::V0::Models::ShippingConfiguration.new(x))
end

Instance Attribute Details

#event_idObject (readonly)

Returns the value of attribute event_id.



50573
50574
50575
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50573

def event_id
  @event_id
end

#organizationObject (readonly)

Returns the value of attribute organization.



50573
50574
50575
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50573

def organization
  @organization
end

#shipping_configurationObject (readonly)

Returns the value of attribute shipping_configuration.



50573
50574
50575
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50573

def shipping_configuration
  @shipping_configuration
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



50573
50574
50575
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50573

def timestamp
  @timestamp
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



50589
50590
50591
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50589

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

#subtype_to_hashObject



50593
50594
50595
50596
50597
50598
50599
50600
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50593

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

#to_jsonObject



50585
50586
50587
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50585

def to_json
  JSON.dump(to_hash)
end