BatchInsertItemsRequest.cc 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  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/cloudesl/model/BatchInsertItemsRequest.h>
  17. using AlibabaCloud::Cloudesl::Model::BatchInsertItemsRequest;
  18. BatchInsertItemsRequest::BatchInsertItemsRequest() :
  19. RpcServiceRequest("cloudesl", "2020-02-01", "BatchInsertItems")
  20. {
  21. setMethod(HttpRequest::Method::Post);
  22. }
  23. BatchInsertItemsRequest::~BatchInsertItemsRequest()
  24. {}
  25. std::string BatchInsertItemsRequest::getExtraParams()const
  26. {
  27. return extraParams_;
  28. }
  29. void BatchInsertItemsRequest::setExtraParams(const std::string& extraParams)
  30. {
  31. extraParams_ = extraParams;
  32. setBodyParameter("ExtraParams", extraParams);
  33. }
  34. std::string BatchInsertItemsRequest::getStoreId()const
  35. {
  36. return storeId_;
  37. }
  38. void BatchInsertItemsRequest::setStoreId(const std::string& storeId)
  39. {
  40. storeId_ = storeId;
  41. setBodyParameter("StoreId", storeId);
  42. }
  43. bool BatchInsertItemsRequest::getSyncByItemId()const
  44. {
  45. return syncByItemId_;
  46. }
  47. void BatchInsertItemsRequest::setSyncByItemId(bool syncByItemId)
  48. {
  49. syncByItemId_ = syncByItemId;
  50. setBodyParameter("SyncByItemId", syncByItemId ? "true" : "false");
  51. }
  52. std::vector<BatchInsertItemsRequest::ItemInfo> BatchInsertItemsRequest::getItemInfo()const
  53. {
  54. return itemInfo_;
  55. }
  56. void BatchInsertItemsRequest::setItemInfo(const std::vector<ItemInfo>& itemInfo)
  57. {
  58. itemInfo_ = itemInfo;
  59. for(int dep1 = 0; dep1!= itemInfo.size(); dep1++) {
  60. auto itemInfoObj = itemInfo.at(dep1);
  61. std::string itemInfoObjStr = "ItemInfo." + std::to_string(dep1 + 1);
  62. setParameter(itemInfoObjStr + ".MemberPrice", std::to_string(itemInfoObj.memberPrice));
  63. setParameter(itemInfoObjStr + ".ActionPrice", std::to_string(itemInfoObj.actionPrice));
  64. setParameter(itemInfoObjStr + ".BeSourceCode", itemInfoObj.beSourceCode ? "true" : "false");
  65. setParameter(itemInfoObjStr + ".BrandName", itemInfoObj.brandName);
  66. setParameter(itemInfoObjStr + ".PromotionStart", itemInfoObj.promotionStart);
  67. setParameter(itemInfoObjStr + ".PriceUnit", itemInfoObj.priceUnit);
  68. setParameter(itemInfoObjStr + ".Rank", itemInfoObj.rank);
  69. setParameter(itemInfoObjStr + ".ItemInfoIndex", std::to_string(itemInfoObj.itemInfoIndex));
  70. setParameter(itemInfoObjStr + ".ItemBarCode", itemInfoObj.itemBarCode);
  71. setParameter(itemInfoObjStr + ".CustomizeFeatureK", itemInfoObj.customizeFeatureK);
  72. setParameter(itemInfoObjStr + ".CustomizeFeatureL", itemInfoObj.customizeFeatureL);
  73. setParameter(itemInfoObjStr + ".CustomizeFeatureM", itemInfoObj.customizeFeatureM);
  74. setParameter(itemInfoObjStr + ".CustomizeFeatureN", itemInfoObj.customizeFeatureN);
  75. setParameter(itemInfoObjStr + ".BePromotion", itemInfoObj.bePromotion ? "true" : "false");
  76. setParameter(itemInfoObjStr + ".CustomizeFeatureO", itemInfoObj.customizeFeatureO);
  77. setParameter(itemInfoObjStr + ".CustomizeFeatureP", itemInfoObj.customizeFeatureP);
  78. setParameter(itemInfoObjStr + ".PromotionEnd", itemInfoObj.promotionEnd);
  79. setParameter(itemInfoObjStr + ".ItemTitle", itemInfoObj.itemTitle);
  80. setParameter(itemInfoObjStr + ".CustomizeFeatureQ", itemInfoObj.customizeFeatureQ);
  81. setParameter(itemInfoObjStr + ".CustomizeFeatureR", itemInfoObj.customizeFeatureR);
  82. setParameter(itemInfoObjStr + ".CustomizeFeatureC", itemInfoObj.customizeFeatureC);
  83. setParameter(itemInfoObjStr + ".CustomizeFeatureD", itemInfoObj.customizeFeatureD);
  84. setParameter(itemInfoObjStr + ".ItemQrCode", itemInfoObj.itemQrCode);
  85. setParameter(itemInfoObjStr + ".CustomizeFeatureE", itemInfoObj.customizeFeatureE);
  86. setParameter(itemInfoObjStr + ".PromotionReason", itemInfoObj.promotionReason);
  87. setParameter(itemInfoObjStr + ".InventoryStatus", itemInfoObj.inventoryStatus);
  88. setParameter(itemInfoObjStr + ".CustomizeFeatureF", itemInfoObj.customizeFeatureF);
  89. setParameter(itemInfoObjStr + ".CustomizeFeatureG", itemInfoObj.customizeFeatureG);
  90. setParameter(itemInfoObjStr + ".CustomizeFeatureH", itemInfoObj.customizeFeatureH);
  91. setParameter(itemInfoObjStr + ".CustomizeFeatureI", itemInfoObj.customizeFeatureI);
  92. setParameter(itemInfoObjStr + ".CustomizeFeatureJ", itemInfoObj.customizeFeatureJ);
  93. setParameter(itemInfoObjStr + ".CustomizeFeatureA", itemInfoObj.customizeFeatureA);
  94. setParameter(itemInfoObjStr + ".CustomizeFeatureB", itemInfoObj.customizeFeatureB);
  95. setParameter(itemInfoObjStr + ".SuggestPrice", std::to_string(itemInfoObj.suggestPrice));
  96. setParameter(itemInfoObjStr + ".ForestFirstId", itemInfoObj.forestFirstId);
  97. setParameter(itemInfoObjStr + ".ProductionPlace", itemInfoObj.productionPlace);
  98. setParameter(itemInfoObjStr + ".SourceCode", itemInfoObj.sourceCode);
  99. setParameter(itemInfoObjStr + ".Manufacturer", itemInfoObj.manufacturer);
  100. setParameter(itemInfoObjStr + ".ItemId", itemInfoObj.itemId);
  101. setParameter(itemInfoObjStr + ".BeMember", itemInfoObj.beMember ? "true" : "false");
  102. setParameter(itemInfoObjStr + ".CustomizeFeatureS", itemInfoObj.customizeFeatureS);
  103. setParameter(itemInfoObjStr + ".CustomizeFeatureT", itemInfoObj.customizeFeatureT);
  104. setParameter(itemInfoObjStr + ".CustomizeFeatureU", itemInfoObj.customizeFeatureU);
  105. setParameter(itemInfoObjStr + ".TemplateSceneId", itemInfoObj.templateSceneId);
  106. setParameter(itemInfoObjStr + ".CustomizeFeatureV", itemInfoObj.customizeFeatureV);
  107. setParameter(itemInfoObjStr + ".CustomizeFeatureW", itemInfoObj.customizeFeatureW);
  108. setParameter(itemInfoObjStr + ".CustomizeFeatureX", itemInfoObj.customizeFeatureX);
  109. setParameter(itemInfoObjStr + ".CustomizeFeatureY", itemInfoObj.customizeFeatureY);
  110. setParameter(itemInfoObjStr + ".CustomizeFeatureZ", itemInfoObj.customizeFeatureZ);
  111. setParameter(itemInfoObjStr + ".SalesPrice", std::to_string(itemInfoObj.salesPrice));
  112. setParameter(itemInfoObjStr + ".OriginalPrice", std::to_string(itemInfoObj.originalPrice));
  113. setParameter(itemInfoObjStr + ".ItemShortTitle", itemInfoObj.itemShortTitle);
  114. setParameter(itemInfoObjStr + ".ItemPicUrl", itemInfoObj.itemPicUrl);
  115. setParameter(itemInfoObjStr + ".ForestSecondId", itemInfoObj.forestSecondId);
  116. setParameter(itemInfoObjStr + ".SupplierName", itemInfoObj.supplierName);
  117. setParameter(itemInfoObjStr + ".Material", itemInfoObj.material);
  118. setParameter(itemInfoObjStr + ".ModelNumber", itemInfoObj.modelNumber);
  119. setParameter(itemInfoObjStr + ".SaleSpec", itemInfoObj.saleSpec);
  120. setParameter(itemInfoObjStr + ".CategoryName", itemInfoObj.categoryName);
  121. setParameter(itemInfoObjStr + ".TaxFee", itemInfoObj.taxFee);
  122. setParameter(itemInfoObjStr + ".EnergyEfficiency", itemInfoObj.energyEfficiency);
  123. setParameter(itemInfoObjStr + ".PromotionText", itemInfoObj.promotionText);
  124. setParameter(itemInfoObjStr + ".SkuId", itemInfoObj.skuId);
  125. }
  126. }