Inttegro.FileLinks (inttegro v0.2.0)

Copy Markdown View Source

Creates controlled links for delivering files.

File links can be time-limited, revocable, and protected by a token. Creating and administering links requires a secret key; opening a link uses its public ID and token and intentionally does not send the application's secret key.

Summary

Functions

Creates a revocable public capability URL for an existing file.

Retrieves a file link without exposing token material.

Opens a token-protected public file link. Depending on delivery policy, this either streams bytes or redirects to a short-lived provider URL.

Lists file links for the authorized application, optionally filtered by file or status.

Revokes an active file link so its public capability URL can no longer serve the file.

Functions

create(client, request, options \\ [])

Creates a revocable public capability URL for an existing file.

Parameters

Returns

Returns {:ok, Inttegro.FileLinks.Creation.t()} when Inttegro accepts and decodes the operation. Returns {:error, exception} for API, transport, or decoding failures. A successful API response can still describe an asynchronous resource that has not reached its terminal state.

Example

request = Inttegro.FileLinks.CreateRequest.new!(request_attributes)

case Inttegro.FileLinks.create(client, request) do
  {:ok, result} -> result
  {:error, error} -> {:error, error}
end

lookup(client, request, options \\ [])

Retrieves a file link without exposing token material.

Parameters

Returns

Returns {:ok, Inttegro.FileLinks.FileLink.t()} when Inttegro accepts and decodes the operation. Returns {:error, exception} for API, transport, or decoding failures. A successful API response can still describe an asynchronous resource that has not reached its terminal state.

Example

request = Inttegro.FileLinks.LookupRequest.new!(request_attributes)

case Inttegro.FileLinks.lookup(client, request) do
  {:ok, result} -> result
  {:error, error} -> {:error, error}
end

open(client, request)

Opens a token-protected public file link. Depending on delivery policy, this either streams bytes or redirects to a short-lived provider URL.

Parameters

Returns

Returns {:ok, Inttegro.Files.Download.t()} when Inttegro accepts and decodes the operation. Returns {:error, exception} for API, transport, or decoding failures. A successful API response can still describe an asynchronous resource that has not reached its terminal state.

Example

request = Inttegro.FileLinks.OpenRequest.new!(request_attributes)

case Inttegro.FileLinks.open(client, request) do
  {:ok, result} -> result
  {:error, error} -> {:error, error}
end

page(client, request, options \\ [])

Lists file links for the authorized application, optionally filtered by file or status.

Parameters

Returns

Returns {:ok, Inttegro.FileLinks.Page.t()} when Inttegro accepts and decodes the operation. Returns {:error, exception} for API, transport, or decoding failures. A successful API response can still describe an asynchronous resource that has not reached its terminal state.

Example

request = Inttegro.FileLinks.PageRequest.new!(request_attributes)

case Inttegro.FileLinks.page(client, request) do
  {:ok, result} -> result
  {:error, error} -> {:error, error}
end

revoke(client, request, options \\ [])

Revokes an active file link so its public capability URL can no longer serve the file.

Parameters

Returns

Returns {:ok, Inttegro.FileLinks.FileLink.t()} when Inttegro accepts and decodes the operation. Returns {:error, exception} for API, transport, or decoding failures. A successful API response can still describe an asynchronous resource that has not reached its terminal state.

Example

request = Inttegro.FileLinks.RevokeRequest.new!(request_attributes)

case Inttegro.FileLinks.revoke(client, request) do
  {:ok, result} -> result
  {:error, error} -> {:error, error}
end