Skip to main content
API Reference SwiftyNsdk

NsdkSitesSession


Declaration

final class NsdkSitesSession

Methods

NameTypeSummary
requestAssetInfoAssetResult
Requests asset info and waits for the result.
- Parameters:
- assetId: The asset ID to fetch info for.
- pollingInterval: The interval between status checks (default: 0.5 seconds).
- timeout: Maximum time to wait for completion (default: 60 seconds).
- Returns: An AssetResult containing the asset info.
- Throws:
- CancellationError if the Task running this function was cancelled.
- TimeoutError if the function timed out before it could complete execution.
- SitesResult.Error if there was an error specific to the network query.
requestAssetsForSiteAssetResult
Requests assets for a site and waits for the result.
- Parameters:
- siteId: The site ID to fetch assets for.
- pollingInterval: The interval between status checks (default: 0.5 seconds).
- timeout: Maximum time to wait for completion (default: 60 seconds).
- Returns: An AssetResult containing the assets.
- Throws:
- CancellationError if the Task running this function was cancelled.
- TimeoutError if the function timed out before it could complete execution.
- SitesResult.Error if there was an error specific to the network query.
requestOrganizationInfoOrganizationResult
Requests organization info and waits for the result.
- Parameters:
- orgId: The organization ID to fetch info for.
- pollingInterval: The interval between status checks (default: 0.5 seconds).
- timeout: Maximum time to wait for completion (default: 60 seconds).
- Returns: An OrganizationResult containing the organization info.
- Throws:
- CancellationError if the Task running this function was cancelled.
- TimeoutError if the function timed out before it could complete execution.
- SitesResult.Error if there was an error specific to the network query.
requestOrganizationsForUserOrganizationResult
Requests organizations for a user and waits for the result.
This is an async wrapper that combines request initiation and polling.
It automatically handles polling until the request completes or times out.
- Parameters:
- userId: The user ID to fetch organizations for.
- pollingInterval: The interval between status checks (default: 0.5 seconds).
- timeout: Maximum time to wait for completion (default: 60 seconds).
- Returns: An OrganizationResult containing the organizations.
- Throws:
- CancellationError if the Task running this function was cancelled.
- TimeoutError if the function timed out before it could complete execution.
- SitesResult.Error if there was an error specific to the network query.
requestSelfUserInfoUserResult
Requests self user info and waits for the result.
Uses the user ID from the authenticated session's metadata.
- Parameters:
- pollingInterval: The interval between status checks (default: 0.5 seconds).
- timeout: Maximum time to wait for completion (default: 60 seconds).
- Returns: A UserResult containing the user info.
- Throws:
- CancellationError if the Task running this function was cancelled.
- TimeoutError if the function timed out before it could complete execution.
- SitesResult.Error if there was an error specific to the network query.
- NsdkError.invalidOperation if no access token was available.
requestSiteInfoSiteResult
Requests site info and waits for the result.
- Parameters:
- siteId: The site ID to fetch info for.
- pollingInterval: The interval between status checks (default: 0.5 seconds).
- timeout: Maximum time to wait for completion (default: 60 seconds).
- Returns: A SiteResult containing the site info.
- Throws:
- CancellationError if the Task running this function was cancelled.
- TimeoutError if the function timed out before it could complete execution.
- SitesResult.Error if there was an error specific to the network query.
requestSitesForOrganizationSiteResult
Requests sites for an organization and waits for the result.
- Parameters:
- orgId: The organization ID to fetch sites for.
- pollingInterval: The interval between status checks (default: 0.5 seconds).
- timeout: Maximum time to wait for completion (default: 60 seconds).
- Returns: A SiteResult containing the sites.
- Throws:
- CancellationError if the Task running this function was cancelled.
- TimeoutError if the function timed out before it could complete execution.
- SitesResult.Error if there was an error specific to the network query.
requestUserInfoUserResult
Requests user info and waits for the result.
- Parameters:
- userId: The user ID to fetch info for.
- pollingInterval: The interval between status checks (default: 0.5 seconds).
- timeout: Maximum time to wait for completion (default: 60 seconds).
- Returns: A UserResult containing the user info.
- Throws:
- CancellationError if the Task running this function was cancelled.
- TimeoutError if the function timed out before it could complete execution.
- SitesResult.Error if there was an error specific to the network query.

ON THIS PAGE