CloudgameClient.h 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * Copyright 2009-2017 Alibaba Cloud All rights reserved.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #ifndef ALIBABACLOUD_CLOUDGAME_CLOUDGAMECLIENT_H_
  17. #define ALIBABACLOUD_CLOUDGAME_CLOUDGAMECLIENT_H_
  18. #include <future>
  19. #include <alibabacloud/core/AsyncCallerContext.h>
  20. #include <alibabacloud/core/EndpointProvider.h>
  21. #include <alibabacloud/core/RpcServiceClient.h>
  22. #include "CloudgameExport.h"
  23. #include "model/ListGamesRequest.h"
  24. #include "model/ListGamesResult.h"
  25. #include "model/ListProjectsRequest.h"
  26. #include "model/ListProjectsResult.h"
  27. namespace AlibabaCloud
  28. {
  29. namespace Cloudgame
  30. {
  31. class ALIBABACLOUD_CLOUDGAME_EXPORT CloudgameClient : public RpcServiceClient
  32. {
  33. public:
  34. typedef Outcome<Error, Model::ListGamesResult> ListGamesOutcome;
  35. typedef std::future<ListGamesOutcome> ListGamesOutcomeCallable;
  36. typedef std::function<void(const CloudgameClient*, const Model::ListGamesRequest&, const ListGamesOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ListGamesAsyncHandler;
  37. typedef Outcome<Error, Model::ListProjectsResult> ListProjectsOutcome;
  38. typedef std::future<ListProjectsOutcome> ListProjectsOutcomeCallable;
  39. typedef std::function<void(const CloudgameClient*, const Model::ListProjectsRequest&, const ListProjectsOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ListProjectsAsyncHandler;
  40. CloudgameClient(const Credentials &credentials, const ClientConfiguration &configuration);
  41. CloudgameClient(const std::shared_ptr<CredentialsProvider> &credentialsProvider, const ClientConfiguration &configuration);
  42. CloudgameClient(const std::string &accessKeyId, const std::string &accessKeySecret, const ClientConfiguration &configuration);
  43. ~CloudgameClient();
  44. ListGamesOutcome listGames(const Model::ListGamesRequest &request)const;
  45. void listGamesAsync(const Model::ListGamesRequest& request, const ListGamesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
  46. ListGamesOutcomeCallable listGamesCallable(const Model::ListGamesRequest& request) const;
  47. ListProjectsOutcome listProjects(const Model::ListProjectsRequest &request)const;
  48. void listProjectsAsync(const Model::ListProjectsRequest& request, const ListProjectsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
  49. ListProjectsOutcomeCallable listProjectsCallable(const Model::ListProjectsRequest& request) const;
  50. private:
  51. std::shared_ptr<EndpointProvider> endpointProvider_;
  52. };
  53. }
  54. }
  55. #endif // !ALIBABACLOUD_CLOUDGAME_CLOUDGAMECLIENT_H_