Skip to main content

Methods

List virtual accounts for the tenant.

Parameters

limit
typing.Optional[int]
Number of items per page
offset
typing.Optional[int]
Number of items to skip

Returns

SyncPager[VirtualAccount]
SyncPager[VirtualAccount]
🔗 VirtualAccountReturn all virtual accounts for the tenant

Usage

from truefoundry import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)

client.virtual_accounts.list(
    limit=10,
    offset=10,
)

# Iterate through results
for item in response:
    print(item.name)

# Or paginate page by page
for page in response.iter_pages():
    for item in page:
        print(item.name)
Creates a new virtual account or updates an existing one based on the provided manifest.

Parameters

manifest
VirtualAccountManifest
required
🔗 VirtualAccountManifestVirtual account manifest
dry_run
typing.Optional[bool]
Dry run

Returns

GetVirtualAccountResponse
GetVirtualAccountResponse
🔗 GetVirtualAccountResponseVirtual account created/updated successfully

Usage

from truefoundry import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)

client.virtual_accounts.create_or_update(
    manifest={"key": "value"},
    dry_run=False,
)
Get virtual account by id

Parameters

id
str
required
serviceaccount id

Returns

GetVirtualAccountResponse
GetVirtualAccountResponse
🔗 GetVirtualAccountResponseReturns the virtual account associated with the provided virtual account id

Usage

from truefoundry import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)

client.virtual_accounts.get(
    id="id_value",
)
Delete a virtual account associated with the provided virtual account id.

Parameters

id
str
required
serviceaccount id

Returns

DeleteVirtualAccountResponse
DeleteVirtualAccountResponse
🔗 DeleteVirtualAccountResponseVirtual account deleted successfully

Usage

from truefoundry import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)

client.virtual_accounts.delete(
    id="id_value",
)
I