Class: Io::Flow::V0::Models::StatementDeleted

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

Returns a new instance of StatementDeleted.



68724
68725
68726
68727
68728
68729
68730
68731
68732
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 68724

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

Instance Attribute Details

#event_idObject (readonly)

Returns the value of attribute event_id.



68722
68723
68724
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 68722

def event_id
  @event_id
end

#organizationObject (readonly)

Returns the value of attribute organization.



68722
68723
68724
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 68722

def organization
  @organization
end

#statementObject (readonly)

Returns the value of attribute statement.



68722
68723
68724
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 68722

def statement
  @statement
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



68722
68723
68724
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 68722

def timestamp
  @timestamp
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



68738
68739
68740
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 68738

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

#subtype_to_hashObject



68742
68743
68744
68745
68746
68747
68748
68749
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 68742

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

#to_jsonObject



68734
68735
68736
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 68734

def to_json
  JSON.dump(to_hash)
end