Class: Io::Flow::V0::Models::OrganizationTransactionUpserted
- 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.
-
#organization ⇒ Object
readonly
Returns the value of attribute organization.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
-
#transaction ⇒ Object
readonly
Returns the value of attribute transaction.
Attributes inherited from Event
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ OrganizationTransactionUpserted
constructor
A new instance of OrganizationTransactionUpserted.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from Event
Constructor Details
#initialize(incoming = {}) ⇒ OrganizationTransactionUpserted
Returns a new instance of OrganizationTransactionUpserted.
55726 55727 55728 55729 55730 55731 55732 55733 55734 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55726 def initialize(incoming={}) super(:discriminator => Event::Types::ORGANIZATION_TRANSACTION_UPSERTED) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :transaction], 'OrganizationTransactionUpserted') @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) @transaction = (x = opts.delete(:transaction); x.is_a?(::Io::Flow::V0::Models::Transaction) ? x : ::Io::Flow::V0::Models::Transaction.new(x)) end |
Instance Attribute Details
#event_id ⇒ Object (readonly)
Returns the value of attribute event_id.
55724 55725 55726 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55724 def event_id @event_id end |
#organization ⇒ Object (readonly)
Returns the value of attribute organization.
55724 55725 55726 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55724 def organization @organization end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
55724 55725 55726 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55724 def @timestamp end |
#transaction ⇒ Object (readonly)
Returns the value of attribute transaction.
55724 55725 55726 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55724 def transaction @transaction end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
55740 55741 55742 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55740 def copy(incoming={}) OrganizationTransactionUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
55744 55745 55746 55747 55748 55749 55750 55751 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55744 def subtype_to_hash { :event_id => event_id, :timestamp => , :organization => organization, :transaction => transaction.to_hash } end |
#to_json ⇒ Object
55736 55737 55738 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55736 def to_json JSON.dump(to_hash) end |