Inttegro.Files.File (inttegro v0.2.0)

Copy Markdown View Source

Metadata for a file owned by the authenticated application.

This struct deliberately excludes the file bytes, storage-provider credentials, object keys, and idempotency internals. Retrieve original bytes with Inttegro.Files.contents/3.

Files normally move from :uploading through :processing to :available. A :failed status may include latest_error; :deleted is a tombstone. scan_status records the safety scan independently of storage status, so check both before making a file public.

Important fields include:

  • id — stable file identifier used by lookup, delivery, links, and references.
  • purpose — policy category applied when the file was accepted.
  • status and scan_status — storage lifecycle and safety state.
  • content_type, size, and checksum_sha256 — representation metadata for verification.
  • available_at and expires_at — availability boundaries when present.

Summary

Types

t()

The decoded file value.

Functions

Builds a Inttegro.Files.File and raises KeyError when a required field is missing.

Types

t()

@type t() :: %Inttegro.Files.File{
  available_at: String.t() | nil,
  checksum_sha256: String.t(),
  content_type: String.t(),
  created_at: String.t(),
  created_by: Inttegro.Files.Actor.t(),
  custom_data: %{optional(String.t()) => String.t()} | nil,
  delivery: Inttegro.Files.DeliveryDetails.t() | nil,
  expires_at: String.t() | nil,
  filename: String.t() | nil,
  id: String.t(),
  latest_error: Inttegro.Files.LatestError.t() | nil,
  media: Inttegro.Files.Media.t() | nil,
  metadata: %{optional(String.t()) => String.t()} | nil,
  name: String.t() | nil,
  purpose: String.t(),
  scan_status: Inttegro.Files.ScanStatus.t(),
  size: integer(),
  source: Inttegro.Files.Source.t(),
  status: Inttegro.Files.Status.t(),
  storage: Inttegro.Files.PublicStorage.t(),
  updated_at: String.t()
}

The decoded file value.

Functions

new!(attrs \\ %{})

@spec new!(map() | keyword()) :: t()

Builds a Inttegro.Files.File and raises KeyError when a required field is missing.