Class: Io::Flow::V0::Models::OrganizationUpserted
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#currencies ⇒ Object
readonly
Returns the value of attribute currencies.
-
#default_base_currency ⇒ Object
readonly
Returns the value of attribute default_base_currency.
-
#default_country ⇒ Object
readonly
Returns the value of attribute default_country.
-
#default_language ⇒ Object
readonly
Returns the value of attribute default_language.
-
#default_locale ⇒ Object
readonly
Returns the value of attribute default_locale.
-
#default_timezone ⇒ Object
readonly
Returns the value of attribute default_timezone.
-
#environment ⇒ Object
readonly
Returns the value of attribute environment.
-
#event_id ⇒ Object
readonly
Returns the value of attribute event_id.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#parent_id ⇒ Object
readonly
Returns the value of attribute parent_id.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
Attributes inherited from Event
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ OrganizationUpserted
constructor
A new instance of OrganizationUpserted.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from Event
Constructor Details
#initialize(incoming = {}) ⇒ OrganizationUpserted
Returns a new instance of OrganizationUpserted.
43405 43406 43407 43408 43409 43410 43411 43412 43413 43414 43415 43416 43417 43418 43419 43420 43421 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43405 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
#currencies ⇒ Object (readonly)
Returns the value of attribute currencies.
43403 43404 43405 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43403 def currencies @currencies end |
#default_base_currency ⇒ Object (readonly)
Returns the value of attribute default_base_currency.
43403 43404 43405 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43403 def default_base_currency @default_base_currency end |
#default_country ⇒ Object (readonly)
Returns the value of attribute default_country.
43403 43404 43405 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43403 def default_country @default_country end |
#default_language ⇒ Object (readonly)
Returns the value of attribute default_language.
43403 43404 43405 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43403 def default_language @default_language end |
#default_locale ⇒ Object (readonly)
Returns the value of attribute default_locale.
43403 43404 43405 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43403 def default_locale @default_locale end |
#default_timezone ⇒ Object (readonly)
Returns the value of attribute default_timezone.
43403 43404 43405 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43403 def default_timezone @default_timezone end |
#environment ⇒ Object (readonly)
Returns the value of attribute environment.
43403 43404 43405 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43403 def environment @environment end |
#event_id ⇒ Object (readonly)
Returns the value of attribute event_id.
43403 43404 43405 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43403 def event_id @event_id end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
43403 43404 43405 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43403 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
43403 43404 43405 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43403 def name @name end |
#parent_id ⇒ Object (readonly)
Returns the value of attribute parent_id.
43403 43404 43405 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43403 def parent_id @parent_id end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
43403 43404 43405 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43403 def @timestamp end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
43427 43428 43429 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43427 def copy(incoming={}) OrganizationUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
43431 43432 43433 43434 43435 43436 43437 43438 43439 43440 43441 43442 43443 43444 43445 43446 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43431 def subtype_to_hash { :event_id => event_id, :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 ⇒ Object
43423 43424 43425 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43423 def to_json JSON.dump(to_hash) end |