NsdkSitesSession
Declaration
final class NsdkSitesSessionMethods
| Name | Type | Summary |
|---|---|---|
| requestAssetInfo | AssetResult | |
| requestAssetsForSite | AssetResult | 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. |
| requestOrganizationInfo | OrganizationResult | 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. |
| requestOrganizationsForUser | OrganizationResult | 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. |
| requestSelfUserInfo | UserResult | 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. |
| requestSiteInfo | SiteResult | 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. |
| requestSitesForOrganization | SiteResult | 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. |
| requestUserInfo | UserResult | 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. |
- 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
AssetResultcontaining the asset info.- Throws:
-
CancellationErrorif the Task running this function was cancelled.-
TimeoutErrorif the function timed out before it could complete execution.-
SitesResult.Errorif there was an error specific to the network query.