ExShopify v0.2.0 ExShopify.Comment
Reader’s response to an article in a blog.
Summary
Functions
Approve a comment that is currently pending
Get a count of all comments for an article
Create a new comment for an article
Get a single comment by its id
Get a list of all comments for an article
Mark a comment as not spam
Mark a comment as spam
Remove a comment
Restore a comment
Update a comment of an article within a blog
Types
comment_plural()
comment_plural() :: {:ok, [%ExShopify.Comment{article_id: term, author: term, blog_id: term, body: term, body_html: term, created_at: term, email: term, id: term, ip: term, published_at: term, status: term, updated_at: term, user_agent: term}], %ExShopify.Meta{api_call_limit: term}}
comment_singular()
comment_singular() :: {:ok, %ExShopify.Comment{article_id: term, author: term, blog_id: term, body: term, body_html: term, created_at: term, email: term, id: term, ip: term, published_at: term, status: term, updated_at: term, user_agent: term}, %ExShopify.Meta{api_call_limit: term}}
Functions
approve(session, id)
approve(%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) :: comment_singular | ExShopify.Resource.error
Approve a comment that is currently pending.
Examples
iex> ExShopify.Comment.approve(session, 653537639)
{:ok, comment, meta}
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
count(session, params)
count(%ExShopify.Session{access_token: term, api_key: term, domain: term, port: term, protocol: term, secret: term, shop_name: term, shop_url: term}, map) :: ExShopify.Resource.count | ExShopify.Resource.error
Get a count of all comments for an article.
Examples
Get a count of all the comments for this shop
iex> ExShopify.Comment.count(session)
{:ok, count, meta}
Count all comments for a certain article of a blog
iex> ExShopify.Comment.count(session, %{blog_id: 241253187, article_id: 134645308})
{:ok, count, meta}
create(session, params)
create(%ExShopify.Comment{article_id: term, author: term, blog_id: term, body: term, body_html: term, created_at: term, email: term, id: term, ip: term, published_at: term, status: term, updated_at: term, user_agent: term}, map) :: comment_singular | ExShopify.Resource.error
Create a new comment for an article.
Examples
iex> params = %ExShopify.Comment{
...> body: "I like comments\nAnd I like posting them *RESTfully*.",
...> author: "Your name",
...> email: "your@email.com",
...> ip: "107.20.160.121",
...> blog_id: 241253187,
...> article_id: 134645308
...> }
iex> ExShopify.Comment.create(session, params)
{:ok, comment, 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) :: comment_singular | ExShopify.Resource.error
Get a single comment by its id.
Examples
iex> ExShopify.Comment.find(session, 118373535)
{:ok, comment, 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}) :: comment_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) :: comment_plural | ExShopify.Resource.error
Get a list of all comments for an article.
Examples
Get all the comments for this shop
iex> ExShopify.Comment.list(session)
{:ok, comments, meta}
Get all the comments for all the articles of a certain blog
iex> ExShopify.Comment.list(session, %{blog_id: 241253187})
{:ok, comments, meta}
Get all the comments for a certain article of a blog
iex> ExShopify.Comment.list(session, %{blog_id: 241253187, article_id: 134645308})
mark_as_not_spam(session, id)
mark_as_not_spam(%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) :: comment_singular | ExShopify.Resource.error
Mark a comment as not spam.
Examples
iex> ExShopify.Comment.mark_as_not_spam(session, 653537639)
{:ok, comment, meta}
mark_as_spam(session, id)
mark_as_spam(%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) :: comment_singular | ExShopify.Resource.error
Mark a comment as spam.
Examples
iex> ExShopify.Comment.mark_as_span(session, 653537639)
{:ok, comment, meta}
remove(session, id)
remove(%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) :: comment_singular | ExShopify.Resource.error
Remove a comment.
Examples
iex> ExShopify.Comment.remove(session, 653537639)
{:ok, comment, meta}
restore(session, id)
restore(%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) :: comment_singular | ExShopify.Resource.error
Restore a comment
Examples
iex> ExShopify.Comment.restore(session, 653537639)
{:ok, comment, 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, %{}) :: comment_singular | ExShopify.Resource.error
Update a comment of an article within a blog
Examples
iex> params = %{
...> body: "You can even update through a web service.",
...> author: "Your new name",
...> email: "your@updated-email.com",
...> published_at: "2016-11-09T18:42:55.227Z"
...> }
iex> ExShopify.Comment.update(session, 118373535, params)
{:ok, comment, meta}