Turso.Organizations (turso v0.1.1)
View SourceOrganization 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
@type api_result(success_type) :: Turso.api_result(success_type)
@type organization() :: Turso.organization()
Functions
@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 clientorganization_slug- The organization's slug identifier
Returns
{:ok, map()}- Limits and quotas information{:error, map()}- Error details
@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 nameslug- URL-safe organization identifiertype- Organization type (e.g., "personal", "team")blocked- Whether the organization is blocked
@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 clientorganization_slug- The organization's slug identifier
Returns
{:ok, organization()}- Organization details{:error, map()}- Error details
@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 clientorganization_slug- The organization's slug identifier
Returns
{:ok, map()}- Subscription details{:error, map()}- Error details
@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 clientorganization_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 databasesstorage- Storage usage in bytesbandwidth- Bandwidth usage statisticsrequests- API request counts