This module provides functions for managing equipment resources in the Humaans API.
Summary
Functions
Creates a new equipment.
Deletes a specific equipment by ID.
Lists all equipment.
Retrieves a specific equipment by ID.
Updates a specific equipment by ID.
Types
Functions
@spec create(client :: map(), params :: map() | keyword()) :: {:ok, Humaans.Resources.Equipment.t()} | {:error, Humaans.Error.t()}
Creates a new equipment.
Parameters
client- Client created withHumaans.new/1params- Map of attributes for the new equipment
Examples
client = Humaans.new(access_token: "your_access_token")
params = %{personId: "person_abc", equipmentTypeId: "type_abc", equipmentNameId: "name_abc", serialNumber: "ABC-123"}
{:ok, equipment} = Humaans.Equipment.create(client, params)
@spec delete(client :: map(), id :: String.t()) :: {:ok, %{id: String.t(), deleted: boolean()}} | {:error, Humaans.Error.t()}
Deletes a specific equipment by ID.
Parameters
client- Client created withHumaans.new/1id- String ID of the equipment to delete
Examples
client = Humaans.new(access_token: "your_access_token")
{:ok, %{id: "equipment_id", deleted: true}} = Humaans.Equipment.delete(client, "equipment_id")
@spec list(client :: map(), params :: map() | keyword() | [{String.t(), term()}]) :: {:ok, [Humaans.Resources.Equipment.t()]} | {:error, Humaans.Error.t()}
Lists all equipment.
Returns a list of equipment 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, equipment} = Humaans.Equipment.list(client)
{:ok, equipment} = Humaans.Equipment.list(client, %{})
@spec retrieve(client :: map(), id :: String.t()) :: {:ok, Humaans.Resources.Equipment.t()} | {:error, Humaans.Error.t()}
Retrieves a specific equipment by ID.
Parameters
client- Client created withHumaans.new/1id- String ID of the equipment to retrieve
Examples
client = Humaans.new(access_token: "your_access_token")
{:ok, equipment} = Humaans.Equipment.retrieve(client, "equipment_id")
@spec update(client :: map(), id :: String.t(), params :: map() | keyword()) :: {:ok, Humaans.Resources.Equipment.t()} | {:error, Humaans.Error.t()}
Updates a specific equipment by ID.
Parameters
client- Client created withHumaans.new/1id- String ID of the equipment to updateparams- Map of attributes to update
Examples
client = Humaans.new(access_token: "your_access_token")
params = %{returnedDate: "2025-12-31"}
{:ok, equipment} = Humaans.Equipment.update(client, "equipment_id", params)