Class: Io::Flow::V0::Models::DeliveryOptionUpserted
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#cost ⇒ Object
readonly
Returns the value of attribute cost.
-
#delivered_duty ⇒ Object
readonly
Returns the value of attribute delivered_duty.
-
#delivery_window_components ⇒ Object
readonly
Returns the value of attribute delivery_window_components.
-
#event_id ⇒ Object
readonly
Returns the value of attribute event_id.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#organization ⇒ Object
readonly
Returns the value of attribute organization.
-
#price ⇒ Object
readonly
Returns the value of attribute price.
-
#rule_outcome ⇒ Object
readonly
Returns the value of attribute rule_outcome.
-
#service_id ⇒ Object
readonly
Returns the value of attribute service_id.
-
#tier ⇒ Object
readonly
Returns the value of attribute tier.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
-
#weight ⇒ Object
readonly
Returns the value of attribute weight.
-
#window ⇒ Object
readonly
Returns the value of attribute window.
Attributes inherited from Event
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ DeliveryOptionUpserted
constructor
A new instance of DeliveryOptionUpserted.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from Event
Constructor Details
#initialize(incoming = {}) ⇒ DeliveryOptionUpserted
Returns a new instance of DeliveryOptionUpserted.
22045 22046 22047 22048 22049 22050 22051 22052 22053 22054 22055 22056 22057 22058 22059 22060 22061 22062 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22045 def initialize(incoming={}) super(:discriminator => Event::Types::DELIVERY_OPTION_UPSERTED) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :id, :cost, :price, :delivered_duty, :service_id, :tier, :window, :rule_outcome, :delivery_window_components], 'DeliveryOptionUpserted') @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) @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String) @cost = HttpClient::Preconditions.assert_class('cost', HttpClient::Helper.to_object(opts.delete(:cost)), Hash) @price = HttpClient::Preconditions.assert_class('price', HttpClient::Helper.to_object(opts.delete(:price)), Hash) @delivered_duty = HttpClient::Preconditions.assert_class('delivered_duty', opts.delete(:delivered_duty), String) @service_id = HttpClient::Preconditions.assert_class('service_id', opts.delete(:service_id), String) @tier = HttpClient::Preconditions.assert_class('tier', HttpClient::Helper.to_object(opts.delete(:tier)), Hash) @window = HttpClient::Preconditions.assert_class('window', HttpClient::Helper.to_object(opts.delete(:window)), Hash) @rule_outcome = HttpClient::Preconditions.assert_class('rule_outcome', HttpClient::Helper.to_object(opts.delete(:rule_outcome)), Hash) @weight = (x = opts.delete(:weight); x.nil? ? nil : HttpClient::Preconditions.assert_class('weight', HttpClient::Helper.to_object(x), Hash)) @delivery_window_components = HttpClient::Preconditions.assert_class('delivery_window_components', HttpClient::Helper.to_object(opts.delete(:delivery_window_components)), Hash) end |
Instance Attribute Details
#cost ⇒ Object (readonly)
Returns the value of attribute cost.
22043 22044 22045 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22043 def cost @cost end |
#delivered_duty ⇒ Object (readonly)
Returns the value of attribute delivered_duty.
22043 22044 22045 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22043 def delivered_duty @delivered_duty end |
#delivery_window_components ⇒ Object (readonly)
Returns the value of attribute delivery_window_components.
22043 22044 22045 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22043 def delivery_window_components @delivery_window_components end |
#event_id ⇒ Object (readonly)
Returns the value of attribute event_id.
22043 22044 22045 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22043 def event_id @event_id end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
22043 22044 22045 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22043 def id @id end |
#organization ⇒ Object (readonly)
Returns the value of attribute organization.
22043 22044 22045 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22043 def organization @organization end |
#price ⇒ Object (readonly)
Returns the value of attribute price.
22043 22044 22045 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22043 def price @price end |
#rule_outcome ⇒ Object (readonly)
Returns the value of attribute rule_outcome.
22043 22044 22045 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22043 def rule_outcome @rule_outcome end |
#service_id ⇒ Object (readonly)
Returns the value of attribute service_id.
22043 22044 22045 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22043 def service_id @service_id end |
#tier ⇒ Object (readonly)
Returns the value of attribute tier.
22043 22044 22045 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22043 def tier @tier end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
22043 22044 22045 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22043 def end |
#weight ⇒ Object (readonly)
Returns the value of attribute weight.
22043 22044 22045 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22043 def weight @weight end |
#window ⇒ Object (readonly)
Returns the value of attribute window.
22043 22044 22045 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22043 def window @window end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
22068 22069 22070 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22068 def copy(incoming={}) DeliveryOptionUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
22072 22073 22074 22075 22076 22077 22078 22079 22080 22081 22082 22083 22084 22085 22086 22087 22088 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22072 def subtype_to_hash { :event_id => event_id, :timestamp => , :organization => organization, :id => id, :cost => cost, :price => price, :delivered_duty => delivered_duty, :service_id => service_id, :tier => tier, :window => window, :rule_outcome => rule_outcome, :weight => weight, :delivery_window_components => delivery_window_components } end |
#to_json ⇒ Object
22064 22065 22066 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22064 def to_json JSON.dump(to_hash) end |