Inttegro.Files.PageRequest (inttegro v0.2.0)

Copy Markdown View Source

Parameters for Page Request in the Files API.

Build this struct with new!/1 and pass it to the corresponding function on Inttegro.Files. Required keys are enforced immediately; optional values left as nil are omitted from the request sent to Inttegro.

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 validated page request request.

Functions

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

Types

t()

@type t() :: %Inttegro.Files.PageRequest{
  created_after: String.t() | nil,
  created_before: String.t() | nil,
  page_number: integer() | nil,
  page_size: integer() | nil,
  purpose: String.t() | nil,
  status: Inttegro.Files.Status.t() | nil
}

A validated page request request.

Functions

new!(attrs \\ %{})

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

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