3 #include "ApplicationData.h"
11 #include <CesiumAsync/AsyncSystem.h>
12 #include <CesiumAsync/IAssetAccessor.h>
13 #include <CesiumAsync/Library.h>
40 std::optional<int32_t>
page;
102 const std::shared_ptr<CesiumAsync::IAssetAccessor>& pAssetAccessor,
103 const std::string& friendlyApplicationName,
105 const std::string& redirectPath,
106 const std::vector<std::string>& scopes,
107 std::function<
void(
const std::string&)>&& openUrlCallback,
109 const std::string& ionApiUrl =
"https://api.cesium.com/",
110 const std::string& ionAuthorizeUrl =
"https://ion.cesium.com/oauth");
119 const std::shared_ptr<CesiumAsync::IAssetAccessor>& pAssetAccessor,
120 const std::string& apiUrl =
"https://api.cesium.com");
124 const std::shared_ptr<CesiumAsync::IAssetAccessor>& pAssetAccessor,
125 const std::string& ionUrl);
139 const std::shared_ptr<CesiumAsync::IAssetAccessor>& pAssetAccessor,
140 const std::string& accessToken,
142 const std::string& apiUrl =
"https://api.cesium.com");
148 return this->_asyncSystem;
155 const std::shared_ptr<CesiumAsync::IAssetAccessor>&
157 return this->_pAssetAccessor;
164 return this->_accessToken;
170 const std::string&
getApiUrl() const noexcept {
return this->_apiUrl; }
268 const std::string& name,
269 const std::vector<std::string>& scopes,
270 const std::optional<std::vector<int64_t>>& assetIds = std::nullopt,
271 const std::optional<std::vector<std::string>>& allowedUrls =
288 const std::string& tokenID,
289 const std::string& newName,
290 const std::optional<std::vector<int64_t>>& newAssetIDs,
291 const std::vector<std::string>& newScopes,
292 const std::optional<std::vector<std::string>>& newAllowedUrls)
const;
306 const std::shared_ptr<CesiumAsync::IAssetAccessor>& pAssetAccessor,
308 const std::string& ionApiUrl,
310 const std::string& code,
311 const std::string& redirectUrl,
312 const std::string& codeVerifier);
317 std::shared_ptr<CesiumAsync::IAssetAccessor> _pAssetAccessor;
318 std::string _accessToken;
A system for managing asynchronous requests and tasks.
A value that will be available in the future, as produced by AsyncSystem.
A connection to Cesium ion that can be used to interact with it via its REST API.
const std::string & getApiUrl() const noexcept
Gets the Cesium ion API base URL.
static CesiumAsync::Future< Connection > authorize(const CesiumAsync::AsyncSystem &asyncSystem, const std::shared_ptr< CesiumAsync::IAssetAccessor > &pAssetAccessor, const std::string &friendlyApplicationName, int64_t clientID, const std::string &redirectPath, const std::vector< std::string > &scopes, std::function< void(const std::string &)> &&openUrlCallback, const CesiumIonClient::ApplicationData &appData, const std::string &ionApiUrl="https://api.cesium.com/", const std::string &ionAuthorizeUrl="https://ion.cesium.com/oauth")
Authorizes access to Cesium ion on behalf of a user, and returns a Connection that can be used to int...
Connection(const CesiumAsync::AsyncSystem &asyncSystem, const std::shared_ptr< CesiumAsync::IAssetAccessor > &pAssetAccessor, const std::string &accessToken, const CesiumIonClient::ApplicationData &appData, const std::string &apiUrl="https://api.cesium.com")
Creates a connection to Cesium ion using the provided access token.
const std::shared_ptr< CesiumAsync::IAssetAccessor > & getAssetAccessor() const noexcept
Gets the interface used by this connection to interact with the Cesium ion REST API.
CesiumAsync::Future< Response< TokenList > > tokens(const ListTokensOptions &options={}) const
Invokes the "List tokens" service to get the list of available tokens.
CesiumAsync::Future< Response< TokenList > > previousPage(const Response< TokenList > ¤tPage) const
Gets the previous page of results from the "List tokens" service.
CesiumAsync::Future< Response< Token > > token(const std::string &tokenID) const
Gets details of the token with the given ID.
static std::optional< std::string > getIdFromToken(const std::string &token)
Decodes a token ID from a token.
static CesiumAsync::Future< Response< ApplicationData > > appData(const CesiumAsync::AsyncSystem &asyncSystem, const std::shared_ptr< CesiumAsync::IAssetAccessor > &pAssetAccessor, const std::string &apiUrl="https://api.cesium.com")
Retrieves information about the ion API server.
CesiumAsync::Future< Response< Assets > > assets() const
Gets the list of available assets.
CesiumAsync::Future< Response< Token > > createToken(const std::string &name, const std::vector< std::string > &scopes, const std::optional< std::vector< int64_t >> &assetIds=std::nullopt, const std::optional< std::vector< std::string >> &allowedUrls=std::nullopt) const
Creates a new token.
const CesiumAsync::AsyncSystem & getAsyncSystem() const noexcept
Gets the async system used by this connection to do work in threads.
const std::string & getAccessToken() const noexcept
Gets the access token used by this connection.
CesiumAsync::Future< Response< Asset > > asset(int64_t assetID) const
Gets details of the asset with the given ID.
CesiumAsync::Future< Response< NoValue > > modifyToken(const std::string &tokenID, const std::string &newName, const std::optional< std::vector< int64_t >> &newAssetIDs, const std::vector< std::string > &newScopes, const std::optional< std::vector< std::string >> &newAllowedUrls) const
Modifies a token.
CesiumAsync::Future< Response< Profile > > me() const
Retrieves profile information for the access token currently being used to make API calls.
CesiumAsync::Future< Response< TokenList > > nextPage(const Response< TokenList > ¤tPage) const
Gets the next page of results from the "List tokens" service.
CesiumAsync::Future< Response< Defaults > > defaults() const
Retrieves default imagery, terrain and building assets along with quick add assets that can be useful...
Classes for working with Cesium ion clients.
SortOrder
Whether sorted results should be ascending or descending.
Data retrieved from the Cesium ion server via an "appData" request from Cesium ion....
Options to be passed to Connection::tokens.
std::optional< std::string > search
One or more keywords separated by whitespace by which to filter the list of tokens....
std::optional< int32_t > page
The page number, where the first page of results is page 1 (not 0).
std::optional< std::string > sortBy
The property by which to sort results. Valid values are "NAME" and "LAST_USED".
std::optional< int32_t > limit
The maximum number of tokens to return in a single page.
std::optional< SortOrder > sortOrder
The property by which to sort results. Valid values are "NAME" and "LAST_USED".
A response from Cesium ion.