class ShopifyAPI::CollectionListing

Attributes

body_html[R]
collection_id[R]
default_product_image[R]
handle[R]
image[R]
published_at[R]
sort_order[R]
title[R]
updated_at[R]

Public Class Methods

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

  T.cast(response, T::Array[CollectionListing])
end
delete( collection_id:, session: ShopifyAPI::Context.active_session ) click to toggle source
# File lib/shopify_api/rest/resources/2022_04/collection_listing.rb, line 97
def delete(
  collection_id:,
  session: ShopifyAPI::Context.active_session
)
  request(
    http_method: :delete,
    operation: :delete,
    session: session,
    ids: {collection_id: collection_id},
    params: {},
  )
end
find( collection_id:, session: ShopifyAPI::Context.active_session ) click to toggle source
# File lib/shopify_api/rest/resources/2022_04/collection_listing.rb, line 79
def find(
  collection_id:,
  session: ShopifyAPI::Context.active_session
)
  result = base_find(
    session: session,
    ids: {collection_id: collection_id},
    params: {},
  )
  T.cast(result[0], T.nilable(CollectionListing))
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/collection_listing.rb, line 19
def initialize(session: ShopifyAPI::Context.active_session, from_hash: nil)

  @body_html = T.let(nil, T.nilable(String))
  @collection_id = T.let(nil, T.nilable(Integer))
  @default_product_image = T.let(nil, T.nilable(T::Array[T.untyped]))
  @handle = T.let(nil, T.nilable(String))
  @image = T.let(nil, T.nilable(Image))
  @published_at = T.let(nil, T.nilable(String))
  @sort_order = T.let(nil, T.nilable(String))
  @title = T.let(nil, T.nilable(String))
  @updated_at = 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/collection_listing.rb, line 69
def primary_key()
  "collection_id"
end
product_ids( collection_id:, limit: nil, session: ShopifyAPI::Context.active_session, **kwargs ) click to toggle source
# File lib/shopify_api/rest/resources/2022_04/collection_listing.rb, line 139
def product_ids(
  collection_id:,
  limit: nil,
  session: ShopifyAPI::Context.active_session,
  **kwargs
)
  request(
    http_method: :get,
    operation: :product_ids,
    session: session,
    ids: {collection_id: collection_id},
    params: {limit: limit}.merge(kwargs).compact,
    body: {},
    entity: nil,
  )
end