This module provides functions for managing working pattern allocation resources in the Humaans API.
Summary
Functions
Creates a new working_pattern_allocation.
Deletes a specific working_pattern_allocation by ID.
Lists all working_pattern_allocations.
Retrieves a specific working_pattern_allocation by ID.
Updates a specific working_pattern_allocation by ID.
Types
Functions
@spec create(client :: map(), params :: map() | keyword()) :: {:ok, Humaans.Resources.WorkingPatternAllocation.t()} | {:error, Humaans.Error.t()}
Creates a new working_pattern_allocation.
Parameters
client- Client created withHumaans.new/1params- Map of attributes for the new working_pattern_allocation
Examples
client = Humaans.new(access_token: "your_access_token")
params = %{personId: "person_abc", workingPatternId: "wp_abc", startDate: "2025-01-01"}
{:ok, working_pattern_allocation} = Humaans.WorkingPatternAllocations.create(client, params)
@spec delete(client :: map(), id :: String.t()) :: {:ok, %{id: String.t(), deleted: boolean()}} | {:error, Humaans.Error.t()}
Deletes a specific working_pattern_allocation by ID.
Parameters
client- Client created withHumaans.new/1id- String ID of the working_pattern_allocation to delete
Examples
client = Humaans.new(access_token: "your_access_token")
{:ok, %{id: "working_pattern_allocation_id", deleted: true}} = Humaans.WorkingPatternAllocations.delete(client, "working_pattern_allocation_id")
@spec list(client :: map(), params :: map() | keyword() | [{String.t(), term()}]) :: {:ok, [Humaans.Resources.WorkingPatternAllocation.t()]} | {:error, Humaans.Error.t()}
Lists all working_pattern_allocations.
Returns a list of working_pattern_allocations 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, working_pattern_allocations} = Humaans.WorkingPatternAllocations.list(client)
{:ok, working_pattern_allocations} = Humaans.WorkingPatternAllocations.list(client, %{})
@spec retrieve(client :: map(), id :: String.t()) :: {:ok, Humaans.Resources.WorkingPatternAllocation.t()} | {:error, Humaans.Error.t()}
Retrieves a specific working_pattern_allocation by ID.
Parameters
client- Client created withHumaans.new/1id- String ID of the working_pattern_allocation to retrieve
Examples
client = Humaans.new(access_token: "your_access_token")
{:ok, working_pattern_allocation} = Humaans.WorkingPatternAllocations.retrieve(client, "working_pattern_allocation_id")
@spec update(client :: map(), id :: String.t(), params :: map() | keyword()) :: {:ok, Humaans.Resources.WorkingPatternAllocation.t()} | {:error, Humaans.Error.t()}
Updates a specific working_pattern_allocation by ID.
Parameters
client- Client created withHumaans.new/1id- String ID of the working_pattern_allocation to updateparams- Map of attributes to update
Examples
client = Humaans.new(access_token: "your_access_token")
params = %{endDate: "2025-12-31"}
{:ok, working_pattern_allocation} = Humaans.WorkingPatternAllocations.update(client, "working_pattern_allocation_id", params)