Class: Io::Flow::V0::Models::SnapshotDeleted

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

#to_hash

Constructor Details

#initialize(incoming = {}) ⇒ SnapshotDeleted

Returns a new instance of SnapshotDeleted.



20415
20416
20417
20418
20419
20420
20421
20422
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20415

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

Instance Attribute Details

#event_id ⇒ Object (readonly)

Returns the value of attribute event_id.



20413
20414
20415
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20413

def event_id
  @event_id
end

#snapshot_id ⇒ Object (readonly)

Returns the value of attribute snapshot_id.



20413
20414
20415
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20413

def snapshot_id
  @snapshot_id
end

#timestamp ⇒ Object (readonly)

Returns the value of attribute timestamp.



20413
20414
20415
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20413

def timestamp
  @timestamp
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



20428
20429
20430
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20428

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

#subtype_to_hash ⇒ Object



20432
20433
20434
20435
20436
20437
20438
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20432

def subtype_to_hash
  {
    :event_id => event_id,
    :timestamp => timestamp,
    :snapshot_id => snapshot_id
  }
end

#to_json ⇒ Object



20424
20425
20426
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20424

def to_json
  JSON.dump(to_hash)
end