Turso.Platform.Groups
Manage groups in Turso.
This module is incomplete and only supports a subsset of groups functionality in the Turso Platform API.
type alias Group =
{ name : String
, version : String
, groupId : String
, locations : Array String
, primaryLocation : String
, deleteProtection : Bool
}
A group in Turso. Many functions in this module return a Group
.
List Groups
list :
Connection
-> Task (Error ( Array Group))
(Response ( Array Group))
List all groups in Turso for the organization specified in the
Turso.Db.Connection
.
Get a Single Group
type alias RetrieveArgs =
{ groupName : String }
Arguments for the retrieve
function.
groupName
is the group you're attempting to retrieve from Turso.
type RetrieveError
= RetrieveErrorGroupNotFound
| RetrieveHttpError (Error Group)
Errors that can happen when attempting to get a group.
RetrieveErrorGroupNotFound
happens when the givengroupName
does not exist.RetrieveHttpError
captures any other HTTP errors.
retrieve :
Connection
-> RetrieveArgs
-> Task RetrieveError (Response Group)
Get a single group in Turso.
Get Group Configuration
type alias RetrieveConfigurationArgs =
{ groupName : String }
Arguments for the retrieve
function.
groupName
is the group you're attempting to retrieve the configuration info of.
type alias RetrieveConfigurationResult =
{ deleteProtection : Bool }
Result of successfully getting a groups configuration.
deleteProtection
specifies if the group cannot be deleted.
type RetrieveConfigurationError
= RetrieveConfigurationErrorGroupNotFound
| RetrieveConfigurationHttpError (Error RetrieveConfigurationResult)
Errors that can happen when attempting to get a group.
RetrieveConfigurationErrorGroupNotFound
happens when the givengroupName
does not exist.RetrieveConfigurationHttpError
captures any other HTTP errors.
retrieveConfiguration :
Connection
-> RetrieveConfigurationArgs
-> Task RetrieveConfigurationError (Response RetrieveConfigurationResult)
Retrieve the configuration for a group in Turso.