Class: Io::Flow::V0::Models::ShippingConfigurationItemAvailability
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::ShippingConfigurationItemAvailability
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Denormalized availability status of an item in a shipping configuration for a destination region
Instance Attribute Summary collapse
-
#availabilities ⇒ Object
readonly
Returns the value of attribute availabilities.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#item ⇒ Object
readonly
Returns the value of attribute item.
-
#shipping_configuration ⇒ Object
readonly
Returns the value of attribute shipping_configuration.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ ShippingConfigurationItemAvailability
constructor
A new instance of ShippingConfigurationItemAvailability.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ ShippingConfigurationItemAvailability
Returns a new instance of ShippingConfigurationItemAvailability.
66091 66092 66093 66094 66095 66096 66097 66098 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 66091 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:id, :item, :shipping_configuration, :availabilities], 'ShippingConfigurationItemAvailability') @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String) @item = (x = opts.delete(:item); x.is_a?(::Io::Flow::V0::Models::ItemReference) ? x : ::Io::Flow::V0::Models::ItemReference.new(x)) @shipping_configuration = (x = opts.delete(:shipping_configuration); x.is_a?(::Io::Flow::V0::Models::ShippingConfigurationSummary) ? x : ::Io::Flow::V0::Models::ShippingConfigurationSummary.new(x)) @availabilities = HttpClient::Preconditions.assert_class('availabilities', opts.delete(:availabilities), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::CountryAvailability) ? x : ::Io::Flow::V0::Models::CountryAvailability.new(x)) } end |
Instance Attribute Details
#availabilities ⇒ Object (readonly)
Returns the value of attribute availabilities.
66089 66090 66091 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 66089 def availabilities @availabilities end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
66089 66090 66091 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 66089 def id @id end |
#item ⇒ Object (readonly)
Returns the value of attribute item.
66089 66090 66091 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 66089 def item @item end |
#shipping_configuration ⇒ Object (readonly)
Returns the value of attribute shipping_configuration.
66089 66090 66091 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 66089 def shipping_configuration @shipping_configuration end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
66104 66105 66106 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 66104 def copy(incoming={}) ShippingConfigurationItemAvailability.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
66108 66109 66110 66111 66112 66113 66114 66115 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 66108 def to_hash { :id => id, :item => item.to_hash, :shipping_configuration => shipping_configuration.to_hash, :availabilities => availabilities.map { |o| o.to_hash } } end |
#to_json ⇒ Object
66100 66101 66102 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 66100 def to_json JSON.dump(to_hash) end |