This module provides functions for managing working pattern resources in the Humaans API.
Summary
Functions
Creates a new working_pattern.
Deletes a specific working_pattern by ID.
Lists all working_patterns.
Retrieves a specific working_pattern by ID.
Updates a specific working_pattern by ID.
Types
Functions
@spec create(client :: map(), params :: map() | keyword()) :: {:ok, Humaans.Resources.WorkingPattern.t()} | {:error, Humaans.Error.t()}
Creates a new working_pattern.
Parameters
client- Client created withHumaans.new/1params- Map of attributes for the new working_pattern
Examples
client = Humaans.new(access_token: "your_access_token")
params = %{name: "Mon-Fri 9-5"}
{:ok, working_pattern} = Humaans.WorkingPatterns.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 by ID.
Parameters
client- Client created withHumaans.new/1id- String ID of the working_pattern to delete
Examples
client = Humaans.new(access_token: "your_access_token")
{:ok, %{id: "working_pattern_id", deleted: true}} = Humaans.WorkingPatterns.delete(client, "working_pattern_id")
@spec list(client :: map(), params :: map() | keyword() | [{String.t(), term()}]) :: {:ok, [Humaans.Resources.WorkingPattern.t()]} | {:error, Humaans.Error.t()}
Lists all working_patterns.
Returns a list of working_patterns 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_patterns} = Humaans.WorkingPatterns.list(client)
{:ok, working_patterns} = Humaans.WorkingPatterns.list(client, %{})
@spec retrieve(client :: map(), id :: String.t()) :: {:ok, Humaans.Resources.WorkingPattern.t()} | {:error, Humaans.Error.t()}
Retrieves a specific working_pattern by ID.
Parameters
client- Client created withHumaans.new/1id- String ID of the working_pattern to retrieve
Examples
client = Humaans.new(access_token: "your_access_token")
{:ok, working_pattern} = Humaans.WorkingPatterns.retrieve(client, "working_pattern_id")
@spec update(client :: map(), id :: String.t(), params :: map() | keyword()) :: {:ok, Humaans.Resources.WorkingPattern.t()} | {:error, Humaans.Error.t()}
Updates a specific working_pattern by ID.
Parameters
client- Client created withHumaans.new/1id- String ID of the working_pattern to updateparams- Map of attributes to update
Examples
client = Humaans.new(access_token: "your_access_token")
params = %{name: "Mon-Thu 9-5"}
{:ok, working_pattern} = Humaans.WorkingPatterns.update(client, "working_pattern_id", params)