Class: Io::Flow::V0::Models::ChannelOrganizationUpserted

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

Returns a new instance of ChannelOrganizationUpserted.



35256
35257
35258
35259
35260
35261
35262
35263
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35256

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

Instance Attribute Details

#channel_organizationObject (readonly)

Returns the value of attribute channel_organization.



35254
35255
35256
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35254

def channel_organization
  @channel_organization
end

#event_idObject (readonly)

Returns the value of attribute event_id.



35254
35255
35256
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35254

def event_id
  @event_id
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



35254
35255
35256
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35254

def timestamp
  @timestamp
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



35269
35270
35271
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35269

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

#subtype_to_hashObject



35273
35274
35275
35276
35277
35278
35279
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35273

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

#to_jsonObject



35265
35266
35267
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35265

def to_json
  JSON.dump(to_hash)
end