Class: Io::Flow::V0::Models::ChannelStatementDeleted

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

Returns a new instance of ChannelStatementDeleted.



35480
35481
35482
35483
35484
35485
35486
35487
35488
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35480

def initialize(incoming={})
  super(:discriminator => Event::Types::CHANNEL_STATEMENT_DELETED)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :channel_id, :channel_statement], 'ChannelStatementDeleted')
  @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_id = HttpClient::Preconditions.assert_class('channel_id', opts.delete(:channel_id), String)
  @channel_statement = (x = opts.delete(:channel_statement); x.is_a?(::Io::Flow::V0::Models::ChannelStatement) ? x : ::Io::Flow::V0::Models::ChannelStatement.new(x))
end

Instance Attribute Details

#channel_idObject (readonly)

Returns the value of attribute channel_id.



35478
35479
35480
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35478

def channel_id
  @channel_id
end

#channel_statementObject (readonly)

Returns the value of attribute channel_statement.



35478
35479
35480
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35478

def channel_statement
  @channel_statement
end

#event_idObject (readonly)

Returns the value of attribute event_id.



35478
35479
35480
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35478

def event_id
  @event_id
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



35478
35479
35480
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35478

def timestamp
  @timestamp
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



35494
35495
35496
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35494

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

#subtype_to_hashObject



35498
35499
35500
35501
35502
35503
35504
35505
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35498

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

#to_jsonObject



35490
35491
35492
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35490

def to_json
  JSON.dump(to_hash)
end