Time Settings
Usage
Manage break configurations:
import asyncio
import factorialhr
async def main():
auth = factorialhr.AccessTokenAuth("your_access_token")
async with factorialhr.ApiClient(auth=auth) as api:
break_config = factorialhr.BreakConfigurationEndpoint(api)
one = await break_config.get_by_id(123)
print(one.name, one.duration_minutes)
asyncio.run(main())
- class factorialhr.BreakConfiguration(*, id: int, name: str, paid: bool, archived: bool | None = None)[source]
Model for time_settings_break_configuration.
- archived: bool | None
Whether the break configuration is archived
- id: int
Break configuration ID
- name: str
Name of the break configuration
- paid: bool
Whether the break is paid
- class factorialhr.BreakConfigurationEndpoint(api: ApiClient)[source]
Endpoint for time_settings/break_configurations operations.
- async all(**kwargs) ListApiResponse[BreakConfiguration][source]
Get all break configurations.
Official documentation: time_settings/break_configurations
- Parameters:
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Response containing the list of records.
- Return type:
- async create(data: Mapping[str, Any], **kwargs) BreakConfiguration[source]
Create a new break configuration.
Official documentation: time_settings/break_configurations
- Parameters:
data (Mapping[str, Any]) – Payload for the new record (key-value mapping).
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The created record.
- Return type:
- async get(**kwargs) MetaApiResponse[BreakConfiguration][source]
Get break configurations with pagination metadata.
Official documentation: time_settings/break_configurations
- Parameters:
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Response containing records and pagination metadata.
- Return type:
- async get_by_id(config_id: int | str, **kwargs) BreakConfiguration[source]
Get a specific break configuration by ID.
Official documentation: time_settings/break_configurations
- Parameters:
config_id (int | str) – The unique identifier.
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The record.
- Return type:
- async update(config_id: int | str, data: Mapping[str, Any], **kwargs) BreakConfiguration[source]
Update a break configuration.
Official documentation: time_settings/break_configurations
- Parameters:
config_id (int | str) – The unique identifier of the record to update.
data (Mapping[str, Any]) – Payload with fields to update (key-value mapping).
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The updated record.
- Return type: