Current section
Files
Jump to
Current section
Files
lib/foyer_api/api/publisher.ex
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
# https://openapi-generator.tech
# Do not edit the class manually.
defmodule FoyerAPI.Api.Publisher do
@moduledoc """
API calls for all endpoints tagged `Publisher`.
"""
alias FoyerAPI.Connection
import FoyerAPI.RequestBuilder
@doc """
Get Publishers
Get an array of Publishers according to defined filter criteria
## Parameters
- connection (FoyerAPI.Connection): Connection to server
- opts (KeywordList): [optional] Optional parameters
- :filter (String.t):
## Returns
{:ok, [%Publisher{}, ...]} on success
{:error, Tesla.Env.t} on failure
"""
@spec get_publishers(Tesla.Env.client, keyword()) :: {:ok, nil} | {:ok, list(FoyerAPI.Model.Publisher.t)} | {:error, Tesla.Env.t}
def get_publishers(connection, opts \\ []) do
optional_params = %{
:filter => :headers
}
%{}
|> method(:get)
|> url("/Publisher")
|> add_optional_params(optional_params, opts)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> evaluate_response([
{ 200, [%FoyerAPI.Model.Publisher{}]},
{ 401, false}
])
end
@doc """
Post Publishers
Post an array of Publisher objects
## Parameters
- connection (FoyerAPI.Connection): Connection to server
- publisher (Publisher):
- opts (KeywordList): [optional] Optional parameters
## Returns
{:ok, FoyerAPI.Model.Publisher.t} on success
{:error, Tesla.Env.t} on failure
"""
@spec post_publishers(Tesla.Env.client, FoyerAPI.Model.Publisher.t, keyword()) :: {:ok, nil} | {:ok, FoyerAPI.Model.Publisher.t} | {:error, Tesla.Env.t}
def post_publishers(connection, publisher, _opts \\ []) do
%{}
|> method(:post)
|> url("/Publisher")
|> add_param(:body, :body, publisher)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> evaluate_response([
{ 200, %FoyerAPI.Model.Publisher{}},
{ 401, false}
])
end
@doc """
Refresh All Properties
Retrieve an array of urls for use to refresh all Publisher linked properties
## Parameters
- connection (FoyerAPI.Connection): Connection to server
- opts (KeywordList): [optional] Optional parameters
## Returns
{:ok, [%String{}, ...]} on success
{:error, Tesla.Env.t} on failure
"""
@spec refresh_all_properties(Tesla.Env.client, keyword()) :: {:ok, nil} | {:ok, list(String.t)} | {:error, Tesla.Env.t}
def refresh_all_properties(connection, _opts \\ []) do
%{}
|> method(:get)
|> url("/Publisher/refreshAllProperties")
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> evaluate_response([
{ 200, []},
{ 401, false}
])
end
@doc """
Update Notify
Update publisher notification endpoint to keep up to date on property feed
## Parameters
- connection (FoyerAPI.Connection): Connection to server
- update_notify_request (UpdateNotifyRequest):
- opts (KeywordList): [optional] Optional parameters
## Returns
{:ok, FoyerAPI.Model.Publisher.t} on success
{:error, Tesla.Env.t} on failure
"""
@spec update_notify(Tesla.Env.client, FoyerAPI.Model.UpdateNotifyRequest.t, keyword()) :: {:ok, nil} | {:ok, FoyerAPI.Model.Publisher.t} | {:error, Tesla.Env.t}
def update_notify(connection, update_notify_request, _opts \\ []) do
%{}
|> method(:post)
|> url("/Publisher/updateNotify")
|> add_param(:body, :body, update_notify_request)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> evaluate_response([
{ 200, %FoyerAPI.Model.Publisher{}},
{ 401, false}
])
end
end