This module provides functions for managing space (team/department) resources in the Humaans API.
Summary
Functions
Creates a new space.
Deletes a specific space by ID.
Lists all spaces.
Retrieves a specific space by ID.
Updates a specific space by ID.
Types
Functions
@spec create(client :: map(), params :: map() | keyword()) :: {:ok, Humaans.Resources.Space.t()} | {:error, Humaans.Error.t()}
Creates a new space.
Parameters
client- Client created withHumaans.new/1params- Map of attributes for the new space
Examples
client = Humaans.new(access_token: "your_access_token")
params = %{name: "Engineering"}
{:ok, space} = Humaans.Spaces.create(client, params)
@spec delete(client :: map(), id :: String.t()) :: {:ok, %{id: String.t(), deleted: boolean()}} | {:error, Humaans.Error.t()}
Deletes a specific space by ID.
Parameters
client- Client created withHumaans.new/1id- String ID of the space to delete
Examples
client = Humaans.new(access_token: "your_access_token")
{:ok, %{id: "space_id", deleted: true}} = Humaans.Spaces.delete(client, "space_id")
@spec list(client :: map(), params :: map() | keyword() | [{String.t(), term()}]) :: {:ok, [Humaans.Resources.Space.t()]} | {:error, Humaans.Error.t()}
Lists all spaces.
Returns a list of spaces matching the optional filter params.
Parameters
client- Client created withHumaans.new/1params- Optional map of filter parameters (default:%{})
Examples
client = Humaans.new(access_token: "your_access_token")
{:ok, spaces} = Humaans.Spaces.list(client)
{:ok, spaces} = Humaans.Spaces.list(client, %{})
@spec retrieve(client :: map(), id :: String.t()) :: {:ok, Humaans.Resources.Space.t()} | {:error, Humaans.Error.t()}
Retrieves a specific space by ID.
Parameters
client- Client created withHumaans.new/1id- String ID of the space to retrieve
Examples
client = Humaans.new(access_token: "your_access_token")
{:ok, space} = Humaans.Spaces.retrieve(client, "space_id")
@spec update(client :: map(), id :: String.t(), params :: map() | keyword()) :: {:ok, Humaans.Resources.Space.t()} | {:error, Humaans.Error.t()}
Updates a specific space by ID.
Parameters
client- Client created withHumaans.new/1id- String ID of the space to updateparams- Map of attributes to update
Examples
client = Humaans.new(access_token: "your_access_token")
params = %{name: "Platform Engineering"}
{:ok, space} = Humaans.Spaces.update(client, "space_id", params)