# `BambooHR.Employee`
[🔗](https://github.com/sgerrand/ex_bamboo_hr/blob/v0.6.0/lib/bamboo_hr/employee.ex#L1)

Functions for interacting with employee resources in the BambooHR API.

# `add`

```elixir
@spec add(BambooHR.Client.t(), map()) :: BambooHR.Client.response()
```

Adds a new employee.

BambooHR returns no response body for this endpoint — the created
employee is identified only by the `Location` header, which points to
the employee's page in the BambooHR web app (and includes the new
employee's ID). This function surfaces that header as `"location"`; if
the upstream response has no `Location` header, the result is `{:ok,
%{}}`.

## Parameters

  * `client` - Client configuration created with `BambooHR.Client.new/1`
  * `employee_data` - Map containing the employee information (firstName and lastName are required)

## Examples

    iex> employee_data = %{"firstName" => "Jane", "lastName" => "Smith"}
    iex> BambooHR.Employee.add(client, employee_data)
    {:ok, %{"location" => "https://acme.bamboohr.com/employees/employee.php?id=124"}}

# `get`

```elixir
@spec get(BambooHR.Client.t(), integer(), [String.t(), ...]) ::
  BambooHR.Client.response()
```

Retrieves information about a specific employee.

## Parameters

  * `client` - Client configuration created with `BambooHR.Client.new/1`
  * `employee_id` - The ID of the employee to retrieve
  * `fields` - List of field names to retrieve (e.g., ["firstName", "lastName", "jobTitle"])

## Examples

    iex> BambooHR.Employee.get(client, 123, ["firstName", "lastName", "jobTitle"])
    {:ok, %{
      "firstName" => "John",
      "lastName" => "Doe",
      "jobTitle" => "Software Engineer"
    }}

# `get_directory`

```elixir
@spec get_directory(BambooHR.Client.t()) :: BambooHR.Client.response()
```

Retrieves the company's employee directory.

Returns a list of all employees with basic information like name and contact details.

## Parameters

  * `client` - Client configuration created with `BambooHR.Client.new/1`

## Examples

    iex> BambooHR.Employee.get_directory(client)
    {:ok, %{
      "employees" => [
        %{
          "id" => 123,
          "displayName" => "John Doe",
          "jobTitle" => "Developer",
          "workEmail" => "john@example.com"
        }
      ]
    }}

# `update`

```elixir
@spec update(BambooHR.Client.t(), integer(), map()) :: BambooHR.Client.response()
```

Updates information for an existing employee.

## Parameters

  * `client` - Client configuration created with `BambooHR.Client.new/1`
  * `employee_id` - The ID of the employee to update
  * `employee_data` - Map containing the updated employee information

## Examples

    iex> update_data = %{"firstName" => "Jane", "lastName" => "Smith-Jones"}
    iex> BambooHR.Employee.update(client, 124, update_data)
    {:ok, %{}}

---

*Consult [api-reference.md](api-reference.md) for complete listing*
