# `OpenrelikWorkerCommon.FileUtils.OutputFile`
[🔗](https://github.com/hacktobeer/openrelik-worker-common-elixir/blob/v0.1.0/lib/openrelik_worker_common/file_utils.ex#L53)

Represents an output file created by an OpenRelik worker task
(Elixir port of `openrelik_worker_common.file_utils.OutputFile`).

## Fields
* `:uuid` - Unique identifier (`uuid4` hex) for the file.
* `:display_name` - Display name for the file.
* `:extension` - Extension of the file.
* `:data_type` - Data type of the file.
* `:path` - The full path to the file on disk.
* `:original_path` - The full original path to the file.
* `:source_file_id` - The source file ID or parent `OutputFile` this file belongs to.
* `:register_in_db` - When `false`, the mediator skips DB registration, hashing,
  and file reports for this file. Defaults to `true`.

# `t`

```elixir
@type t() :: %OpenrelikWorkerCommon.FileUtils.OutputFile{
  data_type: String.t() | nil,
  display_name: String.t(),
  extension: String.t() | nil,
  original_path: String.t() | nil,
  path: String.t(),
  register_in_db: boolean(),
  source_file_id: integer() | String.t() | t() | map() | nil,
  uuid: String.t()
}
```

# `new`

```elixir
@spec new(keyword() | map()) :: t()
```

Initializes an `%OutputFile{}` struct.

Accepts keyword options or a map, or positional arguments matching Python's
`OutputFile(uuid, output_path, display_name, ...)`.

# `new`

```elixir
@spec new(String.t(), String.t(), String.t(), keyword() | map()) :: t()
```

# `to_dict`

```elixir
@spec to_dict(t()) :: %{required(String.t()) =&gt; term()}
```

Returns a dictionary (string-keyed map) representation of the `OutputFile` struct.
This is what the mediator server receives and uses to create a File in the database.

---

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