This module provides functions for listing and retrieving role resources in the Humaans API. Roles are read-only via the API.
Summary
Types
@type list_response() :: {:ok, [%Humaans.Resources.Role{id: term(), name: term()}]} | {:error, Humaans.Error.t()}
@type response() :: {:ok, %Humaans.Resources.Role{id: term(), name: term()}} | {:error, Humaans.Error.t()}
Functions
@spec list(client :: map(), params :: map() | keyword() | [{String.t(), term()}]) :: {:ok, [Humaans.Resources.Role.t()]} | {:error, Humaans.Error.t()}
Lists all roles.
Returns a list of roles 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, roles} = Humaans.Roles.list(client)
{:ok, roles} = Humaans.Roles.list(client, %{})
@spec retrieve(client :: map(), id :: String.t()) :: {:ok, Humaans.Resources.Role.t()} | {:error, Humaans.Error.t()}
Retrieves a specific role by ID.
Parameters
client- Client created withHumaans.new/1id- String ID of the role to retrieve
Examples
client = Humaans.new(access_token: "your_access_token")
{:ok, role} = Humaans.Roles.retrieve(client, "role_id")