Class: Io::Flow::V0::Models::AttributeUpserted
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#event_id ⇒ Object
readonly
Returns the value of attribute event_id.
-
#intent ⇒ Object
readonly
Returns the value of attribute intent.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#organization ⇒ Object
readonly
Returns the value of attribute organization.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Attributes inherited from Event
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ AttributeUpserted
constructor
A new instance of AttributeUpserted.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from Event
Constructor Details
#initialize(incoming = {}) ⇒ AttributeUpserted
Returns a new instance of AttributeUpserted.
20402 20403 20404 20405 20406 20407 20408 20409 20410 20411 20412 20413 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20402 def initialize(incoming={}) super(:discriminator => Event::Types::ATTRIBUTE_UPSERTED) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :key, :label, :type], 'AttributeUpserted') @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) @organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String) @key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String) @label = HttpClient::Preconditions.assert_class('label', opts.delete(:label), String) @intent = (x = opts.delete(:intent); x.nil? ? nil : HttpClient::Preconditions.assert_class('intent', x, String)) @type = HttpClient::Preconditions.assert_class('type', opts.delete(:type), String) end |
Instance Attribute Details
#event_id ⇒ Object (readonly)
Returns the value of attribute event_id.
20400 20401 20402 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20400 def event_id @event_id end |
#intent ⇒ Object (readonly)
Returns the value of attribute intent.
20400 20401 20402 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20400 def intent @intent end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
20400 20401 20402 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20400 def key @key end |
#label ⇒ Object (readonly)
Returns the value of attribute label.
20400 20401 20402 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20400 def label @label end |
#organization ⇒ Object (readonly)
Returns the value of attribute organization.
20400 20401 20402 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20400 def organization @organization end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
20400 20401 20402 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20400 def @timestamp end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
20400 20401 20402 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20400 def type @type end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
20419 20420 20421 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20419 def copy(incoming={}) AttributeUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
20423 20424 20425 20426 20427 20428 20429 20430 20431 20432 20433 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20423 def subtype_to_hash { :event_id => event_id, :timestamp => , :organization => organization, :key => key, :label => label, :intent => intent, :type => type } end |
#to_json ⇒ Object
20415 20416 20417 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20415 def to_json JSON.dump(to_hash) end |