Skip to content

Commit 10014a8

Browse files
author
awstools
committed
feat(client-sns): Message Archiving and Replay is now supported in Amazon SNS for FIFO topics.
1 parent 6a156d7 commit 10014a8

File tree

9 files changed

+225
-17
lines changed

9 files changed

+225
-17
lines changed

clients/client-sns/src/commands/ConfirmSubscriptionCommand.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ export interface ConfirmSubscriptionCommandOutput extends ConfirmSubscriptionRes
8585
* @throws {@link NotFoundException} (client fault)
8686
* <p>Indicates that the requested resource does not exist.</p>
8787
*
88+
* @throws {@link ReplayLimitExceededException} (client fault)
89+
* <p>Indicates that the request parameter has exceeded the maximum number of concurrent message replays.</p>
90+
*
8891
* @throws {@link SubscriptionLimitExceededException} (client fault)
8992
* <p>Indicates that the customer already owns the maximum allowed number of
9093
* subscriptions.</p>

clients/client-sns/src/commands/DeleteTopicCommand.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ export interface DeleteTopicCommandOutput extends __MetadataBearer {}
7676
* <p>Indicates that a request parameter does not comply with the associated
7777
* constraints.</p>
7878
*
79+
* @throws {@link InvalidStateException} (client fault)
80+
* <p>Indicates that the specified state is not a valid state for an event source.</p>
81+
*
7982
* @throws {@link NotFoundException} (client fault)
8083
* <p>Indicates that the requested resource does not exist.</p>
8184
*

clients/client-sns/src/commands/PublishBatchCommand.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,13 +149,12 @@ export interface PublishBatchCommandOutput extends PublishBatchResponse, __Metad
149149
* to.</p>
150150
*
151151
* @throws {@link KMSDisabledException} (client fault)
152-
* <p>The request was rejected because the specified customer master key (CMK) isn't
152+
* <p>The request was rejected because the specified Amazon Web Services KMS key isn't
153153
* enabled.</p>
154154
*
155155
* @throws {@link KMSInvalidStateException} (client fault)
156156
* <p>The request was rejected because the state of the specified resource isn't valid for
157-
* this request. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html">How Key State Affects Use of a
158-
* Customer Master Key</a> in the <i>Key Management Service Developer
157+
* this request. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html">Key states of Amazon Web Services KMS keys</a> in the <i>Key Management Service Developer
159158
* Guide</i>.</p>
160159
*
161160
* @throws {@link KMSNotFoundException} (client fault)

clients/client-sns/src/commands/PublishCommand.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,12 @@ export interface PublishCommandOutput extends PublishResponse, __MetadataBearer
118118
* to.</p>
119119
*
120120
* @throws {@link KMSDisabledException} (client fault)
121-
* <p>The request was rejected because the specified customer master key (CMK) isn't
121+
* <p>The request was rejected because the specified Amazon Web Services KMS key isn't
122122
* enabled.</p>
123123
*
124124
* @throws {@link KMSInvalidStateException} (client fault)
125125
* <p>The request was rejected because the state of the specified resource isn't valid for
126-
* this request. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html">How Key State Affects Use of a
127-
* Customer Master Key</a> in the <i>Key Management Service Developer
126+
* this request. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html">Key states of Amazon Web Services KMS keys</a> in the <i>Key Management Service Developer
128127
* Guide</i>.</p>
129128
*
130129
* @throws {@link KMSNotFoundException} (client fault)

clients/client-sns/src/commands/SetSubscriptionAttributesCommand.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ export interface SetSubscriptionAttributesCommandOutput extends __MetadataBearer
8080
* @throws {@link NotFoundException} (client fault)
8181
* <p>Indicates that the requested resource does not exist.</p>
8282
*
83+
* @throws {@link ReplayLimitExceededException} (client fault)
84+
* <p>Indicates that the request parameter has exceeded the maximum number of concurrent message replays.</p>
85+
*
8386
* @throws {@link SNSServiceException}
8487
* <p>Base exception class for all service exceptions from SNS service.</p>
8588
*

clients/client-sns/src/commands/SubscribeCommand.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export interface SubscribeCommandOutput extends SubscribeResponse, __MetadataBea
4141
* if the endpoint and the topic are not in the same Amazon Web Services account, the endpoint owner must
4242
* run the <code>ConfirmSubscription</code> action to confirm the subscription.</p>
4343
* <p>You call the <code>ConfirmSubscription</code> action with the token from the
44-
* subscription response. Confirmation tokens are valid for three days.</p>
44+
* subscription response. Confirmation tokens are valid for two days.</p>
4545
* <p>This action is throttled at 100 transactions per second (TPS).</p>
4646
* @example
4747
* Use a bare-bones client and the command you need to make an API call.
@@ -94,6 +94,9 @@ export interface SubscribeCommandOutput extends SubscribeResponse, __MetadataBea
9494
* @throws {@link NotFoundException} (client fault)
9595
* <p>Indicates that the requested resource does not exist.</p>
9696
*
97+
* @throws {@link ReplayLimitExceededException} (client fault)
98+
* <p>Indicates that the request parameter has exceeded the maximum number of concurrent message replays.</p>
99+
*
97100
* @throws {@link SubscriptionLimitExceededException} (client fault)
98101
* <p>Indicates that the customer already owns the maximum allowed number of
99102
* subscriptions.</p>

clients/client-sns/src/models/models_0.ts

Lines changed: 89 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,26 @@ export class FilterPolicyLimitExceededException extends __BaseException {
233233
}
234234
}
235235

236+
/**
237+
* @public
238+
* <p>Indicates that the request parameter has exceeded the maximum number of concurrent message replays.</p>
239+
*/
240+
export class ReplayLimitExceededException extends __BaseException {
241+
readonly name: "ReplayLimitExceededException" = "ReplayLimitExceededException";
242+
readonly $fault: "client" = "client";
243+
/**
244+
* @internal
245+
*/
246+
constructor(opts: __ExceptionOptionType<ReplayLimitExceededException, __BaseException>) {
247+
super({
248+
name: "ReplayLimitExceededException",
249+
$fault: "client",
250+
...opts,
251+
});
252+
Object.setPrototypeOf(this, ReplayLimitExceededException.prototype);
253+
}
254+
}
255+
236256
/**
237257
* @public
238258
* <p>Indicates that the customer already owns the maximum allowed number of
@@ -544,8 +564,15 @@ export interface CreateTopicInput {
544564
* <ul>
545565
* <li>
546566
* <p>
547-
* <code>FifoTopic</code> – When this is set to <code>true</code>, a FIFO
548-
* topic is created.</p>
567+
* <code>ArchivePolicy</code> – Adds or updates an inline policy document
568+
* to archive messages stored in the specified Amazon SNS topic.</p>
569+
* </li>
570+
* <li>
571+
* <p>
572+
* <code>BeginningArchiveTime</code> – The earliest starting point at
573+
* which a message in the topic’s archive can be replayed from. This point in time
574+
* is based on the configured message retention period set by the topic’s message
575+
* archiving policy.</p>
549576
* </li>
550577
* <li>
551578
* <p>
@@ -780,6 +807,26 @@ export interface DeleteTopicInput {
780807
TopicArn: string | undefined;
781808
}
782809

810+
/**
811+
* @public
812+
* <p>Indicates that the specified state is not a valid state for an event source.</p>
813+
*/
814+
export class InvalidStateException extends __BaseException {
815+
readonly name: "InvalidStateException" = "InvalidStateException";
816+
readonly $fault: "client" = "client";
817+
/**
818+
* @internal
819+
*/
820+
constructor(opts: __ExceptionOptionType<InvalidStateException, __BaseException>) {
821+
super({
822+
name: "InvalidStateException",
823+
$fault: "client",
824+
...opts,
825+
});
826+
Object.setPrototypeOf(this, InvalidStateException.prototype);
827+
}
828+
}
829+
783830
/**
784831
* @public
785832
*/
@@ -1812,7 +1859,7 @@ export class KMSAccessDeniedException extends __BaseException {
18121859

18131860
/**
18141861
* @public
1815-
* <p>The request was rejected because the specified customer master key (CMK) isn't
1862+
* <p>The request was rejected because the specified Amazon Web Services KMS key isn't
18161863
* enabled.</p>
18171864
*/
18181865
export class KMSDisabledException extends __BaseException {
@@ -1834,8 +1881,7 @@ export class KMSDisabledException extends __BaseException {
18341881
/**
18351882
* @public
18361883
* <p>The request was rejected because the state of the specified resource isn't valid for
1837-
* this request. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html">How Key State Affects Use of a
1838-
* Customer Master Key</a> in the <i>Key Management Service Developer
1884+
* this request. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html">Key states of Amazon Web Services KMS keys</a> in the <i>Key Management Service Developer
18391885
* Guide</i>.</p>
18401886
*/
18411887
export class KMSInvalidStateException extends __BaseException {
@@ -3299,6 +3345,44 @@ export interface SubscribeInput {
32993345
* to Kinesis Data Firehose delivery streams</a> in the <i>Amazon SNS Developer Guide</i>.</p>
33003346
* </li>
33013347
* </ul>
3348+
* <p>The following attributes apply only to <a href="https://docs.aws.amazon.com/sns/latest/dg/sns-fifo-topics.html">FIFO topics</a>:</p>
3349+
* <ul>
3350+
* <li>
3351+
* <p>
3352+
* <code>ReplayPolicy</code> – Adds or updates an inline policy document
3353+
* for a subscription to replay messages stored in the specified Amazon SNS
3354+
* topic.</p>
3355+
* </li>
3356+
* <li>
3357+
* <p>
3358+
* <code>ReplayStatus</code> – Retrieves the status of the subscription
3359+
* message replay, which can be one of the following:</p>
3360+
* <ul>
3361+
* <li>
3362+
* <p>
3363+
* <code>Completed</code> – The replay has successfully
3364+
* redelivered all messages, and is now delivering newly published
3365+
* messages. If an ending point was specified in the
3366+
* <code>ReplayPolicy</code> then the subscription will no longer
3367+
* receive newly published messages.</p>
3368+
* </li>
3369+
* <li>
3370+
* <p>
3371+
* <code>In progress</code> – The replay is currently replaying
3372+
* the selected messages.</p>
3373+
* </li>
3374+
* <li>
3375+
* <p>
3376+
* <code>Failed</code> – The replay was unable to complete.</p>
3377+
* </li>
3378+
* <li>
3379+
* <p>
3380+
* <code>Pending</code> – The default state while the replay
3381+
* initiates.</p>
3382+
* </li>
3383+
* </ul>
3384+
* </li>
3385+
* </ul>
33023386
*/
33033387
Attributes?: Record<string, string>;
33043388

clients/client-sns/src/protocols/Aws_query.ts

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ import {
181181
InvalidParameterException,
182182
InvalidParameterValueException,
183183
InvalidSecurityException,
184+
InvalidStateException,
184185
KMSAccessDeniedException,
185186
KMSDisabledException,
186187
KMSInvalidStateException,
@@ -222,6 +223,7 @@ import {
222223
PublishResponse,
223224
PutDataProtectionPolicyInput,
224225
RemovePermissionInput,
226+
ReplayLimitExceededException,
225227
ResourceNotFoundException,
226228
SetEndpointAttributesInput,
227229
SetPlatformApplicationAttributesInput,
@@ -1124,6 +1126,9 @@ const de_ConfirmSubscriptionCommandError = async (
11241126
case "NotFound":
11251127
case "com.amazonaws.sns#NotFoundException":
11261128
throw await de_NotFoundExceptionRes(parsedOutput, context);
1129+
case "ReplayLimitExceeded":
1130+
case "com.amazonaws.sns#ReplayLimitExceededException":
1131+
throw await de_ReplayLimitExceededExceptionRes(parsedOutput, context);
11271132
case "SubscriptionLimitExceeded":
11281133
case "com.amazonaws.sns#SubscriptionLimitExceededException":
11291134
throw await de_SubscriptionLimitExceededExceptionRes(parsedOutput, context);
@@ -1576,6 +1581,9 @@ const de_DeleteTopicCommandError = async (
15761581
case "InvalidParameter":
15771582
case "com.amazonaws.sns#InvalidParameterException":
15781583
throw await de_InvalidParameterExceptionRes(parsedOutput, context);
1584+
case "InvalidState":
1585+
case "com.amazonaws.sns#InvalidStateException":
1586+
throw await de_InvalidStateExceptionRes(parsedOutput, context);
15791587
case "NotFound":
15801588
case "com.amazonaws.sns#NotFoundException":
15811589
throw await de_NotFoundExceptionRes(parsedOutput, context);
@@ -3035,6 +3043,9 @@ const de_SetSubscriptionAttributesCommandError = async (
30353043
case "NotFound":
30363044
case "com.amazonaws.sns#NotFoundException":
30373045
throw await de_NotFoundExceptionRes(parsedOutput, context);
3046+
case "ReplayLimitExceeded":
3047+
case "com.amazonaws.sns#ReplayLimitExceededException":
3048+
throw await de_ReplayLimitExceededExceptionRes(parsedOutput, context);
30383049
default:
30393050
const parsedBody = parsedOutput.body;
30403051
return throwDefaultError({
@@ -3151,6 +3162,9 @@ const de_SubscribeCommandError = async (
31513162
case "NotFound":
31523163
case "com.amazonaws.sns#NotFoundException":
31533164
throw await de_NotFoundExceptionRes(parsedOutput, context);
3165+
case "ReplayLimitExceeded":
3166+
case "com.amazonaws.sns#ReplayLimitExceededException":
3167+
throw await de_ReplayLimitExceededExceptionRes(parsedOutput, context);
31543168
case "SubscriptionLimitExceeded":
31553169
case "com.amazonaws.sns#SubscriptionLimitExceededException":
31563170
throw await de_SubscriptionLimitExceededExceptionRes(parsedOutput, context);
@@ -3600,6 +3614,22 @@ const de_InvalidSecurityExceptionRes = async (
36003614
return __decorateServiceException(exception, body);
36013615
};
36023616

3617+
/**
3618+
* deserializeAws_queryInvalidStateExceptionRes
3619+
*/
3620+
const de_InvalidStateExceptionRes = async (
3621+
parsedOutput: any,
3622+
context: __SerdeContext
3623+
): Promise<InvalidStateException> => {
3624+
const body = parsedOutput.body;
3625+
const deserialized: any = de_InvalidStateException(body.Error, context);
3626+
const exception = new InvalidStateException({
3627+
$metadata: deserializeMetadata(parsedOutput),
3628+
...deserialized,
3629+
});
3630+
return __decorateServiceException(exception, body);
3631+
};
3632+
36033633
/**
36043634
* deserializeAws_queryKMSAccessDeniedExceptionRes
36053635
*/
@@ -3735,6 +3765,22 @@ const de_PlatformApplicationDisabledExceptionRes = async (
37353765
return __decorateServiceException(exception, body);
37363766
};
37373767

3768+
/**
3769+
* deserializeAws_queryReplayLimitExceededExceptionRes
3770+
*/
3771+
const de_ReplayLimitExceededExceptionRes = async (
3772+
parsedOutput: any,
3773+
context: __SerdeContext
3774+
): Promise<ReplayLimitExceededException> => {
3775+
const body = parsedOutput.body;
3776+
const deserialized: any = de_ReplayLimitExceededException(body.Error, context);
3777+
const exception = new ReplayLimitExceededException({
3778+
$metadata: deserializeMetadata(parsedOutput),
3779+
...deserialized,
3780+
});
3781+
return __decorateServiceException(exception, body);
3782+
};
3783+
37383784
/**
37393785
* deserializeAws_queryResourceNotFoundExceptionRes
37403786
*/
@@ -5171,6 +5217,17 @@ const de_InvalidSecurityException = (output: any, context: __SerdeContext): Inva
51715217
return contents;
51725218
};
51735219

5220+
/**
5221+
* deserializeAws_queryInvalidStateException
5222+
*/
5223+
const de_InvalidStateException = (output: any, context: __SerdeContext): InvalidStateException => {
5224+
const contents: any = {};
5225+
if (output["message"] !== undefined) {
5226+
contents.message = __expectString(output["message"]);
5227+
}
5228+
return contents;
5229+
};
5230+
51745231
/**
51755232
* deserializeAws_queryKMSAccessDeniedException
51765233
*/
@@ -5624,6 +5681,17 @@ const de_PublishResponse = (output: any, context: __SerdeContext): PublishRespon
56245681
return contents;
56255682
};
56265683

5684+
/**
5685+
* deserializeAws_queryReplayLimitExceededException
5686+
*/
5687+
const de_ReplayLimitExceededException = (output: any, context: __SerdeContext): ReplayLimitExceededException => {
5688+
const contents: any = {};
5689+
if (output["message"] !== undefined) {
5690+
contents.message = __expectString(output["message"]);
5691+
}
5692+
return contents;
5693+
};
5694+
56275695
/**
56285696
* deserializeAws_queryResourceNotFoundException
56295697
*/

0 commit comments

Comments
 (0)