Skip to contents

Account$current() is the typical way of creating an Account

If the current request signer (CLI user or execution context) lacks permissions to fetch some information, the corresponding operations will act as if the information does not exist. Update operations will usually produce errors.

See also

Other Accounts APIs: Account$current

Public fields

id

String. Unique identifier.

Methods


Method new()

Get the representation of a specific account.

Usage

Account$new(id)

Arguments

id

String. The ID of the target account.


Method print()

Print a human-readable representation of this account.

Usage

Account$print()

Examples

\dontrun{
acc <- Account$current()
acc$print()
}


Method load()

(Re-)populate this account instance's cache.

Future calls to most getters will return immediately without making a network request.

Always makes a network request.

Usage

Account$load()

Examples

\dontrun{
acc <- Account$current()
acc$print()
acc$load()
acc$print()
}


Method get_display_name()

Get the display name of this account.

This is an opaque string that can contain any valid Unicode data.

Display names are not unique and must never be used as identifiers. Use id instead.

For users, this is the user's full name as reported by the authentication provider.

For teams, this is the team display name.

Usage

Account$get_display_name(load_if_missing = TRUE)

Arguments

load_if_missing

Logical.
If TRUE, load() the display name if not in cache. If FALSE, return NULL if not in cache.

Returns

String value of the display name.

Examples

\dontrun{
acc <- Account$current()
acc$get_display_name()
}


Method list_registry_projects()

List Registry projects owned by this workspace.

Usage

Account$list_registry_projects(load_if_missing = TRUE)

Arguments

load_if_missing

Logical.
If TRUE, load() the project list if not in cache. If FALSE, return NULL if not in cache.

Returns

List of projects owned by this workspace.

Examples

\dontrun{
acc <- Account$current()
acc$list_registry_projects()
}


Method clone()

The objects of this class are cloneable with this method.

Usage

Account$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

Account$new("1")
#> <Account id=1>

## ------------------------------------------------
## Method `Account$print`
## ------------------------------------------------

if (FALSE) {
acc <- Account$current()
acc$print()
}

## ------------------------------------------------
## Method `Account$load`
## ------------------------------------------------

if (FALSE) {
acc <- Account$current()
acc$print()
acc$load()
acc$print()
}

## ------------------------------------------------
## Method `Account$get_display_name`
## ------------------------------------------------

if (FALSE) {
acc <- Account$current()
acc$get_display_name()
}

## ------------------------------------------------
## Method `Account$list_registry_projects`
## ------------------------------------------------

if (FALSE) {
acc <- Account$current()
acc$list_registry_projects()
}