Class: Io::Flow::V0::Models::OrderServiceChangeForm
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::OrderServiceChangeForm
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Manual change for a shipping method used for an order. Currently only available to orders with a single calculated delivery. To help with orders with multiple deliveries, we will require verification of both the current service level (from) and the new service level (to).
Instance Attribute Summary collapse
-
#from_service_id ⇒ Object
readonly
Returns the value of attribute from_service_id.
-
#to_service_id ⇒ Object
readonly
Returns the value of attribute to_service_id.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ OrderServiceChangeForm
constructor
A new instance of OrderServiceChangeForm.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ OrderServiceChangeForm
Returns a new instance of OrderServiceChangeForm.
40501 40502 40503 40504 40505 40506 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40501 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:from_service_id, :to_service_id], 'OrderServiceChangeForm') @from_service_id = HttpClient::Preconditions.assert_class('from_service_id', opts.delete(:from_service_id), String) @to_service_id = HttpClient::Preconditions.assert_class('to_service_id', opts.delete(:to_service_id), String) end |
Instance Attribute Details
#from_service_id ⇒ Object (readonly)
Returns the value of attribute from_service_id.
40499 40500 40501 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40499 def from_service_id @from_service_id end |
#to_service_id ⇒ Object (readonly)
Returns the value of attribute to_service_id.
40499 40500 40501 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40499 def to_service_id @to_service_id end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
40512 40513 40514 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40512 def copy(incoming={}) OrderServiceChangeForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
40516 40517 40518 40519 40520 40521 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40516 def to_hash { :from_service_id => from_service_id, :to_service_id => to_service_id } end |
#to_json ⇒ Object
40508 40509 40510 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40508 def to_json JSON.dump(to_hash) end |