PushRequest.cc 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535
  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/PushRequest.h>
  17. using AlibabaCloud::Push::Model::PushRequest;
  18. PushRequest::PushRequest() :
  19. RpcServiceRequest("push", "2016-08-01", "Push")
  20. {
  21. setMethod(HttpRequest::Method::Post);
  22. }
  23. PushRequest::~PushRequest()
  24. {}
  25. int PushRequest::getAndroidNotificationBarType()const
  26. {
  27. return androidNotificationBarType_;
  28. }
  29. void PushRequest::setAndroidNotificationBarType(int androidNotificationBarType)
  30. {
  31. androidNotificationBarType_ = androidNotificationBarType;
  32. setParameter("AndroidNotificationBarType", std::to_string(androidNotificationBarType));
  33. }
  34. int PushRequest::getSmsSendPolicy()const
  35. {
  36. return smsSendPolicy_;
  37. }
  38. void PushRequest::setSmsSendPolicy(int smsSendPolicy)
  39. {
  40. smsSendPolicy_ = smsSendPolicy;
  41. setParameter("SmsSendPolicy", std::to_string(smsSendPolicy));
  42. }
  43. std::string PushRequest::getBody()const
  44. {
  45. return body_;
  46. }
  47. void PushRequest::setBody(const std::string& body)
  48. {
  49. body_ = body;
  50. setParameter("Body", body);
  51. }
  52. std::string PushRequest::getDeviceType()const
  53. {
  54. return deviceType_;
  55. }
  56. void PushRequest::setDeviceType(const std::string& deviceType)
  57. {
  58. deviceType_ = deviceType;
  59. setParameter("DeviceType", deviceType);
  60. }
  61. std::string PushRequest::getPushTime()const
  62. {
  63. return pushTime_;
  64. }
  65. void PushRequest::setPushTime(const std::string& pushTime)
  66. {
  67. pushTime_ = pushTime;
  68. setParameter("PushTime", pushTime);
  69. }
  70. int PushRequest::getSendSpeed()const
  71. {
  72. return sendSpeed_;
  73. }
  74. void PushRequest::setSendSpeed(int sendSpeed)
  75. {
  76. sendSpeed_ = sendSpeed;
  77. setParameter("SendSpeed", std::to_string(sendSpeed));
  78. }
  79. std::string PushRequest::getAndroidPopupActivity()const
  80. {
  81. return androidPopupActivity_;
  82. }
  83. void PushRequest::setAndroidPopupActivity(const std::string& androidPopupActivity)
  84. {
  85. androidPopupActivity_ = androidPopupActivity;
  86. setParameter("AndroidPopupActivity", androidPopupActivity);
  87. }
  88. std::string PushRequest::getIOSRemindBody()const
  89. {
  90. return iOSRemindBody_;
  91. }
  92. void PushRequest::setIOSRemindBody(const std::string& iOSRemindBody)
  93. {
  94. iOSRemindBody_ = iOSRemindBody;
  95. setParameter("IOSRemindBody", iOSRemindBody);
  96. }
  97. std::string PushRequest::getAndroidNotifyType()const
  98. {
  99. return androidNotifyType_;
  100. }
  101. void PushRequest::setAndroidNotifyType(const std::string& androidNotifyType)
  102. {
  103. androidNotifyType_ = androidNotifyType;
  104. setParameter("AndroidNotifyType", androidNotifyType);
  105. }
  106. std::string PushRequest::getAndroidPopupTitle()const
  107. {
  108. return androidPopupTitle_;
  109. }
  110. void PushRequest::setAndroidPopupTitle(const std::string& androidPopupTitle)
  111. {
  112. androidPopupTitle_ = androidPopupTitle;
  113. setParameter("AndroidPopupTitle", androidPopupTitle);
  114. }
  115. std::string PushRequest::getIOSMusic()const
  116. {
  117. return iOSMusic_;
  118. }
  119. void PushRequest::setIOSMusic(const std::string& iOSMusic)
  120. {
  121. iOSMusic_ = iOSMusic;
  122. setParameter("IOSMusic", iOSMusic);
  123. }
  124. std::string PushRequest::getIOSApnsEnv()const
  125. {
  126. return iOSApnsEnv_;
  127. }
  128. void PushRequest::setIOSApnsEnv(const std::string& iOSApnsEnv)
  129. {
  130. iOSApnsEnv_ = iOSApnsEnv;
  131. setParameter("IOSApnsEnv", iOSApnsEnv);
  132. }
  133. bool PushRequest::getIOSMutableContent()const
  134. {
  135. return iOSMutableContent_;
  136. }
  137. void PushRequest::setIOSMutableContent(bool iOSMutableContent)
  138. {
  139. iOSMutableContent_ = iOSMutableContent;
  140. setParameter("IOSMutableContent", iOSMutableContent ? "true" : "false");
  141. }
  142. int PushRequest::getAndroidNotificationBarPriority()const
  143. {
  144. return androidNotificationBarPriority_;
  145. }
  146. void PushRequest::setAndroidNotificationBarPriority(int androidNotificationBarPriority)
  147. {
  148. androidNotificationBarPriority_ = androidNotificationBarPriority;
  149. setParameter("AndroidNotificationBarPriority", std::to_string(androidNotificationBarPriority));
  150. }
  151. std::string PushRequest::getExpireTime()const
  152. {
  153. return expireTime_;
  154. }
  155. void PushRequest::setExpireTime(const std::string& expireTime)
  156. {
  157. expireTime_ = expireTime;
  158. setParameter("ExpireTime", expireTime);
  159. }
  160. std::string PushRequest::getIOSNotificationCategory()const
  161. {
  162. return iOSNotificationCategory_;
  163. }
  164. void PushRequest::setIOSNotificationCategory(const std::string& iOSNotificationCategory)
  165. {
  166. iOSNotificationCategory_ = iOSNotificationCategory;
  167. setParameter("IOSNotificationCategory", iOSNotificationCategory);
  168. }
  169. std::string PushRequest::getAndroidNotificationXiaomiChannel()const
  170. {
  171. return androidNotificationXiaomiChannel_;
  172. }
  173. void PushRequest::setAndroidNotificationXiaomiChannel(const std::string& androidNotificationXiaomiChannel)
  174. {
  175. androidNotificationXiaomiChannel_ = androidNotificationXiaomiChannel;
  176. setParameter("AndroidNotificationXiaomiChannel", androidNotificationXiaomiChannel);
  177. }
  178. bool PushRequest::getStoreOffline()const
  179. {
  180. return storeOffline_;
  181. }
  182. void PushRequest::setStoreOffline(bool storeOffline)
  183. {
  184. storeOffline_ = storeOffline;
  185. setParameter("StoreOffline", storeOffline ? "true" : "false");
  186. }
  187. std::string PushRequest::getSmsParams()const
  188. {
  189. return smsParams_;
  190. }
  191. void PushRequest::setSmsParams(const std::string& smsParams)
  192. {
  193. smsParams_ = smsParams;
  194. setParameter("SmsParams", smsParams);
  195. }
  196. std::string PushRequest::getJobKey()const
  197. {
  198. return jobKey_;
  199. }
  200. void PushRequest::setJobKey(const std::string& jobKey)
  201. {
  202. jobKey_ = jobKey;
  203. setParameter("JobKey", jobKey);
  204. }
  205. std::string PushRequest::getAndroidOpenUrl()const
  206. {
  207. return androidOpenUrl_;
  208. }
  209. void PushRequest::setAndroidOpenUrl(const std::string& androidOpenUrl)
  210. {
  211. androidOpenUrl_ = androidOpenUrl;
  212. setParameter("AndroidOpenUrl", androidOpenUrl);
  213. }
  214. std::string PushRequest::getAndroidXiaoMiNotifyBody()const
  215. {
  216. return androidXiaoMiNotifyBody_;
  217. }
  218. void PushRequest::setAndroidXiaoMiNotifyBody(const std::string& androidXiaoMiNotifyBody)
  219. {
  220. androidXiaoMiNotifyBody_ = androidXiaoMiNotifyBody;
  221. setParameter("AndroidXiaoMiNotifyBody", androidXiaoMiNotifyBody);
  222. }
  223. std::string PushRequest::getIOSSubtitle()const
  224. {
  225. return iOSSubtitle_;
  226. }
  227. void PushRequest::setIOSSubtitle(const std::string& iOSSubtitle)
  228. {
  229. iOSSubtitle_ = iOSSubtitle;
  230. setParameter("IOSSubtitle", iOSSubtitle);
  231. }
  232. bool PushRequest::getIOSRemind()const
  233. {
  234. return iOSRemind_;
  235. }
  236. void PushRequest::setIOSRemind(bool iOSRemind)
  237. {
  238. iOSRemind_ = iOSRemind;
  239. setParameter("IOSRemind", iOSRemind ? "true" : "false");
  240. }
  241. std::string PushRequest::getAndroidMusic()const
  242. {
  243. return androidMusic_;
  244. }
  245. void PushRequest::setAndroidMusic(const std::string& androidMusic)
  246. {
  247. androidMusic_ = androidMusic;
  248. setParameter("AndroidMusic", androidMusic);
  249. }
  250. std::string PushRequest::getPushType()const
  251. {
  252. return pushType_;
  253. }
  254. void PushRequest::setPushType(const std::string& pushType)
  255. {
  256. pushType_ = pushType;
  257. setParameter("PushType", pushType);
  258. }
  259. std::string PushRequest::getAndroidExtParameters()const
  260. {
  261. return androidExtParameters_;
  262. }
  263. void PushRequest::setAndroidExtParameters(const std::string& androidExtParameters)
  264. {
  265. androidExtParameters_ = androidExtParameters;
  266. setParameter("AndroidExtParameters", androidExtParameters);
  267. }
  268. int PushRequest::getIOSBadge()const
  269. {
  270. return iOSBadge_;
  271. }
  272. void PushRequest::setIOSBadge(int iOSBadge)
  273. {
  274. iOSBadge_ = iOSBadge;
  275. setParameter("IOSBadge", std::to_string(iOSBadge));
  276. }
  277. bool PushRequest::getIOSBadgeAutoIncrement()const
  278. {
  279. return iOSBadgeAutoIncrement_;
  280. }
  281. void PushRequest::setIOSBadgeAutoIncrement(bool iOSBadgeAutoIncrement)
  282. {
  283. iOSBadgeAutoIncrement_ = iOSBadgeAutoIncrement;
  284. setParameter("IOSBadgeAutoIncrement", iOSBadgeAutoIncrement ? "true" : "false");
  285. }
  286. std::string PushRequest::getAndroidOpenType()const
  287. {
  288. return androidOpenType_;
  289. }
  290. void PushRequest::setAndroidOpenType(const std::string& androidOpenType)
  291. {
  292. androidOpenType_ = androidOpenType;
  293. setParameter("AndroidOpenType", androidOpenType);
  294. }
  295. std::string PushRequest::getTitle()const
  296. {
  297. return title_;
  298. }
  299. void PushRequest::setTitle(const std::string& title)
  300. {
  301. title_ = title;
  302. setParameter("Title", title);
  303. }
  304. std::string PushRequest::getAccessKeyId()const
  305. {
  306. return accessKeyId_;
  307. }
  308. void PushRequest::setAccessKeyId(const std::string& accessKeyId)
  309. {
  310. accessKeyId_ = accessKeyId;
  311. setParameter("AccessKeyId", accessKeyId);
  312. }
  313. int PushRequest::getSmsDelaySecs()const
  314. {
  315. return smsDelaySecs_;
  316. }
  317. void PushRequest::setSmsDelaySecs(int smsDelaySecs)
  318. {
  319. smsDelaySecs_ = smsDelaySecs;
  320. setParameter("SmsDelaySecs", std::to_string(smsDelaySecs));
  321. }
  322. std::string PushRequest::getIOSExtParameters()const
  323. {
  324. return iOSExtParameters_;
  325. }
  326. void PushRequest::setIOSExtParameters(const std::string& iOSExtParameters)
  327. {
  328. iOSExtParameters_ = iOSExtParameters;
  329. setParameter("IOSExtParameters", iOSExtParameters);
  330. }
  331. std::string PushRequest::getSmsTemplateName()const
  332. {
  333. return smsTemplateName_;
  334. }
  335. void PushRequest::setSmsTemplateName(const std::string& smsTemplateName)
  336. {
  337. smsTemplateName_ = smsTemplateName;
  338. setParameter("SmsTemplateName", smsTemplateName);
  339. }
  340. std::string PushRequest::getAndroidPopupBody()const
  341. {
  342. return androidPopupBody_;
  343. }
  344. void PushRequest::setAndroidPopupBody(const std::string& androidPopupBody)
  345. {
  346. androidPopupBody_ = androidPopupBody;
  347. setParameter("AndroidPopupBody", androidPopupBody);
  348. }
  349. bool PushRequest::getIOSSilentNotification()const
  350. {
  351. return iOSSilentNotification_;
  352. }
  353. void PushRequest::setIOSSilentNotification(bool iOSSilentNotification)
  354. {
  355. iOSSilentNotification_ = iOSSilentNotification;
  356. setParameter("IOSSilentNotification", iOSSilentNotification ? "true" : "false");
  357. }
  358. std::string PushRequest::getTarget()const
  359. {
  360. return target_;
  361. }
  362. void PushRequest::setTarget(const std::string& target)
  363. {
  364. target_ = target;
  365. setParameter("Target", target);
  366. }
  367. std::string PushRequest::getAndroidNotificationChannel()const
  368. {
  369. return androidNotificationChannel_;
  370. }
  371. void PushRequest::setAndroidNotificationChannel(const std::string& androidNotificationChannel)
  372. {
  373. androidNotificationChannel_ = androidNotificationChannel;
  374. setParameter("AndroidNotificationChannel", androidNotificationChannel);
  375. }
  376. bool PushRequest::getAndroidRemind()const
  377. {
  378. return androidRemind_;
  379. }
  380. void PushRequest::setAndroidRemind(bool androidRemind)
  381. {
  382. androidRemind_ = androidRemind;
  383. setParameter("AndroidRemind", androidRemind ? "true" : "false");
  384. }
  385. std::string PushRequest::getAndroidActivity()const
  386. {
  387. return androidActivity_;
  388. }
  389. void PushRequest::setAndroidActivity(const std::string& androidActivity)
  390. {
  391. androidActivity_ = androidActivity;
  392. setParameter("AndroidActivity", androidActivity);
  393. }
  394. std::string PushRequest::getSmsSignName()const
  395. {
  396. return smsSignName_;
  397. }
  398. void PushRequest::setSmsSignName(const std::string& smsSignName)
  399. {
  400. smsSignName_ = smsSignName;
  401. setParameter("SmsSignName", smsSignName);
  402. }
  403. long PushRequest::getAppKey()const
  404. {
  405. return appKey_;
  406. }
  407. void PushRequest::setAppKey(long appKey)
  408. {
  409. appKey_ = appKey;
  410. setParameter("AppKey", std::to_string(appKey));
  411. }
  412. std::string PushRequest::getTargetValue()const
  413. {
  414. return targetValue_;
  415. }
  416. void PushRequest::setTargetValue(const std::string& targetValue)
  417. {
  418. targetValue_ = targetValue;
  419. setParameter("TargetValue", targetValue);
  420. }
  421. std::string PushRequest::getAndroidXiaoMiActivity()const
  422. {
  423. return androidXiaoMiActivity_;
  424. }
  425. void PushRequest::setAndroidXiaoMiActivity(const std::string& androidXiaoMiActivity)
  426. {
  427. androidXiaoMiActivity_ = androidXiaoMiActivity;
  428. setParameter("AndroidXiaoMiActivity", androidXiaoMiActivity);
  429. }
  430. std::string PushRequest::getAndroidXiaoMiNotifyTitle()const
  431. {
  432. return androidXiaoMiNotifyTitle_;
  433. }
  434. void PushRequest::setAndroidXiaoMiNotifyTitle(const std::string& androidXiaoMiNotifyTitle)
  435. {
  436. androidXiaoMiNotifyTitle_ = androidXiaoMiNotifyTitle;
  437. setParameter("AndroidXiaoMiNotifyTitle", androidXiaoMiNotifyTitle);
  438. }