Turso.Organizations (turso v0.1.1)

View Source

Organization management for Turso Cloud Platform.

Organizations are the top-level containers for all Turso resources including databases, groups, and members. This module provides functions for listing and retrieving organization information.

Summary

Functions

Gets organization limits and quotas.

Lists all organizations you have access to.

Retrieves details of a specific organization.

Gets the organization's subscription information.

Gets usage statistics for an organization.

Types

api_result(success_type)

@type api_result(success_type) :: Turso.api_result(success_type)

organization()

@type organization() :: Turso.organization()

Functions

limits(client, organization_slug)

@spec limits(Turso.t(), String.t()) :: api_result(map())

Gets organization limits and quotas.

Returns information about the organization's resource limits, quotas, and current utilization against those limits.

Examples

{:ok, limits} = Turso.Organizations.limits(client, "my-org")

Parameters

  • client - The Turso client
  • organization_slug - The organization's slug identifier

Returns

  • {:ok, map()} - Limits and quotas information
  • {:error, map()} - Error details

list(client)

@spec list(Turso.t()) :: api_result(map())

Lists all organizations you have access to.

This returns all organizations where you are a member, regardless of your role or permissions within each organization.

Examples

{:ok, organizations} = Turso.Organizations.list(client)

Returns

  • {:ok, list(organization())} - List of organization objects
  • {:error, map()} - Error details

Organization Object

Each organization object typically contains:

  • name - Organization name
  • slug - URL-safe organization identifier
  • type - Organization type (e.g., "personal", "team")
  • blocked - Whether the organization is blocked

retrieve(client, organization_slug)

@spec retrieve(Turso.t(), String.t()) :: api_result(organization())

Retrieves details of a specific organization.

Examples

{:ok, organization} = Turso.Organizations.retrieve(client, "my-org")

Parameters

  • client - The Turso client
  • organization_slug - The organization's slug identifier

Returns

  • {:ok, organization()} - Organization details
  • {:error, map()} - Error details

subscription(client, organization_slug)

@spec subscription(Turso.t(), String.t()) :: api_result(map())

Gets the organization's subscription information.

Returns details about the organization's current subscription plan, billing information, and plan limits.

Examples

{:ok, subscription} = Turso.Organizations.subscription(client, "my-org")

Parameters

  • client - The Turso client
  • organization_slug - The organization's slug identifier

Returns

  • {:ok, map()} - Subscription details
  • {:error, map()} - Error details

usage(client, organization_slug)

@spec usage(Turso.t(), String.t()) :: api_result(map())

Gets usage statistics for an organization.

Returns current usage metrics including database count, storage usage, bandwidth consumption, and other resource utilization data.

Examples

{:ok, usage} = Turso.Organizations.usage(client, "my-org")

Parameters

  • client - The Turso client
  • organization_slug - The organization's slug identifier

Returns

  • {:ok, map()} - Usage statistics
  • {:error, map()} - Error details

Usage Object

The usage object typically contains:

  • databases - Number of databases
  • storage - Storage usage in bytes
  • bandwidth - Bandwidth usage statistics
  • requests - API request counts