Class: Io::Flow::V0::Models::ReturnUpserted
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#destination ⇒ Object
readonly
Returns the value of attribute destination.
-
#event_id ⇒ Object
readonly
Returns the value of attribute event_id.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#items ⇒ Object
readonly
Returns the value of attribute items.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#labels ⇒ Object
readonly
Returns the value of attribute labels.
-
#organization ⇒ Object
readonly
Returns the value of attribute organization.
-
#origin ⇒ Object
readonly
Returns the value of attribute origin.
-
#service ⇒ Object
readonly
Returns the value of attribute service.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
Attributes inherited from Event
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ ReturnUpserted
constructor
A new instance of ReturnUpserted.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from Event
Constructor Details
#initialize(incoming = {}) ⇒ ReturnUpserted
Returns a new instance of ReturnUpserted.
24717 24718 24719 24720 24721 24722 24723 24724 24725 24726 24727 24728 24729 24730 24731 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24717 def initialize(incoming={}) super(:discriminator => Event::Types::RETURN_UPSERTED) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :id, :organization, :destination, :items, :key, :labels, :service, :origin], 'ReturnUpserted') @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) @organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String) @destination = HttpClient::Preconditions.assert_class('destination', HttpClient::Helper.to_object(opts.delete(:destination)), Hash) @items = HttpClient::Preconditions.assert_class('items', HttpClient::Helper.to_object(opts.delete(:items)), Hash) @key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String) @labels = HttpClient::Preconditions.assert_class('labels', HttpClient::Helper.to_object(opts.delete(:labels)), Hash) @service = HttpClient::Preconditions.assert_class('service', opts.delete(:service), String) @origin = HttpClient::Preconditions.assert_class('origin', HttpClient::Helper.to_object(opts.delete(:origin)), Hash) end |
Instance Attribute Details
#destination ⇒ Object (readonly)
Returns the value of attribute destination.
24715 24716 24717 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24715 def destination @destination end |
#event_id ⇒ Object (readonly)
Returns the value of attribute event_id.
24715 24716 24717 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24715 def event_id @event_id end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
24715 24716 24717 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24715 def id @id end |
#items ⇒ Object (readonly)
Returns the value of attribute items.
24715 24716 24717 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24715 def items @items end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
24715 24716 24717 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24715 def key @key end |
#labels ⇒ Object (readonly)
Returns the value of attribute labels.
24715 24716 24717 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24715 def labels @labels end |
#organization ⇒ Object (readonly)
Returns the value of attribute organization.
24715 24716 24717 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24715 def organization @organization end |
#origin ⇒ Object (readonly)
Returns the value of attribute origin.
24715 24716 24717 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24715 def origin @origin end |
#service ⇒ Object (readonly)
Returns the value of attribute service.
24715 24716 24717 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24715 def service @service end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
24715 24716 24717 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24715 def @timestamp end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
24737 24738 24739 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24737 def copy(incoming={}) ReturnUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
24741 24742 24743 24744 24745 24746 24747 24748 24749 24750 24751 24752 24753 24754 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24741 def subtype_to_hash { :event_id => event_id, :timestamp => , :id => id, :organization => organization, :destination => destination, :items => items, :key => key, :labels => labels, :service => service, :origin => origin } end |
#to_json ⇒ Object
24733 24734 24735 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24733 def to_json JSON.dump(to_hash) end |