ImageauditClient.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_IMAGEAUDIT_IMAGEAUDITCLIENT_H_
  17. #define ALIBABACLOUD_IMAGEAUDIT_IMAGEAUDITCLIENT_H_
  18. #include <future>
  19. #include <alibabacloud/core/AsyncCallerContext.h>
  20. #include <alibabacloud/core/EndpointProvider.h>
  21. #include <alibabacloud/core/RpcServiceClient.h>
  22. #include "ImageauditExport.h"
  23. #include "model/ScanImageRequest.h"
  24. #include "model/ScanImageResult.h"
  25. #include "model/ScanTextRequest.h"
  26. #include "model/ScanTextResult.h"
  27. namespace AlibabaCloud
  28. {
  29. namespace Imageaudit
  30. {
  31. class ALIBABACLOUD_IMAGEAUDIT_EXPORT ImageauditClient : public RpcServiceClient
  32. {
  33. public:
  34. typedef Outcome<Error, Model::ScanImageResult> ScanImageOutcome;
  35. typedef std::future<ScanImageOutcome> ScanImageOutcomeCallable;
  36. typedef std::function<void(const ImageauditClient*, const Model::ScanImageRequest&, const ScanImageOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ScanImageAsyncHandler;
  37. typedef Outcome<Error, Model::ScanTextResult> ScanTextOutcome;
  38. typedef std::future<ScanTextOutcome> ScanTextOutcomeCallable;
  39. typedef std::function<void(const ImageauditClient*, const Model::ScanTextRequest&, const ScanTextOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ScanTextAsyncHandler;
  40. ImageauditClient(const Credentials &credentials, const ClientConfiguration &configuration);
  41. ImageauditClient(const std::shared_ptr<CredentialsProvider> &credentialsProvider, const ClientConfiguration &configuration);
  42. ImageauditClient(const std::string &accessKeyId, const std::string &accessKeySecret, const ClientConfiguration &configuration);
  43. ~ImageauditClient();
  44. ScanImageOutcome scanImage(const Model::ScanImageRequest &request)const;
  45. void scanImageAsync(const Model::ScanImageRequest& request, const ScanImageAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
  46. ScanImageOutcomeCallable scanImageCallable(const Model::ScanImageRequest& request) const;
  47. ScanTextOutcome scanText(const Model::ScanTextRequest &request)const;
  48. void scanTextAsync(const Model::ScanTextRequest& request, const ScanTextAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
  49. ScanTextOutcomeCallable scanTextCallable(const Model::ScanTextRequest& request) const;
  50. private:
  51. std::shared_ptr<EndpointProvider> endpointProvider_;
  52. };
  53. }
  54. }
  55. #endif // !ALIBABACLOUD_IMAGEAUDIT_IMAGEAUDITCLIENT_H_