This module provides functions for managing job role resources in the Humaans API.
Summary
Functions
Creates a new job_role.
Deletes a specific job_role by ID.
Lists all job_roles.
Retrieves a specific job_role by ID.
Updates a specific job_role by ID.
Types
Functions
@spec create(client :: map(), params :: map() | keyword()) :: {:ok, Humaans.Resources.JobRole.t()} | {:error, Humaans.Error.t()}
Creates a new job_role.
Parameters
client- Client created withHumaans.new/1params- Map of attributes for the new job_role
Examples
client = Humaans.new(access_token: "your_access_token")
params = %{name: "Software Engineer"}
{:ok, job_role} = Humaans.JobRoles.create(client, params)
@spec delete(client :: map(), id :: String.t()) :: {:ok, %{id: String.t(), deleted: boolean()}} | {:error, Humaans.Error.t()}
Deletes a specific job_role by ID.
Parameters
client- Client created withHumaans.new/1id- String ID of the job_role to delete
Examples
client = Humaans.new(access_token: "your_access_token")
{:ok, %{id: "job_role_id", deleted: true}} = Humaans.JobRoles.delete(client, "job_role_id")
@spec list(client :: map(), params :: map() | keyword() | [{String.t(), term()}]) :: {:ok, [Humaans.Resources.JobRole.t()]} | {:error, Humaans.Error.t()}
Lists all job_roles.
Returns a list of job_roles 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, job_roles} = Humaans.JobRoles.list(client)
{:ok, job_roles} = Humaans.JobRoles.list(client, %{})
@spec retrieve(client :: map(), id :: String.t()) :: {:ok, Humaans.Resources.JobRole.t()} | {:error, Humaans.Error.t()}
Retrieves a specific job_role by ID.
Parameters
client- Client created withHumaans.new/1id- String ID of the job_role to retrieve
Examples
client = Humaans.new(access_token: "your_access_token")
{:ok, job_role} = Humaans.JobRoles.retrieve(client, "job_role_id")
@spec update(client :: map(), id :: String.t(), params :: map() | keyword()) :: {:ok, Humaans.Resources.JobRole.t()} | {:error, Humaans.Error.t()}
Updates a specific job_role by ID.
Parameters
client- Client created withHumaans.new/1id- String ID of the job_role to updateparams- Map of attributes to update
Examples
client = Humaans.new(access_token: "your_access_token")
params = %{name: "Senior Software Engineer"}
{:ok, job_role} = Humaans.JobRoles.update(client, "job_role_id", params)