Current section
Files
Jump to
Current section
Files
lib/foyer_api/api/share.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.Share do
@moduledoc """
API calls for all endpoints tagged `Share`.
"""
alias FoyerAPI.Connection
import FoyerAPI.RequestBuilder
@doc """
Delete Share By Id
Delete a specific Share with unique id
## Parameters
- connection (FoyerAPI.Connection): Connection to server
- id (integer()):
- opts (KeywordList): [optional] Optional parameters
## Returns
{:ok, nil} on success
{:error, Tesla.Env.t} on failure
"""
@spec delete_share_by_id(Tesla.Env.client, integer(), keyword()) :: {:ok, nil} | {:error, Tesla.Env.t}
def delete_share_by_id(connection, id, _opts \\ []) do
%{}
|> method(:delete)
|> url("/Share/#{id}")
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> evaluate_response([
{ 204, false},
{ 401, false}
])
end
@doc """
Find One Share
Find a single Share according to defined filter criteria
## Parameters
- connection (FoyerAPI.Connection): Connection to server
- filter (String.t):
- opts (KeywordList): [optional] Optional parameters
## Returns
{:ok, FoyerAPI.Model.Share.t} on success
{:error, Tesla.Env.t} on failure
"""
@spec find_one_share(Tesla.Env.client, String.t, keyword()) :: {:ok, nil} | {:ok, FoyerAPI.Model.Share.t} | {:error, Tesla.Env.t}
def find_one_share(connection, filter, _opts \\ []) do
%{}
|> method(:get)
|> url("/Share/findOne")
|> add_param(:headers, :filter, filter)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> evaluate_response([
{ 200, %FoyerAPI.Model.Share{}},
{ 401, false}
])
end
@doc """
Get Share By Id
Get a specific Share with unique id
## Parameters
- connection (FoyerAPI.Connection): Connection to server
- id (integer()):
- opts (KeywordList): [optional] Optional parameters
- :filter (String.t):
## Returns
{:ok, FoyerAPI.Model.Share.t} on success
{:error, Tesla.Env.t} on failure
"""
@spec get_share_by_id(Tesla.Env.client, integer(), keyword()) :: {:ok, nil} | {:ok, FoyerAPI.Model.Share.t} | {:error, Tesla.Env.t}
def get_share_by_id(connection, id, opts \\ []) do
optional_params = %{
:filter => :headers
}
%{}
|> method(:get)
|> url("/Share/#{id}")
|> add_optional_params(optional_params, opts)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> evaluate_response([
{ 200, %FoyerAPI.Model.Share{}},
{ 401, false}
])
end
@doc """
Get Shares
Get an array of shares according to defined filter criteria
## Parameters
- connection (FoyerAPI.Connection): Connection to server
- opts (KeywordList): [optional] Optional parameters
- :filter (String.t):
## Returns
{:ok, [%Share{}, ...]} on success
{:error, Tesla.Env.t} on failure
"""
@spec get_shares(Tesla.Env.client, keyword()) :: {:ok, nil} | {:ok, list(FoyerAPI.Model.Share.t)} | {:error, Tesla.Env.t}
def get_shares(connection, opts \\ []) do
optional_params = %{
:filter => :headers
}
%{}
|> method(:get)
|> url("/Share")
|> add_optional_params(optional_params, opts)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> evaluate_response([
{ 200, [%FoyerAPI.Model.Share{}]},
{ 401, false}
])
end
@doc """
Make Share
Make a share with specific contact information
## Parameters
- connection (FoyerAPI.Connection): Connection to server
- make_share_request (MakeShareRequest):
- opts (KeywordList): [optional] Optional parameters
## Returns
{:ok, FoyerAPI.Model.Share.t} on success
{:error, Tesla.Env.t} on failure
"""
@spec make_share(Tesla.Env.client, FoyerAPI.Model.MakeShareRequest.t, keyword()) :: {:ok, nil} | {:ok, FoyerAPI.Model.Share.t} | {:error, Tesla.Env.t}
def make_share(connection, make_share_request, _opts \\ []) do
%{}
|> method(:post)
|> url("/Share/makeShare")
|> add_param(:body, :body, make_share_request)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> evaluate_response([
{ 200, %FoyerAPI.Model.Share{}},
{ 401, false}
])
end
@doc """
Patch Share By Id
Patch a specific Share with unique id
## Parameters
- connection (FoyerAPI.Connection): Connection to server
- id (integer()):
- opts (KeywordList): [optional] Optional parameters
- :body ([FoyerAPI.Model.PatchDocument.t]):
## Returns
{:ok, FoyerAPI.Model.Share.t} on success
{:error, Tesla.Env.t} on failure
"""
@spec patch_share_by_id(Tesla.Env.client, integer(), keyword()) :: {:ok, nil} | {:ok, FoyerAPI.Model.Share.t} | {:error, Tesla.Env.t}
def patch_share_by_id(connection, id, opts \\ []) do
optional_params = %{
:body => :body
}
%{}
|> method(:patch)
|> url("/Share/#{id}")
|> add_optional_params(optional_params, opts)
|> ensure_body()
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> evaluate_response([
{ 200, %FoyerAPI.Model.Share{}},
{ 401, false}
])
end
@doc """
Post Shares
Post an array of Share objects
## Parameters
- connection (FoyerAPI.Connection): Connection to server
- share (Share):
- opts (KeywordList): [optional] Optional parameters
## Returns
{:ok, FoyerAPI.Model.Share.t} on success
{:error, Tesla.Env.t} on failure
"""
@spec post_shares(Tesla.Env.client, FoyerAPI.Model.Share.t, keyword()) :: {:ok, nil} | {:ok, FoyerAPI.Model.Share.t} | {:error, Tesla.Env.t}
def post_shares(connection, share, _opts \\ []) do
%{}
|> method(:post)
|> url("/Share")
|> add_param(:body, :body, share)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> evaluate_response([
{ 200, %FoyerAPI.Model.Share{}},
{ 401, false}
])
end
end