Class: Io::Flow::V0::Models::ChannelTransactionDeletedV2

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

Returns a new instance of ChannelTransactionDeletedV2.



35731
35732
35733
35734
35735
35736
35737
35738
35739
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35731

def initialize(incoming={})
  super(:discriminator => Event::Types::CHANNEL_TRANSACTION_DELETED_V2)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :channel_id, :id], 'ChannelTransactionDeletedV2')
  @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)
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
end

Instance Attribute Details

#channel_idObject (readonly)

Returns the value of attribute channel_id.



35729
35730
35731
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35729

def channel_id
  @channel_id
end

#event_idObject (readonly)

Returns the value of attribute event_id.



35729
35730
35731
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35729

def event_id
  @event_id
end

#idObject (readonly)

Returns the value of attribute id.



35729
35730
35731
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35729

def id
  @id
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



35729
35730
35731
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35729

def timestamp
  @timestamp
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



35745
35746
35747
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35745

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

#subtype_to_hashObject



35749
35750
35751
35752
35753
35754
35755
35756
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35749

def subtype_to_hash
  {
    :event_id => event_id,
    :timestamp => timestamp,
    :channel_id => channel_id,
    :id => id
  }
end

#to_jsonObject



35741
35742
35743
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35741

def to_json
  JSON.dump(to_hash)
end