class ShopifyAPI::Collection

Attributes

body_html[R]
handle[R]
id[R]
image[R]
published_at[R]
published_scope[R]
sort_order[R]
template_suffix[R]
title[R]
updated_at[R]

Public Class Methods

find( id:, fields: nil, session: ShopifyAPI::Context.active_session ) click to toggle source
# File lib/shopify_api/rest/resources/2022_04/collection.rb, line 73
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(Collection))
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.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))
  @handle = T.let(nil, T.nilable(String))
  @id = T.let(nil, T.nilable(Integer))
  @image = T.let(nil, T.nilable(Image))
  @published_at = T.let(nil, T.nilable(String))
  @published_scope = T.let(nil, T.nilable(String))
  @sort_order = T.let(nil, T.nilable(String))
  @template_suffix = T.let(nil, T.nilable(String))
  @updated_at = T.let(nil, T.nilable(String))

  super(session: session, from_hash: from_hash)
end
products( id:, limit: nil, session: ShopifyAPI::Context.active_session, **kwargs ) click to toggle source
# File lib/shopify_api/rest/resources/2022_04/collection.rb, line 94
def products(
  id:,
  limit: nil,
  session: ShopifyAPI::Context.active_session,
  **kwargs
)
  request(
    http_method: :get,
    operation: :products,
    session: session,
    ids: {id: id},
    params: {limit: limit}.merge(kwargs).compact,
    body: {},
    entity: nil,
  )
end