Class: Io::Flow::V0::Models::ShopifyVariantInventoryMetafield
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::ShopifyVariantInventoryMetafield
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
For enabled organizations, this indicates the total number of available units of inventory for customers in this experience.
Instance Attribute Summary collapse
-
#experience ⇒ Object
readonly
Returns the value of attribute experience.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ ShopifyVariantInventoryMetafield
constructor
A new instance of ShopifyVariantInventoryMetafield.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ ShopifyVariantInventoryMetafield
Returns a new instance of ShopifyVariantInventoryMetafield.
38695 38696 38697 38698 38699 38700 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38695 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:experience, :status], 'ShopifyVariantInventoryMetafield') @experience = (x = opts.delete(:experience); x.is_a?(::Io::Flow::V0::Models::ExperienceReference) ? x : ::Io::Flow::V0::Models::ExperienceReference.new(x)) @status = (x = opts.delete(:status); x.is_a?(::Io::Flow::V0::Models::ShopifyVariantInventoryMetafieldStatus) ? x : ::Io::Flow::V0::Models::ShopifyVariantInventoryMetafieldStatus.apply(x)) end |
Instance Attribute Details
#experience ⇒ Object (readonly)
Returns the value of attribute experience.
38693 38694 38695 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38693 def experience @experience end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
38693 38694 38695 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38693 def status @status end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
38706 38707 38708 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38706 def copy(incoming={}) ShopifyVariantInventoryMetafield.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
38710 38711 38712 38713 38714 38715 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38710 def to_hash { :experience => experience.to_hash, :status => status.value } end |
#to_json ⇒ Object
38702 38703 38704 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38702 def to_json JSON.dump(to_hash) end |