class ShopifyAPI::Product

Attributes

body_html[R]
created_at[R]
handle[R]
id[R]
images[R]
options[R]
product_type[R]
published_at[R]
published_scope[R]
status[R]
tags[R]
template_suffix[R]
title[R]
updated_at[R]
variants[R]
vendor[R]

Public Class Methods

all( ids: nil, limit: nil, since_id: nil, title: nil, vendor: nil, handle: nil, product_type: nil, status: nil, collection_id: nil, created_at_min: nil, created_at_max: nil, updated_at_min: nil, updated_at_max: nil, published_at_min: nil, published_at_max: nil, published_status: nil, fields: nil, presentment_currencies: nil, session: ShopifyAPI::Context.active_session, **kwargs ) click to toggle source
# File lib/shopify_api/rest/resources/2022_04/product.rb, line 152
def all(
  ids: nil,
  limit: nil,
  since_id: nil,
  title: nil,
  vendor: nil,
  handle: nil,
  product_type: nil,
  status: nil,
  collection_id: nil,
  created_at_min: nil,
  created_at_max: nil,
  updated_at_min: nil,
  updated_at_max: nil,
  published_at_min: nil,
  published_at_max: nil,
  published_status: nil,
  fields: nil,
  presentment_currencies: nil,
  session: ShopifyAPI::Context.active_session,
  **kwargs
)
  response = base_find(
    session: session,
    ids: {},
    params: {ids: ids, limit: limit, since_id: since_id, title: title, vendor: vendor, handle: handle, product_type: product_type, status: status, collection_id: collection_id, created_at_min: created_at_min, created_at_max: created_at_max, updated_at_min: updated_at_min, updated_at_max: updated_at_max, published_at_min: published_at_min, published_at_max: published_at_max, published_status: published_status, fields: fields, presentment_currencies: presentment_currencies}.merge(kwargs).compact,
  )

  T.cast(response, T::Array[Product])
end
count( vendor: nil, product_type: nil, collection_id: nil, created_at_min: nil, created_at_max: nil, updated_at_min: nil, updated_at_max: nil, published_at_min: nil, published_at_max: nil, published_status: nil, session: ShopifyAPI::Context.active_session, **kwargs ) click to toggle source
# File lib/shopify_api/rest/resources/2022_04/product.rb, line 199
def count(
  vendor: nil,
  product_type: nil,
  collection_id: nil,
  created_at_min: nil,
  created_at_max: nil,
  updated_at_min: nil,
  updated_at_max: nil,
  published_at_min: nil,
  published_at_max: nil,
  published_status: nil,
  session: ShopifyAPI::Context.active_session,
  **kwargs
)
  request(
    http_method: :get,
    operation: :count,
    session: session,
    ids: {},
    params: {vendor: vendor, product_type: product_type, collection_id: collection_id, created_at_min: created_at_min, created_at_max: created_at_max, updated_at_min: updated_at_min, updated_at_max: updated_at_max, published_at_min: published_at_min, published_at_max: published_at_max, published_status: published_status}.merge(kwargs).compact,
    body: {},
    entity: nil,
  )
end
delete( id:, session: ShopifyAPI::Context.active_session ) click to toggle source
# File lib/shopify_api/rest/resources/2022_04/product.rb, line 115
def delete(
  id:,
  session: ShopifyAPI::Context.active_session
)
  request(
    http_method: :delete,
    operation: :delete,
    session: session,
    ids: {id: id},
    params: {},
  )
end
find( id:, fields: nil, session: ShopifyAPI::Context.active_session ) click to toggle source
# File lib/shopify_api/rest/resources/2022_04/product.rb, line 96
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(Product))
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/product.rb, line 19
def initialize(session: ShopifyAPI::Context.active_session, from_hash: nil)

  @title = T.let(nil, T.nilable(String))
  @body_html = T.let(nil, T.nilable(String))
  @created_at = T.let(nil, T.nilable(String))
  @handle = T.let(nil, T.nilable(String))
  @id = T.let(nil, T.nilable(Integer))
  @images = T.let(nil, T.nilable(T::Array[T.untyped]))
  @options = T.let(nil, T.nilable(T.any(T::Hash[T.untyped, T.untyped], T::Array[T.untyped])))
  @product_type = T.let(nil, T.nilable(String))
  @published_at = T.let(nil, T.nilable(String))
  @published_scope = T.let(nil, T.nilable(String))
  @status = T.let(nil, T.nilable(String))
  @tags = T.let(nil, T.nilable(T.any(String, T::Array[T.untyped])))
  @template_suffix = T.let(nil, T.nilable(String))
  @updated_at = T.let(nil, T.nilable(String))
  @variants = T.let(nil, T.nilable(T::Array[T.untyped]))
  @vendor = T.let(nil, T.nilable(String))

  super(session: session, from_hash: from_hash)
end