starkbank v2.3.0 StarkBank.Workspace View Source
Groups Workspace related functions
Link to this section Summary
Functions
Workspaces are bank accounts. They have independent balances, statements, operations and permissions. The only property that is shared between your workspaces is that they are linked to your organization, which carries your basic informations, such as tax ID, name, etc.
Send a single Workspace for creation in the Stark Bank API
Same as create(), but it will unwrap the error tuple and raise in case of errors.
Receive a single Workspace struct previously created in the Stark Bank API by passing its id
Same as get(), but it will unwrap the error tuple and raise in case of errors.
Receive a stream of Workspace structs previously created in the Stark Bank API
Same as query(), but it will unwrap the error tuple and raise in case of errors.
Link to this section Types
Link to this section Functions
Workspaces are bank accounts. They have independent balances, statements, operations and permissions. The only property that is shared between your workspaces is that they are linked to your organization, which carries your basic informations, such as tax ID, name, etc.
Parameters (required):
:username
[string]: Simplified name to define the workspace URL. This name must be unique across all Stark Bank Workspaces. Ex: "starkbankworkspace":name
[string]: Full name that identifies the Workspace. This name will appear when people access the Workspace on our platform, for example. Ex: "Stark Bank Workspace"
Attributes (return-only):
:id
[string, default None]: unique id returned when the workspace is created. ex: "5656565656565656"
create(parameters \\ [])
View Sourcecreate( user: StarkBank.User.Organization.t() | nil, username: binary(), name: binary() ) :: {:ok, StarkBank.Workspace.t()} | {:error, [StarkBank.Error.t()]}
Send a single Workspace for creation in the Stark Bank API
Parameters (required):
:username
[string]: Simplified name to define the workspace URL. This name must be unique across all Stark Bank Workspaces. Ex: "starkbankworkspace":name
[string]: Full name that identifies the Workspace. This name will appear when people access the Workspace on our platform, for example. Ex: "Stark Bank Workspace"
Options:
:user
[Organization]: Organization struct with nil workspace_id. Only necessary if default organization has not been set in configs.
Return:
- Workspace struct with updated attributes
Same as create(), but it will unwrap the error tuple and raise in case of errors.
get(id, options \\ [])
View Sourceget(binary(), [ {:user, StarkBank.User.Project.t() | StarkBank.User.Organization.t() | nil} ]) :: {:ok, StarkBank.Workspace.t()} | {:error, [%StarkBank.Error{code: term(), message: term()}]}
Receive a single Workspace struct previously created in the Stark Bank API by passing its id
Parameters (required):
id
[string]: struct unique id. ex: "5656565656565656"
Options:
:user
[Organization/Project]: Organization or Project struct. Only necessary if default project or organization has not been set in configs.
Return:
- Workspace struct with updated attributes
get!(id, options \\ [])
View Sourceget!(binary(), [ {:user, StarkBank.User.Project.t() | StarkBank.User.Organization.t() | nil} ]) :: StarkBank.Workspace.t()
Same as get(), but it will unwrap the error tuple and raise in case of errors.
query(options \\ [])
View Sourcequery( limit: integer(), username: binary(), ids: [binary()], user: StarkBank.User.Project.t() | StarkBank.User.Organization.t() ) :: ({:cont, {:ok, [StarkBank.Workspace.t()]}} | {:error, [StarkBank.Error.t()]} | {:halt, any()} | {:suspend, any()}, any() -> any())
Receive a stream of Workspace structs previously created in the Stark Bank API
Options:
:limit
[integer, default nil]: maximum number of structs to be retrieved. Unlimited if nil. ex: 35:username
[string]: query by the simplified name that defines the workspace URL. This name is always unique across all Stark Bank Workspaces. Ex: "starkbankworkspace":ids
[list of strings, default nil]: list of ids to filter retrieved structs. ex: ["5656565656565656", "4545454545454545"]:user
[Project]: Project struct returned from StarkBank.project(). Only necessary if default project or organization has not been set in configs.
Return:
- stream of Workspace structs with updated attributes
Same as query(), but it will unwrap the error tuple and raise in case of errors.