class ShopifyAPI::Metafield

Attributes

article_id[R]
blog_id[R]
collection_id[R]
created_at[R]
customer_id[R]
description[R]
draft_order_id[R]
id[R]
key[R]
namespace[R]
order_id[R]
owner_id[R]
owner_resource[R]
page_id[R]
product_id[R]
product_image_id[R]
type[R]
updated_at[R]
value[R]
variant_id[R]

Public Class Methods

all( article_id: nil, blog_id: nil, collection_id: nil, customer_id: nil, draft_order_id: nil, order_id: nil, page_id: nil, product_image_id: nil, product_id: nil, variant_id: nil, limit: nil, since_id: nil, created_at_min: nil, created_at_max: nil, updated_at_min: nil, updated_at_max: nil, namespace: nil, key: nil, type: nil, fields: nil, metafield: nil, session: ShopifyAPI::Context.active_session, **kwargs ) click to toggle source
# File lib/shopify_api/rest/resources/2022_04/metafield.rb, line 270
def all(
  article_id: nil,
  blog_id: nil,
  collection_id: nil,
  customer_id: nil,
  draft_order_id: nil,
  order_id: nil,
  page_id: nil,
  product_image_id: nil,
  product_id: nil,
  variant_id: nil,
  limit: nil,
  since_id: nil,
  created_at_min: nil,
  created_at_max: nil,
  updated_at_min: nil,
  updated_at_max: nil,
  namespace: nil,
  key: nil,
  type: nil,
  fields: nil,
  metafield: nil,
  session: ShopifyAPI::Context.active_session,
  **kwargs
)
  response = base_find(
    session: session,
    ids: {article_id: article_id, blog_id: blog_id, collection_id: collection_id, customer_id: customer_id, draft_order_id: draft_order_id, order_id: order_id, page_id: page_id, product_image_id: product_image_id, product_id: product_id, variant_id: variant_id},
    params: {limit: limit, since_id: since_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, namespace: namespace, key: key, type: type, fields: fields, metafield: metafield}.merge(kwargs).compact,
  )

  T.cast(response, T::Array[Metafield])
end
count( article_id: nil, blog_id: nil, collection_id: nil, customer_id: nil, draft_order_id: nil, order_id: nil, page_id: nil, product_image_id: nil, product_id: nil, variant_id: nil, session: ShopifyAPI::Context.active_session, **kwargs ) click to toggle source
# File lib/shopify_api/rest/resources/2022_04/metafield.rb, line 320
def count(
  article_id: nil,
  blog_id: nil,
  collection_id: nil,
  customer_id: nil,
  draft_order_id: nil,
  order_id: nil,
  page_id: nil,
  product_image_id: nil,
  product_id: nil,
  variant_id: nil,
  session: ShopifyAPI::Context.active_session,
  **kwargs
)
  request(
    http_method: :get,
    operation: :count,
    session: session,
    ids: {article_id: article_id, blog_id: blog_id, collection_id: collection_id, customer_id: customer_id, draft_order_id: draft_order_id, order_id: order_id, page_id: page_id, product_image_id: product_image_id, product_id: product_id, variant_id: variant_id},
    params: {}.merge(kwargs).compact,
    body: {},
    entity: nil,
  )
end
delete( id:, article_id: nil, blog_id: nil, collection_id: nil, customer_id: nil, draft_order_id: nil, order_id: nil, page_id: nil, product_image_id: nil, product_id: nil, variant_id: nil, session: ShopifyAPI::Context.active_session ) click to toggle source
# File lib/shopify_api/rest/resources/2022_04/metafield.rb, line 220
def delete(
  id:,
  article_id: nil,
  blog_id: nil,
  collection_id: nil,
  customer_id: nil,
  draft_order_id: nil,
  order_id: nil,
  page_id: nil,
  product_image_id: nil,
  product_id: nil,
  variant_id: nil,
  session: ShopifyAPI::Context.active_session
)
  request(
    http_method: :delete,
    operation: :delete,
    session: session,
    ids: {id: id, article_id: article_id, blog_id: blog_id, collection_id: collection_id, customer_id: customer_id, draft_order_id: draft_order_id, order_id: order_id, page_id: page_id, product_image_id: product_image_id, product_id: product_id, variant_id: variant_id},
    params: {},
  )
end
find( id:, article_id: nil, blog_id: nil, collection_id: nil, customer_id: nil, draft_order_id: nil, order_id: nil, page_id: nil, product_image_id: nil, product_id: nil, variant_id: nil, fields: nil, session: ShopifyAPI::Context.active_session ) click to toggle source
# File lib/shopify_api/rest/resources/2022_04/metafield.rb, line 181
def find(
  id:,
  article_id: nil,
  blog_id: nil,
  collection_id: nil,
  customer_id: nil,
  draft_order_id: nil,
  order_id: nil,
  page_id: nil,
  product_image_id: nil,
  product_id: nil,
  variant_id: nil,
  fields: nil,
  session: ShopifyAPI::Context.active_session
)
  result = base_find(
    session: session,
    ids: {id: id, article_id: article_id, blog_id: blog_id, collection_id: collection_id, customer_id: customer_id, draft_order_id: draft_order_id, order_id: order_id, page_id: page_id, product_image_id: product_image_id, product_id: product_id, variant_id: variant_id},
    params: {fields: fields},
  )
  T.cast(result[0], T.nilable(Metafield))
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/metafield.rb, line 19
def initialize(session: ShopifyAPI::Context.active_session, from_hash: nil)

  @key = T.let(nil, T.nilable(String))
  @namespace = T.let(nil, T.nilable(String))
  @value = T.let(nil, T.nilable(T.any(String, Integer, Float, T::Boolean, String)))
  @article_id = T.let(nil, T.nilable(Integer))
  @blog_id = T.let(nil, T.nilable(Integer))
  @collection_id = T.let(nil, T.nilable(Integer))
  @created_at = T.let(nil, T.nilable(String))
  @customer_id = T.let(nil, T.nilable(Integer))
  @description = T.let(nil, T.nilable(String))
  @draft_order_id = T.let(nil, T.nilable(Integer))
  @id = T.let(nil, T.nilable(Integer))
  @order_id = T.let(nil, T.nilable(Integer))
  @owner_id = T.let(nil, T.nilable(Integer))
  @owner_resource = T.let(nil, T.nilable(String))
  @page_id = T.let(nil, T.nilable(Integer))
  @product_id = T.let(nil, T.nilable(Integer))
  @product_image_id = T.let(nil, T.nilable(Integer))
  @type = T.let(nil, T.nilable(String))
  @updated_at = T.let(nil, T.nilable(String))
  @variant_id = T.let(nil, T.nilable(Integer))

  super(session: session, from_hash: from_hash)
end