Class: Io::Flow::V0::Models::MerchantApplicationDeleted

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

Returns a new instance of MerchantApplicationDeleted.



49912
49913
49914
49915
49916
49917
49918
49919
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49912

def initialize(incoming={})
  super(:discriminator => Event::Types::MERCHANT_APPLICATION_DELETED)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :merchant_application], 'MerchantApplicationDeleted')
  @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)
  @merchant_application = (x = opts.delete(:merchant_application); x.is_a?(::Io::Flow::V0::Models::MerchantApplication) ? x : ::Io::Flow::V0::Models::MerchantApplication.from_json(x))
end

Instance Attribute Details

#event_idObject (readonly)

Returns the value of attribute event_id.



49910
49911
49912
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49910

def event_id
  @event_id
end

#merchant_applicationObject (readonly)

Returns the value of attribute merchant_application.



49910
49911
49912
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49910

def merchant_application
  @merchant_application
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



49910
49911
49912
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49910

def timestamp
  @timestamp
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



49925
49926
49927
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49925

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

#subtype_to_hashObject



49929
49930
49931
49932
49933
49934
49935
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49929

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

#to_jsonObject



49921
49922
49923
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49921

def to_json
  JSON.dump(to_hash)
end