This module provides functions for managing custom value resources in the Humaans API.
Summary
Functions
Creates a new custom_value.
Deletes a specific custom_value by ID.
Lists all custom_values.
Retrieves a specific custom_value by ID.
Updates a specific custom_value by ID.
Types
Functions
@spec create(client :: map(), params :: map() | keyword()) :: {:ok, Humaans.Resources.CustomValue.t()} | {:error, Humaans.Error.t()}
Creates a new custom_value.
Parameters
client- Client created withHumaans.new/1params- Map of attributes for the new custom_value
Examples
client = Humaans.new(access_token: "your_access_token")
params = %{personId: "person_abc", customFieldId: "cf_abc", value: "M"}
{:ok, custom_value} = Humaans.CustomValues.create(client, params)
@spec delete(client :: map(), id :: String.t()) :: {:ok, %{id: String.t(), deleted: boolean()}} | {:error, Humaans.Error.t()}
Deletes a specific custom_value by ID.
Parameters
client- Client created withHumaans.new/1id- String ID of the custom_value to delete
Examples
client = Humaans.new(access_token: "your_access_token")
{:ok, %{id: "custom_value_id", deleted: true}} = Humaans.CustomValues.delete(client, "custom_value_id")
@spec list(client :: map(), params :: map() | keyword() | [{String.t(), term()}]) :: {:ok, [Humaans.Resources.CustomValue.t()]} | {:error, Humaans.Error.t()}
Lists all custom_values.
Returns a list of custom_values 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, custom_values} = Humaans.CustomValues.list(client)
{:ok, custom_values} = Humaans.CustomValues.list(client, %{})
@spec retrieve(client :: map(), id :: String.t()) :: {:ok, Humaans.Resources.CustomValue.t()} | {:error, Humaans.Error.t()}
Retrieves a specific custom_value by ID.
Parameters
client- Client created withHumaans.new/1id- String ID of the custom_value to retrieve
Examples
client = Humaans.new(access_token: "your_access_token")
{:ok, custom_value} = Humaans.CustomValues.retrieve(client, "custom_value_id")
@spec update(client :: map(), id :: String.t(), params :: map() | keyword()) :: {:ok, Humaans.Resources.CustomValue.t()} | {:error, Humaans.Error.t()}
Updates a specific custom_value by ID.
Parameters
client- Client created withHumaans.new/1id- String ID of the custom_value to updateparams- Map of attributes to update
Examples
client = Humaans.new(access_token: "your_access_token")
params = %{value: "L"}
{:ok, custom_value} = Humaans.CustomValues.update(client, "custom_value_id", params)