Class: Io::Flow::V0::Models::TestUpserted
- 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.
-
#test ⇒ Object
readonly
Returns the value of attribute test.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
Attributes inherited from Event
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ TestUpserted
constructor
A new instance of TestUpserted.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from Event
Constructor Details
#initialize(incoming = {}) ⇒ TestUpserted
Returns a new instance of TestUpserted.
70382 70383 70384 70385 70386 70387 70388 70389 70390 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 70382 def initialize(incoming={}) super(:discriminator => Event::Types::TEST_UPSERTED) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :test], 'TestUpserted') @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) @test = (x = opts.delete(:test); x.is_a?(::Io::Flow::V0::Models::Test) ? x : ::Io::Flow::V0::Models::Test.new(x)) end |
Instance Attribute Details
#event_id ⇒ Object (readonly)
Returns the value of attribute event_id.
70380 70381 70382 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 70380 def event_id @event_id end |
#organization ⇒ Object (readonly)
Returns the value of attribute organization.
70380 70381 70382 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 70380 def organization @organization end |
#test ⇒ Object (readonly)
Returns the value of attribute test.
70380 70381 70382 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 70380 def test @test end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
70380 70381 70382 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 70380 def @timestamp end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
70396 70397 70398 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 70396 def copy(incoming={}) TestUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
70400 70401 70402 70403 70404 70405 70406 70407 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 70400 def subtype_to_hash { :event_id => event_id, :timestamp => , :organization => organization, :test => test.to_hash } end |
#to_json ⇒ Object
70392 70393 70394 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 70392 def to_json JSON.dump(to_hash) end |