Supported CloudGame.
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
2020-07-23 Version: 1.36.534
|
||||
- Supported CloudGame.
|
||||
|
||||
2020-07-23 Version: 1.36.533
|
||||
- Supported AAA for BBB.
|
||||
- Fixed bugs for CCC.
|
||||
|
||||
90
cloudgame/CMakeLists.txt
Normal file
90
cloudgame/CMakeLists.txt
Normal file
@@ -0,0 +1,90 @@
|
||||
#
|
||||
# Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
set(public_header_dir ${CMAKE_CURRENT_SOURCE_DIR}/../include)
|
||||
|
||||
set(cloudgame_public_header
|
||||
include/alibabacloud/cloudgame/CloudgameClient.h
|
||||
include/alibabacloud/cloudgame/CloudgameExport.h )
|
||||
|
||||
set(cloudgame_public_header_model
|
||||
include/alibabacloud/cloudgame/model/ListGamesRequest.h
|
||||
include/alibabacloud/cloudgame/model/ListGamesResult.h
|
||||
include/alibabacloud/cloudgame/model/ListProjectsRequest.h
|
||||
include/alibabacloud/cloudgame/model/ListProjectsResult.h )
|
||||
|
||||
set(cloudgame_src
|
||||
src/CloudgameClient.cc
|
||||
src/model/ListGamesRequest.cc
|
||||
src/model/ListGamesResult.cc
|
||||
src/model/ListProjectsRequest.cc
|
||||
src/model/ListProjectsResult.cc )
|
||||
|
||||
add_library(cloudgame ${LIB_TYPE}
|
||||
${cloudgame_public_header}
|
||||
${cloudgame_public_header_model}
|
||||
${cloudgame_src})
|
||||
|
||||
set_target_properties(cloudgame
|
||||
PROPERTIES
|
||||
LINKER_LANGUAGE CXX
|
||||
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib
|
||||
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib
|
||||
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
|
||||
OUTPUT_NAME ${TARGET_OUTPUT_NAME_PREFIX}cloudgame
|
||||
)
|
||||
|
||||
if(${LIB_TYPE} STREQUAL "SHARED")
|
||||
set_target_properties(cloudgame
|
||||
PROPERTIES
|
||||
DEFINE_SYMBOL ALIBABACLOUD_CLOUDGAME_LIBRARY)
|
||||
endif()
|
||||
|
||||
target_include_directories(cloudgame
|
||||
PRIVATE include
|
||||
${CMAKE_SOURCE_DIR}/core/include
|
||||
)
|
||||
target_link_libraries(cloudgame
|
||||
core)
|
||||
|
||||
if(CMAKE_HOST_WIN32)
|
||||
ExternalProject_Get_Property(jsoncpp INSTALL_DIR)
|
||||
set(jsoncpp_install_dir ${INSTALL_DIR})
|
||||
add_dependencies(cloudgame
|
||||
jsoncpp)
|
||||
target_include_directories(cloudgame
|
||||
PRIVATE ${jsoncpp_install_dir}/include)
|
||||
target_link_libraries(cloudgame
|
||||
${jsoncpp_install_dir}/lib/jsoncpp.lib)
|
||||
set_target_properties(cloudgame
|
||||
PROPERTIES
|
||||
COMPILE_OPTIONS "/bigobj")
|
||||
else()
|
||||
target_include_directories(cloudgame
|
||||
PRIVATE /usr/include/jsoncpp)
|
||||
target_link_libraries(cloudgame
|
||||
jsoncpp)
|
||||
endif()
|
||||
|
||||
install(FILES ${cloudgame_public_header}
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/cloudgame)
|
||||
install(FILES ${cloudgame_public_header_model}
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/cloudgame/model)
|
||||
install(TARGETS cloudgame
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
)
|
||||
62
cloudgame/include/alibabacloud/cloudgame/CloudgameClient.h
Normal file
62
cloudgame/include/alibabacloud/cloudgame/CloudgameClient.h
Normal file
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_CLOUDGAME_CLOUDGAMECLIENT_H_
|
||||
#define ALIBABACLOUD_CLOUDGAME_CLOUDGAMECLIENT_H_
|
||||
|
||||
#include <future>
|
||||
#include <alibabacloud/core/AsyncCallerContext.h>
|
||||
#include <alibabacloud/core/EndpointProvider.h>
|
||||
#include <alibabacloud/core/RpcServiceClient.h>
|
||||
#include "CloudgameExport.h"
|
||||
#include "model/ListGamesRequest.h"
|
||||
#include "model/ListGamesResult.h"
|
||||
#include "model/ListProjectsRequest.h"
|
||||
#include "model/ListProjectsResult.h"
|
||||
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Cloudgame
|
||||
{
|
||||
class ALIBABACLOUD_CLOUDGAME_EXPORT CloudgameClient : public RpcServiceClient
|
||||
{
|
||||
public:
|
||||
typedef Outcome<Error, Model::ListGamesResult> ListGamesOutcome;
|
||||
typedef std::future<ListGamesOutcome> ListGamesOutcomeCallable;
|
||||
typedef std::function<void(const CloudgameClient*, const Model::ListGamesRequest&, const ListGamesOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ListGamesAsyncHandler;
|
||||
typedef Outcome<Error, Model::ListProjectsResult> ListProjectsOutcome;
|
||||
typedef std::future<ListProjectsOutcome> ListProjectsOutcomeCallable;
|
||||
typedef std::function<void(const CloudgameClient*, const Model::ListProjectsRequest&, const ListProjectsOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ListProjectsAsyncHandler;
|
||||
|
||||
CloudgameClient(const Credentials &credentials, const ClientConfiguration &configuration);
|
||||
CloudgameClient(const std::shared_ptr<CredentialsProvider> &credentialsProvider, const ClientConfiguration &configuration);
|
||||
CloudgameClient(const std::string &accessKeyId, const std::string &accessKeySecret, const ClientConfiguration &configuration);
|
||||
~CloudgameClient();
|
||||
ListGamesOutcome listGames(const Model::ListGamesRequest &request)const;
|
||||
void listGamesAsync(const Model::ListGamesRequest& request, const ListGamesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
ListGamesOutcomeCallable listGamesCallable(const Model::ListGamesRequest& request) const;
|
||||
ListProjectsOutcome listProjects(const Model::ListProjectsRequest &request)const;
|
||||
void listProjectsAsync(const Model::ListProjectsRequest& request, const ListProjectsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
ListProjectsOutcomeCallable listProjectsCallable(const Model::ListProjectsRequest& request) const;
|
||||
|
||||
private:
|
||||
std::shared_ptr<EndpointProvider> endpointProvider_;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !ALIBABACLOUD_CLOUDGAME_CLOUDGAMECLIENT_H_
|
||||
32
cloudgame/include/alibabacloud/cloudgame/CloudgameExport.h
Normal file
32
cloudgame/include/alibabacloud/cloudgame/CloudgameExport.h
Normal file
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_CLOUDGAME_CLOUDGAMEEXPORT_H_
|
||||
#define ALIBABACLOUD_CLOUDGAME_CLOUDGAMEEXPORT_H_
|
||||
|
||||
#include <alibabacloud/core/Global.h>
|
||||
|
||||
#if defined(ALIBABACLOUD_SHARED)
|
||||
# if defined(ALIBABACLOUD_CLOUDGAME_LIBRARY)
|
||||
# define ALIBABACLOUD_CLOUDGAME_EXPORT ALIBABACLOUD_DECL_EXPORT
|
||||
# else
|
||||
# define ALIBABACLOUD_CLOUDGAME_EXPORT ALIBABACLOUD_DECL_IMPORT
|
||||
# endif
|
||||
#else
|
||||
# define ALIBABACLOUD_CLOUDGAME_EXPORT
|
||||
#endif
|
||||
|
||||
#endif // !ALIBABACLOUD_CLOUDGAME_CLOUDGAMEEXPORT_H_
|
||||
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_CLOUDGAME_MODEL_LISTGAMESREQUEST_H_
|
||||
#define ALIBABACLOUD_CLOUDGAME_MODEL_LISTGAMESREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/cloudgame/CloudgameExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Cloudgame
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_CLOUDGAME_EXPORT ListGamesRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
ListGamesRequest();
|
||||
~ListGamesRequest();
|
||||
|
||||
std::string getOrderKey()const;
|
||||
void setOrderKey(const std::string& orderKey);
|
||||
std::string getSortType()const;
|
||||
void setSortType(const std::string& sortType);
|
||||
int getPageNumber()const;
|
||||
void setPageNumber(int pageNumber);
|
||||
int getPageSize()const;
|
||||
void setPageSize(int pageSize);
|
||||
|
||||
private:
|
||||
std::string orderKey_;
|
||||
std::string sortType_;
|
||||
int pageNumber_;
|
||||
int pageSize_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_CLOUDGAME_MODEL_LISTGAMESREQUEST_H_
|
||||
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_CLOUDGAME_MODEL_LISTGAMESRESULT_H_
|
||||
#define ALIBABACLOUD_CLOUDGAME_MODEL_LISTGAMESRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/cloudgame/CloudgameExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Cloudgame
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_CLOUDGAME_EXPORT ListGamesResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct DataListItem
|
||||
{
|
||||
std::string status;
|
||||
std::string frameRate;
|
||||
std::string inputType;
|
||||
std::string device;
|
||||
std::string gameName;
|
||||
std::string installPath;
|
||||
std::string curVersion;
|
||||
std::string savePath;
|
||||
std::string gameId;
|
||||
std::string resolution;
|
||||
};
|
||||
|
||||
|
||||
ListGamesResult();
|
||||
explicit ListGamesResult(const std::string &payload);
|
||||
~ListGamesResult();
|
||||
std::vector<DataListItem> getDataList()const;
|
||||
int getPageSize()const;
|
||||
int getCurrentPage()const;
|
||||
std::string getCount()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::vector<DataListItem> dataList_;
|
||||
int pageSize_;
|
||||
int currentPage_;
|
||||
std::string count_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_CLOUDGAME_MODEL_LISTGAMESRESULT_H_
|
||||
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_CLOUDGAME_MODEL_LISTPROJECTSREQUEST_H_
|
||||
#define ALIBABACLOUD_CLOUDGAME_MODEL_LISTPROJECTSREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/cloudgame/CloudgameExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Cloudgame
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_CLOUDGAME_EXPORT ListProjectsRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
ListProjectsRequest();
|
||||
~ListProjectsRequest();
|
||||
|
||||
std::string getProjectName()const;
|
||||
void setProjectName(const std::string& projectName);
|
||||
int getPageNumber()const;
|
||||
void setPageNumber(int pageNumber);
|
||||
int getPageSize()const;
|
||||
void setPageSize(int pageSize);
|
||||
|
||||
private:
|
||||
std::string projectName_;
|
||||
int pageNumber_;
|
||||
int pageSize_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_CLOUDGAME_MODEL_LISTPROJECTSREQUEST_H_
|
||||
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_CLOUDGAME_MODEL_LISTPROJECTSRESULT_H_
|
||||
#define ALIBABACLOUD_CLOUDGAME_MODEL_LISTPROJECTSRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/cloudgame/CloudgameExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Cloudgame
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_CLOUDGAME_EXPORT ListProjectsResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct DataListItem
|
||||
{
|
||||
std::string highDefinitionCodeRate;
|
||||
std::string highDefinitionResolution;
|
||||
std::string projectName;
|
||||
std::string standardResolution;
|
||||
std::string projectId;
|
||||
std::string highestCodeRate;
|
||||
int concurrencyLimitNumber;
|
||||
std::string standardCodeRate;
|
||||
std::string highestResolution;
|
||||
};
|
||||
|
||||
|
||||
ListProjectsResult();
|
||||
explicit ListProjectsResult(const std::string &payload);
|
||||
~ListProjectsResult();
|
||||
std::vector<DataListItem> getDataList()const;
|
||||
int getPageSize()const;
|
||||
int getCurrentPage()const;
|
||||
int getCount()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::vector<DataListItem> dataList_;
|
||||
int pageSize_;
|
||||
int currentPage_;
|
||||
int count_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_CLOUDGAME_MODEL_LISTPROJECTSRESULT_H_
|
||||
125
cloudgame/src/CloudgameClient.cc
Normal file
125
cloudgame/src/CloudgameClient.cc
Normal file
@@ -0,0 +1,125 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/cloudgame/CloudgameClient.h>
|
||||
#include <alibabacloud/core/SimpleCredentialsProvider.h>
|
||||
|
||||
using namespace AlibabaCloud;
|
||||
using namespace AlibabaCloud::Location;
|
||||
using namespace AlibabaCloud::Cloudgame;
|
||||
using namespace AlibabaCloud::Cloudgame::Model;
|
||||
|
||||
namespace
|
||||
{
|
||||
const std::string SERVICE_NAME = "cloudgame";
|
||||
}
|
||||
|
||||
CloudgameClient::CloudgameClient(const Credentials &credentials, const ClientConfiguration &configuration) :
|
||||
RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(credentials), configuration)
|
||||
{
|
||||
auto locationClient = std::make_shared<LocationClient>(credentials, configuration);
|
||||
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
|
||||
}
|
||||
|
||||
CloudgameClient::CloudgameClient(const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration & configuration) :
|
||||
RpcServiceClient(SERVICE_NAME, credentialsProvider, configuration)
|
||||
{
|
||||
auto locationClient = std::make_shared<LocationClient>(credentialsProvider, configuration);
|
||||
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
|
||||
}
|
||||
|
||||
CloudgameClient::CloudgameClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) :
|
||||
RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(accessKeyId, accessKeySecret), configuration)
|
||||
{
|
||||
auto locationClient = std::make_shared<LocationClient>(accessKeyId, accessKeySecret, configuration);
|
||||
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
|
||||
}
|
||||
|
||||
CloudgameClient::~CloudgameClient()
|
||||
{}
|
||||
|
||||
CloudgameClient::ListGamesOutcome CloudgameClient::listGames(const ListGamesRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return ListGamesOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return ListGamesOutcome(ListGamesResult(outcome.result()));
|
||||
else
|
||||
return ListGamesOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void CloudgameClient::listGamesAsync(const ListGamesRequest& request, const ListGamesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, listGames(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
CloudgameClient::ListGamesOutcomeCallable CloudgameClient::listGamesCallable(const ListGamesRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<ListGamesOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->listGames(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
CloudgameClient::ListProjectsOutcome CloudgameClient::listProjects(const ListProjectsRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return ListProjectsOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return ListProjectsOutcome(ListProjectsResult(outcome.result()));
|
||||
else
|
||||
return ListProjectsOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void CloudgameClient::listProjectsAsync(const ListProjectsRequest& request, const ListProjectsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, listProjects(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
CloudgameClient::ListProjectsOutcomeCallable CloudgameClient::listProjectsCallable(const ListProjectsRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<ListProjectsOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->listProjects(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
73
cloudgame/src/model/ListGamesRequest.cc
Normal file
73
cloudgame/src/model/ListGamesRequest.cc
Normal file
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/cloudgame/model/ListGamesRequest.h>
|
||||
|
||||
using AlibabaCloud::Cloudgame::Model::ListGamesRequest;
|
||||
|
||||
ListGamesRequest::ListGamesRequest() :
|
||||
RpcServiceRequest("cloudgame", "2020-04-29", "ListGames")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
ListGamesRequest::~ListGamesRequest()
|
||||
{}
|
||||
|
||||
std::string ListGamesRequest::getOrderKey()const
|
||||
{
|
||||
return orderKey_;
|
||||
}
|
||||
|
||||
void ListGamesRequest::setOrderKey(const std::string& orderKey)
|
||||
{
|
||||
orderKey_ = orderKey;
|
||||
setParameter("OrderKey", orderKey);
|
||||
}
|
||||
|
||||
std::string ListGamesRequest::getSortType()const
|
||||
{
|
||||
return sortType_;
|
||||
}
|
||||
|
||||
void ListGamesRequest::setSortType(const std::string& sortType)
|
||||
{
|
||||
sortType_ = sortType;
|
||||
setParameter("SortType", sortType);
|
||||
}
|
||||
|
||||
int ListGamesRequest::getPageNumber()const
|
||||
{
|
||||
return pageNumber_;
|
||||
}
|
||||
|
||||
void ListGamesRequest::setPageNumber(int pageNumber)
|
||||
{
|
||||
pageNumber_ = pageNumber;
|
||||
setParameter("PageNumber", std::to_string(pageNumber));
|
||||
}
|
||||
|
||||
int ListGamesRequest::getPageSize()const
|
||||
{
|
||||
return pageSize_;
|
||||
}
|
||||
|
||||
void ListGamesRequest::setPageSize(int pageSize)
|
||||
{
|
||||
pageSize_ = pageSize;
|
||||
setParameter("PageSize", std::to_string(pageSize));
|
||||
}
|
||||
|
||||
96
cloudgame/src/model/ListGamesResult.cc
Normal file
96
cloudgame/src/model/ListGamesResult.cc
Normal file
@@ -0,0 +1,96 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/cloudgame/model/ListGamesResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Cloudgame;
|
||||
using namespace AlibabaCloud::Cloudgame::Model;
|
||||
|
||||
ListGamesResult::ListGamesResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
ListGamesResult::ListGamesResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
ListGamesResult::~ListGamesResult()
|
||||
{}
|
||||
|
||||
void ListGamesResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto allDataListNode = value["DataList"]["DataListItem"];
|
||||
for (auto valueDataListDataListItem : allDataListNode)
|
||||
{
|
||||
DataListItem dataListObject;
|
||||
if(!valueDataListDataListItem["GameId"].isNull())
|
||||
dataListObject.gameId = valueDataListDataListItem["GameId"].asString();
|
||||
if(!valueDataListDataListItem["GameName"].isNull())
|
||||
dataListObject.gameName = valueDataListDataListItem["GameName"].asString();
|
||||
if(!valueDataListDataListItem["InstallPath"].isNull())
|
||||
dataListObject.installPath = valueDataListDataListItem["InstallPath"].asString();
|
||||
if(!valueDataListDataListItem["SavePath"].isNull())
|
||||
dataListObject.savePath = valueDataListDataListItem["SavePath"].asString();
|
||||
if(!valueDataListDataListItem["Resolution"].isNull())
|
||||
dataListObject.resolution = valueDataListDataListItem["Resolution"].asString();
|
||||
if(!valueDataListDataListItem["FrameRate"].isNull())
|
||||
dataListObject.frameRate = valueDataListDataListItem["FrameRate"].asString();
|
||||
if(!valueDataListDataListItem["InputType"].isNull())
|
||||
dataListObject.inputType = valueDataListDataListItem["InputType"].asString();
|
||||
if(!valueDataListDataListItem["Device"].isNull())
|
||||
dataListObject.device = valueDataListDataListItem["Device"].asString();
|
||||
if(!valueDataListDataListItem["Status"].isNull())
|
||||
dataListObject.status = valueDataListDataListItem["Status"].asString();
|
||||
if(!valueDataListDataListItem["CurVersion"].isNull())
|
||||
dataListObject.curVersion = valueDataListDataListItem["CurVersion"].asString();
|
||||
dataList_.push_back(dataListObject);
|
||||
}
|
||||
if(!value["Count"].isNull())
|
||||
count_ = value["Count"].asString();
|
||||
if(!value["PageSize"].isNull())
|
||||
pageSize_ = std::stoi(value["PageSize"].asString());
|
||||
if(!value["CurrentPage"].isNull())
|
||||
currentPage_ = std::stoi(value["CurrentPage"].asString());
|
||||
|
||||
}
|
||||
|
||||
std::vector<ListGamesResult::DataListItem> ListGamesResult::getDataList()const
|
||||
{
|
||||
return dataList_;
|
||||
}
|
||||
|
||||
int ListGamesResult::getPageSize()const
|
||||
{
|
||||
return pageSize_;
|
||||
}
|
||||
|
||||
int ListGamesResult::getCurrentPage()const
|
||||
{
|
||||
return currentPage_;
|
||||
}
|
||||
|
||||
std::string ListGamesResult::getCount()const
|
||||
{
|
||||
return count_;
|
||||
}
|
||||
|
||||
62
cloudgame/src/model/ListProjectsRequest.cc
Normal file
62
cloudgame/src/model/ListProjectsRequest.cc
Normal file
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/cloudgame/model/ListProjectsRequest.h>
|
||||
|
||||
using AlibabaCloud::Cloudgame::Model::ListProjectsRequest;
|
||||
|
||||
ListProjectsRequest::ListProjectsRequest() :
|
||||
RpcServiceRequest("cloudgame", "2020-04-29", "ListProjects")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
ListProjectsRequest::~ListProjectsRequest()
|
||||
{}
|
||||
|
||||
std::string ListProjectsRequest::getProjectName()const
|
||||
{
|
||||
return projectName_;
|
||||
}
|
||||
|
||||
void ListProjectsRequest::setProjectName(const std::string& projectName)
|
||||
{
|
||||
projectName_ = projectName;
|
||||
setParameter("ProjectName", projectName);
|
||||
}
|
||||
|
||||
int ListProjectsRequest::getPageNumber()const
|
||||
{
|
||||
return pageNumber_;
|
||||
}
|
||||
|
||||
void ListProjectsRequest::setPageNumber(int pageNumber)
|
||||
{
|
||||
pageNumber_ = pageNumber;
|
||||
setParameter("PageNumber", std::to_string(pageNumber));
|
||||
}
|
||||
|
||||
int ListProjectsRequest::getPageSize()const
|
||||
{
|
||||
return pageSize_;
|
||||
}
|
||||
|
||||
void ListProjectsRequest::setPageSize(int pageSize)
|
||||
{
|
||||
pageSize_ = pageSize;
|
||||
setParameter("PageSize", std::to_string(pageSize));
|
||||
}
|
||||
|
||||
94
cloudgame/src/model/ListProjectsResult.cc
Normal file
94
cloudgame/src/model/ListProjectsResult.cc
Normal file
@@ -0,0 +1,94 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/cloudgame/model/ListProjectsResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Cloudgame;
|
||||
using namespace AlibabaCloud::Cloudgame::Model;
|
||||
|
||||
ListProjectsResult::ListProjectsResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
ListProjectsResult::ListProjectsResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
ListProjectsResult::~ListProjectsResult()
|
||||
{}
|
||||
|
||||
void ListProjectsResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto allDataListNode = value["DataList"]["DataListItem"];
|
||||
for (auto valueDataListDataListItem : allDataListNode)
|
||||
{
|
||||
DataListItem dataListObject;
|
||||
if(!valueDataListDataListItem["StandardCodeRate"].isNull())
|
||||
dataListObject.standardCodeRate = valueDataListDataListItem["StandardCodeRate"].asString();
|
||||
if(!valueDataListDataListItem["HighDefinitionResolution"].isNull())
|
||||
dataListObject.highDefinitionResolution = valueDataListDataListItem["HighDefinitionResolution"].asString();
|
||||
if(!valueDataListDataListItem["HighDefinitionCodeRate"].isNull())
|
||||
dataListObject.highDefinitionCodeRate = valueDataListDataListItem["HighDefinitionCodeRate"].asString();
|
||||
if(!valueDataListDataListItem["StandardResolution"].isNull())
|
||||
dataListObject.standardResolution = valueDataListDataListItem["StandardResolution"].asString();
|
||||
if(!valueDataListDataListItem["ProjectId"].isNull())
|
||||
dataListObject.projectId = valueDataListDataListItem["ProjectId"].asString();
|
||||
if(!valueDataListDataListItem["ConcurrencyLimitNumber"].isNull())
|
||||
dataListObject.concurrencyLimitNumber = std::stoi(valueDataListDataListItem["ConcurrencyLimitNumber"].asString());
|
||||
if(!valueDataListDataListItem["HighestCodeRate"].isNull())
|
||||
dataListObject.highestCodeRate = valueDataListDataListItem["HighestCodeRate"].asString();
|
||||
if(!valueDataListDataListItem["ProjectName"].isNull())
|
||||
dataListObject.projectName = valueDataListDataListItem["ProjectName"].asString();
|
||||
if(!valueDataListDataListItem["HighestResolution"].isNull())
|
||||
dataListObject.highestResolution = valueDataListDataListItem["HighestResolution"].asString();
|
||||
dataList_.push_back(dataListObject);
|
||||
}
|
||||
if(!value["Count"].isNull())
|
||||
count_ = std::stoi(value["Count"].asString());
|
||||
if(!value["CurrentPage"].isNull())
|
||||
currentPage_ = std::stoi(value["CurrentPage"].asString());
|
||||
if(!value["PageSize"].isNull())
|
||||
pageSize_ = std::stoi(value["PageSize"].asString());
|
||||
|
||||
}
|
||||
|
||||
std::vector<ListProjectsResult::DataListItem> ListProjectsResult::getDataList()const
|
||||
{
|
||||
return dataList_;
|
||||
}
|
||||
|
||||
int ListProjectsResult::getPageSize()const
|
||||
{
|
||||
return pageSize_;
|
||||
}
|
||||
|
||||
int ListProjectsResult::getCurrentPage()const
|
||||
{
|
||||
return currentPage_;
|
||||
}
|
||||
|
||||
int ListProjectsResult::getCount()const
|
||||
{
|
||||
return count_;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user