blib/lib/Paws/SQS/SendMessage.pm

filter: Statementstmt 100% 17 / 17 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 2 / 2 Podpod n/a totaltotal 100% 19 / 19 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« blib/lib/Paws/SQS/ReceiveMessageResult.pm ↑ Summary blib/lib/Paws/SQS/SendMessageBatch.pm »
1  
2 package Paws::SQS::SendMessage;
3 1 ▶ use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 has DelaySeconds => (is => 'ro', isa => 'Int');
5 1 has MessageAttributes => (is => 'ro', isa => 'Paws::SQS::MessageBodyAttributeMap', traits => ['NameInRequest'], request_name => 'MessageAttribute' );
6 1 has MessageBody => (is => 'ro', isa => 'Str', required => 1);
7 1 has MessageDeduplicationId => (is => 'ro', isa => 'Str');
8 1 has MessageGroupId => (is => 'ro', isa => 'Str');
9 1 has MessageSystemAttributes => (is => 'ro', isa => 'Paws::SQS::MessageBodySystemAttributeMap', traits => ['NameInRequest'], request_name => 'MessageSystemAttribute' );
10 1 has QueueUrl => (is => 'ro', isa => 'Str', required => 1);
11  
12 1 ▶ use MooseX::ClassAttribute;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 1 class_has _api_call => (isa => 'Str', is => 'ro', default => 'SendMessage');
15 1 class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::SQS::SendMessageResult');
16 1 class_has _result_key => (isa => 'Str', is => 'ro', default => 'SendMessageResult');
17 1 1;
18  
19 ### main pod documentation begin ###
20  
21 =head1 NAME
22  
23 Paws::SQS::SendMessage - Arguments for method SendMessage on L<Paws::SQS>
24  
25 =head1 DESCRIPTION
26  
27 This class represents the parameters used for calling the method SendMessage on the
28 L<Amazon Simple Queue Service|Paws::SQS> service. Use the attributes of this class
29 as arguments to method SendMessage.
30  
31 You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to SendMessage.
32  
33 =head1 SYNOPSIS
34  
35 my $sqs = Paws->service('SQS');
36 my $SendMessageResult = $sqs->SendMessage(
37 MessageBody => 'MyString',
38 QueueUrl => 'MyString',
39 DelaySeconds => 1, # OPTIONAL
40 MessageAttributes => {
41 'MyString' => {
42 DataType => 'MyString',
43 BinaryListValues => [ 'BlobBinary', ... ], # OPTIONAL
44 BinaryValue => 'BlobBinary',
45 StringListValues => [ 'MyString', ... ], # OPTIONAL
46 StringValue => 'MyString',
47 },
48 }, # OPTIONAL
49 MessageDeduplicationId => 'MyString', # OPTIONAL
50 MessageGroupId => 'MyString', # OPTIONAL
51 MessageSystemAttributes => {
52 'AWSTraceHeader' => {
53 DataType => 'MyString',
54 BinaryListValues => [ 'BlobBinary', ... ], # OPTIONAL
55 BinaryValue => 'BlobBinary',
56 StringListValues => [ 'MyString', ... ], # OPTIONAL
57 StringValue => 'MyString',
58 }, # key: values: AWSTraceHeader
59 }, # OPTIONAL
60 );
61  
62 # Results:
63 my $MD5OfMessageAttributes = $SendMessageResult->MD5OfMessageAttributes;
64 my $MD5OfMessageBody = $SendMessageResult->MD5OfMessageBody;
65 my $MD5OfMessageSystemAttributes =
66 $SendMessageResult->MD5OfMessageSystemAttributes;
67 my $MessageId = $SendMessageResult->MessageId;
68 my $SequenceNumber = $SendMessageResult->SequenceNumber;
69  
70 # Returns a L<Paws::SQS::SendMessageResult> object.
71  
72 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.
73 For the AWS API documentation, see L<https://docs.aws.amazon.com/goto/WebAPI/sqs/SendMessage>
74  
75 =head1 ATTRIBUTES
76  
77  
78 =head2 DelaySeconds => Int
79  
80 The length of time, in seconds, for which to delay a specific message.
81 Valid values: 0 to 900. Maximum: 15 minutes. Messages with a positive
82 C<DelaySeconds> value become available for processing after the delay
83 period is finished. If you don't specify a value, the default value for
84 the queue applies.
85  
86 When you set C<FifoQueue>, you can't set C<DelaySeconds> per message.
87 You can set this parameter only on a queue level.
88  
89  
90  
91 =head2 MessageAttributes => L<Paws::SQS::MessageBodyAttributeMap>
92  
93 Each message attribute consists of a C<Name>, C<Type>, and C<Value>.
94 For more information, see Amazon SQS message attributes
95 (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-metadata.html#sqs-message-attributes)
96 in the I<Amazon SQS Developer Guide>.
97  
98  
99  
100 =head2 B<REQUIRED> MessageBody => Str
101  
102 The message to send. The minimum size is one character. The maximum
103 size is 256 KB.
104  
105 A message can include only XML, JSON, and unformatted text. The
106 following Unicode characters are allowed:
107  
108 C<#x9> | C<#xA> | C<#xD> | C<#x20> to C<#xD7FF> | C<#xE000> to
109 C<#xFFFD> | C<#x10000> to C<#x10FFFF>
110  
111 Any characters not included in this list will be rejected. For more
112 information, see the W3C specification for characters
113 (http://www.w3.org/TR/REC-xml/#charsets).
114  
115  
116  
117 =head2 MessageDeduplicationId => Str
118  
119 This parameter applies only to FIFO (first-in-first-out) queues.
120  
121 The token used for deduplication of sent messages. If a message with a
122 particular C<MessageDeduplicationId> is sent successfully, any messages
123 sent with the same C<MessageDeduplicationId> are accepted successfully
124 but aren't delivered during the 5-minute deduplication interval. For
125 more information, see Exactly-once processing
126 (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues-exactly-once-processing.html)
127 in the I<Amazon SQS Developer Guide>.
128  
129 =over
130  
131 =item *
132  
133 Every message must have a unique C<MessageDeduplicationId>,
134  
135 =over
136  
137 =item *
138  
139 You may provide a C<MessageDeduplicationId> explicitly.
140  
141 =item *
142  
143 If you aren't able to provide a C<MessageDeduplicationId> and you
144 enable C<ContentBasedDeduplication> for your queue, Amazon SQS uses a
145 SHA-256 hash to generate the C<MessageDeduplicationId> using the body
146 of the message (but not the attributes of the message).
147  
148 =item *
149  
150 If you don't provide a C<MessageDeduplicationId> and the queue doesn't
151 have C<ContentBasedDeduplication> set, the action fails with an error.
152  
153 =item *
154  
155 If the queue has C<ContentBasedDeduplication> set, your
156 C<MessageDeduplicationId> overrides the generated one.
157  
158 =back
159  
160 =item *
161  
162 When C<ContentBasedDeduplication> is in effect, messages with identical
163 content sent within the deduplication interval are treated as
164 duplicates and only one copy of the message is delivered.
165  
166 =item *
167  
168 If you send one message with C<ContentBasedDeduplication> enabled and
169 then another message with a C<MessageDeduplicationId> that is the same
170 as the one generated for the first C<MessageDeduplicationId>, the two
171 messages are treated as duplicates and only one copy of the message is
172 delivered.
173  
174 =back
175  
176 The C<MessageDeduplicationId> is available to the consumer of the
177 message (this can be useful for troubleshooting delivery issues).
178  
179 If a message is sent successfully but the acknowledgement is lost and
180 the message is resent with the same C<MessageDeduplicationId> after the
181 deduplication interval, Amazon SQS can't detect duplicate messages.
182  
183 Amazon SQS continues to keep track of the message deduplication ID even
184 after the message is received and deleted.
185  
186 The maximum length of C<MessageDeduplicationId> is 128 characters.
187 C<MessageDeduplicationId> can contain alphanumeric characters (C<a-z>,
188 C<A-Z>, C<0-9>) and punctuation
189 (C<!"#$%&'()*+,-./:;E<lt>=E<gt>?@[\]^_`{|}~>).
190  
191 For best practices of using C<MessageDeduplicationId>, see Using the
192 MessageDeduplicationId Property
193 (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-messagededuplicationid-property.html)
194 in the I<Amazon SQS Developer Guide>.
195  
196  
197  
198 =head2 MessageGroupId => Str
199  
200 This parameter applies only to FIFO (first-in-first-out) queues.
201  
202 The tag that specifies that a message belongs to a specific message
203 group. Messages that belong to the same message group are processed in
204 a FIFO manner (however, messages in different message groups might be
205 processed out of order). To interleave multiple ordered streams within
206 a single queue, use C<MessageGroupId> values (for example, session data
207 for multiple users). In this scenario, multiple consumers can process
208 the queue, but the session data of each user is processed in a FIFO
209 fashion.
210  
211 =over
212  
213 =item *
214  
215 You must associate a non-empty C<MessageGroupId> with a message. If you
216 don't provide a C<MessageGroupId>, the action fails.
217  
218 =item *
219  
220 C<ReceiveMessage> might return messages with multiple C<MessageGroupId>
221 values. For each C<MessageGroupId>, the messages are sorted by time
222 sent. The caller can't specify a C<MessageGroupId>.
223  
224 =back
225  
226 The length of C<MessageGroupId> is 128 characters. Valid values:
227 alphanumeric characters and punctuation
228 C<(!"#$%&'()*+,-./:;E<lt>=E<gt>?@[\]^_`{|}~)>.
229  
230 For best practices of using C<MessageGroupId>, see Using the
231 MessageGroupId Property
232 (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-messagegroupid-property.html)
233 in the I<Amazon SQS Developer Guide>.
234  
235 C<MessageGroupId> is required for FIFO queues. You can't use it for
236 Standard queues.
237  
238  
239  
240 =head2 MessageSystemAttributes => L<Paws::SQS::MessageBodySystemAttributeMap>
241  
242 The message system attribute to send. Each message system attribute
243 consists of a C<Name>, C<Type>, and C<Value>.
244  
245 =over
246  
247 =item *
248  
249 Currently, the only supported message system attribute is
250 C<AWSTraceHeader>. Its type must be C<String> and its value must be a
251 correctly formatted X-Ray trace header string.
252  
253 =item *
254  
255 The size of a message system attribute doesn't count towards the total
256 size of a message.
257  
258 =back
259  
260  
261  
262  
263 =head2 B<REQUIRED> QueueUrl => Str
264  
265 The URL of the Amazon SQS queue to which a message is sent.
266  
267 Queue URLs and names are case-sensitive.
268  
269  
270  
271  
272 =head1 SEE ALSO
273  
274 This class forms part of L<Paws>, documenting arguments for method SendMessage in L<Paws::SQS>
275  
276 =head1 BUGS and CONTRIBUTIONS
277  
278 The source code is located here: L<https://github.com/pplu/aws-sdk-perl>
279  
280 Please report bugs to: L<https://github.com/pplu/aws-sdk-perl/issues>
281  
282 =cut
283  
« blib/lib/Paws/SQS/ReceiveMessageResult.pm ↑ Summary blib/lib/Paws/SQS/SendMessageBatch.pm »