Inttegro.Files.Disposition (inttegro v0.2.0)

Copy Markdown View Source

Values accepted for Disposition in the Files API.

Prefer the documented atoms returned by values/0. The type also accepts strings so a newer server value can be preserved by an older SDK instead of failing during decoding.

Uploads files, reads their metadata, and delivers their original bytes.

Inttegro stores file metadata separately from binary contents. Uploads move through processing and safety checks before becoming available. create/3 accepts bytes, lookup/3 returns metadata, and contents/3 returns a %Inttegro.Files.Download{} without exposing storage provider credentials or object keys.

Upload and download

upload = %Inttegro.Files.CreateRequest{
  file_name: "receipt.pdf",
  bytes: File.read!("receipt.pdf"),
  purpose: "order_document"
}

{:ok, file} = Inttegro.Files.create(client, upload,
  idempotency_key: "receipt-order-123"
)

request = Inttegro.Files.ContentsRequest.new!(file_id: file.id)
{:ok, download} = Inttegro.Files.contents(client, request)
File.write!("downloaded-receipt.pdf", download.bytes)

See the Files guide for lifecycle, delivery, and deletion behavior.

Summary

Types

t()

A disposition atom or an unknown wire value preserved as a string.

Functions

Returns the documented Inttegro.Files.Disposition atoms known by this SDK version.

Types

t()

@type t() :: :attachment | :inline | String.t()

A disposition atom or an unknown wire value preserved as a string.

Functions

values()

@spec values() :: [t()]

Returns the documented Inttegro.Files.Disposition atoms known by this SDK version.