ExShopify v0.2.0 ExShopify.Blog

Shopify’s blogging engine.

Summary

Functions

Get a count of all blogs

Create a new blog

Delete a blog

Get a single blog by its ID

Get a list of all blogs

Types

blog_plural()
blog_plural() :: {:ok, [%ExShopify.Blog{commentable: term, created_at: term, feedburner: term, feedburner_location: term, handle: term, id: term, metafields: term, tags: term, template_suffix: term, title: term, updated_at: term}], %ExShopify.Meta{api_call_limit: term}}
blog_singular()
blog_singular() :: {:ok, %ExShopify.Blog{commentable: term, created_at: term, feedburner: term, feedburner_location: term, handle: term, id: term, metafields: term, tags: term, template_suffix: term, title: term, updated_at: 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 all blogs

Examples

iex> ExShopify.Blog.count(session)
{: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) ::
  blog_singular |
  ExShopify.Resource.error

Create a new blog.

Examples

Create a new empty blog

iex> params = %ExShopify.Blog {
...>   title: "Apple main blog"
...> }

iex> ExShopify.Blog.create(session, params)
{:ok, blog, meta}

Create a new empty blog with a metafield

iex> params = %ExShopify.Blog{
...>   title: "Apple main blog",
...>   metafields: [
...>     %ExShopify.Metafield{
...>       key: "new",
...>       value: "newvalue",
...>       value_type: "string",
...>       namespace: "global"
...>     }
...>   ]
...> }

iex> ExShopify.Blog.create(session, params)
{:ok, blog, 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 blog.

Examples

iex > ExShopify.Blog.delete(session, 241253187)
{: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) ::
  blog_singular |
  ExShopify.Resource.error
find(session, id, params)
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, map) ::
  blog_singular |
  ExShopify.Resource.error

Get a single blog by its ID.

Examples

Get a single blog

iex> ExShopify.Blog.find(session, 241253187)
{:ok, blog, 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}) ::
  blog_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) ::
  blog_plural |
  ExShopify.Resource.error

Get a list of all blogs

Examples

Get all blogs for a shop

iex > ExShopify.Blog.list(session)
{:ok, blogs, meta}

Get all blogs for a shop after a specified ID

iex> ExShopify.Blog.list(session, %{since_id: 241253187})
{:ok, blogs, meta}
response_mapping()
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) ::
  blog_singular |
  ExShopify.Resource.error

Update a blog.

Examples

iex> params = %{
...>   title: "IPod Updates",
...>   handle: "ipod-updates",
...>   commentable: "moderate"
...> }

iex> ExShopify.Blog.update(session, 241253187, params)
{:ok, blog, meta}