View Source Stripe.FileLink (stripity_stripe v3.2.0)

To share the contents of a File object with non-Stripe users, you can create a FileLink. FileLinks contain a URL that you can use to retrieve the contents of the file without authentication.

Summary

Types

t()

The file_link type.

Functions

Creates a new file link object.

Returns a list of file links.

Retrieves the file link with the given ID.

Updates an existing file link object. Expired links can no longer be updated.

Types

@type created() :: %{
  optional(:gt) => integer(),
  optional(:gte) => integer(),
  optional(:lt) => integer(),
  optional(:lte) => integer()
}
@type t() :: %Stripe.FileLink{
  created: integer(),
  expired: boolean(),
  expires_at: integer() | nil,
  file: binary() | Stripe.File.t(),
  id: binary(),
  livemode: boolean(),
  metadata: term(),
  object: binary(),
  url: binary() | nil
}

The file_link type.

  • created Time at which the object was created. Measured in seconds since the Unix epoch.
  • expired Returns if the link is already expired.
  • expires_at Time that the link expires.
  • file The file object this link points to.
  • id Unique identifier for the object.
  • livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode.
  • metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
  • object String representing the object's type. Objects of the same type share the same value.
  • url The publicly accessible URL to download the file.

Functions

Link to this function

create(params \\ %{}, opts \\ [])

View Source
@spec create(
  params :: %{
    optional(:expand) => [binary()],
    optional(:expires_at) => integer(),
    optional(:file) => binary(),
    optional(:metadata) => %{optional(binary()) => binary()} | binary()
  },
  opts :: Keyword.t()
) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

Creates a new file link object.

Details

  • Method: post
  • Path: /v1/file_links
Link to this function

list(params \\ %{}, opts \\ [])

View Source
@spec list(
  params :: %{
    optional(:created) => created() | integer(),
    optional(:ending_before) => binary(),
    optional(:expand) => [binary()],
    optional(:expired) => boolean(),
    optional(:file) => binary(),
    optional(:limit) => integer(),
    optional(:starting_after) => binary()
  },
  opts :: Keyword.t()
) ::
  {:ok, Stripe.List.t(t())} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

Returns a list of file links.

Details

  • Method: get
  • Path: /v1/file_links
Link to this function

retrieve(link, params \\ %{}, opts \\ [])

View Source
@spec retrieve(
  link :: binary(),
  params :: %{optional(:expand) => [binary()]},
  opts :: Keyword.t()
) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

Retrieves the file link with the given ID.

Details

  • Method: get
  • Path: /v1/file_links/{link}
Link to this function

update(link, params \\ %{}, opts \\ [])

View Source
@spec update(
  link :: binary(),
  params :: %{
    optional(:expand) => [binary()],
    optional(:expires_at) => :now | integer() | binary(),
    optional(:metadata) => %{optional(binary()) => binary()} | binary()
  },
  opts :: Keyword.t()
) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

Updates an existing file link object. Expired links can no longer be updated.

Details

  • Method: post
  • Path: /v1/file_links/{link}