class ShopifyAPI::ProductListing

Attributes

body_html[R]
created_at[R]
handle[R]
images[R]
options[R]
product_id[R]
product_type[R]
published_at[R]
tags[R]
title[R]
updated_at[R]
variants[R]
vendor[R]

Public Class Methods

all( product_ids: nil, limit: nil, collection_id: nil, updated_at_min: nil, handle: nil, session: ShopifyAPI::Context.active_session, **kwargs ) click to toggle source
# File lib/shopify_api/rest/resources/2022_04/product_listing.rb, line 135
def all(
  product_ids: nil,
  limit: nil,
  collection_id: nil,
  updated_at_min: nil,
  handle: nil,
  session: ShopifyAPI::Context.active_session,
  **kwargs
)
  response = base_find(
    session: session,
    ids: {},
    params: {product_ids: product_ids, limit: limit, collection_id: collection_id, updated_at_min: updated_at_min, handle: handle}.merge(kwargs).compact,
  )

  T.cast(response, T::Array[ProductListing])
end
count( session: ShopifyAPI::Context.active_session, **kwargs ) click to toggle source
# File lib/shopify_api/rest/resources/2022_04/product_listing.rb, line 159
def count(
  session: ShopifyAPI::Context.active_session,
  **kwargs
)
  request(
    http_method: :get,
    operation: :count,
    session: session,
    ids: {},
    params: {}.merge(kwargs).compact,
    body: {},
    entity: nil,
  )
end
delete( product_id:, session: ShopifyAPI::Context.active_session ) click to toggle source
# File lib/shopify_api/rest/resources/2022_04/product_listing.rb, line 111
def delete(
  product_id:,
  session: ShopifyAPI::Context.active_session
)
  request(
    http_method: :delete,
    operation: :delete,
    session: session,
    ids: {product_id: product_id},
    params: {},
  )
end
find( product_id:, session: ShopifyAPI::Context.active_session ) click to toggle source
# File lib/shopify_api/rest/resources/2022_04/product_listing.rb, line 93
def find(
  product_id:,
  session: ShopifyAPI::Context.active_session
)
  result = base_find(
    session: session,
    ids: {product_id: product_id},
    params: {},
  )
  T.cast(result[0], T.nilable(ProductListing))
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_listing.rb, line 19
def initialize(session: ShopifyAPI::Context.active_session, from_hash: nil)

  @body_html = T.let(nil, T.nilable(String))
  @created_at = T.let(nil, T.nilable(String))
  @handle = T.let(nil, T.nilable(String))
  @images = T.let(nil, T.nilable(T::Array[T.untyped]))
  @options = T.let(nil, T.nilable(T::Array[T.untyped]))
  @product_id = T.let(nil, T.nilable(Integer))
  @product_type = T.let(nil, T.nilable(String))
  @published_at = T.let(nil, T.nilable(String))
  @tags = T.let(nil, T.nilable(String))
  @title = 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
primary_key() click to toggle source
# File lib/shopify_api/rest/resources/2022_04/product_listing.rb, line 83
def primary_key()
  "product_id"
end
product_ids( limit: nil, session: ShopifyAPI::Context.active_session, **kwargs ) click to toggle source
# File lib/shopify_api/rest/resources/2022_04/product_listing.rb, line 181
def product_ids(
  limit: nil,
  session: ShopifyAPI::Context.active_session,
  **kwargs
)
  request(
    http_method: :get,
    operation: :product_ids,
    session: session,
    ids: {},
    params: {limit: limit}.merge(kwargs).compact,
    body: {},
    entity: nil,
  )
end