This module provides functions for managing time away adjustment resources in the Humaans API.
Summary
Functions
Creates a new time_away_adjustment.
Deletes a specific time_away_adjustment by ID.
Lists all time_away_adjustments.
Retrieves a specific time_away_adjustment by ID.
Updates a specific time_away_adjustment by ID.
Types
Functions
@spec create(client :: map(), params :: map() | keyword()) :: {:ok, Humaans.Resources.TimeAwayAdjustment.t()} | {:error, Humaans.Error.t()}
Creates a new time_away_adjustment.
Parameters
client- Client created withHumaans.new/1params- Map of attributes for the new time_away_adjustment
Examples
client = Humaans.new(access_token: "your_access_token")
params = %{personId: "person_abc", timeAwayAllocationId: "allocation_abc", amount: 1.5, note: "Carry-over"}
{:ok, time_away_adjustment} = Humaans.TimeAwayAdjustments.create(client, params)
@spec delete(client :: map(), id :: String.t()) :: {:ok, %{id: String.t(), deleted: boolean()}} | {:error, Humaans.Error.t()}
Deletes a specific time_away_adjustment by ID.
Parameters
client- Client created withHumaans.new/1id- String ID of the time_away_adjustment to delete
Examples
client = Humaans.new(access_token: "your_access_token")
{:ok, %{id: "time_away_adjustment_id", deleted: true}} = Humaans.TimeAwayAdjustments.delete(client, "time_away_adjustment_id")
@spec list(client :: map(), params :: map() | keyword() | [{String.t(), term()}]) :: {:ok, [Humaans.Resources.TimeAwayAdjustment.t()]} | {:error, Humaans.Error.t()}
Lists all time_away_adjustments.
Returns a list of time_away_adjustments 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, time_away_adjustments} = Humaans.TimeAwayAdjustments.list(client)
{:ok, time_away_adjustments} = Humaans.TimeAwayAdjustments.list(client, %{})
@spec retrieve(client :: map(), id :: String.t()) :: {:ok, Humaans.Resources.TimeAwayAdjustment.t()} | {:error, Humaans.Error.t()}
Retrieves a specific time_away_adjustment by ID.
Parameters
client- Client created withHumaans.new/1id- String ID of the time_away_adjustment to retrieve
Examples
client = Humaans.new(access_token: "your_access_token")
{:ok, time_away_adjustment} = Humaans.TimeAwayAdjustments.retrieve(client, "time_away_adjustment_id")
@spec update(client :: map(), id :: String.t(), params :: map() | keyword()) :: {:ok, Humaans.Resources.TimeAwayAdjustment.t()} | {:error, Humaans.Error.t()}
Updates a specific time_away_adjustment by ID.
Parameters
client- Client created withHumaans.new/1id- String ID of the time_away_adjustment to updateparams- Map of attributes to update
Examples
client = Humaans.new(access_token: "your_access_token")
params = %{note: "Updated note"}
{:ok, time_away_adjustment} = Humaans.TimeAwayAdjustments.update(client, "time_away_adjustment_id", params)