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.
-
#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.
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.
14213 14214 14215 14216 14217 14218 14219 14220 14221 14222 14223 14224 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14213 def initialize(incoming={}) super(:name => 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)) end |
Instance Attribute Details
#currencies ⇒ Object (readonly)
Returns the value of attribute currencies.
14211 14212 14213 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14211 def currencies @currencies end |
#environment ⇒ Object (readonly)
Returns the value of attribute environment.
14211 14212 14213 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14211 def environment @environment end |
#event_id ⇒ Object (readonly)
Returns the value of attribute event_id.
14211 14212 14213 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14211 def event_id @event_id end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
14211 14212 14213 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14211 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
14211 14212 14213 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14211 def name @name end |
#parent_id ⇒ Object (readonly)
Returns the value of attribute parent_id.
14211 14212 14213 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14211 def parent_id @parent_id end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
14211 14212 14213 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14211 def @timestamp end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
14230 14231 14232 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14230 def copy(incoming={}) OrganizationUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
14234 14235 14236 14237 14238 14239 14240 14241 14242 14243 14244 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14234 def subtype_to_hash { :event_id => event_id, :timestamp => , :id => id, :name => name, :environment => environment, :currencies => currencies, :parent_id => parent_id } end |
#to_json ⇒ Object
14226 14227 14228 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14226 def to_json JSON.dump(to_hash) end |