Class: Io::Flow::V0::Models::OrderIdentifierDeletedV2

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

Returns a new instance of OrderIdentifierDeletedV2.



41430
41431
41432
41433
41434
41435
41436
41437
41438
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41430

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

Instance Attribute Details

#event_idObject (readonly)

Returns the value of attribute event_id.



41428
41429
41430
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41428

def event_id
  @event_id
end

#idObject (readonly)

Returns the value of attribute id.



41428
41429
41430
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41428

def id
  @id
end

#organizationObject (readonly)

Returns the value of attribute organization.



41428
41429
41430
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41428

def organization
  @organization
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



41428
41429
41430
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41428

def timestamp
  @timestamp
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



41444
41445
41446
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41444

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

#subtype_to_hashObject



41448
41449
41450
41451
41452
41453
41454
41455
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41448

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

#to_jsonObject



41440
41441
41442
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41440

def to_json
  JSON.dump(to_hash)
end