Supabase.Storage.Bucket (supabase_storage v0.4.2)

Represents a Bucket on Supabase Storage.

This module defines the structure and operations related to a storage bucket on Supabase.

Summary

Types

A FileSizeLimit consists of

t()

A Bucket consists of

Types

file_size_limit_t()

@type file_size_limit_t() :: %Supabase.Storage.Bucket.FileSizeLimit{
  size: integer(),
  unit: :byte | :megabyte | :gigabyte | :terabyte
}

A FileSizeLimit consists of:

  • size: The maximum file size limit itself as an integer.
  • unit The unit of the file size limit, can be: :byte, :megabyte, :gigabyte or :terabyte, defaults to :byte.

t()

@type t() :: %Supabase.Storage.Bucket{
  allowed_mime_types: [String.t()] | nil,
  created_at: NaiveDateTime.t() | nil,
  file_size_limit: file_size_limit_t() | nil,
  id: String.t() | nil,
  name: String.t() | nil,
  owner: String.t() | nil,
  public: boolean(),
  updated_at: NaiveDateTime.t() | nil
}

A Bucket consists of:

  • id: The unique identifier for the bucket.
  • name: The display name of the bucket.
  • owner: The owner of the bucket.
  • file_size_limit: The maximum file size allowed in the bucket. Can be nil for no limit.
  • allowed_mime_types: List of MIME types permitted in this bucket. Can be nil for no restrictions.
  • created_at: Timestamp indicating when the bucket was created.
  • updated_at: Timestamp indicating the last update to the bucket.
  • public: Boolean flag determining if the bucket is publicly accessible or not.

Functions

changeset(source, attrs)

@spec changeset(t(), map()) :: Ecto.Changeset.t()

parse(attrs)

@spec parse([map()]) :: {:ok, [t()]} | {:error, Ecto.Changeset.t()}
@spec parse(map()) :: {:ok, t()} | {:error, Ecto.Changeset.t()}