# 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 Thinkific.Api.Instructors do @moduledoc """ API calls for all endpoints tagged `Instructors`. """ alias Thinkific.Connection import Thinkific.RequestBuilder @doc """ createInstructor Creates a new Instructor ## Parameters - connection (Thinkific.Connection): Connection to server - body (InstructorRequest): New instructor attributes - opts (KeywordList): [optional] Optional parameters ## Returns {:ok, %Thinkific.Model.InstructorResponse{}} on success {:error, info} on failure """ @spec create_instructor(Tesla.Env.client, Thinkific.Model.InstructorRequest.t, keyword()) :: {:ok, Thinkific.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(%Thinkific.Model.InstructorResponse{}) end @doc """ deleteInstructorByID Delete the Instructor identified by the provided id ## Parameters - connection (Thinkific.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 (Thinkific.Connection): Connection to server - id (float()): ID of the Instructor in the form of an integer. - opts (KeywordList): [optional] Optional parameters ## Returns {:ok, %Thinkific.Model.InstructorResponse{}} on success {:error, info} on failure """ @spec get_instructor_by_id(Tesla.Env.client, float(), keyword()) :: {:ok, Thinkific.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(%Thinkific.Model.InstructorResponse{}) end @doc """ getInstructors Retrieve a list of Instructors ## Parameters - connection (Thinkific.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, %Thinkific.Model.GetInstructorsResponse{}} on success {:error, info} on failure """ @spec get_instructors(Tesla.Env.client, keyword()) :: {:ok, Thinkific.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(%Thinkific.Model.GetInstructorsResponse{}) end @doc """ updateInstructor Updates the Instructor identified by the provided id ## Parameters - connection (Thinkific.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, %Thinkific.Model.InstructorResponse{}} on success {:error, info} on failure """ @spec update_instructor(Tesla.Env.client, float(), Thinkific.Model.InstructorRequest.t, keyword()) :: {:ok, Thinkific.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(%Thinkific.Model.InstructorResponse{}) end end