Packages
The Elixir SDK for the Thinkific Admin API
Current section
Files
Jump to
Current section
Files
lib/thinkific_admin_api/api/instructors.ex
# NOTE: This class is auto generated by the swagger code generator program.
# https://github.com/swagger-api/swagger-codegen.git
# Do not edit the class manually.
defmodule ThinkificAdminAPI.Api.Instructors do
@moduledoc """
API calls for all endpoints tagged `Instructors`.
"""
alias ThinkificAdminAPI.Connection
import ThinkificAdminAPI.RequestBuilder
@doc """
createInstructor
Creates a new Instructor
## Parameters
- connection (ThinkificAdminAPI.Connection): Connection to server
- body (InstructorRequest): New instructor attributes
- opts (KeywordList): [optional] Optional parameters
## Returns
{:ok, %ThinkificAdminAPI.Model.InstructorResponse{}} on success
{:error, info} on failure
"""
@spec create_instructor(Tesla.Env.client, ThinkificAdminAPI.Model.InstructorRequest.t, keyword()) :: {:ok, ThinkificAdminAPI.Model.InstructorResponse.t} | {:error, Tesla.Env.t}
def create_instructor(connection, body, _opts \\ []) do
%{}
|> method(:post)
|> url("/instructors")
|> add_param(:body, :"body", body)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> decode(%ThinkificAdminAPI.Model.InstructorResponse{})
end
@doc """
deleteInstructorByID
Delete the Instructor identified by the provided id
## Parameters
- connection (ThinkificAdminAPI.Connection): Connection to server
- id (float()): ID of the Instructor in the form of an integer
- opts (KeywordList): [optional] Optional parameters
## Returns
{:ok, %{}} on success
{:error, info} on failure
"""
@spec delete_instructor_by_id(Tesla.Env.client, float(), keyword()) :: {:ok, nil} | {:error, Tesla.Env.t}
def delete_instructor_by_id(connection, id, _opts \\ []) do
%{}
|> method(:delete)
|> url("/instructor/#{id}")
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> decode(false)
end
@doc """
getInstructorByID
Returns the Instructor identified by the provided id.
## Parameters
- connection (ThinkificAdminAPI.Connection): Connection to server
- id (float()): ID of the Instructor in the form of an integer.
- opts (KeywordList): [optional] Optional parameters
## Returns
{:ok, %ThinkificAdminAPI.Model.InstructorResponse{}} on success
{:error, info} on failure
"""
@spec get_instructor_by_id(Tesla.Env.client, float(), keyword()) :: {:ok, ThinkificAdminAPI.Model.InstructorResponse.t} | {:error, Tesla.Env.t}
def get_instructor_by_id(connection, id, _opts \\ []) do
%{}
|> method(:get)
|> url("/instructor/#{id}")
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> decode(%ThinkificAdminAPI.Model.InstructorResponse{})
end
@doc """
getInstructors
Retrieve a list of Instructors
## Parameters
- connection (ThinkificAdminAPI.Connection): Connection to server
- opts (KeywordList): [optional] Optional parameters
- :page (float()): The page within the collection to fetch.
- :limit (float()): The number of items to be returned.
## Returns
{:ok, %ThinkificAdminAPI.Model.GetInstructorsResponse{}} on success
{:error, info} on failure
"""
@spec get_instructors(Tesla.Env.client, keyword()) :: {:ok, ThinkificAdminAPI.Model.GetInstructorsResponse.t} | {:error, Tesla.Env.t}
def get_instructors(connection, opts \\ []) do
optional_params = %{
:"page" => :query,
:"limit" => :query
}
%{}
|> method(:get)
|> url("/instructors")
|> add_optional_params(optional_params, opts)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> decode(%ThinkificAdminAPI.Model.GetInstructorsResponse{})
end
@doc """
updateInstructor
Updates the Instructor identified by the provided id
## Parameters
- connection (ThinkificAdminAPI.Connection): Connection to server
- id (float()): ID of the Instructor in the form of an integer
- body (InstructorRequest): New instructor attributes
- opts (KeywordList): [optional] Optional parameters
## Returns
{:ok, %ThinkificAdminAPI.Model.InstructorResponse{}} on success
{:error, info} on failure
"""
@spec update_instructor(Tesla.Env.client, float(), ThinkificAdminAPI.Model.InstructorRequest.t, keyword()) :: {:ok, ThinkificAdminAPI.Model.InstructorResponse.t} | {:error, Tesla.Env.t}
def update_instructor(connection, id, body, _opts \\ []) do
%{}
|> method(:put)
|> url("/instructor/#{id}")
|> add_param(:body, :"body", body)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> decode(%ThinkificAdminAPI.Model.InstructorResponse{})
end
end