| 1 | |||
| 2 | package Paws::SNS::Publish; | ||
| 3 | 1 | ▶ | use Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | has Message => (is => 'ro', isa => 'Str', required => 1); | |
| 5 | 1 | has MessageAttributes => (is => 'ro', isa => 'Paws::SNS::MessageAttributeMap'); | |
| 6 | 1 | has MessageDeduplicationId => (is => 'ro', isa => 'Str'); | |
| 7 | 1 | has MessageGroupId => (is => 'ro', isa => 'Str'); | |
| 8 | 1 | has MessageStructure => (is => 'ro', isa => 'Str'); | |
| 9 | 1 | has PhoneNumber => (is => 'ro', isa => 'Str'); | |
| 10 | 1 | has Subject => (is => 'ro', isa => 'Str'); | |
| 11 | 1 | has TargetArn => (is => 'ro', isa => 'Str'); | |
| 12 | 1 | has TopicArn => (is => 'ro', isa => 'Str'); | |
| 13 | |||
| 14 | 1 | ▶ | use MooseX::ClassAttribute; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 15 | |||
| 16 | 1 | class_has _api_call => (isa => 'Str', is => 'ro', default => 'Publish'); | |
| 17 | 1 | class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::SNS::PublishResponse'); | |
| 18 | 1 | class_has _result_key => (isa => 'Str', is => 'ro', default => 'PublishResult'); | |
| 19 | 1 | 1; | |
| 20 | |||
| 21 | ### main pod documentation begin ### | ||
| 22 | |||
| 23 | =head1 NAME | ||
| 24 | |||
| 25 | Paws::SNS::Publish - Arguments for method Publish on L<Paws::SNS> | ||
| 26 | |||
| 27 | =head1 DESCRIPTION | ||
| 28 | |||
| 29 | This class represents the parameters used for calling the method Publish on the | ||
| 30 | L<Amazon Simple Notification Service|Paws::SNS> service. Use the attributes of this class | ||
| 31 | as arguments to method Publish. | ||
| 32 | |||
| 33 | You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to Publish. | ||
| 34 | |||
| 35 | =head1 SYNOPSIS | ||
| 36 | |||
| 37 | my $sns = Paws->service('SNS'); | ||
| 38 | my $PublishResponse = $sns->Publish( | ||
| 39 | Message => 'Mymessage', | ||
| 40 | MessageAttributes => { | ||
| 41 | 'MyString' => { | ||
| 42 | DataType => 'MyString', | ||
| 43 | BinaryValue => 'BlobBinary', # OPTIONAL | ||
| 44 | StringValue => 'MyString', | ||
| 45 | }, | ||
| 46 | }, # OPTIONAL | ||
| 47 | MessageDeduplicationId => 'MyString', # OPTIONAL | ||
| 48 | MessageGroupId => 'MyString', # OPTIONAL | ||
| 49 | MessageStructure => 'MymessageStructure', # OPTIONAL | ||
| 50 | PhoneNumber => 'MyString', # OPTIONAL | ||
| 51 | Subject => 'Mysubject', # OPTIONAL | ||
| 52 | TargetArn => 'MyString', # OPTIONAL | ||
| 53 | TopicArn => 'MytopicARN', # OPTIONAL | ||
| 54 | ); | ||
| 55 | |||
| 56 | # Results: | ||
| 57 | my $MessageId = $PublishResponse->MessageId; | ||
| 58 | my $SequenceNumber = $PublishResponse->SequenceNumber; | ||
| 59 | |||
| 60 | # Returns a L<Paws::SNS::PublishResponse> object. | ||
| 61 | |||
| 62 | Values for attributes that are native types (Int, String, Float, etc) can passed as-is (scalar values). Values for complex Types (objects) can be passed as a HashRef. The keys and values of the hashref will be used to instance the underlying object. | ||
| 63 | For the AWS API documentation, see L<https://docs.aws.amazon.com/goto/WebAPI/sns/Publish> | ||
| 64 | |||
| 65 | =head1 ATTRIBUTES | ||
| 66 | |||
| 67 | |||
| 68 | =head2 B<REQUIRED> Message => Str | ||
| 69 | |||
| 70 | The message you want to send. | ||
| 71 | |||
| 72 | If you are publishing to a topic and you want to send the same message | ||
| 73 | to all transport protocols, include the text of the message as a String | ||
| 74 | value. If you want to send different messages for each transport | ||
| 75 | protocol, set the value of the C<MessageStructure> parameter to C<json> | ||
| 76 | and use a JSON object for the C<Message> parameter. | ||
| 77 | |||
| 78 | Constraints: | ||
| 79 | |||
| 80 | =over | ||
| 81 | |||
| 82 | =item * | ||
| 83 | |||
| 84 | With the exception of SMS, messages must be UTF-8 encoded strings and | ||
| 85 | at most 256 KB in size (262,144 bytes, not 262,144 characters). | ||
| 86 | |||
| 87 | =item * | ||
| 88 | |||
| 89 | For SMS, each message can contain up to 140 characters. This character | ||
| 90 | limit depends on the encoding schema. For example, an SMS message can | ||
| 91 | contain 160 GSM characters, 140 ASCII characters, or 70 UCS-2 | ||
| 92 | characters. | ||
| 93 | |||
| 94 | If you publish a message that exceeds this size limit, Amazon SNS sends | ||
| 95 | the message as multiple messages, each fitting within the size limit. | ||
| 96 | Messages aren't truncated mid-word but are cut off at whole-word | ||
| 97 | boundaries. | ||
| 98 | |||
| 99 | The total size limit for a single SMS C<Publish> action is 1,600 | ||
| 100 | characters. | ||
| 101 | |||
| 102 | =back | ||
| 103 | |||
| 104 | JSON-specific constraints: | ||
| 105 | |||
| 106 | =over | ||
| 107 | |||
| 108 | =item * | ||
| 109 | |||
| 110 | Keys in the JSON object that correspond to supported transport | ||
| 111 | protocols must have simple JSON string values. | ||
| 112 | |||
| 113 | =item * | ||
| 114 | |||
| 115 | The values will be parsed (unescaped) before they are used in outgoing | ||
| 116 | messages. | ||
| 117 | |||
| 118 | =item * | ||
| 119 | |||
| 120 | Outbound notifications are JSON encoded (meaning that the characters | ||
| 121 | will be reescaped for sending). | ||
| 122 | |||
| 123 | =item * | ||
| 124 | |||
| 125 | Values have a minimum length of 0 (the empty string, "", is allowed). | ||
| 126 | |||
| 127 | =item * | ||
| 128 | |||
| 129 | Values have a maximum length bounded by the overall message size (so, | ||
| 130 | including multiple protocols may limit message sizes). | ||
| 131 | |||
| 132 | =item * | ||
| 133 | |||
| 134 | Non-string values will cause the key to be ignored. | ||
| 135 | |||
| 136 | =item * | ||
| 137 | |||
| 138 | Keys that do not correspond to supported transport protocols are | ||
| 139 | ignored. | ||
| 140 | |||
| 141 | =item * | ||
| 142 | |||
| 143 | Duplicate keys are not allowed. | ||
| 144 | |||
| 145 | =item * | ||
| 146 | |||
| 147 | Failure to parse or validate any key or value in the message will cause | ||
| 148 | the C<Publish> call to return an error (no partial delivery). | ||
| 149 | |||
| 150 | =back | ||
| 151 | |||
| 152 | |||
| 153 | |||
| 154 | |||
| 155 | =head2 MessageAttributes => L<Paws::SNS::MessageAttributeMap> | ||
| 156 | |||
| 157 | Message attributes for Publish action. | ||
| 158 | |||
| 159 | |||
| 160 | |||
| 161 | =head2 MessageDeduplicationId => Str | ||
| 162 | |||
| 163 | This parameter applies only to FIFO (first-in-first-out) topics. The | ||
| 164 | C<MessageDeduplicationId> can contain up to 128 alphanumeric characters | ||
| 165 | (a-z, A-Z, 0-9) and punctuation | ||
| 166 | C<(!"#$%&'()*+,-./:;E<lt>=E<gt>?@[\]^_`{|}~)>. | ||
| 167 | |||
| 168 | Every message must have a unique C<MessageDeduplicationId>, which is a | ||
| 169 | token used for deduplication of sent messages. If a message with a | ||
| 170 | particular C<MessageDeduplicationId> is sent successfully, any message | ||
| 171 | sent with the same C<MessageDeduplicationId> during the 5-minute | ||
| 172 | deduplication interval is treated as a duplicate. | ||
| 173 | |||
| 174 | If the topic has C<ContentBasedDeduplication> set, the system generates | ||
| 175 | a C<MessageDeduplicationId> based on the contents of the message. Your | ||
| 176 | C<MessageDeduplicationId> overrides the generated one. | ||
| 177 | |||
| 178 | |||
| 179 | |||
| 180 | =head2 MessageGroupId => Str | ||
| 181 | |||
| 182 | This parameter applies only to FIFO (first-in-first-out) topics. The | ||
| 183 | C<MessageGroupId> can contain up to 128 alphanumeric characters (a-z, | ||
| 184 | A-Z, 0-9) and punctuation | ||
| 185 | C<(!"#$%&'()*+,-./:;E<lt>=E<gt>?@[\]^_`{|}~)>. | ||
| 186 | |||
| 187 | The C<MessageGroupId> is a tag that specifies that a message belongs to | ||
| 188 | a specific message group. Messages that belong to the same message | ||
| 189 | group are processed in a FIFO manner (however, messages in different | ||
| 190 | message groups might be processed out of order). Every message must | ||
| 191 | include a C<MessageGroupId>. | ||
| 192 | |||
| 193 | |||
| 194 | |||
| 195 | =head2 MessageStructure => Str | ||
| 196 | |||
| 197 | Set C<MessageStructure> to C<json> if you want to send a different | ||
| 198 | message for each protocol. For example, using one publish action, you | ||
| 199 | can send a short message to your SMS subscribers and a longer message | ||
| 200 | to your email subscribers. If you set C<MessageStructure> to C<json>, | ||
| 201 | the value of the C<Message> parameter must: | ||
| 202 | |||
| 203 | =over | ||
| 204 | |||
| 205 | =item * | ||
| 206 | |||
| 207 | be a syntactically valid JSON object; and | ||
| 208 | |||
| 209 | =item * | ||
| 210 | |||
| 211 | contain at least a top-level JSON key of "default" with a value that is | ||
| 212 | a string. | ||
| 213 | |||
| 214 | =back | ||
| 215 | |||
| 216 | You can define other top-level keys that define the message you want to | ||
| 217 | send to a specific transport protocol (e.g., "http"). | ||
| 218 | |||
| 219 | Valid value: C<json> | ||
| 220 | |||
| 221 | |||
| 222 | |||
| 223 | =head2 PhoneNumber => Str | ||
| 224 | |||
| 225 | The phone number to which you want to deliver an SMS message. Use E.164 | ||
| 226 | format. | ||
| 227 | |||
| 228 | If you don't specify a value for the C<PhoneNumber> parameter, you must | ||
| 229 | specify a value for the C<TargetArn> or C<TopicArn> parameters. | ||
| 230 | |||
| 231 | |||
| 232 | |||
| 233 | =head2 Subject => Str | ||
| 234 | |||
| 235 | Optional parameter to be used as the "Subject" line when the message is | ||
| 236 | delivered to email endpoints. This field will also be included, if | ||
| 237 | present, in the standard JSON messages delivered to other endpoints. | ||
| 238 | |||
| 239 | Constraints: Subjects must be ASCII text that begins with a letter, | ||
| 240 | number, or punctuation mark; must not include line breaks or control | ||
| 241 | characters; and must be less than 100 characters long. | ||
| 242 | |||
| 243 | |||
| 244 | |||
| 245 | =head2 TargetArn => Str | ||
| 246 | |||
| 247 | If you don't specify a value for the C<TargetArn> parameter, you must | ||
| 248 | specify a value for the C<PhoneNumber> or C<TopicArn> parameters. | ||
| 249 | |||
| 250 | |||
| 251 | |||
| 252 | =head2 TopicArn => Str | ||
| 253 | |||
| 254 | The topic you want to publish to. | ||
| 255 | |||
| 256 | If you don't specify a value for the C<TopicArn> parameter, you must | ||
| 257 | specify a value for the C<PhoneNumber> or C<TargetArn> parameters. | ||
| 258 | |||
| 259 | |||
| 260 | |||
| 261 | |||
| 262 | =head1 SEE ALSO | ||
| 263 | |||
| 264 | This class forms part of L<Paws>, documenting arguments for method Publish in L<Paws::SNS> | ||
| 265 | |||
| 266 | =head1 BUGS and CONTRIBUTIONS | ||
| 267 | |||
| 268 | The source code is located here: L<https://github.com/pplu/aws-sdk-perl> | ||
| 269 | |||
| 270 | Please report bugs to: L<https://github.com/pplu/aws-sdk-perl/issues> | ||
| 271 | |||
| 272 | =cut | ||
| 273 | |||