Class: Io::Flow::V0::Models::OrganizationUpserted

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

Returns a new instance of OrganizationUpserted.



21369
21370
21371
21372
21373
21374
21375
21376
21377
21378
21379
21380
21381
21382
21383
21384
21385
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21369

def initialize(incoming={})
  super(:discriminator => Event::Types::ORGANIZATION_UPSERTED)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :id, :name, :environment, :currencies], 'OrganizationUpserted')
  @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)
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
  @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
  @environment = HttpClient::Preconditions.assert_class('environment', opts.delete(:environment), String)
  @currencies = HttpClient::Preconditions.assert_class('currencies', opts.delete(:currencies), Array).map { |v| HttpClient::Preconditions.assert_class('currencies', v, String) }
  @parent_id = (x = opts.delete(:parent_id); x.nil? ? nil : HttpClient::Preconditions.assert_class('parent_id', x, String))
  @default_base_currency = (x = opts.delete(:default_base_currency); x.nil? ? nil : HttpClient::Preconditions.assert_class('default_base_currency', x, String))
  @default_country = (x = opts.delete(:default_country); x.nil? ? nil : HttpClient::Preconditions.assert_class('default_country', x, String))
  @default_language = (x = opts.delete(:default_language); x.nil? ? nil : HttpClient::Preconditions.assert_class('default_language', x, String))
  @default_locale = (x = opts.delete(:default_locale); x.nil? ? nil : HttpClient::Preconditions.assert_class('default_locale', x, String))
  @default_timezone = (x = opts.delete(:default_timezone); x.nil? ? nil : HttpClient::Preconditions.assert_class('default_timezone', x, String))
end

Instance Attribute Details

#currenciesObject (readonly)

Returns the value of attribute currencies.



21367
21368
21369
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21367

def currencies
  @currencies
end

#default_base_currencyObject (readonly)

Returns the value of attribute default_base_currency.



21367
21368
21369
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21367

def default_base_currency
  @default_base_currency
end

#default_countryObject (readonly)

Returns the value of attribute default_country.



21367
21368
21369
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21367

def default_country
  @default_country
end

#default_languageObject (readonly)

Returns the value of attribute default_language.



21367
21368
21369
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21367

def default_language
  @default_language
end

#default_localeObject (readonly)

Returns the value of attribute default_locale.



21367
21368
21369
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21367

def default_locale
  @default_locale
end

#default_timezoneObject (readonly)

Returns the value of attribute default_timezone.



21367
21368
21369
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21367

def default_timezone
  @default_timezone
end

#environmentObject (readonly)

Returns the value of attribute environment.



21367
21368
21369
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21367

def environment
  @environment
end

#event_idObject (readonly)

Returns the value of attribute event_id.



21367
21368
21369
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21367

def event_id
  @event_id
end

#idObject (readonly)

Returns the value of attribute id.



21367
21368
21369
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21367

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



21367
21368
21369
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21367

def name
  @name
end

#parent_idObject (readonly)

Returns the value of attribute parent_id.



21367
21368
21369
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21367

def parent_id
  @parent_id
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



21367
21368
21369
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21367

def timestamp
  @timestamp
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



21391
21392
21393
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21391

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

#subtype_to_hashObject



21395
21396
21397
21398
21399
21400
21401
21402
21403
21404
21405
21406
21407
21408
21409
21410
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21395

def subtype_to_hash
  {
    :event_id => event_id,
    :timestamp => timestamp,
    :id => id,
    :name => name,
    :environment => environment,
    :currencies => currencies,
    :parent_id => parent_id,
    :default_base_currency => default_base_currency,
    :default_country => default_country,
    :default_language => default_language,
    :default_locale => default_locale,
    :default_timezone => default_timezone
  }
end

#to_jsonObject



21387
21388
21389
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21387

def to_json
  JSON.dump(to_hash)
end