# `Polarex.Files`
[🔗](https://github.com/giusdp/polarex/blob/main/lib/polarex/operations/files.ex#L1)

Provides API endpoints related to files

# `files_create`

```elixir
@spec files_create(
  body ::
    Polarex.DownloadableFileCreate.t()
    | Polarex.OrganizationAvatarFileCreate.t()
    | Polarex.ProductMediaFileCreate.t(),
  opts :: keyword()
) :: {:ok, Polarex.FileUpload.t()} | {:error, Polarex.HTTPValidationError.t()}
```

Create File

Create a file.

**Scopes**: `files:write`

## Request Body

**Content Types**: `application/json`

# `files_delete`

```elixir
@spec files_delete(id :: String.t(), opts :: keyword()) ::
  :ok
  | {:error,
     Polarex.HTTPValidationError.t()
     | Polarex.NotPermitted.t()
     | Polarex.ResourceNotFound.t()}
```

Delete File

Delete a file.

**Scopes**: `files:write`

# `files_list`

```elixir
@spec files_list(opts :: keyword()) ::
  {:ok, Polarex.ListResourceFileRead.t()}
  | {:error, Polarex.HTTPValidationError.t()}
```

List Files

List files.

**Scopes**: `files:read` `files:write`

## Options

  * `organization_id`: Filter by organization ID.
  * `ids`: Filter by file ID.
  * `page`: Page number, defaults to 1.
  * `limit`: Size of a page, defaults to 10. Maximum is 100.

# `files_update`

```elixir
@spec files_update(id :: String.t(), body :: Polarex.FilePatch.t(), opts :: keyword()) ::
  {:ok,
   Polarex.DownloadableFileRead.t()
   | Polarex.OrganizationAvatarFileRead.t()
   | Polarex.ProductMediaFileRead.t()}
  | {:error,
     Polarex.HTTPValidationError.t()
     | Polarex.NotPermitted.t()
     | Polarex.ResourceNotFound.t()}
```

Update File

Update a file.

**Scopes**: `files:write`

## Request Body

**Content Types**: `application/json`

# `files_uploaded`

```elixir
@spec files_uploaded(
  id :: String.t(),
  body :: Polarex.FileUploadCompleted.t(),
  opts :: keyword()
) ::
  {:ok,
   Polarex.DownloadableFileRead.t()
   | Polarex.OrganizationAvatarFileRead.t()
   | Polarex.ProductMediaFileRead.t()}
  | {:error,
     Polarex.HTTPValidationError.t()
     | Polarex.NotPermitted.t()
     | Polarex.ResourceNotFound.t()}
```

Complete File Upload

Complete a file upload.

**Scopes**: `files:write`

## Request Body

**Content Types**: `application/json`

---

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