PageRenderTime 247ms CodeModel.GetById 28ms RepoModel.GetById 0ms app.codeStats 0ms

/aws-android-sdk-sns/src/main/java/com/amazonaws/services/sns/model/PublishRequest.java

https://gitlab.com/github-cloud-corp/aws-sdk-android
Java | 1414 lines | 78 code | 31 blank | 1305 comment | 0 complexity | 4c0539f9672aad901ea115463cd14e4e MD5 | raw file
  1. /*
  2. * Copyright 2010-2016 Amazon.com, Inc. or its affiliates. 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. * A copy of the License is located at
  7. *
  8. * http://aws.amazon.com/apache2.0
  9. *
  10. * or in the "license" file accompanying this file. This file is distributed
  11. * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
  12. * express or implied. See the License for the specific language governing
  13. * permissions and limitations under the License.
  14. */
  15. package com.amazonaws.services.sns.model;
  16. import java.io.Serializable;
  17. import com.amazonaws.AmazonWebServiceRequest;
  18. /**
  19. * <p>
  20. * Sends a message to all of a topic's subscribed endpoints. When a
  21. * <code>messageId</code> is returned, the message has been saved and Amazon SNS
  22. * will attempt to deliver it to the topic's subscribers shortly. The format of
  23. * the outgoing message to each subscribed endpoint depends on the notification
  24. * protocol.
  25. * </p>
  26. * <p>
  27. * To use the <code>Publish</code> action for sending a message to a mobile
  28. * endpoint, such as an app on a Kindle device or mobile phone, you must specify
  29. * the EndpointArn for the TargetArn parameter. The EndpointArn is returned when
  30. * making a call with the <code>CreatePlatformEndpoint</code> action. The second
  31. * example below shows a request and response for publishing to a mobile
  32. * endpoint.
  33. * </p>
  34. * <p>
  35. * For more information about formatting messages, see <a href=
  36. * "http://docs.aws.amazon.com/sns/latest/dg/mobile-push-send-custommessage.html"
  37. * >Send Custom Platform-Specific Payloads in Messages to Mobile Devices</a>.
  38. * </p>
  39. */
  40. public class PublishRequest extends AmazonWebServiceRequest implements Serializable {
  41. /**
  42. * <p>
  43. * The topic you want to publish to.
  44. * </p>
  45. * <p>
  46. * If you don't specify a value for the <code>TopicArn</code> parameter, you
  47. * must specify a value for the <code>PhoneNumber</code> or
  48. * <code>TargetArn</code> parameters.
  49. * </p>
  50. */
  51. private String topicArn;
  52. /**
  53. * <p>
  54. * Either TopicArn or EndpointArn, but not both.
  55. * </p>
  56. * <p>
  57. * If you don't specify a value for the <code>TargetArn</code> parameter,
  58. * you must specify a value for the <code>PhoneNumber</code> or
  59. * <code>TopicArn</code> parameters.
  60. * </p>
  61. */
  62. private String targetArn;
  63. /**
  64. * <p>
  65. * The phone number to which you want to deliver an SMS message. Use E.164
  66. * format.
  67. * </p>
  68. * <p>
  69. * If you don't specify a value for the <code>PhoneNumber</code> parameter,
  70. * you must specify a value for the <code>TargetArn</code> or
  71. * <code>TopicArn</code> parameters.
  72. * </p>
  73. */
  74. private String phoneNumber;
  75. /**
  76. * <p>
  77. * The message you want to send to the topic.
  78. * </p>
  79. * <p>
  80. * If you want to send the same message to all transport protocols, include
  81. * the text of the message as a String value.
  82. * </p>
  83. * <p>
  84. * If you want to send different messages for each transport protocol, set
  85. * the value of the <code>MessageStructure</code> parameter to
  86. * <code>json</code> and use a JSON object for the <code>Message</code>
  87. * parameter. See the Examples section for the format of the JSON object.
  88. * </p>
  89. * <p>
  90. * Constraints: Messages must be UTF-8 encoded strings at most 256 KB in
  91. * size (262144 bytes, not 262144 characters).
  92. * </p>
  93. * <p>
  94. * JSON-specific constraints:
  95. * </p>
  96. * <ul>
  97. * <li>
  98. * <p>
  99. * Keys in the JSON object that correspond to supported transport protocols
  100. * must have simple JSON string values.
  101. * </p>
  102. * </li>
  103. * <li>
  104. * <p>
  105. * The values will be parsed (unescaped) before they are used in outgoing
  106. * messages.
  107. * </p>
  108. * </li>
  109. * <li>
  110. * <p>
  111. * Outbound notifications are JSON encoded (meaning that the characters will
  112. * be reescaped for sending).
  113. * </p>
  114. * </li>
  115. * <li>
  116. * <p>
  117. * Values have a minimum length of 0 (the empty string, "", is allowed).
  118. * </p>
  119. * </li>
  120. * <li>
  121. * <p>
  122. * Values have a maximum length bounded by the overall message size (so,
  123. * including multiple protocols may limit message sizes).
  124. * </p>
  125. * </li>
  126. * <li>
  127. * <p>
  128. * Non-string values will cause the key to be ignored.
  129. * </p>
  130. * </li>
  131. * <li>
  132. * <p>
  133. * Keys that do not correspond to supported transport protocols are ignored.
  134. * </p>
  135. * </li>
  136. * <li>
  137. * <p>
  138. * Duplicate keys are not allowed.
  139. * </p>
  140. * </li>
  141. * <li>
  142. * <p>
  143. * Failure to parse or validate any key or value in the message will cause
  144. * the <code>Publish</code> call to return an error (no partial delivery).
  145. * </p>
  146. * </li>
  147. * </ul>
  148. */
  149. private String message;
  150. /**
  151. * <p>
  152. * Optional parameter to be used as the "Subject" line when the message is
  153. * delivered to email endpoints. This field will also be included, if
  154. * present, in the standard JSON messages delivered to other endpoints.
  155. * </p>
  156. * <p>
  157. * Constraints: Subjects must be ASCII text that begins with a letter,
  158. * number, or punctuation mark; must not include line breaks or control
  159. * characters; and must be less than 100 characters long.
  160. * </p>
  161. */
  162. private String subject;
  163. /**
  164. * <p>
  165. * Set <code>MessageStructure</code> to <code>json</code> if you want to
  166. * send a different message for each protocol. For example, using one
  167. * publish action, you can send a short message to your SMS subscribers and
  168. * a longer message to your email subscribers. If you set
  169. * <code>MessageStructure</code> to <code>json</code>, the value of the
  170. * <code>Message</code> parameter must:
  171. * </p>
  172. * <ul>
  173. * <li>
  174. * <p>
  175. * be a syntactically valid JSON object; and
  176. * </p>
  177. * </li>
  178. * <li>
  179. * <p>
  180. * contain at least a top-level JSON key of "default" with a value that is a
  181. * string.
  182. * </p>
  183. * </li>
  184. * </ul>
  185. * <p>
  186. * You can define other top-level keys that define the message you want to
  187. * send to a specific transport protocol (e.g., "http").
  188. * </p>
  189. * <p>
  190. * For information about sending different messages for each protocol using
  191. * the AWS Management Console, go to <a href=
  192. * "http://docs.aws.amazon.com/sns/latest/gsg/Publish.html#sns-message-formatting-by-protocol"
  193. * >Create Different Messages for Each Protocol</a> in the <i>Amazon Simple
  194. * Notification Service Getting Started Guide</i>.
  195. * </p>
  196. * <p>
  197. * Valid value: <code>json</code>
  198. * </p>
  199. */
  200. private String messageStructure;
  201. /**
  202. * <p>
  203. * Message attributes for Publish action.
  204. * </p>
  205. */
  206. private java.util.Map<String, MessageAttributeValue> messageAttributes = new java.util.HashMap<String, MessageAttributeValue>();
  207. /**
  208. * Default constructor for PublishRequest object. Callers should use the
  209. * setter or fluent setter (with...) methods to initialize any additional
  210. * object members.
  211. */
  212. public PublishRequest() {
  213. }
  214. /**
  215. * Constructs a new PublishRequest object. Callers should use the setter or
  216. * fluent setter (with...) methods to initialize any additional object
  217. * members.
  218. *
  219. * @param topicArn <p>
  220. * The topic you want to publish to.
  221. * </p>
  222. * <p>
  223. * If you don't specify a value for the <code>TopicArn</code>
  224. * parameter, you must specify a value for the
  225. * <code>PhoneNumber</code> or <code>TargetArn</code> parameters.
  226. * </p>
  227. * @param message <p>
  228. * The message you want to send to the topic.
  229. * </p>
  230. * <p>
  231. * If you want to send the same message to all transport
  232. * protocols, include the text of the message as a String value.
  233. * </p>
  234. * <p>
  235. * If you want to send different messages for each transport
  236. * protocol, set the value of the <code>MessageStructure</code>
  237. * parameter to <code>json</code> and use a JSON object for the
  238. * <code>Message</code> parameter. See the Examples section for
  239. * the format of the JSON object.
  240. * </p>
  241. * <p>
  242. * Constraints: Messages must be UTF-8 encoded strings at most
  243. * 256 KB in size (262144 bytes, not 262144 characters).
  244. * </p>
  245. * <p>
  246. * JSON-specific constraints:
  247. * </p>
  248. * <ul>
  249. * <li>
  250. * <p>
  251. * Keys in the JSON object that correspond to supported transport
  252. * protocols must have simple JSON string values.
  253. * </p>
  254. * </li>
  255. * <li>
  256. * <p>
  257. * The values will be parsed (unescaped) before they are used in
  258. * outgoing messages.
  259. * </p>
  260. * </li>
  261. * <li>
  262. * <p>
  263. * Outbound notifications are JSON encoded (meaning that the
  264. * characters will be reescaped for sending).
  265. * </p>
  266. * </li>
  267. * <li>
  268. * <p>
  269. * Values have a minimum length of 0 (the empty string, "", is
  270. * allowed).
  271. * </p>
  272. * </li>
  273. * <li>
  274. * <p>
  275. * Values have a maximum length bounded by the overall message
  276. * size (so, including multiple protocols may limit message
  277. * sizes).
  278. * </p>
  279. * </li>
  280. * <li>
  281. * <p>
  282. * Non-string values will cause the key to be ignored.
  283. * </p>
  284. * </li>
  285. * <li>
  286. * <p>
  287. * Keys that do not correspond to supported transport protocols
  288. * are ignored.
  289. * </p>
  290. * </li>
  291. * <li>
  292. * <p>
  293. * Duplicate keys are not allowed.
  294. * </p>
  295. * </li>
  296. * <li>
  297. * <p>
  298. * Failure to parse or validate any key or value in the message
  299. * will cause the <code>Publish</code> call to return an error
  300. * (no partial delivery).
  301. * </p>
  302. * </li>
  303. * </ul>
  304. */
  305. public PublishRequest(String topicArn, String message) {
  306. setTopicArn(topicArn);
  307. setMessage(message);
  308. }
  309. /**
  310. * Constructs a new PublishRequest object. Callers should use the setter or
  311. * fluent setter (with...) methods to initialize any additional object
  312. * members.
  313. *
  314. * @param topicArn <p>
  315. * The topic you want to publish to.
  316. * </p>
  317. * <p>
  318. * If you don't specify a value for the <code>TopicArn</code>
  319. * parameter, you must specify a value for the
  320. * <code>PhoneNumber</code> or <code>TargetArn</code> parameters.
  321. * </p>
  322. * @param message <p>
  323. * The message you want to send to the topic.
  324. * </p>
  325. * <p>
  326. * If you want to send the same message to all transport
  327. * protocols, include the text of the message as a String value.
  328. * </p>
  329. * <p>
  330. * If you want to send different messages for each transport
  331. * protocol, set the value of the <code>MessageStructure</code>
  332. * parameter to <code>json</code> and use a JSON object for the
  333. * <code>Message</code> parameter. See the Examples section for
  334. * the format of the JSON object.
  335. * </p>
  336. * <p>
  337. * Constraints: Messages must be UTF-8 encoded strings at most
  338. * 256 KB in size (262144 bytes, not 262144 characters).
  339. * </p>
  340. * <p>
  341. * JSON-specific constraints:
  342. * </p>
  343. * <ul>
  344. * <li>
  345. * <p>
  346. * Keys in the JSON object that correspond to supported transport
  347. * protocols must have simple JSON string values.
  348. * </p>
  349. * </li>
  350. * <li>
  351. * <p>
  352. * The values will be parsed (unescaped) before they are used in
  353. * outgoing messages.
  354. * </p>
  355. * </li>
  356. * <li>
  357. * <p>
  358. * Outbound notifications are JSON encoded (meaning that the
  359. * characters will be reescaped for sending).
  360. * </p>
  361. * </li>
  362. * <li>
  363. * <p>
  364. * Values have a minimum length of 0 (the empty string, "", is
  365. * allowed).
  366. * </p>
  367. * </li>
  368. * <li>
  369. * <p>
  370. * Values have a maximum length bounded by the overall message
  371. * size (so, including multiple protocols may limit message
  372. * sizes).
  373. * </p>
  374. * </li>
  375. * <li>
  376. * <p>
  377. * Non-string values will cause the key to be ignored.
  378. * </p>
  379. * </li>
  380. * <li>
  381. * <p>
  382. * Keys that do not correspond to supported transport protocols
  383. * are ignored.
  384. * </p>
  385. * </li>
  386. * <li>
  387. * <p>
  388. * Duplicate keys are not allowed.
  389. * </p>
  390. * </li>
  391. * <li>
  392. * <p>
  393. * Failure to parse or validate any key or value in the message
  394. * will cause the <code>Publish</code> call to return an error
  395. * (no partial delivery).
  396. * </p>
  397. * </li>
  398. * </ul>
  399. * @param subject <p>
  400. * Optional parameter to be used as the "Subject" line when the
  401. * message is delivered to email endpoints. This field will also
  402. * be included, if present, in the standard JSON messages
  403. * delivered to other endpoints.
  404. * </p>
  405. * <p>
  406. * Constraints: Subjects must be ASCII text that begins with a
  407. * letter, number, or punctuation mark; must not include line
  408. * breaks or control characters; and must be less than 100
  409. * characters long.
  410. * </p>
  411. */
  412. public PublishRequest(String topicArn, String message, String subject) {
  413. setTopicArn(topicArn);
  414. setMessage(message);
  415. setSubject(subject);
  416. }
  417. /**
  418. * <p>
  419. * The topic you want to publish to.
  420. * </p>
  421. * <p>
  422. * If you don't specify a value for the <code>TopicArn</code> parameter, you
  423. * must specify a value for the <code>PhoneNumber</code> or
  424. * <code>TargetArn</code> parameters.
  425. * </p>
  426. *
  427. * @return <p>
  428. * The topic you want to publish to.
  429. * </p>
  430. * <p>
  431. * If you don't specify a value for the <code>TopicArn</code>
  432. * parameter, you must specify a value for the
  433. * <code>PhoneNumber</code> or <code>TargetArn</code> parameters.
  434. * </p>
  435. */
  436. public String getTopicArn() {
  437. return topicArn;
  438. }
  439. /**
  440. * <p>
  441. * The topic you want to publish to.
  442. * </p>
  443. * <p>
  444. * If you don't specify a value for the <code>TopicArn</code> parameter, you
  445. * must specify a value for the <code>PhoneNumber</code> or
  446. * <code>TargetArn</code> parameters.
  447. * </p>
  448. *
  449. * @param topicArn <p>
  450. * The topic you want to publish to.
  451. * </p>
  452. * <p>
  453. * If you don't specify a value for the <code>TopicArn</code>
  454. * parameter, you must specify a value for the
  455. * <code>PhoneNumber</code> or <code>TargetArn</code> parameters.
  456. * </p>
  457. */
  458. public void setTopicArn(String topicArn) {
  459. this.topicArn = topicArn;
  460. }
  461. /**
  462. * <p>
  463. * The topic you want to publish to.
  464. * </p>
  465. * <p>
  466. * If you don't specify a value for the <code>TopicArn</code> parameter, you
  467. * must specify a value for the <code>PhoneNumber</code> or
  468. * <code>TargetArn</code> parameters.
  469. * </p>
  470. * <p>
  471. * Returns a reference to this object so that method calls can be chained
  472. * together.
  473. *
  474. * @param topicArn <p>
  475. * The topic you want to publish to.
  476. * </p>
  477. * <p>
  478. * If you don't specify a value for the <code>TopicArn</code>
  479. * parameter, you must specify a value for the
  480. * <code>PhoneNumber</code> or <code>TargetArn</code> parameters.
  481. * </p>
  482. * @return A reference to this updated object so that method calls can be
  483. * chained together.
  484. */
  485. public PublishRequest withTopicArn(String topicArn) {
  486. this.topicArn = topicArn;
  487. return this;
  488. }
  489. /**
  490. * <p>
  491. * Either TopicArn or EndpointArn, but not both.
  492. * </p>
  493. * <p>
  494. * If you don't specify a value for the <code>TargetArn</code> parameter,
  495. * you must specify a value for the <code>PhoneNumber</code> or
  496. * <code>TopicArn</code> parameters.
  497. * </p>
  498. *
  499. * @return <p>
  500. * Either TopicArn or EndpointArn, but not both.
  501. * </p>
  502. * <p>
  503. * If you don't specify a value for the <code>TargetArn</code>
  504. * parameter, you must specify a value for the
  505. * <code>PhoneNumber</code> or <code>TopicArn</code> parameters.
  506. * </p>
  507. */
  508. public String getTargetArn() {
  509. return targetArn;
  510. }
  511. /**
  512. * <p>
  513. * Either TopicArn or EndpointArn, but not both.
  514. * </p>
  515. * <p>
  516. * If you don't specify a value for the <code>TargetArn</code> parameter,
  517. * you must specify a value for the <code>PhoneNumber</code> or
  518. * <code>TopicArn</code> parameters.
  519. * </p>
  520. *
  521. * @param targetArn <p>
  522. * Either TopicArn or EndpointArn, but not both.
  523. * </p>
  524. * <p>
  525. * If you don't specify a value for the <code>TargetArn</code>
  526. * parameter, you must specify a value for the
  527. * <code>PhoneNumber</code> or <code>TopicArn</code> parameters.
  528. * </p>
  529. */
  530. public void setTargetArn(String targetArn) {
  531. this.targetArn = targetArn;
  532. }
  533. /**
  534. * <p>
  535. * Either TopicArn or EndpointArn, but not both.
  536. * </p>
  537. * <p>
  538. * If you don't specify a value for the <code>TargetArn</code> parameter,
  539. * you must specify a value for the <code>PhoneNumber</code> or
  540. * <code>TopicArn</code> parameters.
  541. * </p>
  542. * <p>
  543. * Returns a reference to this object so that method calls can be chained
  544. * together.
  545. *
  546. * @param targetArn <p>
  547. * Either TopicArn or EndpointArn, but not both.
  548. * </p>
  549. * <p>
  550. * If you don't specify a value for the <code>TargetArn</code>
  551. * parameter, you must specify a value for the
  552. * <code>PhoneNumber</code> or <code>TopicArn</code> parameters.
  553. * </p>
  554. * @return A reference to this updated object so that method calls can be
  555. * chained together.
  556. */
  557. public PublishRequest withTargetArn(String targetArn) {
  558. this.targetArn = targetArn;
  559. return this;
  560. }
  561. /**
  562. * <p>
  563. * The phone number to which you want to deliver an SMS message. Use E.164
  564. * format.
  565. * </p>
  566. * <p>
  567. * If you don't specify a value for the <code>PhoneNumber</code> parameter,
  568. * you must specify a value for the <code>TargetArn</code> or
  569. * <code>TopicArn</code> parameters.
  570. * </p>
  571. *
  572. * @return <p>
  573. * The phone number to which you want to deliver an SMS message. Use
  574. * E.164 format.
  575. * </p>
  576. * <p>
  577. * If you don't specify a value for the <code>PhoneNumber</code>
  578. * parameter, you must specify a value for the
  579. * <code>TargetArn</code> or <code>TopicArn</code> parameters.
  580. * </p>
  581. */
  582. public String getPhoneNumber() {
  583. return phoneNumber;
  584. }
  585. /**
  586. * <p>
  587. * The phone number to which you want to deliver an SMS message. Use E.164
  588. * format.
  589. * </p>
  590. * <p>
  591. * If you don't specify a value for the <code>PhoneNumber</code> parameter,
  592. * you must specify a value for the <code>TargetArn</code> or
  593. * <code>TopicArn</code> parameters.
  594. * </p>
  595. *
  596. * @param phoneNumber <p>
  597. * The phone number to which you want to deliver an SMS message.
  598. * Use E.164 format.
  599. * </p>
  600. * <p>
  601. * If you don't specify a value for the <code>PhoneNumber</code>
  602. * parameter, you must specify a value for the
  603. * <code>TargetArn</code> or <code>TopicArn</code> parameters.
  604. * </p>
  605. */
  606. public void setPhoneNumber(String phoneNumber) {
  607. this.phoneNumber = phoneNumber;
  608. }
  609. /**
  610. * <p>
  611. * The phone number to which you want to deliver an SMS message. Use E.164
  612. * format.
  613. * </p>
  614. * <p>
  615. * If you don't specify a value for the <code>PhoneNumber</code> parameter,
  616. * you must specify a value for the <code>TargetArn</code> or
  617. * <code>TopicArn</code> parameters.
  618. * </p>
  619. * <p>
  620. * Returns a reference to this object so that method calls can be chained
  621. * together.
  622. *
  623. * @param phoneNumber <p>
  624. * The phone number to which you want to deliver an SMS message.
  625. * Use E.164 format.
  626. * </p>
  627. * <p>
  628. * If you don't specify a value for the <code>PhoneNumber</code>
  629. * parameter, you must specify a value for the
  630. * <code>TargetArn</code> or <code>TopicArn</code> parameters.
  631. * </p>
  632. * @return A reference to this updated object so that method calls can be
  633. * chained together.
  634. */
  635. public PublishRequest withPhoneNumber(String phoneNumber) {
  636. this.phoneNumber = phoneNumber;
  637. return this;
  638. }
  639. /**
  640. * <p>
  641. * The message you want to send to the topic.
  642. * </p>
  643. * <p>
  644. * If you want to send the same message to all transport protocols, include
  645. * the text of the message as a String value.
  646. * </p>
  647. * <p>
  648. * If you want to send different messages for each transport protocol, set
  649. * the value of the <code>MessageStructure</code> parameter to
  650. * <code>json</code> and use a JSON object for the <code>Message</code>
  651. * parameter. See the Examples section for the format of the JSON object.
  652. * </p>
  653. * <p>
  654. * Constraints: Messages must be UTF-8 encoded strings at most 256 KB in
  655. * size (262144 bytes, not 262144 characters).
  656. * </p>
  657. * <p>
  658. * JSON-specific constraints:
  659. * </p>
  660. * <ul>
  661. * <li>
  662. * <p>
  663. * Keys in the JSON object that correspond to supported transport protocols
  664. * must have simple JSON string values.
  665. * </p>
  666. * </li>
  667. * <li>
  668. * <p>
  669. * The values will be parsed (unescaped) before they are used in outgoing
  670. * messages.
  671. * </p>
  672. * </li>
  673. * <li>
  674. * <p>
  675. * Outbound notifications are JSON encoded (meaning that the characters will
  676. * be reescaped for sending).
  677. * </p>
  678. * </li>
  679. * <li>
  680. * <p>
  681. * Values have a minimum length of 0 (the empty string, "", is allowed).
  682. * </p>
  683. * </li>
  684. * <li>
  685. * <p>
  686. * Values have a maximum length bounded by the overall message size (so,
  687. * including multiple protocols may limit message sizes).
  688. * </p>
  689. * </li>
  690. * <li>
  691. * <p>
  692. * Non-string values will cause the key to be ignored.
  693. * </p>
  694. * </li>
  695. * <li>
  696. * <p>
  697. * Keys that do not correspond to supported transport protocols are ignored.
  698. * </p>
  699. * </li>
  700. * <li>
  701. * <p>
  702. * Duplicate keys are not allowed.
  703. * </p>
  704. * </li>
  705. * <li>
  706. * <p>
  707. * Failure to parse or validate any key or value in the message will cause
  708. * the <code>Publish</code> call to return an error (no partial delivery).
  709. * </p>
  710. * </li>
  711. * </ul>
  712. *
  713. * @return <p>
  714. * The message you want to send to the topic.
  715. * </p>
  716. * <p>
  717. * If you want to send the same message to all transport protocols,
  718. * include the text of the message as a String value.
  719. * </p>
  720. * <p>
  721. * If you want to send different messages for each transport
  722. * protocol, set the value of the <code>MessageStructure</code>
  723. * parameter to <code>json</code> and use a JSON object for the
  724. * <code>Message</code> parameter. See the Examples section for the
  725. * format of the JSON object.
  726. * </p>
  727. * <p>
  728. * Constraints: Messages must be UTF-8 encoded strings at most 256
  729. * KB in size (262144 bytes, not 262144 characters).
  730. * </p>
  731. * <p>
  732. * JSON-specific constraints:
  733. * </p>
  734. * <ul>
  735. * <li>
  736. * <p>
  737. * Keys in the JSON object that correspond to supported transport
  738. * protocols must have simple JSON string values.
  739. * </p>
  740. * </li>
  741. * <li>
  742. * <p>
  743. * The values will be parsed (unescaped) before they are used in
  744. * outgoing messages.
  745. * </p>
  746. * </li>
  747. * <li>
  748. * <p>
  749. * Outbound notifications are JSON encoded (meaning that the
  750. * characters will be reescaped for sending).
  751. * </p>
  752. * </li>
  753. * <li>
  754. * <p>
  755. * Values have a minimum length of 0 (the empty string, "", is
  756. * allowed).
  757. * </p>
  758. * </li>
  759. * <li>
  760. * <p>
  761. * Values have a maximum length bounded by the overall message size
  762. * (so, including multiple protocols may limit message sizes).
  763. * </p>
  764. * </li>
  765. * <li>
  766. * <p>
  767. * Non-string values will cause the key to be ignored.
  768. * </p>
  769. * </li>
  770. * <li>
  771. * <p>
  772. * Keys that do not correspond to supported transport protocols are
  773. * ignored.
  774. * </p>
  775. * </li>
  776. * <li>
  777. * <p>
  778. * Duplicate keys are not allowed.
  779. * </p>
  780. * </li>
  781. * <li>
  782. * <p>
  783. * Failure to parse or validate any key or value in the message will
  784. * cause the <code>Publish</code> call to return an error (no
  785. * partial delivery).
  786. * </p>
  787. * </li>
  788. * </ul>
  789. */
  790. public String getMessage() {
  791. return message;
  792. }
  793. /**
  794. * <p>
  795. * The message you want to send to the topic.
  796. * </p>
  797. * <p>
  798. * If you want to send the same message to all transport protocols, include
  799. * the text of the message as a String value.
  800. * </p>
  801. * <p>
  802. * If you want to send different messages for each transport protocol, set
  803. * the value of the <code>MessageStructure</code> parameter to
  804. * <code>json</code> and use a JSON object for the <code>Message</code>
  805. * parameter. See the Examples section for the format of the JSON object.
  806. * </p>
  807. * <p>
  808. * Constraints: Messages must be UTF-8 encoded strings at most 256 KB in
  809. * size (262144 bytes, not 262144 characters).
  810. * </p>
  811. * <p>
  812. * JSON-specific constraints:
  813. * </p>
  814. * <ul>
  815. * <li>
  816. * <p>
  817. * Keys in the JSON object that correspond to supported transport protocols
  818. * must have simple JSON string values.
  819. * </p>
  820. * </li>
  821. * <li>
  822. * <p>
  823. * The values will be parsed (unescaped) before they are used in outgoing
  824. * messages.
  825. * </p>
  826. * </li>
  827. * <li>
  828. * <p>
  829. * Outbound notifications are JSON encoded (meaning that the characters will
  830. * be reescaped for sending).
  831. * </p>
  832. * </li>
  833. * <li>
  834. * <p>
  835. * Values have a minimum length of 0 (the empty string, "", is allowed).
  836. * </p>
  837. * </li>
  838. * <li>
  839. * <p>
  840. * Values have a maximum length bounded by the overall message size (so,
  841. * including multiple protocols may limit message sizes).
  842. * </p>
  843. * </li>
  844. * <li>
  845. * <p>
  846. * Non-string values will cause the key to be ignored.
  847. * </p>
  848. * </li>
  849. * <li>
  850. * <p>
  851. * Keys that do not correspond to supported transport protocols are ignored.
  852. * </p>
  853. * </li>
  854. * <li>
  855. * <p>
  856. * Duplicate keys are not allowed.
  857. * </p>
  858. * </li>
  859. * <li>
  860. * <p>
  861. * Failure to parse or validate any key or value in the message will cause
  862. * the <code>Publish</code> call to return an error (no partial delivery).
  863. * </p>
  864. * </li>
  865. * </ul>
  866. *
  867. * @param message <p>
  868. * The message you want to send to the topic.
  869. * </p>
  870. * <p>
  871. * If you want to send the same message to all transport
  872. * protocols, include the text of the message as a String value.
  873. * </p>
  874. * <p>
  875. * If you want to send different messages for each transport
  876. * protocol, set the value of the <code>MessageStructure</code>
  877. * parameter to <code>json</code> and use a JSON object for the
  878. * <code>Message</code> parameter. See the Examples section for
  879. * the format of the JSON object.
  880. * </p>
  881. * <p>
  882. * Constraints: Messages must be UTF-8 encoded strings at most
  883. * 256 KB in size (262144 bytes, not 262144 characters).
  884. * </p>
  885. * <p>
  886. * JSON-specific constraints:
  887. * </p>
  888. * <ul>
  889. * <li>
  890. * <p>
  891. * Keys in the JSON object that correspond to supported transport
  892. * protocols must have simple JSON string values.
  893. * </p>
  894. * </li>
  895. * <li>
  896. * <p>
  897. * The values will be parsed (unescaped) before they are used in
  898. * outgoing messages.
  899. * </p>
  900. * </li>
  901. * <li>
  902. * <p>
  903. * Outbound notifications are JSON encoded (meaning that the
  904. * characters will be reescaped for sending).
  905. * </p>
  906. * </li>
  907. * <li>
  908. * <p>
  909. * Values have a minimum length of 0 (the empty string, "", is
  910. * allowed).
  911. * </p>
  912. * </li>
  913. * <li>
  914. * <p>
  915. * Values have a maximum length bounded by the overall message
  916. * size (so, including multiple protocols may limit message
  917. * sizes).
  918. * </p>
  919. * </li>
  920. * <li>
  921. * <p>
  922. * Non-string values will cause the key to be ignored.
  923. * </p>
  924. * </li>
  925. * <li>
  926. * <p>
  927. * Keys that do not correspond to supported transport protocols
  928. * are ignored.
  929. * </p>
  930. * </li>
  931. * <li>
  932. * <p>
  933. * Duplicate keys are not allowed.
  934. * </p>
  935. * </li>
  936. * <li>
  937. * <p>
  938. * Failure to parse or validate any key or value in the message
  939. * will cause the <code>Publish</code> call to return an error
  940. * (no partial delivery).
  941. * </p>
  942. * </li>
  943. * </ul>
  944. */
  945. public void setMessage(String message) {
  946. this.message = message;
  947. }
  948. /**
  949. * <p>
  950. * The message you want to send to the topic.
  951. * </p>
  952. * <p>
  953. * If you want to send the same message to all transport protocols, include
  954. * the text of the message as a String value.
  955. * </p>
  956. * <p>
  957. * If you want to send different messages for each transport protocol, set
  958. * the value of the <code>MessageStructure</code> parameter to
  959. * <code>json</code> and use a JSON object for the <code>Message</code>
  960. * parameter. See the Examples section for the format of the JSON object.
  961. * </p>
  962. * <p>
  963. * Constraints: Messages must be UTF-8 encoded strings at most 256 KB in
  964. * size (262144 bytes, not 262144 characters).
  965. * </p>
  966. * <p>
  967. * JSON-specific constraints:
  968. * </p>
  969. * <ul>
  970. * <li>
  971. * <p>
  972. * Keys in the JSON object that correspond to supported transport protocols
  973. * must have simple JSON string values.
  974. * </p>
  975. * </li>
  976. * <li>
  977. * <p>
  978. * The values will be parsed (unescaped) before they are used in outgoing
  979. * messages.
  980. * </p>
  981. * </li>
  982. * <li>
  983. * <p>
  984. * Outbound notifications are JSON encoded (meaning that the characters will
  985. * be reescaped for sending).
  986. * </p>
  987. * </li>
  988. * <li>
  989. * <p>
  990. * Values have a minimum length of 0 (the empty string, "", is allowed).
  991. * </p>
  992. * </li>
  993. * <li>
  994. * <p>
  995. * Values have a maximum length bounded by the overall message size (so,
  996. * including multiple protocols may limit message sizes).
  997. * </p>
  998. * </li>
  999. * <li>
  1000. * <p>
  1001. * Non-string values will cause the key to be ignored.
  1002. * </p>
  1003. * </li>
  1004. * <li>
  1005. * <p>
  1006. * Keys that do not correspond to supported transport protocols are ignored.
  1007. * </p>
  1008. * </li>
  1009. * <li>
  1010. * <p>
  1011. * Duplicate keys are not allowed.
  1012. * </p>
  1013. * </li>
  1014. * <li>
  1015. * <p>
  1016. * Failure to parse or validate any key or value in the message will cause
  1017. * the <code>Publish</code> call to return an error (no partial delivery).
  1018. * </p>
  1019. * </li>
  1020. * </ul>
  1021. * <p>
  1022. * Returns a reference to this object so that method calls can be chained
  1023. * together.
  1024. *
  1025. * @param message <p>
  1026. * The message you want to send to the topic.
  1027. * </p>
  1028. * <p>
  1029. * If you want to send the same message to all transport
  1030. * protocols, include the text of the message as a String value.
  1031. * </p>
  1032. * <p>
  1033. * If you want to send different messages for each transport
  1034. * protocol, set the value of the <code>MessageStructure</code>
  1035. * parameter to <code>json</code> and use a JSON object for the
  1036. * <code>Message</code> parameter. See the Examples section for
  1037. * the format of the JSON object.
  1038. * </p>
  1039. * <p>
  1040. * Constraints: Messages must be UTF-8 encoded strings at most
  1041. * 256 KB in size (262144 bytes, not 262144 characters).
  1042. * </p>
  1043. * <p>
  1044. * JSON-specific constraints:
  1045. * </p>
  1046. * <ul>
  1047. * <li>
  1048. * <p>
  1049. * Keys in the JSON object that correspond to supported transport
  1050. * protocols must have simple JSON string values.
  1051. * </p>
  1052. * </li>
  1053. * <li>
  1054. * <p>
  1055. * The values will be parsed (unescaped) before they are used in
  1056. * outgoing messages.
  1057. * </p>
  1058. * </li>
  1059. * <li>
  1060. * <p>
  1061. * Outbound notifications are JSON encoded (meaning that the
  1062. * characters will be reescaped for sending).
  1063. * </p>
  1064. * </li>
  1065. * <li>
  1066. * <p>
  1067. * Values have a minimum length of 0 (the empty string, "", is
  1068. * allowed).
  1069. * </p>
  1070. * </li>
  1071. * <li>
  1072. * <p>
  1073. * Values have a maximum length bounded by the overall message
  1074. * size (so, including multiple protocols may limit message
  1075. * sizes).
  1076. * </p>
  1077. * </li>
  1078. * <li>
  1079. * <p>
  1080. * Non-string values will cause the key to be ignored.
  1081. * </p>
  1082. * </li>
  1083. * <li>
  1084. * <p>
  1085. * Keys that do not correspond to supported transport protocols
  1086. * are ignored.
  1087. * </p>
  1088. * </li>
  1089. * <li>
  1090. * <p>
  1091. * Duplicate keys are not allowed.
  1092. * </p>
  1093. * </li>
  1094. * <li>
  1095. * <p>
  1096. * Failure to parse or validate any key or value in the message
  1097. * will cause the <code>Publish</code> call to return an error
  1098. * (no partial delivery).
  1099. * </p>
  1100. * </li>
  1101. * </ul>
  1102. * @return A reference to this updated object so that method calls can be
  1103. * chained together.
  1104. */
  1105. public PublishRequest withMessage(String message) {
  1106. this.message = message;
  1107. return this;
  1108. }
  1109. /**
  1110. * <p>
  1111. * Optional parameter to be used as the "Subject" line when the message is
  1112. * delivered to email endpoints. This field will also be included, if
  1113. * present, in the standard JSON messages delivered to other endpoints.
  1114. * </p>
  1115. * <p>
  1116. * Constraints: Subjects must be ASCII text that begins with a letter,
  1117. * number, or punctuation mark; must not include line breaks or control
  1118. * characters; and must be less than 100 characters long.
  1119. * </p>
  1120. *
  1121. * @return <p>
  1122. * Optional parameter to be used as the "Subject" line when the
  1123. * message is delivered to email endpoints. This field will also be
  1124. * included, if present, in the standard JSON messages delivered to
  1125. * other endpoints.
  1126. * </p>
  1127. * <p>
  1128. * Constraints: Subjects must be ASCII text that begins with a
  1129. * letter, number, or punctuation mark; must not include line breaks
  1130. * or control characters; and must be less than 100 characters long.
  1131. * </p>
  1132. */
  1133. public String getSubject() {
  1134. return subject;
  1135. }
  1136. /**
  1137. * <p>
  1138. * Optional parameter to be used as the "Subject" line when the message is
  1139. * delivered to email endpoints. This field will also be included, if
  1140. * present, in the standard JSON messages delivered to other endpoints.
  1141. * </p>
  1142. * <p>
  1143. * Constraints: Subjects must be ASCII text that begins with a letter,
  1144. * number, or punctuation mark; must not include line breaks or control
  1145. * characters; and must be less than 100 characters long.
  1146. * </p>
  1147. *
  1148. * @param subject <p>
  1149. * Optional parameter to be used as the "Subject" line when the
  1150. * message is delivered to email endpoints. This field will also
  1151. * be included, if present, in the standard JSON messages
  1152. * delivered to other endpoints.
  1153. * </p>
  1154. * <p>
  1155. * Constraints: Subjects must be ASCII text that begins with a
  1156. * letter, number, or punctuation mark; must not include line
  1157. * breaks or control characters; and must be less than 100
  1158. * characters long.
  1159. * </p>
  1160. */
  1161. public void setSubject(String subject) {
  1162. this.subject = subject;
  1163. }
  1164. /**
  1165. * <p>
  1166. * Optional parameter to be used as the "Subject" line when the message is
  1167. * delivered to email endpoints. This field will also be included, if
  1168. * present, in the standard JSON messages delivered to other endpoints.
  1169. * </p>
  1170. * <p>
  1171. * Constraints: Subjects must be ASCII text that begins with a letter,
  1172. * number, or punctuation mark; must not include line breaks or control
  1173. * characters; and must be less than 100 characters long.
  1174. * </p>
  1175. * <p>
  1176. * Returns a reference to this object so that method calls can be chained
  1177. * together.
  1178. *
  1179. * @param subject <p>
  1180. * Optional parameter to be used as the "Subject" line when the
  1181. * message is delivered to email endpoints. This field will also
  1182. * be included, if present, in the standard JSON messages
  1183. * delivered to other endpoints.
  1184. * </p>
  1185. * <p>
  1186. * Constraints: Subjects must be ASCII text that begins with a
  1187. * letter, number, or punctuation mark; must not include line
  1188. * breaks or control characters; and must be less than 100
  1189. * characters long.
  1190. * </p>
  1191. * @return A reference to this updated object so that method calls can be
  1192. * chained together.
  1193. */
  1194. public PublishRequest withSubject(String subject) {
  1195. this.subject = subject;
  1196. return this;
  1197. }
  1198. /**
  1199. * <p>
  1200. * Set <code>MessageStructure</code> to <code>json</code> if you want to
  1201. * send a different message for each protocol. For example, using one
  1202. * publish action, you can send a short message to your SMS subscribers and
  1203. * a longer message to your email subscribers. If you set
  1204. * <code>MessageStructure</code> to <code>json</code>, the value of the
  1205. * <code>Message</code> parameter must:
  1206. * </p>
  1207. * <ul>
  1208. * <li>
  1209. * <p>
  1210. * be a syntactically valid JSON object; and
  1211. * </p>
  1212. * </li>
  1213. * <li>
  1214. * <p>
  1215. * contain at least a top-level JSON key of "default" with a value that is a
  1216. * string.
  1217. * </p>
  1218. * </li>
  1219. * </ul>
  1220. * <p>
  1221. * You can define other top-level keys that define the message you want to
  1222. * send to a specific transport protocol (e.g., "http").
  1223. * </p>
  1224. * <p>
  1225. * For information about sending different messages for each protocol using
  1226. * the AWS Management Console, go to <a href=
  1227. * "http://docs.aws.amazon.com/sns/latest/gsg/Publish.html#sns-message-formatting-by-protocol"
  1228. * >Create Different Messages for Each Protocol</a> in the <i>Amazon Simple
  1229. * Notification Service Getting Started Guide</i>.
  1230. * </p>
  1231. * <p>
  1232. * Valid value: <code>json</code>
  1233. * </p>
  1234. *
  1235. * @return <p>
  1236. * Set <code>MessageStructure</code> to <code>json</code> if you
  1237. * want to send a different message for each protocol. For example,
  1238. * using one publish action, you can send a short message to your
  1239. * SMS subscribers and a longer message to your email subscribers.
  1240. * If you set <code>MessageStructure</code> to <code>json</code>,
  1241. * the value of the <code>Message</code> parameter must:
  1242. * </p>
  1243. * <ul>
  1244. * <li>
  1245. * <p>
  1246. * be a syntactically valid JSON object; and
  1247. * </p>
  1248. * </li>
  1249. * <li>
  1250. * <p>
  1251. * contain at least a top-level JSON key of "default" with a value
  1252. * that is a string.
  1253. * </p>
  1254. * </li>
  1255. * </ul>
  1256. * <p>
  1257. * You can define other top-level keys that define the message you
  1258. * want to send to a specific transport protocol (e.g., "http").
  1259. * </p>
  1260. * <p>
  1261. * For information about sending different messages for each
  1262. * protocol using the AWS Management Console, go to <a href=
  1263. * "http://docs.aws.amazon.com/sns/latest/gsg/Publish.html#sns-message-formatting-by-protocol"
  1264. * >Create Different Messages for Each Protocol</a> in the <i>Amazon
  1265. * Simple Notification Service Getting Started Guide</i>.
  1266. * </p>
  1267. * <p>
  1268. * Valid value: <code>json</code>
  1269. * </p>
  1270. */
  1271. public String getMessageStructure() {
  1272. return messageStructure;
  1273. }
  1274. /**
  1275. * <p>
  1276. * Set <code>MessageStructure</code> to <code>json</code> if you want to
  1277. * send a different message for each protocol. For example, using one
  1278. * publish action, you can send a short message to your SMS subscribers and
  1279. * a longer message to your email subscribers. If you set
  1280. * <code>MessageStructure</code> to <code>json</code>, the value of the
  1281. * <code>Message</code> parameter must:
  1282. * </p>
  1283. * <ul>
  1284. * <li>
  1285. * <p>
  1286. * be a syntactically valid JSON object; and
  1287. * </p>
  1288. * </li>
  1289. * <li>
  1290. * <p>
  1291. * contain at least a top-level JSON key of "default" with a value that is a
  1292. * string.
  1293. * </p>
  1294. * </li>
  1295. * </ul>
  1296. * <p>
  1297. * You can define other top-level keys that define the message you want to
  1298. * send to a specific transport protocol (e.g., "http").
  1299. * </p>
  1300. * <p>
  1301. * For information about sending different messages for each protocol using
  1302. * the AWS Management Console, go to <a href=
  1303. * "http://docs.aws.amazon.com/sns/latest/gsg/Publish.html#sns-message-formatting-by-protocol"
  1304. * >Create Different Messages for Each Protocol</a> in the <i>Amazon Simple
  1305. * Notification Service Getting Started Guide</i>.
  1306. * </p>
  1307. * <p>
  1308. * Valid value: <code>json</code>
  1309. * </p>
  1310. *
  1311. * @param messageStructure <p>
  1312. * Set <code>MessageStructure</code> to <code>json</code> if you
  1313. * want to send a different message for each protocol. For
  1314. * example, using one publish action, you can send a short
  1315. * message to your SMS subscribers and a longer message to your
  1316. * email subscribers. If you set <code>MessageStructure</code> to
  1317. * <code>json</code>, the value of the <code>Message</code>
  1318. * parameter must:
  1319. * </p>
  1320. * <ul>
  1321. * <li>
  1322. * <p>
  1323. * be a syntactically valid JSON object; and
  1324. * </p>
  1325. * </li>
  1326. * <li>
  1327. * <p>
  1328. * contain at least a top-level JSON key of "default" with a
  1329. * value that is a string.
  1330. * </p>
  1331. * </li>
  1332. * </ul>
  1333. * <p>
  1334. * You can define other top-level keys that define the message
  1335. * you want to send to a specific transport protocol (e.g.,
  1336. * "http").
  1337. * </p>
  1338. * <p>
  1339. * For information about sending different messages for each
  1340. * protocol using the AWS Management Console, go to <a href=
  1341. * "http://docs.aws.amazon.com/sns/latest/gsg/Publish.html#sns-message-formatting-by-protocol"
  1342. * >Create Different Messages for Each Protocol</a> in the
  1343. * <i>Amazon Simple Notification Service Getting Started
  1344. * Guide</i>.
  1345. * </p>
  1346. * <p>
  1347. * Valid value: <code>json</code>
  1348. * </p>
  1349. */
  1350. public void setMessageStructure(String messageStructure) {
  1351. this.messageStructure = messageStructure;
  1352. }
  1353. /**
  1354. * <p>
  1355. * Set <code>MessageStructure</code> to <code>json</code> if you want to
  1356. * send a different message for each protocol. For example, using one
  1357. * publish action, you can send a short message to your SMS subscribers and
  1358. * a longer message to your email subscribers. If you set
  1359. * <code>MessageStructure</code> to <code>json</code>, the value of the
  1360. * <code>Message</code> parameter must:
  1361. * </p>
  1362. * <ul>
  1363. * <li>
  1364. * <p>
  1365. * be a syntactically valid JSON object; and
  1366. * </p>
  1367. * </li>
  1368. * <li>
  1369. * <p>
  1370. * contain at least a top-level JSON key of "default" with a value that is a
  1371. * string.
  1372. * </p>
  1373. * </li>
  1374. * </ul>
  1375. * <p>
  1376. * You can define other top-level keys that define the message you want to
  1377. * send to a specific transport protocol (e.g., "http").
  1378. * </p>
  1379. * <p>
  1380. * For information about sending different messages for each protocol using
  1381. * the AWS Management Console, go to <a href=
  1382. * "http://docs.aws.amazon.com/sns/latest/gsg/Publish.html#sns-message-formatting-by-protocol"
  1383. * >Create Different Messa