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.



13448
13449
13450
13451
13452
13453
13454
13455
13456
13457
13458
13459
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13448

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.



13446
13447
13448
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13446

def base
  @base
end

#event_idObject (readonly)

Returns the value of attribute event_id.



13446
13447
13448
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13446

def event_id
  @event_id
end

#marginObject (readonly)

Returns the value of attribute margin.



13446
13447
13448
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13446

def margin
  @margin
end

#organization_currency_setting_idObject (readonly)

Returns the value of attribute organization_currency_setting_id.



13446
13447
13448
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13446

def organization_currency_setting_id
  @organization_currency_setting_id
end

#organization_idObject (readonly)

Returns the value of attribute organization_id.



13446
13447
13448
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13446

def organization_id
  @organization_id
end

#targetObject (readonly)

Returns the value of attribute target.



13446
13447
13448
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13446

def target
  @target
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



13446
13447
13448
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13446

def timestamp
  @timestamp
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



13465
13466
13467
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13465

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

#subtype_to_hashObject



13469
13470
13471
13472
13473
13474
13475
13476
13477
13478
13479
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13469

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



13461
13462
13463
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13461

def to_json
  JSON.dump(to_hash)
end