Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2010 Amazon.com, Inc. or its affiliates. All Rights Reserved.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License").
   * You may not use this file except in compliance with the License.
   * A copy of the License is located at
   * 
   *  http://aws.amazon.com/apache2.0
   * 
  * or in the "license" file accompanying this file. This file is distributed
  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
  * express or implied. See the License for the specific language governing
  * permissions and limitations under the License.
  */
 package com.amazonaws.services.sns.model;
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.

 
 public class PublishRequest extends AmazonWebServiceRequest {

    
The topic you want to publish to.
 
     private String topicArn;

    
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).

 
     private String message;

    
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.

 
     private String subject;

    
Default constructor for a new PublishRequest object. Callers should use the setter or fluent setter (with...) methods to initialize this object after creating it.
 
     public PublishRequest() {}
    
    
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).

 
     public PublishRequest(String topicArnString message) {
         this. = topicArn;
         this. = 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).

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.

 
     public PublishRequest(String topicArnString messageString subject) {
         this. = topicArn;
         this. = message;
         this. = subject;
     }
    
    
The topic you want to publish to.

Returns:
The topic you want to publish to.
    public String getTopicArn() {
        return ;
    }
    
    
The topic you want to publish to.

Parameters:
topicArn The topic you want to publish to.
    public void setTopicArn(String topicArn) {
        this. = 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.
    public PublishRequest withTopicArn(String topicArn) {
        this. = topicArn;
        return this;
    }
    
    
    
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).

    public String getMessage() {
        return ;
    }
    
    
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).

    public void setMessage(String message) {
        this. = 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.
    public PublishRequest withMessage(String message) {
        this. = message;
        return this;
    }
    
    
    
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.

    public String getSubject() {
        return ;
    }
    
    
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.

    public void setSubject(String subject) {
        this. = 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.
    public PublishRequest withSubject(String subject) {
        this. = subject;
        return this;
    }
    
    
    
Returns a string representation of this object; useful for testing and debugging.

Returns:
A string representation of this object.
See also:
java.lang.Object.toString()
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        sb.append("TopicArn: " +  + ", ");
        sb.append("Message: " +  + ", ");
        sb.append("Subject: " +  + ", ");
        sb.append("}");
        return sb.toString();
    }
    
}
    
New to GrepCode? Check out our FAQ X