MishkaPay.File.Link (Mishka Pay v0.0.1)

Copy Markdown View Source

A public address of a MishkaPay.File, made with MishkaPay.file_link/4: anyone with :url can open the file without a key, so a site can show it to a person, until :expires_at. A guarded_struct the provider fills in.

  • :id: the provider's id of the link (link_... at Stripe); :file_id: the file it opens.
  • :url: the address to show.
  • :expires_at: when it stops working, or nil for never; :expired: whether it has.
  • :created_at.

Summary

Types

t()

The struct that builder/1 returns.

Functions

A sample %MishkaPay.File.Link{} populated from defaults + type-based fallbacks.

Types

t()

@type t() :: %MishkaPay.File.Link{
  created_at: DateTime.t() | nil,
  expired: boolean() | nil,
  expires_at: DateTime.t() | nil,
  file_id: String.t() | nil,
  id: String.t(),
  provider: String.t(),
  tenant: term() | nil,
  url: String.t()
}

The struct that builder/1 returns.

FieldTypeRequiredDefaultDescriptionDerives
:providerString.t()yesvalidate(not_nil_value, string)
:tenantterm() | nilno
:idString.t()yesvalidate(not_nil_value, string, not_empty)
:file_idString.t() | nilnovalidate(string)
:urlString.t()yesvalidate(not_nil_value, string, not_empty)
:expires_atDateTime.t() | nilnovalidate(struct)
:expiredboolean() | nilnofalsevalidate(boolean)
:created_atDateTime.t() | nilnovalidate(struct)

Functions

builder(attrs_or_input, error \\ false)

enforce_keys()

enforce_keys(field)

example()

A sample %MishkaPay.File.Link{} populated from defaults + type-based fallbacks.

keys()

keys(field)