RecolorImageRequest.cc 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. #include <alibabacloud/imageenhan/model/RecolorImageRequest.h>
  17. using AlibabaCloud::Imageenhan::Model::RecolorImageRequest;
  18. RecolorImageRequest::RecolorImageRequest()
  19. : RpcServiceRequest("imageenhan", "2019-09-30", "RecolorImage") {
  20. setMethod(HttpRequest::Method::Post);
  21. }
  22. RecolorImageRequest::~RecolorImageRequest() {}
  23. std::string RecolorImageRequest::getMode() const {
  24. return mode_;
  25. }
  26. void RecolorImageRequest::setMode(const std::string &mode) {
  27. mode_ = mode;
  28. setBodyParameter(std::string("Mode"), mode);
  29. }
  30. int RecolorImageRequest::getColorCount() const {
  31. return colorCount_;
  32. }
  33. void RecolorImageRequest::setColorCount(int colorCount) {
  34. colorCount_ = colorCount;
  35. setBodyParameter(std::string("ColorCount"), std::to_string(colorCount));
  36. }
  37. std::vector<RecolorImageRequest::ColorTemplate> RecolorImageRequest::getColorTemplate() const {
  38. return colorTemplate_;
  39. }
  40. void RecolorImageRequest::setColorTemplate(const std::vector<RecolorImageRequest::ColorTemplate> &colorTemplate) {
  41. colorTemplate_ = colorTemplate;
  42. for(int dep1 = 0; dep1 != colorTemplate.size(); dep1++) {
  43. auto colorTemplateObj = colorTemplate.at(dep1);
  44. std::string colorTemplateObjStr = std::string("ColorTemplate") + "." + std::to_string(dep1 + 1);
  45. setBodyParameter(colorTemplateObjStr + ".Color", colorTemplateObj.color);
  46. }
  47. }
  48. std::string RecolorImageRequest::getUrl() const {
  49. return url_;
  50. }
  51. void RecolorImageRequest::setUrl(const std::string &url) {
  52. url_ = url;
  53. setBodyParameter(std::string("Url"), url);
  54. }
  55. std::string RecolorImageRequest::getRefUrl() const {
  56. return refUrl_;
  57. }
  58. void RecolorImageRequest::setRefUrl(const std::string &refUrl) {
  59. refUrl_ = refUrl;
  60. setBodyParameter(std::string("RefUrl"), refUrl);
  61. }