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.



30792
30793
30794
30795
30796
30797
30798
30799
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30792

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.



30790
30791
30792
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30790

def channel_organization
  @channel_organization
end

#event_idObject (readonly)

Returns the value of attribute event_id.



30790
30791
30792
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30790

def event_id
  @event_id
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



30790
30791
30792
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30790

def timestamp
  @timestamp
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



30805
30806
30807
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30805

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

#subtype_to_hashObject



30809
30810
30811
30812
30813
30814
30815
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30809

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

#to_jsonObject



30801
30802
30803
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30801

def to_json
  JSON.dump(to_hash)
end