Skip to content

Commit 9a836b2

Browse files
author
awstools
committed
feat(client-savingsplans): Introducing the Savings Plans Return feature enabling customers to return their Savings Plans within 7 days of purchase.
1 parent d93fd4b commit 9a836b2

13 files changed

+409
-99
lines changed

clients/client-savingsplans/README.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66

77
AWS SDK for JavaScript Savingsplans Client for Node.js, Browser and React Native.
88

9-
<p>Savings Plans are a pricing model that offer significant savings on AWS usage (for
10-
example, on Amazon EC2 instances). You commit to a consistent amount of usage, in USD
11-
per hour, for a term of 1 or 3 years, and receive a lower price for that usage. For
12-
more information, see the <a href="https://docs.aws.amazon.com/savingsplans/latest/userguide/">AWS Savings Plans User Guide</a>.</p>
9+
<p>Savings Plans are a pricing model that offer significant savings on Amazon Web Services usage (for example, on Amazon EC2 instances). You commit to a consistent
10+
amount of usage per hour, in the specified currency, for a term of one or three years, and
11+
receive a lower price for that usage. For more information, see the <a href="https://docs.aws.amazon.com/savingsplans/latest/userguide/">Amazon Web Services
12+
Savings Plans User Guide</a>.</p>
1313

1414
## Installing
1515

@@ -261,6 +261,14 @@ ListTagsForResource
261261

262262
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/savingsplans/command/ListTagsForResourceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-savingsplans/Interface/ListTagsForResourceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-savingsplans/Interface/ListTagsForResourceCommandOutput/)
263263

264+
</details>
265+
<details>
266+
<summary>
267+
ReturnSavingsPlan
268+
</summary>
269+
270+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/savingsplans/command/ReturnSavingsPlanCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-savingsplans/Interface/ReturnSavingsPlanCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-savingsplans/Interface/ReturnSavingsPlanCommandOutput/)
271+
264272
</details>
265273
<details>
266274
<summary>

clients/client-savingsplans/src/Savingsplans.ts

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ import {
3737
ListTagsForResourceCommandInput,
3838
ListTagsForResourceCommandOutput,
3939
} from "./commands/ListTagsForResourceCommand";
40+
import {
41+
ReturnSavingsPlanCommand,
42+
ReturnSavingsPlanCommandInput,
43+
ReturnSavingsPlanCommandOutput,
44+
} from "./commands/ReturnSavingsPlanCommand";
4045
import { TagResourceCommand, TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand";
4146
import {
4247
UntagResourceCommand,
@@ -53,6 +58,7 @@ const commands = {
5358
DescribeSavingsPlansOfferingRatesCommand,
5459
DescribeSavingsPlansOfferingsCommand,
5560
ListTagsForResourceCommand,
61+
ReturnSavingsPlanCommand,
5662
TagResourceCommand,
5763
UntagResourceCommand,
5864
};
@@ -180,6 +186,23 @@ export interface Savingsplans {
180186
cb: (err: any, data?: ListTagsForResourceCommandOutput) => void
181187
): void;
182188

189+
/**
190+
* @see {@link ReturnSavingsPlanCommand}
191+
*/
192+
returnSavingsPlan(
193+
args: ReturnSavingsPlanCommandInput,
194+
options?: __HttpHandlerOptions
195+
): Promise<ReturnSavingsPlanCommandOutput>;
196+
returnSavingsPlan(
197+
args: ReturnSavingsPlanCommandInput,
198+
cb: (err: any, data?: ReturnSavingsPlanCommandOutput) => void
199+
): void;
200+
returnSavingsPlan(
201+
args: ReturnSavingsPlanCommandInput,
202+
options: __HttpHandlerOptions,
203+
cb: (err: any, data?: ReturnSavingsPlanCommandOutput) => void
204+
): void;
205+
183206
/**
184207
* @see {@link TagResourceCommand}
185208
*/
@@ -204,10 +227,10 @@ export interface Savingsplans {
204227
}
205228

206229
/**
207-
* <p>Savings Plans are a pricing model that offer significant savings on AWS usage (for
208-
* example, on Amazon EC2 instances). You commit to a consistent amount of usage, in USD
209-
* per hour, for a term of 1 or 3 years, and receive a lower price for that usage. For
210-
* more information, see the <a href="https://docs.aws.amazon.com/savingsplans/latest/userguide/">AWS Savings Plans User Guide</a>.</p>
230+
* <p>Savings Plans are a pricing model that offer significant savings on Amazon Web Services usage (for example, on Amazon EC2 instances). You commit to a consistent
231+
* amount of usage per hour, in the specified currency, for a term of one or three years, and
232+
* receive a lower price for that usage. For more information, see the <a href="https://docs.aws.amazon.com/savingsplans/latest/userguide/">Amazon Web Services
233+
* Savings Plans User Guide</a>.</p>
211234
* @public
212235
*/
213236
export class Savingsplans extends SavingsplansClient implements Savingsplans {}

clients/client-savingsplans/src/SavingsplansClient.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ import {
7878
ListTagsForResourceCommandInput,
7979
ListTagsForResourceCommandOutput,
8080
} from "./commands/ListTagsForResourceCommand";
81+
import { ReturnSavingsPlanCommandInput, ReturnSavingsPlanCommandOutput } from "./commands/ReturnSavingsPlanCommand";
8182
import { TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand";
8283
import { UntagResourceCommandInput, UntagResourceCommandOutput } from "./commands/UntagResourceCommand";
8384
import {
@@ -102,6 +103,7 @@ export type ServiceInputTypes =
102103
| DescribeSavingsPlansOfferingRatesCommandInput
103104
| DescribeSavingsPlansOfferingsCommandInput
104105
| ListTagsForResourceCommandInput
106+
| ReturnSavingsPlanCommandInput
105107
| TagResourceCommandInput
106108
| UntagResourceCommandInput;
107109

@@ -116,6 +118,7 @@ export type ServiceOutputTypes =
116118
| DescribeSavingsPlansOfferingRatesCommandOutput
117119
| DescribeSavingsPlansOfferingsCommandOutput
118120
| ListTagsForResourceCommandOutput
121+
| ReturnSavingsPlanCommandOutput
119122
| TagResourceCommandOutput
120123
| UntagResourceCommandOutput;
121124

@@ -291,10 +294,10 @@ export type SavingsplansClientResolvedConfigType = __SmithyResolvedConfiguration
291294
export interface SavingsplansClientResolvedConfig extends SavingsplansClientResolvedConfigType {}
292295

293296
/**
294-
* <p>Savings Plans are a pricing model that offer significant savings on AWS usage (for
295-
* example, on Amazon EC2 instances). You commit to a consistent amount of usage, in USD
296-
* per hour, for a term of 1 or 3 years, and receive a lower price for that usage. For
297-
* more information, see the <a href="https://docs.aws.amazon.com/savingsplans/latest/userguide/">AWS Savings Plans User Guide</a>.</p>
297+
* <p>Savings Plans are a pricing model that offer significant savings on Amazon Web Services usage (for example, on Amazon EC2 instances). You commit to a consistent
298+
* amount of usage per hour, in the specified currency, for a term of one or three years, and
299+
* receive a lower price for that usage. For more information, see the <a href="https://docs.aws.amazon.com/savingsplans/latest/userguide/">Amazon Web Services
300+
* Savings Plans User Guide</a>.</p>
298301
* @public
299302
*/
300303
export class SavingsplansClient extends __Client<

clients/client-savingsplans/src/commands/DescribeSavingsPlanRatesCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export interface DescribeSavingsPlanRatesCommandInput extends DescribeSavingsPla
2727
export interface DescribeSavingsPlanRatesCommandOutput extends DescribeSavingsPlanRatesResponse, __MetadataBearer {}
2828

2929
/**
30-
* <p>Describes the specified Savings Plans rates.</p>
30+
* <p>Describes the rates for the specified Savings Plan.</p>
3131
* @example
3232
* Use a bare-bones client and the command you need to make an API call.
3333
* ```javascript

clients/client-savingsplans/src/commands/DescribeSavingsPlansCommand.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export interface DescribeSavingsPlansCommandOutput extends DescribeSavingsPlansR
4444
* nextToken: "STRING_VALUE",
4545
* maxResults: Number("int"),
4646
* states: [ // SavingsPlanStateList
47-
* "payment-pending" || "payment-failed" || "active" || "retired" || "queued" || "queued-deleted",
47+
* "payment-pending" || "payment-failed" || "active" || "retired" || "queued" || "queued-deleted" || "pending-return" || "returned",
4848
* ],
4949
* filters: [ // SavingsPlanFilterList
5050
* { // SavingsPlanFilter
@@ -66,7 +66,7 @@ export interface DescribeSavingsPlansCommandOutput extends DescribeSavingsPlansR
6666
* // description: "STRING_VALUE",
6767
* // start: "STRING_VALUE",
6868
* // end: "STRING_VALUE",
69-
* // state: "payment-pending" || "payment-failed" || "active" || "retired" || "queued" || "queued-deleted",
69+
* // state: "payment-pending" || "payment-failed" || "active" || "retired" || "queued" || "queued-deleted" || "pending-return" || "returned",
7070
* // region: "STRING_VALUE",
7171
* // ec2InstanceFamily: "STRING_VALUE",
7272
* // savingsPlanType: "Compute" || "EC2Instance" || "SageMaker",
@@ -82,6 +82,7 @@ export interface DescribeSavingsPlansCommandOutput extends DescribeSavingsPlansR
8282
* // tags: { // TagMap
8383
* // "<keys>": "STRING_VALUE",
8484
* // },
85+
* // returnableUntil: "STRING_VALUE",
8586
* // },
8687
* // ],
8788
* // nextToken: "STRING_VALUE",

clients/client-savingsplans/src/commands/DescribeSavingsPlansOfferingRatesCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export interface DescribeSavingsPlansOfferingRatesCommandOutput
3535
__MetadataBearer {}
3636

3737
/**
38-
* <p>Describes the specified Savings Plans offering rates.</p>
38+
* <p>Describes the offering rates for the specified Savings Plans.</p>
3939
* @example
4040
* Use a bare-bones client and the command you need to make an API call.
4141
* ```javascript

clients/client-savingsplans/src/commands/DescribeSavingsPlansOfferingsCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export interface DescribeSavingsPlansOfferingsCommandOutput
3232
__MetadataBearer {}
3333

3434
/**
35-
* <p>Describes the specified Savings Plans offerings.</p>
35+
* <p>Describes the offerings for the specified Savings Plans.</p>
3636
* @example
3737
* Use a bare-bones client and the command you need to make an API call.
3838
* ```javascript
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
// smithy-typescript generated code
2+
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
3+
import { getSerdePlugin } from "@smithy/middleware-serde";
4+
import { Command as $Command } from "@smithy/smithy-client";
5+
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
6+
7+
import { commonParams } from "../endpoint/EndpointParameters";
8+
import { ReturnSavingsPlanRequest, ReturnSavingsPlanResponse } from "../models/models_0";
9+
import { de_ReturnSavingsPlanCommand, se_ReturnSavingsPlanCommand } from "../protocols/Aws_restJson1";
10+
import { SavingsplansClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../SavingsplansClient";
11+
12+
/**
13+
* @public
14+
*/
15+
export { __MetadataBearer, $Command };
16+
/**
17+
* @public
18+
*
19+
* The input for {@link ReturnSavingsPlanCommand}.
20+
*/
21+
export interface ReturnSavingsPlanCommandInput extends ReturnSavingsPlanRequest {}
22+
/**
23+
* @public
24+
*
25+
* The output of {@link ReturnSavingsPlanCommand}.
26+
*/
27+
export interface ReturnSavingsPlanCommandOutput extends ReturnSavingsPlanResponse, __MetadataBearer {}
28+
29+
/**
30+
* <p>Returns the specified Savings Plan.</p>
31+
* @example
32+
* Use a bare-bones client and the command you need to make an API call.
33+
* ```javascript
34+
* import { SavingsplansClient, ReturnSavingsPlanCommand } from "@aws-sdk/client-savingsplans"; // ES Modules import
35+
* // const { SavingsplansClient, ReturnSavingsPlanCommand } = require("@aws-sdk/client-savingsplans"); // CommonJS import
36+
* const client = new SavingsplansClient(config);
37+
* const input = { // ReturnSavingsPlanRequest
38+
* savingsPlanId: "STRING_VALUE", // required
39+
* clientToken: "STRING_VALUE",
40+
* };
41+
* const command = new ReturnSavingsPlanCommand(input);
42+
* const response = await client.send(command);
43+
* // { // ReturnSavingsPlanResponse
44+
* // savingsPlanId: "STRING_VALUE",
45+
* // };
46+
*
47+
* ```
48+
*
49+
* @param ReturnSavingsPlanCommandInput - {@link ReturnSavingsPlanCommandInput}
50+
* @returns {@link ReturnSavingsPlanCommandOutput}
51+
* @see {@link ReturnSavingsPlanCommandInput} for command's `input` shape.
52+
* @see {@link ReturnSavingsPlanCommandOutput} for command's `response` shape.
53+
* @see {@link SavingsplansClientResolvedConfig | config} for SavingsplansClient's `config` shape.
54+
*
55+
* @throws {@link InternalServerException} (server fault)
56+
* <p>An unexpected error occurred.</p>
57+
*
58+
* @throws {@link ResourceNotFoundException} (client fault)
59+
* <p>The specified resource was not found.</p>
60+
*
61+
* @throws {@link ServiceQuotaExceededException} (client fault)
62+
* <p>A service quota has been exceeded.</p>
63+
*
64+
* @throws {@link ValidationException} (client fault)
65+
* <p>One of the input parameters is not valid.</p>
66+
*
67+
* @throws {@link SavingsplansServiceException}
68+
* <p>Base exception class for all service exceptions from Savingsplans service.</p>
69+
*
70+
* @public
71+
*/
72+
export class ReturnSavingsPlanCommand extends $Command
73+
.classBuilder<
74+
ReturnSavingsPlanCommandInput,
75+
ReturnSavingsPlanCommandOutput,
76+
SavingsplansClientResolvedConfig,
77+
ServiceInputTypes,
78+
ServiceOutputTypes
79+
>()
80+
.ep({
81+
...commonParams,
82+
})
83+
.m(function (this: any, Command: any, cs: any, config: SavingsplansClientResolvedConfig, o: any) {
84+
return [
85+
getSerdePlugin(config, this.serialize, this.deserialize),
86+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
87+
];
88+
})
89+
.s("AWSSavingsPlan", "ReturnSavingsPlan", {})
90+
.n("SavingsplansClient", "ReturnSavingsPlanCommand")
91+
.f(void 0, void 0)
92+
.ser(se_ReturnSavingsPlanCommand)
93+
.de(de_ReturnSavingsPlanCommand)
94+
.build() {}

clients/client-savingsplans/src/commands/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@ export * from "./DescribeSavingsPlansCommand";
66
export * from "./DescribeSavingsPlansOfferingRatesCommand";
77
export * from "./DescribeSavingsPlansOfferingsCommand";
88
export * from "./ListTagsForResourceCommand";
9+
export * from "./ReturnSavingsPlanCommand";
910
export * from "./TagResourceCommand";
1011
export * from "./UntagResourceCommand";

clients/client-savingsplans/src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// smithy-typescript generated code
22
/* eslint-disable */
33
/**
4-
* <p>Savings Plans are a pricing model that offer significant savings on AWS usage (for
5-
* example, on Amazon EC2 instances). You commit to a consistent amount of usage, in USD
6-
* per hour, for a term of 1 or 3 years, and receive a lower price for that usage. For
7-
* more information, see the <a href="https://docs.aws.amazon.com/savingsplans/latest/userguide/">AWS Savings Plans User Guide</a>.</p>
4+
* <p>Savings Plans are a pricing model that offer significant savings on Amazon Web Services usage (for example, on Amazon EC2 instances). You commit to a consistent
5+
* amount of usage per hour, in the specified currency, for a term of one or three years, and
6+
* receive a lower price for that usage. For more information, see the <a href="https://docs.aws.amazon.com/savingsplans/latest/userguide/">Amazon Web Services
7+
* Savings Plans User Guide</a>.</p>
88
*
99
* @packageDocumentation
1010
*/

0 commit comments

Comments
 (0)