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
Delete a product 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
Update a product metafield
Types
Functions
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(%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(%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(%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(%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(%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(%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(%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(%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(%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(%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(%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(%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)