MassPushRequest.cc 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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/push/model/MassPushRequest.h>
  17. using AlibabaCloud::Push::Model::MassPushRequest;
  18. MassPushRequest::MassPushRequest() :
  19. RpcServiceRequest("push", "2016-08-01", "MassPush")
  20. {}
  21. MassPushRequest::~MassPushRequest()
  22. {}
  23. std::string MassPushRequest::getAccessKeyId()const
  24. {
  25. return accessKeyId_;
  26. }
  27. void MassPushRequest::setAccessKeyId(const std::string& accessKeyId)
  28. {
  29. accessKeyId_ = accessKeyId;
  30. setCoreParameter("AccessKeyId", accessKeyId);
  31. }
  32. std::vector<MassPushRequest::PushTask> MassPushRequest::getPushTask()const
  33. {
  34. return pushTask_;
  35. }
  36. void MassPushRequest::setPushTask(const std::vector<PushTask>& pushTask)
  37. {
  38. pushTask_ = pushTask;
  39. int i = 0;
  40. for(int i = 0; i!= pushTask.size(); i++) {
  41. auto obj = pushTask.at(i);
  42. std::string str ="PushTask."+ std::to_string(i);
  43. setCoreParameter(str + ".AndroidNotificationBarType", std::to_string(obj.androidNotificationBarType));
  44. setCoreParameter(str + ".AndroidExtParameters", obj.androidExtParameters);
  45. setCoreParameter(str + ".iOSBadge", std::to_string(obj.iOSBadge));
  46. setCoreParameter(str + ".iOSBadgeAutoIncrement", obj.iOSBadgeAutoIncrement ? "true" : "false");
  47. setCoreParameter(str + ".AndroidOpenType", obj.androidOpenType);
  48. setCoreParameter(str + ".Title", obj.title);
  49. setCoreParameter(str + ".Body", obj.body);
  50. setCoreParameter(str + ".DeviceType", obj.deviceType);
  51. setCoreParameter(str + ".PushTime", obj.pushTime);
  52. setCoreParameter(str + ".SendSpeed", std::to_string(obj.sendSpeed));
  53. setCoreParameter(str + ".AndroidPopupActivity", obj.androidPopupActivity);
  54. setCoreParameter(str + ".iOSRemindBody", obj.iOSRemindBody);
  55. setCoreParameter(str + ".iOSExtParameters", obj.iOSExtParameters);
  56. setCoreParameter(str + ".AndroidNotifyType", obj.androidNotifyType);
  57. setCoreParameter(str + ".AndroidPopupTitle", obj.androidPopupTitle);
  58. setCoreParameter(str + ".iOSMusic", obj.iOSMusic);
  59. setCoreParameter(str + ".iOSApnsEnv", obj.iOSApnsEnv);
  60. setCoreParameter(str + ".iOSMutableContent", obj.iOSMutableContent ? "true" : "false");
  61. setCoreParameter(str + ".AndroidNotificationBarPriority", std::to_string(obj.androidNotificationBarPriority));
  62. setCoreParameter(str + ".ExpireTime", obj.expireTime);
  63. setCoreParameter(str + ".AndroidPopupBody", obj.androidPopupBody);
  64. setCoreParameter(str + ".iOSNotificationCategory", obj.iOSNotificationCategory);
  65. setCoreParameter(str + ".StoreOffline", obj.storeOffline ? "true" : "false");
  66. setCoreParameter(str + ".iOSSilentNotification", obj.iOSSilentNotification ? "true" : "false");
  67. setCoreParameter(str + ".JobKey", obj.jobKey);
  68. setCoreParameter(str + ".Target", obj.target);
  69. setCoreParameter(str + ".AndroidOpenUrl", obj.androidOpenUrl);
  70. setCoreParameter(str + ".AndroidNotificationChannel", obj.androidNotificationChannel);
  71. setCoreParameter(str + ".AndroidRemind", obj.androidRemind ? "true" : "false");
  72. setCoreParameter(str + ".AndroidActivity", obj.androidActivity);
  73. setCoreParameter(str + ".AndroidXiaoMiNotifyBody", obj.androidXiaoMiNotifyBody);
  74. setCoreParameter(str + ".iOSSubtitle", obj.iOSSubtitle);
  75. setCoreParameter(str + ".iOSRemind", obj.iOSRemind ? "true" : "false");
  76. setCoreParameter(str + ".TargetValue", obj.targetValue);
  77. setCoreParameter(str + ".AndroidMusic", obj.androidMusic);
  78. setCoreParameter(str + ".AndroidXiaoMiActivity", obj.androidXiaoMiActivity);
  79. setCoreParameter(str + ".AndroidXiaoMiNotifyTitle", obj.androidXiaoMiNotifyTitle);
  80. setCoreParameter(str + ".PushType", obj.pushType);
  81. }
  82. }
  83. long MassPushRequest::getAppKey()const
  84. {
  85. return appKey_;
  86. }
  87. void MassPushRequest::setAppKey(long appKey)
  88. {
  89. appKey_ = appKey;
  90. setCoreParameter("AppKey", std::to_string(appKey));
  91. }