class ShopifyAPI::Variant

Attributes

barcode[R]
compare_at_price[R]
created_at[R]
fulfillment_service[R]
grams[R]
id[R]
image_id[R]
inventory_item_id[R]
inventory_management[R]
inventory_policy[R]
inventory_quantity[R]
inventory_quantity_adjustment[R]
old_inventory_quantity[R]
option[R]
position[R]
presentment_prices[R]
price[R]
product_id[R]
requires_shipping[R]
sku[R]
tax_code[R]
taxable[R]
title[R]
updated_at[R]
weight[R]
weight_unit[R]

Public Class Methods

all( product_id: nil, limit: nil, presentment_currencies: nil, since_id: nil, fields: nil, session: ShopifyAPI::Context.active_session, **kwargs ) click to toggle source
# File lib/shopify_api/rest/resources/2022_04/variant.rb, line 172
def all(
  product_id: nil,
  limit: nil,
  presentment_currencies: nil,
  since_id: nil,
  fields: nil,
  session: ShopifyAPI::Context.active_session,
  **kwargs
)
  response = base_find(
    session: session,
    ids: {product_id: product_id},
    params: {limit: limit, presentment_currencies: presentment_currencies, since_id: since_id, fields: fields}.merge(kwargs).compact,
  )

  T.cast(response, T::Array[Variant])
end
count( product_id: nil, session: ShopifyAPI::Context.active_session, **kwargs ) click to toggle source
# File lib/shopify_api/rest/resources/2022_04/variant.rb, line 197
def count(
  product_id: nil,
  session: ShopifyAPI::Context.active_session,
  **kwargs
)
  request(
    http_method: :get,
    operation: :count,
    session: session,
    ids: {product_id: product_id},
    params: {}.merge(kwargs).compact,
    body: {},
    entity: nil,
  )
end
delete( id:, product_id: nil, session: ShopifyAPI::Context.active_session ) click to toggle source
# File lib/shopify_api/rest/resources/2022_04/variant.rb, line 147
def delete(
  id:,
  product_id: nil,
  session: ShopifyAPI::Context.active_session
)
  request(
    http_method: :delete,
    operation: :delete,
    session: session,
    ids: {id: id, product_id: product_id},
    params: {},
  )
end
find( id:, fields: nil, session: ShopifyAPI::Context.active_session ) click to toggle source
# File lib/shopify_api/rest/resources/2022_04/variant.rb, line 127
def find(
  id:,
  fields: nil,
  session: ShopifyAPI::Context.active_session
)
  result = base_find(
    session: session,
    ids: {id: id},
    params: {fields: fields},
  )
  T.cast(result[0], T.nilable(Variant))
end
new(session: ShopifyAPI::Context.active_session, from_hash: nil) click to toggle source
Calls superclass method ShopifyAPI::Rest::Base::new
# File lib/shopify_api/rest/resources/2022_04/variant.rb, line 19
def initialize(session: ShopifyAPI::Context.active_session, from_hash: nil)

  @barcode = T.let(nil, T.nilable(String))
  @compare_at_price = T.let(nil, T.nilable(String))
  @created_at = T.let(nil, T.nilable(String))
  @fulfillment_service = T.let(nil, T.nilable(String))
  @grams = T.let(nil, T.nilable(Integer))
  @id = T.let(nil, T.nilable(Integer))
  @image_id = T.let(nil, T.nilable(Integer))
  @inventory_item_id = T.let(nil, T.nilable(Integer))
  @inventory_management = T.let(nil, T.nilable(String))
  @inventory_policy = T.let(nil, T.nilable(String))
  @inventory_quantity = T.let(nil, T.nilable(T.any(Integer, String)))
  @inventory_quantity_adjustment = T.let(nil, T.nilable(T.any(Integer, String)))
  @old_inventory_quantity = T.let(nil, T.nilable(T.any(Integer, String)))
  @option = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
  @position = T.let(nil, T.nilable(Integer))
  @presentment_prices = T.let(nil, T.nilable(T::Array[T.untyped]))
  @price = T.let(nil, T.nilable(String))
  @product_id = T.let(nil, T.nilable(Integer))
  @requires_shipping = T.let(nil, T.nilable(T::Boolean))
  @sku = T.let(nil, T.nilable(String))
  @tax_code = T.let(nil, T.nilable(String))
  @taxable = T.let(nil, T.nilable(T::Boolean))
  @title = T.let(nil, T.nilable(String))
  @updated_at = T.let(nil, T.nilable(String))
  @weight = T.let(nil, T.nilable(Float))
  @weight_unit = T.let(nil, T.nilable(String))

  super(session: session, from_hash: from_hash)
end