ExShopify v0.2.0 ExShopify.Metafield

Additional metadata to a store’s resources.

Summary

Functions

Get a count of metafields that belong to a store

Get a count of metafields that belong to a product

Create a new metafield for a store

Create a new metafield for a product

Delete a store metafield

Get a single store metafield by its id

Get a single product metafield by its id

Get metafields that belong to a store

Get metafields that belong to a product

Update a store metafield

Types

metafield_plural()
metafield_plural() :: {:ok, [%ExShopify.Metafield{created_at: term, description: term, id: term, key: term, namespace: term, owner_id: term, owner_resource: term, updated_at: term, value: term, value_type: term}], %ExShopify.Meta{api_call_limit: term}}
metafield_singular()
metafield_singular() :: {:ok, %ExShopify.Metafield{created_at: term, description: term, id: term, key: term, namespace: term, owner_id: term, owner_resource: term, updated_at: term, value: term, value_type: term}, %ExShopify.Meta{api_call_limit: term}}

Functions

count(session)
count(%ExShopify.Session{access_token: term, api_key: term, domain: term, port: term, protocol: term, secret: term, shop_name: term, shop_url: term}) ::
  ExShopify.Resource.count |
  ExShopify.Resource.error

Get a count of metafields that belong to a store.

Examples

iex> ExShopify.Metafield.count(session)
{:ok, count, meta}
count_from_product(session, product_id)
count_from_product(%ExShopify.Session{access_token: term, api_key: term, domain: term, port: term, protocol: term, secret: term, shop_name: term, shop_url: term}, integer | String.t) ::
  ExShopify.Resource.count |
  ExShopify.Resource.error

Get a count of metafields that belong to a product.

Examples

iex> ExShopify.Metafield.count(session, 632910392)
{:ok, count, meta}
create(session, params)
create(%ExShopify.Session{access_token: term, api_key: term, domain: term, port: term, protocol: term, secret: term, shop_name: term, shop_url: term}, map) ::
  metafield_singular |
  ExShopify.Resource.error

Create a new metafield for a store.

Examples

iex> params = %ExShopify.Metafield{
...>   namespace: "inventory",
...>   key: "warehouse",
...>   value: 25,
...>   value_type: "integer"
...> }

iex> ExShopify.Metafield.create(session, params)
{:ok, metafield, meta}
create_from_product(session, product_id, params)
create_from_product(%ExShopify.Session{access_token: term, api_key: term, domain: term, port: term, protocol: term, secret: term, shop_name: term, shop_url: term}, integer | String.t, map) ::
  metafield_singular |
  ExShopify.Resource.error

Create a new metafield for a product.

Examples

iex> params = %ExShopify.Metafield{
...>   namespace: "inventory",
...>   key: "warehouse",
...>   value: 25,
...>   value_type: "integer"
...> }

iex> ExShopify.Metafield.create_from_product(session, 632910392, params)
{:ok, metafield, meta}
delete(session, id)
delete(%ExShopify.Session{access_token: term, api_key: term, domain: term, port: term, protocol: term, secret: term, shop_name: term, shop_url: term}, integer | String.t) ::
  ExShopify.Resource.only_meta |
  ExShopify.Resource.error

Delete a store metafield.

Examples

iex> ExShopify.Metafield.delete(session, 721389482)
{:ok, meta}
delete_from_product(session, id, product_id)
delete_from_product(%ExShopify.Session{access_token: term, api_key: term, domain: term, port: term, protocol: term, secret: term, shop_name: term, shop_url: term}, integer | String.t, integer | String.t) ::
  ExShopify.Resource.only_meta |
  ExShopify.Resource.error

Delete a product metafield.

Examples

iex> ExShopify.Metafield.delete_from_product(session, 845366454, 632910392)
{:ok, meta}
find(session, id)
find(%ExShopify.Session{access_token: term, api_key: term, domain: term, port: term, protocol: term, secret: term, shop_name: term, shop_url: term}, integer | String.t) ::
  metafield_singular |
  ExShopify.Resource.error

Get a single store metafield by its id.

Examples

iex> ExShopify.Metafield.find(session, 721389482)
{:ok, metafield, meta}
find_from_product(session, id, product_id)
find_from_product(%ExShopify.Session{access_token: term, api_key: term, domain: term, port: term, protocol: term, secret: term, shop_name: term, shop_url: term}, integer | String.t, integer | String.t) ::
  metafield_singular |
  ExShopify.Resource.error

Get a single product metafield by its id.

Examples

iex> ExShopify.Metafield.find_from_product(session, 845366454, 632910392)
{:ok, metafield, meta}
list(session)
list(%ExShopify.Session{access_token: term, api_key: term, domain: term, port: term, protocol: term, secret: term, shop_name: term, shop_url: term}) ::
  metafield_plural |
  ExShopify.Resource.error
list(session, params)
list(%ExShopify.Session{access_token: term, api_key: term, domain: term, port: term, protocol: term, secret: term, shop_name: term, shop_url: term}, map) ::
  metafield_plural |
  ExShopify.Resource.error

Get metafields that belong to a store.

Examples

Get all metafields that belong to a store

iex> ExShopify.Metafield.list(session)
{:ok, metafields, meta}

Get metafields that belong to a product image

iex> params = %{
...>   metafield: %{
...>     owner_id: 850703190,
...>     owner_resource: "product_image"
...>   }
...> }

iex> ExShopify.Metafield.list(session, params)
list_from_product(session, product_id)
list_from_product(%ExShopify.Session{access_token: term, api_key: term, domain: term, port: term, protocol: term, secret: term, shop_name: term, shop_url: term}, integer | String.t) ::
  metafield_plural |
  ExShopify.Resource.error

Get metafields that belong to a product.

Examples

iex> ExShopify.Metafield.list_from_product(session, 632910392)
{:ok, metafields, meta}
update(session, id, params)
update(%ExShopify.Session{access_token: term, api_key: term, domain: term, port: term, protocol: term, secret: term, shop_name: term, shop_url: term}, integer | String.t, map) ::
  metafield_plural |
  ExShopify.Resource.error

Update a store metafield.

Examples

iex> params = %{value: "something new", value_type: "string"}

iex> ExShopify.Metafield.update(session, 721389482, params)
{:ok, metafield, meta}
update_from_product(session, id, product_id, params)
update_from_product(%ExShopify.Session{access_token: term, api_key: term, domain: term, port: term, protocol: term, secret: term, shop_name: term, shop_url: term}, integer | String.t, integer | String.t, map) ::
  metafield_singular |
  ExShopify.Resource.error

Update a product metafield.

Examples

iex> params = %{value: “something new”, value_type: “string”}

iex> ExShopify.Metafield.update_from_product(session, 845366454, 632910392, params)