Ramp.Departments (ramp v1.0.0)

Copy Markdown View Source

The Departments resource: full CRUD on organizational departments.

Summary

Functions

Creates a new department with the given name.

Deletes a department.

Fetches a single department by ID.

Returns a lazily auto-paginating Stream of Ramp.Departments.Departments.

Fetches a single page of departments. See Ramp.Page.

Renames an existing department.

Types

list_opt()

@type list_opt() :: {:start, String.t()} | {:page_size, pos_integer()}

Functions

create(client, name)

@spec create(Ramp.Client.t(), String.t()) ::
  {:ok, Ramp.Departments.Department.t()} | {:error, Ramp.Error.t()}

Creates a new department with the given name.

delete(client, id)

@spec delete(Ramp.Client.t(), String.t()) :: :ok | {:error, Ramp.Error.t()}

Deletes a department.

get(client, id)

@spec get(Ramp.Client.t(), String.t()) ::
  {:ok, Ramp.Departments.Department.t()} | {:error, Ramp.Error.t()}

Fetches a single department by ID.

list(client, opts \\ [])

Returns a lazily auto-paginating Stream of Ramp.Departments.Departments.

list_page(client, opts \\ [])

@spec list_page(Ramp.Client.t(), [list_opt()]) ::
  {:ok, Ramp.Page.t(Ramp.Departments.Department.t())} | {:error, Ramp.Error.t()}

Fetches a single page of departments. See Ramp.Page.

update(client, id, name)

@spec update(Ramp.Client.t(), String.t(), String.t()) ::
  {:ok, Ramp.Departments.Department.t()} | {:error, Ramp.Error.t()}

Renames an existing department.