com.amazonaws.services.sns.model

## クラス PublishRequest

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

- すべての実装されたインタフェース:
    java.io.Serializable

      public class PublishRequest
      extends AmazonWebServiceRequest
      implements java.io.Serializable

  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.

  関連項目:
    `AmazonSNS.publish(PublishRequest)`, 直列化された形式

- - ### コンストラクタの概要

    コンストラクタ
    コンストラクタと説明
    `PublishRequest()` Default constructor for a new PublishRequest object.
    `PublishRequest(java.lang.String topicArn, java.lang.String message)` Constructs a new PublishRequest object.
    `PublishRequest(java.lang.String topicArn, java.lang.String message, java.lang.String subject)` Constructs a new PublishRequest object.

  - ### メソッドの概要

    メソッド
    修飾子とタイプ | メソッドと説明
    --- | ---
    `boolean` | `equals(java.lang.Object obj)`
    `java.lang.String` | `getMessage()` The message you want to send to the topic.
    `java.lang.String` | `getMessageStructure()` Set `MessageStructure` to `json` if you want to send a different message for each protocol.
    `java.lang.String` | `getSubject()` Optional parameter to be used as the "Subject" line of when the message is delivered to email endpoints.
    `java.lang.String` | `getTopicArn()` The topic you want to publish to.
    `int` | `hashCode()`
    `void` | `setMessage(java.lang.String message)` The message you want to send to the topic.
    `void` | `setMessageStructure(java.lang.String messageStructure)` Set `MessageStructure` to `json` if you want to send a different message for each protocol.
    `void` | `setSubject(java.lang.String subject)` Optional parameter to be used as the "Subject" line of when the message is delivered to email endpoints.
    `void` | `setTopicArn(java.lang.String topicArn)` The topic you want to publish to.
    `java.lang.String` | `toString()` Returns a string representation of this object; useful for testing and debugging.
    `PublishRequest` | `withMessage(java.lang.String message)` The message you want to send to the topic.
    `PublishRequest` | `withMessageStructure(java.lang.String messageStructure)` Set `MessageStructure` to `json` if you want to send a different message for each protocol.
    `PublishRequest` | `withSubject(java.lang.String subject)` Optional parameter to be used as the "Subject" line of when the message is delivered to email endpoints.
    `PublishRequest` | `withTopicArn(java.lang.String topicArn)` The topic you want to publish to.

    - ### クラスから継承されたメソッド com.amazonaws.AmazonWebServiceRequest

      `copyPrivateRequestParameters, getRequestClientOptions, getRequestCredentials, setRequestCredentials`

    - ### クラスから継承されたメソッド java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### コンストラクタの詳細

    - #### 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(java.lang.String topicArn,
                        java.lang.String message)

      Constructs a new PublishRequest object. Callers should use the setter or fluent setter (with...) methods to initialize any additional object members.
      パラメータ:
        `topicArn` - The topic you want to publish to.
        `message` - The message you want to send to the topic.

        If you want to send the same message to all transport protocols, include the text of the message as a String value.

        If you want to send different messages for each transport protocol, set the value of the `MessageStructure` parameter to `json` and use a JSON object for the `Message` parameter. See the Examples section for the format of the JSON object.

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

        JSON-specific constraints:

        - Keys in the JSON object that correspond to supported transport protocols must have simple JSON string values.
        - The values will be parsed (unescaped) before they are used in outgoing messages.
        - Outbound notifications are JSON encoded (meaning that the characters will be reescaped for sending).
        - Values have a minimum length of 0 (the empty string, "", is allowed).
        - Values have a maximum length bounded by the overall message size (so, including multiple protocols may limit message sizes).
        - Non-string values will cause the key to be ignored.
        - Keys that do not correspond to supported transport protocols are ignored.
        - Duplicate keys are not allowed.
        - Failure to parse or validate any key or value in the message will cause the `Publish` call to return an error (no partial delivery).

    - #### PublishRequest

          public PublishRequest(java.lang.String topicArn,
                        java.lang.String message,
                        java.lang.String subject)

      Constructs a new PublishRequest object. Callers should use the setter or fluent setter (with...) methods to initialize any additional object members.
      パラメータ:
        `topicArn` - The topic you want to publish to.
        `message` - The message you want to send to the topic.

        If you want to send the same message to all transport protocols, include the text of the message as a String value.

        If you want to send different messages for each transport protocol, set the value of the `MessageStructure` parameter to `json` and use a JSON object for the `Message` parameter. See the Examples section for the format of the JSON object.

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

        JSON-specific constraints:

        - Keys in the JSON object that correspond to supported transport protocols must have simple JSON string values.
        - The values will be parsed (unescaped) before they are used in outgoing messages.
        - Outbound notifications are JSON encoded (meaning that the characters will be reescaped for sending).
        - Values have a minimum length of 0 (the empty string, "", is allowed).
        - Values have a maximum length bounded by the overall message size (so, including multiple protocols may limit message sizes).
        - Non-string values will cause the key to be ignored.
        - Keys that do not correspond to supported transport protocols are ignored.
        - Duplicate keys are not allowed.
        - Failure to parse or validate any key or value in the message will cause the `Publish` call to return an error (no partial delivery).
        `subject` - Optional parameter to be used as the "Subject" line of when the message is delivered to email 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.

  - ### メソッドの詳細

    - #### getTopicArn

          public java.lang.String getTopicArn()

      The topic you want to publish to.
      戻り値:
        The topic you want to publish to.

    - #### setTopicArn

          public void setTopicArn(java.lang.String topicArn)

      The topic you want to publish to.
      パラメータ:
        `topicArn` - The topic you want to publish to.

    - #### withTopicArn

          public PublishRequest withTopicArn(java.lang.String topicArn)

      The topic you want to publish to.

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

      パラメータ:
        `topicArn` - The topic you want to publish to.

    - #### getMessage

          public java.lang.String getMessage()

      The message you want to send to the topic.

      If you want to send the same message to all transport protocols, include the text of the message as a String value.

      If you want to send different messages for each transport protocol, set the value of the `MessageStructure` parameter to `json` and use a JSON object for the `Message` parameter. See the Examples section for the format of the JSON object.

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

      JSON-specific constraints:

      - Keys in the JSON object that correspond to supported transport protocols must have simple JSON string values.
      - The values will be parsed (unescaped) before they are used in outgoing messages.
      - Outbound notifications are JSON encoded (meaning that the characters will be reescaped for sending).
      - Values have a minimum length of 0 (the empty string, "", is allowed).
      - Values have a maximum length bounded by the overall message size (so, including multiple protocols may limit message sizes).
      - Non-string values will cause the key to be ignored.
      - Keys that do not correspond to supported transport protocols are ignored.
      - Duplicate keys are not allowed.
      - Failure to parse or validate any key or value in the message will cause the `Publish` call to return an error (no partial delivery).
      戻り値:
        The message you want to send to the topic.

        If you want to send the same message to all transport protocols, include the text of the message as a String value.

        If you want to send different messages for each transport protocol, set the value of the `MessageStructure` parameter to `json` and use a JSON object for the `Message` parameter. See the Examples section for the format of the JSON object.

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

        JSON-specific constraints:

        - Keys in the JSON object that correspond to supported transport protocols must have simple JSON string values.
        - The values will be parsed (unescaped) before they are used in outgoing messages.
        - Outbound notifications are JSON encoded (meaning that the characters will be reescaped for sending).
        - Values have a minimum length of 0 (the empty string, "", is allowed).
        - Values have a maximum length bounded by the overall message size (so, including multiple protocols may limit message sizes).
        - Non-string values will cause the key to be ignored.
        - Keys that do not correspond to supported transport protocols are ignored.
        - Duplicate keys are not allowed.
        - Failure to parse or validate any key or value in the message will cause the `Publish` call to return an error (no partial delivery).

    - #### setMessage

          public void setMessage(java.lang.String message)

      The message you want to send to the topic.

      If you want to send the same message to all transport protocols, include the text of the message as a String value.

      If you want to send different messages for each transport protocol, set the value of the `MessageStructure` parameter to `json` and use a JSON object for the `Message` parameter. See the Examples section for the format of the JSON object.

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

      JSON-specific constraints:

      - Keys in the JSON object that correspond to supported transport protocols must have simple JSON string values.
      - The values will be parsed (unescaped) before they are used in outgoing messages.
      - Outbound notifications are JSON encoded (meaning that the characters will be reescaped for sending).
      - Values have a minimum length of 0 (the empty string, "", is allowed).
      - Values have a maximum length bounded by the overall message size (so, including multiple protocols may limit message sizes).
      - Non-string values will cause the key to be ignored.
      - Keys that do not correspond to supported transport protocols are ignored.
      - Duplicate keys are not allowed.
      - Failure to parse or validate any key or value in the message will cause the `Publish` call to return an error (no partial delivery).
      パラメータ:
        `message` - The message you want to send to the topic.

        If you want to send the same message to all transport protocols, include the text of the message as a String value.

        If you want to send different messages for each transport protocol, set the value of the `MessageStructure` parameter to `json` and use a JSON object for the `Message` parameter. See the Examples section for the format of the JSON object.

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

        JSON-specific constraints:

        - Keys in the JSON object that correspond to supported transport protocols must have simple JSON string values.
        - The values will be parsed (unescaped) before they are used in outgoing messages.
        - Outbound notifications are JSON encoded (meaning that the characters will be reescaped for sending).
        - Values have a minimum length of 0 (the empty string, "", is allowed).
        - Values have a maximum length bounded by the overall message size (so, including multiple protocols may limit message sizes).
        - Non-string values will cause the key to be ignored.
        - Keys that do not correspond to supported transport protocols are ignored.
        - Duplicate keys are not allowed.
        - Failure to parse or validate any key or value in the message will cause the `Publish` call to return an error (no partial delivery).

    - #### withMessage

          public PublishRequest withMessage(java.lang.String message)

      The message you want to send to the topic.

      If you want to send the same message to all transport protocols, include the text of the message as a String value.

      If you want to send different messages for each transport protocol, set the value of the `MessageStructure` parameter to `json` and use a JSON object for the `Message` parameter. See the Examples section for the format of the JSON object.

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

      JSON-specific constraints:

      - Keys in the JSON object that correspond to supported transport protocols must have simple JSON string values.
      - The values will be parsed (unescaped) before they are used in outgoing messages.
      - Outbound notifications are JSON encoded (meaning that the characters will be reescaped for sending).
      - Values have a minimum length of 0 (the empty string, "", is allowed).
      - Values have a maximum length bounded by the overall message size (so, including multiple protocols may limit message sizes).
      - Non-string values will cause the key to be ignored.
      - Keys that do not correspond to supported transport protocols are ignored.
      - Duplicate keys are not allowed.
      - Failure to parse or validate any key or value in the message will cause the `Publish` call to return an error (no partial delivery).

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

      パラメータ:
        `message` - The message you want to send to the topic.

        If you want to send the same message to all transport protocols, include the text of the message as a String value.

        If you want to send different messages for each transport protocol, set the value of the `MessageStructure` parameter to `json` and use a JSON object for the `Message` parameter. See the Examples section for the format of the JSON object.

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

        JSON-specific constraints:

        - Keys in the JSON object that correspond to supported transport protocols must have simple JSON string values.
        - The values will be parsed (unescaped) before they are used in outgoing messages.
        - Outbound notifications are JSON encoded (meaning that the characters will be reescaped for sending).
        - Values have a minimum length of 0 (the empty string, "", is allowed).
        - Values have a maximum length bounded by the overall message size (so, including multiple protocols may limit message sizes).
        - Non-string values will cause the key to be ignored.
        - Keys that do not correspond to supported transport protocols are ignored.
        - Duplicate keys are not allowed.
        - Failure to parse or validate any key or value in the message will cause the `Publish` call to return an error (no partial delivery).

    - #### getSubject

          public java.lang.String getSubject()

      Optional parameter to be used as the "Subject" line of when the message is delivered to email 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.

      戻り値:
        Optional parameter to be used as the "Subject" line of when the message is delivered to email 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(java.lang.String subject)

      Optional parameter to be used as the "Subject" line of when the message is delivered to email 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.

      パラメータ:
        `subject` - Optional parameter to be used as the "Subject" line of when the message is delivered to email 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(java.lang.String subject)

      Optional parameter to be used as the "Subject" line of when the message is delivered to email 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.

      パラメータ:
        `subject` - Optional parameter to be used as the "Subject" line of when the message is delivered to email 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.

    - #### getMessageStructure

          public java.lang.String getMessageStructure()

      Set `MessageStructure` to `json` if you want to send a different message for each protocol. For example, using one publish action, you can send a short message to your SMS subscribers and a longer message to your email subscribers. If you set `MessageStructure` to `json`, the value of the `Message` parameter must:
      - be a syntactically valid JSON object; and
      - contain at least a top-level JSON key of "default" with a value that is a string.

      You can define other top-level keys that define the message you want to send to a specific transport protocol (e.g., "http").

      For information about sending different messages for each protocol using the AWS Management Console, go to Create Different Messages for Each Protocol in the Amazon Simple Notification Service Getting Started Guide.

      Valid value: `json`

      戻り値:
        Set `MessageStructure` to `json` if you want to send a different message for each protocol. For example, using one publish action, you can send a short message to your SMS subscribers and a longer message to your email subscribers. If you set `MessageStructure` to `json`, the value of the `Message` parameter must:
        - be a syntactically valid JSON object; and
        - contain at least a top-level JSON key of "default" with a value that is a string.

        You can define other top-level keys that define the message you want to send to a specific transport protocol (e.g., "http").

        For information about sending different messages for each protocol using the AWS Management Console, go to Create Different Messages for Each Protocol in the Amazon Simple Notification Service Getting Started Guide.

        Valid value: `json`

    - #### setMessageStructure

          public void setMessageStructure(java.lang.String messageStructure)

      Set `MessageStructure` to `json` if you want to send a different message for each protocol. For example, using one publish action, you can send a short message to your SMS subscribers and a longer message to your email subscribers. If you set `MessageStructure` to `json`, the value of the `Message` parameter must:
      - be a syntactically valid JSON object; and
      - contain at least a top-level JSON key of "default" with a value that is a string.

      You can define other top-level keys that define the message you want to send to a specific transport protocol (e.g., "http").

      For information about sending different messages for each protocol using the AWS Management Console, go to Create Different Messages for Each Protocol in the Amazon Simple Notification Service Getting Started Guide.

      Valid value: `json`

      パラメータ:
        `messageStructure` - Set `MessageStructure` to `json` if you want to send a different message for each protocol. For example, using one publish action, you can send a short message to your SMS subscribers and a longer message to your email subscribers. If you set `MessageStructure` to `json`, the value of the `Message` parameter must:
        - be a syntactically valid JSON object; and
        - contain at least a top-level JSON key of "default" with a value that is a string.

        You can define other top-level keys that define the message you want to send to a specific transport protocol (e.g., "http").

        For information about sending different messages for each protocol using the AWS Management Console, go to Create Different Messages for Each Protocol in the Amazon Simple Notification Service Getting Started Guide.

        Valid value: `json`

    - #### withMessageStructure

          public PublishRequest withMessageStructure(java.lang.String messageStructure)

      Set `MessageStructure` to `json` if you want to send a different message for each protocol. For example, using one publish action, you can send a short message to your SMS subscribers and a longer message to your email subscribers. If you set `MessageStructure` to `json`, the value of the `Message` parameter must:
      - be a syntactically valid JSON object; and
      - contain at least a top-level JSON key of "default" with a value that is a string.

      You can define other top-level keys that define the message you want to send to a specific transport protocol (e.g., "http").

      For information about sending different messages for each protocol using the AWS Management Console, go to Create Different Messages for Each Protocol in the Amazon Simple Notification Service Getting Started Guide.

      Valid value: `json`

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

      パラメータ:
        `messageStructure` - Set `MessageStructure` to `json` if you want to send a different message for each protocol. For example, using one publish action, you can send a short message to your SMS subscribers and a longer message to your email subscribers. If you set `MessageStructure` to `json`, the value of the `Message` parameter must:
        - be a syntactically valid JSON object; and
        - contain at least a top-level JSON key of "default" with a value that is a string.

        You can define other top-level keys that define the message you want to send to a specific transport protocol (e.g., "http").

        For information about sending different messages for each protocol using the AWS Management Console, go to Create Different Messages for Each Protocol in the Amazon Simple Notification Service Getting Started Guide.

        Valid value: `json`

    - #### toString

          public java.lang.String toString()

      Returns a string representation of this object; useful for testing and debugging.
      オーバーライド:
        `toString` クラス内 `java.lang.Object`
      戻り値:
        A string representation of this object.
      関連項目:
        `Object.toString()`

    - #### hashCode

          public int hashCode()

      オーバーライド:
        `hashCode` クラス内 `java.lang.Object`

    - #### equals

          public boolean equals(java.lang.Object obj)

      オーバーライド:
        `equals` クラス内 `java.lang.Object`