class Io::Flow::V0::Models::ShopifyCartChangeForm

Must provide either line or id. If you provide both, they must match

Attributes

id[R]
line[R]
properties[R]
quantity[R]

Public Class Methods

new(incoming={}) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 67184
def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:quantity], 'ShopifyCartChangeForm')
  @quantity = HttpClient::Preconditions.assert_class('quantity', opts.delete(:quantity), Integer)
  @line = (x = opts.delete(:line); x.nil? ? nil : HttpClient::Preconditions.assert_class('line', x, Integer))
  @id = (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Integer))
  @properties = (x = opts.delete(:properties); x.nil? ? nil : HttpClient::Preconditions.assert_class('properties', x, Hash).inject({}) { |h, d| h[d[0]] = HttpClient::Preconditions.assert_class('properties', d[1], String); h })
end

Public Instance Methods

copy(incoming={}) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 67197
def copy(incoming={})
  ShopifyCartChangeForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end
to_hash() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 67201
def to_hash
  {
    :quantity => quantity,
    :line => line,
    :id => id,
    :properties => properties.nil? ? nil : properties
  }
end
to_json() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 67193
def to_json
  JSON.dump(to_hash)
end