Class: Io::Flow::V0::Models::OrderUpserted
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#customer ⇒ Object
readonly
Returns the value of attribute customer.
-
#delivered_duty ⇒ Object
readonly
Returns the value of attribute delivered_duty.
-
#deliveries ⇒ Object
readonly
Returns the value of attribute deliveries.
-
#destination ⇒ Object
readonly
Returns the value of attribute destination.
-
#discount ⇒ Object
readonly
Returns the value of attribute discount.
-
#environment ⇒ Object
readonly
Returns the value of attribute environment.
-
#event_id ⇒ Object
readonly
Returns the value of attribute event_id.
-
#experience_id ⇒ Object
readonly
Returns the value of attribute experience_id.
-
#expires_at ⇒ Object
readonly
Returns the value of attribute expires_at.
-
#items ⇒ Object
readonly
Returns the value of attribute items.
-
#lines ⇒ Object
readonly
Returns the value of attribute lines.
-
#number ⇒ Object
readonly
Returns the value of attribute number.
-
#organization ⇒ Object
readonly
Returns the value of attribute organization.
-
#prices ⇒ Object
readonly
Returns the value of attribute prices.
-
#selections ⇒ Object
readonly
Returns the value of attribute selections.
-
#submitted_at ⇒ Object
readonly
Returns the value of attribute submitted_at.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
-
#total ⇒ Object
readonly
Returns the value of attribute total.
-
#updated_at ⇒ Object
readonly
Returns the value of attribute updated_at.
Attributes inherited from Event
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ OrderUpserted
constructor
A new instance of OrderUpserted.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from Event
Constructor Details
#initialize(incoming = {}) ⇒ OrderUpserted
Returns a new instance of OrderUpserted.
18463 18464 18465 18466 18467 18468 18469 18470 18471 18472 18473 18474 18475 18476 18477 18478 18479 18480 18481 18482 18483 18484 18485 18486 18487 18488 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18463 def initialize(incoming={}) super(:discriminator => Event::Types::ORDER_UPSERTED) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :number, :environment, :experience_id, :expires_at, :customer, :selections, :items, :destination, :deliveries, :prices, :total], 'OrderUpserted') @event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String) = 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) @number = HttpClient::Preconditions.assert_class('number', opts.delete(:number), String) @environment = HttpClient::Preconditions.assert_class('environment', opts.delete(:environment), String) @experience_id = HttpClient::Preconditions.assert_class('experience_id', opts.delete(:experience_id), String) @expires_at = HttpClient::Preconditions.assert_class('expires_at', HttpClient::Helper.to_date_time_iso8601(opts.delete(:expires_at)), DateTime) @customer = HttpClient::Preconditions.assert_class('customer', HttpClient::Helper.to_object(opts.delete(:customer)), Hash) @selections = HttpClient::Preconditions.assert_class('selections', opts.delete(:selections), Array).map { |v| HttpClient::Preconditions.assert_class('selections', v, String) } @items = HttpClient::Preconditions.assert_class('items', opts.delete(:items), Array).map { |v| HttpClient::Preconditions.assert_class('items', HttpClient::Helper.to_object(v), Hash) } @destination = HttpClient::Preconditions.assert_class('destination', HttpClient::Helper.to_object(opts.delete(:destination)), Hash) @deliveries = HttpClient::Preconditions.assert_class('deliveries', opts.delete(:deliveries), Array).map { |v| HttpClient::Preconditions.assert_class('deliveries', HttpClient::Helper.to_object(v), Hash) } @prices = HttpClient::Preconditions.assert_class('prices', opts.delete(:prices), Array).map { |v| HttpClient::Preconditions.assert_class('prices', HttpClient::Helper.to_object(v), Hash) } @discount = (x = opts.delete(:discount); x.nil? ? nil : HttpClient::Preconditions.assert_class('discount', HttpClient::Helper.to_object(x), Hash)) @delivered_duty = (x = opts.delete(:delivered_duty); x.nil? ? nil : HttpClient::Preconditions.assert_class('delivered_duty', x, String)) @total = HttpClient::Preconditions.assert_class('total', HttpClient::Helper.to_object(opts.delete(:total)), Hash) @created_at = (x = opts.delete(:created_at); x.nil? ? nil : HttpClient::Preconditions.assert_class('created_at', HttpClient::Helper.to_date_time_iso8601(x), DateTime)) @updated_at = (x = opts.delete(:updated_at); x.nil? ? nil : HttpClient::Preconditions.assert_class('updated_at', HttpClient::Helper.to_date_time_iso8601(x), DateTime)) @submitted_at = (x = opts.delete(:submitted_at); x.nil? ? nil : HttpClient::Preconditions.assert_class('submitted_at', HttpClient::Helper.to_date_time_iso8601(x), DateTime)) @lines = (x = opts.delete(:lines); x.nil? ? nil : HttpClient::Preconditions.assert_class('lines', x, Array).map { |v| HttpClient::Preconditions.assert_class('lines', HttpClient::Helper.to_object(v), Hash) }) @attributes = (x = opts.delete(:attributes); x.nil? ? nil : HttpClient::Preconditions.assert_class('attributes', x, Hash).inject({}) { |h, d| h[d[0]] = HttpClient::Preconditions.assert_class('attributes', d[1], String); h }) end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
18461 18462 18463 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18461 def attributes @attributes end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
18461 18462 18463 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18461 def created_at @created_at end |
#customer ⇒ Object (readonly)
Returns the value of attribute customer.
18461 18462 18463 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18461 def customer @customer end |
#delivered_duty ⇒ Object (readonly)
Returns the value of attribute delivered_duty.
18461 18462 18463 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18461 def delivered_duty @delivered_duty end |
#deliveries ⇒ Object (readonly)
Returns the value of attribute deliveries.
18461 18462 18463 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18461 def deliveries @deliveries end |
#destination ⇒ Object (readonly)
Returns the value of attribute destination.
18461 18462 18463 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18461 def destination @destination end |
#discount ⇒ Object (readonly)
Returns the value of attribute discount.
18461 18462 18463 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18461 def discount @discount end |
#environment ⇒ Object (readonly)
Returns the value of attribute environment.
18461 18462 18463 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18461 def environment @environment end |
#event_id ⇒ Object (readonly)
Returns the value of attribute event_id.
18461 18462 18463 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18461 def event_id @event_id end |
#experience_id ⇒ Object (readonly)
Returns the value of attribute experience_id.
18461 18462 18463 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18461 def experience_id @experience_id end |
#expires_at ⇒ Object (readonly)
Returns the value of attribute expires_at.
18461 18462 18463 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18461 def expires_at @expires_at end |
#items ⇒ Object (readonly)
Returns the value of attribute items.
18461 18462 18463 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18461 def items @items end |
#lines ⇒ Object (readonly)
Returns the value of attribute lines.
18461 18462 18463 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18461 def lines @lines end |
#number ⇒ Object (readonly)
Returns the value of attribute number.
18461 18462 18463 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18461 def number @number end |
#organization ⇒ Object (readonly)
Returns the value of attribute organization.
18461 18462 18463 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18461 def organization @organization end |
#prices ⇒ Object (readonly)
Returns the value of attribute prices.
18461 18462 18463 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18461 def prices @prices end |
#selections ⇒ Object (readonly)
Returns the value of attribute selections.
18461 18462 18463 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18461 def selections @selections end |
#submitted_at ⇒ Object (readonly)
Returns the value of attribute submitted_at.
18461 18462 18463 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18461 def submitted_at @submitted_at end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
18461 18462 18463 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18461 def end |
#total ⇒ Object (readonly)
Returns the value of attribute total.
18461 18462 18463 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18461 def total @total end |
#updated_at ⇒ Object (readonly)
Returns the value of attribute updated_at.
18461 18462 18463 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18461 def updated_at @updated_at end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
18494 18495 18496 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18494 def copy(incoming={}) OrderUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
18498 18499 18500 18501 18502 18503 18504 18505 18506 18507 18508 18509 18510 18511 18512 18513 18514 18515 18516 18517 18518 18519 18520 18521 18522 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18498 def subtype_to_hash { :event_id => event_id, :timestamp => , :organization => organization, :number => number, :environment => environment, :experience_id => experience_id, :expires_at => expires_at, :customer => customer, :selections => selections, :items => items, :destination => destination, :deliveries => deliveries, :prices => prices, :discount => discount, :delivered_duty => delivered_duty, :total => total, :created_at => created_at, :updated_at => updated_at, :submitted_at => submitted_at, :lines => lines.nil? ? nil : lines, :attributes => attributes.nil? ? nil : attributes } end |
#to_json ⇒ Object
18490 18491 18492 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18490 def to_json JSON.dump(to_hash) end |