class Io::Flow::V0::Models::OrganizationUpserted

Attributes

currencies[R]
default_base_currency[R]
default_country[R]
default_language[R]
default_locale[R]
default_timezone[R]
environment[R]
event_id[R]
id[R]
name[R]
parent_id[R]
timestamp[R]

Public Class Methods

new(incoming={}) click to toggle source
Calls superclass method Io::Flow::V0::Models::Event::new
# File lib/flow_commerce/flow_api_v0_client.rb, line 55759
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

Public Instance Methods

copy(incoming={}) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 55781
def copy(incoming={})
  OrganizationUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end
subtype_to_hash() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 55785
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_json() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 55777
def to_json
  JSON.dump(to_hash)
end