starkbank v2.6.2 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 list of up to 100 Workspace objects previously created in the Stark Bank API and the cursor to the next page. Use this function instead of query if you want to manually page your requests.
Same as page(), 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.
Update a Workspace by passing its ID.
Same as update(), 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"
Parameters (optional):
:allowed_tax_ids
[list of strings, default []]: list of tax IDs that will be allowed to send Deposits to this Workspace. If empty, all are allowed. ex: ["012.345.678-90", "20.018.183/0001-80"]
Attributes (return-only):
:id
[string, default nil]: unique id returned when the workspace is created. ex: "5656565656565656"
create(parameters \\ [])
View Sourcecreate( user: StarkBank.User.Organization.t() | nil, username: binary(), name: binary(), allowed_tax_ids: [binary()] ) :: {:ok, 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.
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, default nil]: Organization or Project struct. Only necessary if default project or organization has not been set in configs.
Return:
- Workspace struct with updated attributes
Same as get(), but it will unwrap the error tuple and raise in case of errors.
Receive a list of up to 100 Workspace objects previously created in the Stark Bank API and the cursor to the next page. Use this function instead of query if you want to manually page your requests.
Options:
:cursor
[string, default nil]: cursor returned on the previous page function call: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:
- list of Workspace structs with updated attributes and cursor to retrieve the next page of Workspace objects
Same as page(), 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
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.
Update a Workspace by passing its ID.
Parameters (required):
:id
[string]: Invoice id. ex: '5656565656565656'
Parameters (optional):
:username
[string, default nil]: Simplified name to define the workspace URL. This name must be unique across all Stark Bank Workspaces. Ex: "starkbank-workspace":name
[string, default nil]: Full name that identifies the Workspace. This name will appear when people access the Workspace on our platform, for example. Ex: "Stark Bank Workspace":allowed_tax_ids
[list of strings, default nil]: list of tax IDs that will be allowed to send Deposits to this Workspace. If empty, all are allowed. ex: ["012.345.678-90", "20.018.183/0001-80"]:user
[Organization/Project, default nil]: Organization or Project struct returned from StarkBank.project(). Only necessary if default project or organization has not been set in configs.
Return:
- target Workspace with updated attributes
Same as update(), but it will unwrap the error tuple and raise in case of errors.