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

from_json, #to_hash

Constructor Details

#initialize(incoming = {}) ⇒ SnapshotDeleted

Returns a new instance of SnapshotDeleted.



30890
30891
30892
30893
30894
30895
30896
30897
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30890

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_idObject (readonly)

Returns the value of attribute event_id.



30888
30889
30890
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30888

def event_id
  @event_id
end

#snapshot_idObject (readonly)

Returns the value of attribute snapshot_id.



30888
30889
30890
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30888

def snapshot_id
  @snapshot_id
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



30888
30889
30890
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30888

def timestamp
  @timestamp
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



30903
30904
30905
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30903

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

#subtype_to_hashObject



30907
30908
30909
30910
30911
30912
30913
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30907

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

#to_jsonObject



30899
30900
30901
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30899

def to_json
  JSON.dump(to_hash)
end