# `Humaans.Companies`
[🔗](https://github.com/sgerrand/ex_humaans/blob/v0.4.2/lib/humaans/companies.ex#L1)

This module provides functions for managing company resources in the Humaans
API.  Note that unlike other resources, companies can only be listed,
retrieved, and updated, but not created or deleted through the API.

# `list_response`

```elixir
@type list_response() ::
  {:ok,
   [
     %Humaans.Resources.Company{
       autogenerate_employee_id: term(),
       autogenerate_employee_id_for_new_hires: term(),
       created_at: term(),
       domains: term(),
       id: term(),
       is_timesheet_enabled: term(),
       name: term(),
       next_employee_id: term(),
       package: term(),
       payment_status: term(),
       status: term(),
       trial_end_date: term(),
       updated_at: term()
     }
   ]}
  | {:error, any()}
```

# `response`

```elixir
@type response() ::
  {:ok,
   %Humaans.Resources.Company{
     autogenerate_employee_id: term(),
     autogenerate_employee_id_for_new_hires: term(),
     created_at: term(),
     domains: term(),
     id: term(),
     is_timesheet_enabled: term(),
     name: term(),
     next_employee_id: term(),
     package: term(),
     payment_status: term(),
     status: term(),
     trial_end_date: term(),
     updated_at: term()
   }}
  | {:error, any()}
```

# `get`

```elixir
@callback get(client :: map(), String.t()) :: {:ok, map()} | {:error, any()}
```

# `list`

```elixir
@callback list(client :: map(), map()) :: {:ok, map()} | {:error, any()}
```

# `update`

```elixir
@callback update(client :: map(), String.t(), map()) :: {:ok, map()} | {:error, any()}
```

# `get`

```elixir
@spec get(client :: map(), id :: String.t()) :: response()
```

Retrieves a specific company by ID.

## Parameters

  * `client` - Client map created with `Humaans.new/1`
  * `id` - String ID of the company to retrieve

## Examples

    client = Humaans.new(access_token: "your_access_token")

    {:ok, company} = Humaans.Companies.get(client, "company_id")

# `list`

```elixir
@spec list(client :: map(), params :: keyword()) :: list_response()
```

Lists all company resources.

Returns a list of company resources that match the optional filters provided in `params`.

## Parameters

  * `client` - Client map created with `Humaans.new/1`
  * `params` - Optional parameters for filtering the results (default: `%{}`)

## Examples

    client = Humaans.new(access_token: "your_access_token")

    # List all companies
    {:ok, companies} = Humaans.Companies.list(client)

    # List with filtering parameters
    {:ok, companies} = Humaans.Companies.list(client, %{limit: 10})

# `update`

```elixir
@spec update(client :: map(), id :: String.t(), params :: keyword()) :: response()
```

Updates a specific company by ID.

## Parameters

  * `client` - Client map created with `Humaans.new/1`
  * `id` - String ID of the company to update
  * `params` - Map of parameters to update

## Examples

    client = Humaans.new(access_token: "your_access_token")

    params = %{name: "New Company Name"}

    {:ok, updated_company} = Humaans.Companies.update(client, "company_id", params)

---

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