Class: Io::Flow::V0::Models::ChannelStatementUpserted
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#channel_id ⇒ Object
readonly
Returns the value of attribute channel_id.
-
#channel_statement ⇒ Object
readonly
Returns the value of attribute channel_statement.
-
#event_id ⇒ Object
readonly
Returns the value of attribute event_id.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
Attributes inherited from Event
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ ChannelStatementUpserted
constructor
A new instance of ChannelStatementUpserted.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from Event
Constructor Details
#initialize(incoming = {}) ⇒ ChannelStatementUpserted
Returns a new instance of ChannelStatementUpserted.
35513 35514 35515 35516 35517 35518 35519 35520 35521 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35513 def initialize(incoming={}) super(:discriminator => Event::Types::CHANNEL_STATEMENT_UPSERTED) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :channel_id, :channel_statement], 'ChannelStatementUpserted') @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) @channel_id = HttpClient::Preconditions.assert_class('channel_id', opts.delete(:channel_id), String) @channel_statement = (x = opts.delete(:channel_statement); x.is_a?(::Io::Flow::V0::Models::ChannelStatement) ? x : ::Io::Flow::V0::Models::ChannelStatement.new(x)) end |
Instance Attribute Details
#channel_id ⇒ Object (readonly)
Returns the value of attribute channel_id.
35511 35512 35513 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35511 def channel_id @channel_id end |
#channel_statement ⇒ Object (readonly)
Returns the value of attribute channel_statement.
35511 35512 35513 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35511 def channel_statement @channel_statement end |
#event_id ⇒ Object (readonly)
Returns the value of attribute event_id.
35511 35512 35513 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35511 def event_id @event_id end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
35511 35512 35513 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35511 def @timestamp end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
35527 35528 35529 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35527 def copy(incoming={}) ChannelStatementUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
35531 35532 35533 35534 35535 35536 35537 35538 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35531 def subtype_to_hash { :event_id => event_id, :timestamp => , :channel_id => channel_id, :channel_statement => channel_statement.to_hash } end |
#to_json ⇒ Object
35523 35524 35525 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35523 def to_json JSON.dump(to_hash) end |