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.
-
#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.
18990 18991 18992 18993 18994 18995 18996 18997 18998 18999 19000 19001 19002 19003 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18990 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) = 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)) end |
Instance Attribute Details
#currencies ⇒ Object (readonly)
Returns the value of attribute currencies.
18988 18989 18990 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18988 def currencies @currencies end |
#default_base_currency ⇒ Object (readonly)
Returns the value of attribute default_base_currency.
18988 18989 18990 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18988 def default_base_currency @default_base_currency end |
#default_country ⇒ Object (readonly)
Returns the value of attribute default_country.
18988 18989 18990 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18988 def default_country @default_country end |
#environment ⇒ Object (readonly)
Returns the value of attribute environment.
18988 18989 18990 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18988 def environment @environment end |
#event_id ⇒ Object (readonly)
Returns the value of attribute event_id.
18988 18989 18990 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18988 def event_id @event_id end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
18988 18989 18990 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18988 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
18988 18989 18990 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18988 def name @name end |
#parent_id ⇒ Object (readonly)
Returns the value of attribute parent_id.
18988 18989 18990 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18988 def parent_id @parent_id end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
18988 18989 18990 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18988 def end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
19009 19010 19011 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19009 def copy(incoming={}) OrganizationUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
19013 19014 19015 19016 19017 19018 19019 19020 19021 19022 19023 19024 19025 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19013 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 } end |
#to_json ⇒ Object
19005 19006 19007 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19005 def to_json JSON.dump(to_hash) end |