Overview | Package | Class | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.amazonaws.services.sns.model
Class PublishRequest

    java.lang.Object
      com.amazonaws.AmazonWebServiceRequest
          com.amazonaws.services.sns.model.PublishRequest

    public class PublishRequest

extends AmazonWebServiceRequest

Container for the parameters to the `Publish operation`.

The Publish action sends a message to all of a topic's subscribed endpoints. When a messageId is returned, the message has been saved and Amazon SNS will attempt to deliver it to the topic's subscribers shortly. The format of the outgoing message to each subscribed endpoint depends on the notification protocol selected.

See Also:
  `AmazonSNS.publish(PublishRequest)`

Constructor Summary
`PublishRequest()` Default constructor for a new PublishRequest object.
`PublishRequest(String topicArn, String message)` Constructs a new PublishRequest object.
`PublishRequest(String topicArn, String message, String subject)` Constructs a new PublishRequest object.

Method Summary
`String` | `getMessage()` The message you want to send to the topic.
`String` | `getSubject()` Optional parameter to be used as the "Subject" line of when the message is delivered to e-mail endpoints.
`String` | `getTopicArn()` The topic you want to publish to.
`void` | `setMessage(String message)` The message you want to send to the topic.
`void` | `setSubject(String subject)` Optional parameter to be used as the "Subject" line of when the message is delivered to e-mail endpoints.
`void` | `setTopicArn(String topicArn)` The topic you want to publish to.
`String` | `toString()` Returns a string representation of this object; useful for testing and debugging.
`PublishRequest` | `withMessage(String message)` The message you want to send to the topic.
`PublishRequest` | `withSubject(String subject)` Optional parameter to be used as the "Subject" line of when the message is delivered to e-mail endpoints.
`PublishRequest` | `withTopicArn(String topicArn)` The topic you want to publish to.

Methods inherited from class com.amazonaws.AmazonWebServiceRequest
`copyPrivateRequestParameters`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### PublishRequest

    public PublishRequest()

  Default constructor for a new PublishRequest object. Callers should use the setter or fluent setter (with...) methods to initialize this object after creating it.

### PublishRequest

    public PublishRequest(String topicArn,
                          String message)

  Constructs a new PublishRequest object. Callers should use the setter or fluent setter (with...) methods to initialize any additional object members.

  Parameters:
    `topicArn` - The topic you want to publish to.
    `message` - The message you want to send to the topic.

    Constraints: Messages must be UTF-8 encoded strings at most 8 KB in size (8192 bytes, not 8192 characters).

### PublishRequest

    public PublishRequest(String topicArn,
                          String message,
                          String subject)

  Constructs a new PublishRequest object. Callers should use the setter or fluent setter (with...) methods to initialize any additional object members.

  Parameters:
    `topicArn` - The topic you want to publish to.
    `message` - The message you want to send to the topic.

    Constraints: Messages must be UTF-8 encoded strings at most 8 KB in size (8192 bytes, not 8192 characters).

    `subject` - Optional parameter to be used as the "Subject" line of when the message is delivered to e-mail endpoints. This field will also be included, if present, in the standard JSON messages delivered to other endpoints.

    Constraints: Subjects must be ASCII text that begins with a letter, number or punctuation mark; must not include line breaks or control characters; and must be less than 100 characters long.

Method Detail

### getTopicArn

    public String getTopicArn()

  The topic you want to publish to.

  Returns:
    The topic you want to publish to.

### setTopicArn

    public void setTopicArn(String topicArn)

  The topic you want to publish to.

  Parameters:
    `topicArn` - The topic you want to publish to.

### withTopicArn

    public PublishRequest withTopicArn(String topicArn)

  The topic you want to publish to.

  Returns a reference to this object so that method calls can be chained together.

  Parameters:
    `topicArn` - The topic you want to publish to.
  Returns:
    A reference to this updated object so that method calls can be chained together.

### getMessage

    public String getMessage()

  The message you want to send to the topic.

  Constraints: Messages must be UTF-8 encoded strings at most 8 KB in size (8192 bytes, not 8192 characters).

  Returns:
    The message you want to send to the topic.

    Constraints: Messages must be UTF-8 encoded strings at most 8 KB in size (8192 bytes, not 8192 characters).

### setMessage

    public void setMessage(String message)

  The message you want to send to the topic.

  Constraints: Messages must be UTF-8 encoded strings at most 8 KB in size (8192 bytes, not 8192 characters).

  Parameters:
    `message` - The message you want to send to the topic.

    Constraints: Messages must be UTF-8 encoded strings at most 8 KB in size (8192 bytes, not 8192 characters).

### withMessage

    public PublishRequest withMessage(String message)

  The message you want to send to the topic.

  Constraints: Messages must be UTF-8 encoded strings at most 8 KB in size (8192 bytes, not 8192 characters).

  Returns a reference to this object so that method calls can be chained together.

  Parameters:
    `message` - The message you want to send to the topic.

    Constraints: Messages must be UTF-8 encoded strings at most 8 KB in size (8192 bytes, not 8192 characters).

  Returns:
    A reference to this updated object so that method calls can be chained together.

### getSubject

    public String getSubject()

  Optional parameter to be used as the "Subject" line of when the message is delivered to e-mail endpoints. This field will also be included, if present, in the standard JSON messages delivered to other endpoints.

  Constraints: Subjects must be ASCII text that begins with a letter, number or punctuation mark; must not include line breaks or control characters; and must be less than 100 characters long.

  Returns:
    Optional parameter to be used as the "Subject" line of when the message is delivered to e-mail endpoints. This field will also be included, if present, in the standard JSON messages delivered to other endpoints.

    Constraints: Subjects must be ASCII text that begins with a letter, number or punctuation mark; must not include line breaks or control characters; and must be less than 100 characters long.

### setSubject

    public void setSubject(String subject)

  Optional parameter to be used as the "Subject" line of when the message is delivered to e-mail endpoints. This field will also be included, if present, in the standard JSON messages delivered to other endpoints.

  Constraints: Subjects must be ASCII text that begins with a letter, number or punctuation mark; must not include line breaks or control characters; and must be less than 100 characters long.

  Parameters:
    `subject` - Optional parameter to be used as the "Subject" line of when the message is delivered to e-mail endpoints. This field will also be included, if present, in the standard JSON messages delivered to other endpoints.

    Constraints: Subjects must be ASCII text that begins with a letter, number or punctuation mark; must not include line breaks or control characters; and must be less than 100 characters long.

### withSubject

    public PublishRequest withSubject(String subject)

  Optional parameter to be used as the "Subject" line of when the message is delivered to e-mail endpoints. This field will also be included, if present, in the standard JSON messages delivered to other endpoints.

  Constraints: Subjects must be ASCII text that begins with a letter, number or punctuation mark; must not include line breaks or control characters; and must be less than 100 characters long.

  Returns a reference to this object so that method calls can be chained together.

  Parameters:
    `subject` - Optional parameter to be used as the "Subject" line of when the message is delivered to e-mail endpoints. This field will also be included, if present, in the standard JSON messages delivered to other endpoints.

    Constraints: Subjects must be ASCII text that begins with a letter, number or punctuation mark; must not include line breaks or control characters; and must be less than 100 characters long.

  Returns:
    A reference to this updated object so that method calls can be chained together.

### toString

    public String toString()

  Returns a string representation of this object; useful for testing and debugging.

  Overrides:
    `toString` in class `Object`
  Returns:
    A string representation of this object.
  See Also:
    `Object.toString()`

Overview | Package | Class | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2010 Amazon Web Services, Inc. All Rights Reserved.