Class: Io::Flow::V0::Models::OrganizationCurrencySettingUpserted

Inherits:
Event
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Event

from_json, #to_hash

Constructor Details

#initialize(incoming = {}) ⇒ OrganizationCurrencySettingUpserted

Returns a new instance of OrganizationCurrencySettingUpserted.



13994
13995
13996
13997
13998
13999
14000
14001
14002
14003
14004
14005
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13994

def initialize(incoming={})
  super(:name => Event::Types::ORGANIZATION_CURRENCY_SETTING_UPSERTED)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization_currency_setting_id, :organization_id, :base, :target, :margin], 'OrganizationCurrencySettingUpserted')
  @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_currency_setting_id = HttpClient::Preconditions.assert_class('organization_currency_setting_id', opts.delete(:organization_currency_setting_id), String)
  @organization_id = HttpClient::Preconditions.assert_class('organization_id', opts.delete(:organization_id), String)
  @base = HttpClient::Preconditions.assert_class('base', opts.delete(:base), String)
  @target = HttpClient::Preconditions.assert_class('target', opts.delete(:target), String)
  @margin = HttpClient::Preconditions.assert_class('margin', HttpClient::Helper.to_big_decimal(opts.delete(:margin)), BigDecimal)
end

Instance Attribute Details

#baseObject (readonly)

Returns the value of attribute base.



13992
13993
13994
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13992

def base
  @base
end

#event_idObject (readonly)

Returns the value of attribute event_id.



13992
13993
13994
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13992

def event_id
  @event_id
end

#marginObject (readonly)

Returns the value of attribute margin.



13992
13993
13994
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13992

def margin
  @margin
end

#organization_currency_setting_idObject (readonly)

Returns the value of attribute organization_currency_setting_id.



13992
13993
13994
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13992

def organization_currency_setting_id
  @organization_currency_setting_id
end

#organization_idObject (readonly)

Returns the value of attribute organization_id.



13992
13993
13994
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13992

def organization_id
  @organization_id
end

#targetObject (readonly)

Returns the value of attribute target.



13992
13993
13994
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13992

def target
  @target
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



13992
13993
13994
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13992

def timestamp
  @timestamp
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



14011
14012
14013
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14011

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

#subtype_to_hashObject



14015
14016
14017
14018
14019
14020
14021
14022
14023
14024
14025
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14015

def subtype_to_hash
  {
    :event_id => event_id,
    :timestamp => timestamp,
    :organization_currency_setting_id => organization_currency_setting_id,
    :organization_id => organization_id,
    :base => base,
    :target => target,
    :margin => margin
  }
end

#to_jsonObject



14007
14008
14009
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14007

def to_json
  JSON.dump(to_hash)
end