This module provides functions for managing timesheet entry resources in the Humaans API. Timesheet entries represent individual time records for a person, such as hours worked on a specific date.
Summary
Functions
Creates a new timesheet_entry.
Deletes a specific timesheet_entry by ID.
Lists all timesheet_entries.
Retrieves a specific timesheet_entry by ID.
Updates a specific timesheet_entry by ID.
Types
Functions
@spec create(client :: map(), params :: map() | keyword()) :: {:ok, Humaans.Resources.TimesheetEntry.t()} | {:error, Humaans.Error.t()}
Creates a new timesheet_entry.
Parameters
client- Client created withHumaans.new/1params- Map of attributes for the new timesheet_entry
Examples
client = Humaans.new(access_token: "your_access_token")
params = %{personId: "person_abc", date: "2024-06-01", startTime: "09:00", endTime: "17:00"}
{:ok, timesheet_entry} = Humaans.TimesheetEntries.create(client, params)
@spec delete(client :: map(), id :: String.t()) :: {:ok, %{id: String.t(), deleted: boolean()}} | {:error, Humaans.Error.t()}
Deletes a specific timesheet_entry by ID.
Parameters
client- Client created withHumaans.new/1id- String ID of the timesheet_entry to delete
Examples
client = Humaans.new(access_token: "your_access_token")
{:ok, %{id: "timesheet_entry_id", deleted: true}} = Humaans.TimesheetEntries.delete(client, "timesheet_entry_id")
@spec list(client :: map(), params :: map() | keyword()) :: {:ok, [Humaans.Resources.TimesheetEntry.t()]} | {:error, Humaans.Error.t()}
Lists all timesheet_entries.
Returns a list of timesheet_entries 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, timesheet_entries} = Humaans.TimesheetEntries.list(client)
{:ok, timesheet_entries} = Humaans.TimesheetEntries.list(client, %{})
@spec retrieve(client :: map(), id :: String.t()) :: {:ok, Humaans.Resources.TimesheetEntry.t()} | {:error, Humaans.Error.t()}
Retrieves a specific timesheet_entry by ID.
Parameters
client- Client created withHumaans.new/1id- String ID of the timesheet_entry to retrieve
Examples
client = Humaans.new(access_token: "your_access_token")
{:ok, timesheet_entry} = Humaans.TimesheetEntries.retrieve(client, "timesheet_entry_id")
@spec update(client :: map(), id :: String.t(), params :: map() | keyword()) :: {:ok, Humaans.Resources.TimesheetEntry.t()} | {:error, Humaans.Error.t()}
Updates a specific timesheet_entry by ID.
Parameters
client- Client created withHumaans.new/1id- String ID of the timesheet_entry to updateparams- Map of attributes to update
Examples
client = Humaans.new(access_token: "your_access_token")
{:ok, timesheet_entry} = Humaans.TimesheetEntries.update(client, "timesheet_entry_id", %{})