# `HuggingfaceClient.Hub.GatedRepos`
[🔗](https://github.com/huggingface/huggingface_client/blob/v0.1.0/lib/huggingface_client/hub/enterprise/gated_repos.ex#L1)

Manage access requests for gated repositories on the HuggingFace Hub.

Gated repos require users to request access before downloading. As a repo admin
you can view pending requests and accept, reject, or cancel them.

See: https://huggingface.co/docs/hub/models-gated

## Example

    # List pending requests for a gated model
    {:ok, requests} = HuggingfaceClient.list_pending_access_requests("my-org/gated-model",
      access_token: "hf_admin_token"
    )

    # Accept a specific user's request
    :ok = HuggingfaceClient.accept_access_request("my-org/gated-model",
      user: "alice",
      access_token: "hf_admin_token"
    )

# `accept`

```elixir
@spec accept(
  String.t(),
  keyword()
) :: :ok | {:error, Exception.t()}
```

Accepts a user's access request for a gated repository.

## Options

- `:user` — username of the user to accept (required)
- `:type` — repo type (default: `:model`)
- `:access_token`

# `cancel`

```elixir
@spec cancel(
  String.t(),
  keyword()
) :: :ok | {:error, Exception.t()}
```

Cancels a user's accepted access (moves them back to pending).

# `grant_access`

```elixir
@spec grant_access(
  String.t(),
  keyword()
) :: :ok | {:error, Exception.t()}
```

Grants access to a user directly (bypassing the request flow).

## Options

- `:user` — username (required)
- `:type` — repo type (default: `:model`)

# `list_accepted`

```elixir
@spec list_accepted(
  String.t(),
  keyword()
) :: {:ok, [map()]} | {:error, Exception.t()}
```

Lists accepted access requests for a gated repository.

# `list_pending`

```elixir
@spec list_pending(
  String.t(),
  keyword()
) :: {:ok, [map()]} | {:error, Exception.t()}
```

Lists pending access requests for a gated repository.

# `list_rejected`

```elixir
@spec list_rejected(
  String.t(),
  keyword()
) :: {:ok, [map()]} | {:error, Exception.t()}
```

Lists rejected access requests for a gated repository.

# `reject`

```elixir
@spec reject(
  String.t(),
  keyword()
) :: :ok | {:error, Exception.t()}
```

Rejects a user's access request for a gated repository.

# `revoke_access`

```elixir
@spec revoke_access(
  String.t(),
  keyword()
) :: :ok | {:error, Exception.t()}
```

Revokes a user's access to a gated repository.

---

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