Class: Io::Flow::V0::Models::MerchantApplicationUpserted

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

Returns a new instance of MerchantApplicationUpserted.



49943
49944
49945
49946
49947
49948
49949
49950
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49943

def initialize(incoming={})
  super(:discriminator => Event::Types::MERCHANT_APPLICATION_UPSERTED)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :merchant_application], 'MerchantApplicationUpserted')
  @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.



49941
49942
49943
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49941

def event_id
  @event_id
end

#merchant_applicationObject (readonly)

Returns the value of attribute merchant_application.



49941
49942
49943
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49941

def merchant_application
  @merchant_application
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



49941
49942
49943
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49941

def timestamp
  @timestamp
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



49956
49957
49958
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49956

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

#subtype_to_hashObject



49960
49961
49962
49963
49964
49965
49966
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49960

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

#to_jsonObject



49952
49953
49954
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49952

def to_json
  JSON.dump(to_hash)
end