|
cesium-native 0.53.0
|
Represents a connection to the Bentley iTwin API. More...
#include <CesiumITwinClient/Connection.h>
Public Member Functions | |
| CesiumAsync::Future< CesiumUtility::Result< UserProfile > > | me () |
| Obtains profile information of the currently logged in user. | |
| CesiumAsync::Future< CesiumUtility::Result< PagedList< ITwin > > > | itwins (const QueryParameters ¶ms) |
| Returns a list of iTwins the current user is a member of. | |
| CesiumAsync::Future< CesiumUtility::Result< PagedList< IModel > > > | imodels (const std::string &iTwinId, const QueryParameters ¶ms) |
| Returns a list of iModels belonging to the specified iTwin. | |
| CesiumAsync::Future< CesiumUtility::Result< PagedList< IModelMeshExport > > > | meshExports (const std::string &iModelId, const QueryParameters ¶ms) |
| Returns a list of mesh export tasks for the specified iModel. | |
| CesiumAsync::Future< CesiumUtility::Result< PagedList< ITwinRealityData > > > | realityData (const std::string &iTwinId, const QueryParameters ¶ms) |
| Returns a list of reality data instances belonging to the specified iTwin. | |
| CesiumAsync::Future< CesiumUtility::Result< std::vector< CesiumCuratedContentAsset > > > | cesiumCuratedContent () |
| Returns all available iTwin Cesium Curated Content items. | |
| CesiumAsync::Future< CesiumUtility::Result< std::vector< GeospatialFeatureCollection > > > | geospatialFeatureCollections (const std::string &iTwinId) |
| Retrieve all Collections (Feature Classes) that contain features within an iTwin. | |
| CesiumAsync::Future< CesiumUtility::Result< PagedList< CesiumVectorData::GeoJsonFeature > > > | geospatialFeatures (const std::string &iTwinId, const std::string &collectionId, uint32_t limit=10000) |
| Returns one or more pages of GeoJSON features in this iTwin. | |
| Connection (const CesiumAsync::AsyncSystem &asyncSystem, const std::shared_ptr< CesiumAsync::IAssetAccessor > &pAssetAccessor, const AuthenticationToken &authenticationToken, const std::optional< std::string > &refreshToken, const CesiumClientCommon::OAuth2ClientOptions &clientOptions) | |
Creates a new Connection with the provided tokens. | |
| const AuthenticationToken & | getAuthenticationToken () const |
| Returns the AuthenticationToken object representing the parsed JWT access or share token. | |
| void | setAuthenticationToken (const AuthenticationToken &authToken) |
| Sets the access or share token that will be used for API calls. | |
| const std::optional< std::string > & | getRefreshToken () const |
| Returns the refresh token used to obtain new access tokens, if any. | |
| void | setRefreshToken (const std::optional< std::string > &refreshToken) |
| Sets the refresh token used to obtain new access tokens, if any. | |
Static Public Member Functions | |
| static CesiumAsync::Future< CesiumUtility::Result< Connection > > | authorize (const CesiumAsync::AsyncSystem &asyncSystem, const std::shared_ptr< CesiumAsync::IAssetAccessor > &pAssetAccessor, const std::string &friendlyApplicationName, const std::string &clientID, const std::string &redirectPath, const std::optional< int > &redirectPort, const std::vector< std::string > &scopes, std::function< void(const std::string &)> &&openUrlCallback) |
Authorizes access to iTwin on behalf of a user, and returns a Connection that can be used to interact with the iTwin API. | |
Represents a connection to the Bentley iTwin API.
Definition at line 77 of file Connection.h.
|
inline |
Creates a new Connection with the provided tokens.
It's recommended to use the Connection::authorize method to create a token instead of calling this constructor directly as the authorize method will handle the OAuth2 authentication flow with iTwin.
| asyncSystem | The CesiumAsync::AsyncSystem to use. |
| pAssetAccessor | The CesiumAsync::IAssetAccessor to use for making requests to the iTwin API. |
| authenticationToken | An AuthenticationToken object created from parsing the obtained iTwin access or share token. |
| refreshToken | A refresh token to use to fetch new access tokens as needed, if any. |
| clientOptions | The set of options to use when interacting with the iTwin OAuth2 API. |
Definition at line 224 of file Connection.h.
|
static |
Authorizes access to iTwin on behalf of a user, and returns a Connection that can be used to interact with the iTwin API.
Uses the "Authorization Code with PKCE" OAuth2 flow.
See Authorize Native Application for a description of the authorization process.
| asyncSystem | The async system used to do work in threads. |
| pAssetAccessor | The interface used to interact with the iTwin REST API. |
| friendlyApplicationName | A friendly name for the application requesting access. It will be displayed to the user when authorization is complete, informing them that they can return to the original application. |
| clientID | The client ID that was assigned to your application when you registered it. |
| redirectPath | The path on http://127.0.0.1 that a user will be redirected to once they authorize your application. This must match the URI provided when you registered your application, without the protocol, hostname, or port. |
| redirectPort | If provided, this will be the port that the internal web server will attempt to bind to. If no port is specified, the server will bind to a random available port. |
| scopes | The list of scopes that the eventually-granted token should allow access to. |
| openUrlCallback | A function that is invoked to launch the user's web browser with a given URL so that they can authorize access. |
Connection once the user authorizes the application and the token handshake completes. | CesiumAsync::Future< CesiumUtility::Result< std::vector< CesiumCuratedContentAsset > > > CesiumITwinClient::Connection::cesiumCuratedContent | ( | ) |
Returns all available iTwin Cesium Curated Content items.
| CesiumAsync::Future< CesiumUtility::Result< std::vector< GeospatialFeatureCollection > > > CesiumITwinClient::Connection::geospatialFeatureCollections | ( | const std::string & | iTwinId | ) |
Retrieve all Collections (Feature Classes) that contain features within an iTwin.
| iTwinId | The ID of the iTwin to retrieve all collections from. |
| CesiumAsync::Future< CesiumUtility::Result< PagedList< CesiumVectorData::GeoJsonFeature > > > CesiumITwinClient::Connection::geospatialFeatures | ( | const std::string & | iTwinId, |
| const std::string & | collectionId, | ||
| uint32_t | limit = 10000 ) |
Returns one or more pages of GeoJSON features in this iTwin.
| iTwinId | The ID of the iTwin to load data from. |
| collectionId | The ID of the data collection to load. |
| limit | The maximum number of items per page, between 1 and 10,000. |
|
inline |
Returns the AuthenticationToken object representing the parsed JWT access or share token.
Definition at line 240 of file Connection.h.
|
inline |
Returns the refresh token used to obtain new access tokens, if any.
Definition at line 256 of file Connection.h.
| CesiumAsync::Future< CesiumUtility::Result< PagedList< IModel > > > CesiumITwinClient::Connection::imodels | ( | const std::string & | iTwinId, |
| const QueryParameters & | params ) |
Returns a list of iModels belonging to the specified iTwin.
| iTwinId | The ID of the iTwin to obtain the iModels of. |
| params | Optional parameters to filter the list results. |
| CesiumAsync::Future< CesiumUtility::Result< PagedList< ITwin > > > CesiumITwinClient::Connection::itwins | ( | const QueryParameters & | params | ) |
Returns a list of iTwins the current user is a member of.
| params | Optional parameters to filter the list results. |
| CesiumAsync::Future< CesiumUtility::Result< UserProfile > > CesiumITwinClient::Connection::me | ( | ) |
Obtains profile information of the currently logged in user.
| CesiumAsync::Future< CesiumUtility::Result< PagedList< IModelMeshExport > > > CesiumITwinClient::Connection::meshExports | ( | const std::string & | iModelId, |
| const QueryParameters & | params ) |
Returns a list of mesh export tasks for the specified iModel.
| iModelId | The ID of the iModel to obtain a list of export tasks for. |
| params | Optional parameters to filter the list results. |
| CesiumAsync::Future< CesiumUtility::Result< PagedList< ITwinRealityData > > > CesiumITwinClient::Connection::realityData | ( | const std::string & | iTwinId, |
| const QueryParameters & | params ) |
Returns a list of reality data instances belonging to the specified iTwin.
| iTwinId | The ID of the iTwin to obtain a list of reality data instances for. |
| params | Optional parameters to filter the list results. |
|
inline |
Sets the access or share token that will be used for API calls.
| authToken | The new auth token. |
Definition at line 249 of file Connection.h.
|
inline |
Sets the refresh token used to obtain new access tokens, if any.
Definition at line 263 of file Connection.h.