Skip to content

Commit 022ccd4

Browse files
author
awstools
committed
feat(client-pricing): Add Throttling Exception to all APIs.
1 parent 36a775b commit 022ccd4

File tree

11 files changed

+104
-6
lines changed

11 files changed

+104
-6
lines changed

clients/client-pricing/src/Pricing.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ export interface Pricing {
140140
* an <code>AmazonEC2</code> instance, with a <code>Provisioned IOPS</code>
141141
* <code>volumeType</code>.</p>
142142
* <p>For more information, see <a href="https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/price-changes.html">Using the
143-
* Amazon Web Services Price List API</a> in the <i>Billing User
143+
* Amazon Web Services Price List API</a> in the <i>Billing User
144144
* Guide</i>.</p>
145145
*/
146146
export class Pricing extends PricingClient implements Pricing {}

clients/client-pricing/src/PricingClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ export interface PricingClientResolvedConfig extends PricingClientResolvedConfig
286286
* an <code>AmazonEC2</code> instance, with a <code>Provisioned IOPS</code>
287287
* <code>volumeType</code>.</p>
288288
* <p>For more information, see <a href="https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/price-changes.html">Using the
289-
* Amazon Web Services Price List API</a> in the <i>Billing User
289+
* Amazon Web Services Price List API</a> in the <i>Billing User
290290
* Guide</i>.</p>
291291
*/
292292
export class PricingClient extends __Client<

clients/client-pricing/src/commands/DescribeServicesCommand.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ export interface DescribeServicesCommandOutput extends DescribeServicesResponse,
8585
* @throws {@link NotFoundException} (client fault)
8686
* <p>The requested resource can't be found.</p>
8787
*
88+
* @throws {@link ThrottlingException} (client fault)
89+
* <p>You've made too many requests exceeding service quotas.
90+
* </p>
91+
*
8892
* @throws {@link PricingServiceException}
8993
* <p>Base exception class for all service exceptions from Pricing service.</p>
9094
*

clients/client-pricing/src/commands/GetAttributeValuesCommand.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ export interface GetAttributeValuesCommandOutput extends GetAttributeValuesRespo
7878
* @throws {@link NotFoundException} (client fault)
7979
* <p>The requested resource can't be found.</p>
8080
*
81+
* @throws {@link ThrottlingException} (client fault)
82+
* <p>You've made too many requests exceeding service quotas.
83+
* </p>
84+
*
8185
* @throws {@link PricingServiceException}
8286
* <p>Base exception class for all service exceptions from Pricing service.</p>
8387
*

clients/client-pricing/src/commands/GetPriceListFileUrlCommand.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ export interface GetPriceListFileUrlCommandOutput extends GetPriceListFileUrlRes
7272
* @throws {@link NotFoundException} (client fault)
7373
* <p>The requested resource can't be found.</p>
7474
*
75+
* @throws {@link ThrottlingException} (client fault)
76+
* <p>You've made too many requests exceeding service quotas.
77+
* </p>
78+
*
7579
* @throws {@link PricingServiceException}
7680
* <p>Base exception class for all service exceptions from Pricing service.</p>
7781
*

clients/client-pricing/src/commands/GetProductsCommand.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ export interface GetProductsCommandOutput extends GetProductsResponse, __Metadat
8181
* @throws {@link NotFoundException} (client fault)
8282
* <p>The requested resource can't be found.</p>
8383
*
84+
* @throws {@link ThrottlingException} (client fault)
85+
* <p>You've made too many requests exceeding service quotas.
86+
* </p>
87+
*
8488
* @throws {@link PricingServiceException}
8589
* <p>Base exception class for all service exceptions from Pricing service.</p>
8690
*

clients/client-pricing/src/commands/ListPriceListsCommand.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,10 @@ export interface ListPriceListsCommandOutput extends ListPriceListsResponse, __M
9696
* @throws {@link NotFoundException} (client fault)
9797
* <p>The requested resource can't be found.</p>
9898
*
99+
* @throws {@link ThrottlingException} (client fault)
100+
* <p>You've made too many requests exceeding service quotas.
101+
* </p>
102+
*
99103
* @throws {@link PricingServiceException}
100104
* <p>Base exception class for all service exceptions from Pricing service.</p>
101105
*

clients/client-pricing/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
* an <code>AmazonEC2</code> instance, with a <code>Provisioned IOPS</code>
2929
* <code>volumeType</code>.</p>
3030
* <p>For more information, see <a href="https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/price-changes.html">Using the
31-
* Amazon Web Services Price List API</a> in the <i>Billing User
31+
* Amazon Web Services Price List API</a> in the <i>Billing User
3232
* Guide</i>.</p>
3333
*
3434
* @packageDocumentation

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

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ export class ExpiredNextTokenException extends __BaseException {
146146
export class InternalErrorException extends __BaseException {
147147
readonly name: "InternalErrorException" = "InternalErrorException";
148148
readonly $fault: "server" = "server";
149+
$retryable = {};
149150
Message?: string;
150151
/**
151152
* @internal
@@ -227,6 +228,32 @@ export class NotFoundException extends __BaseException {
227228
}
228229
}
229230

231+
/**
232+
* @public
233+
* <p>You've made too many requests exceeding service quotas.
234+
* </p>
235+
*/
236+
export class ThrottlingException extends __BaseException {
237+
readonly name: "ThrottlingException" = "ThrottlingException";
238+
readonly $fault: "client" = "client";
239+
$retryable = {
240+
throttling: true,
241+
};
242+
Message?: string;
243+
/**
244+
* @internal
245+
*/
246+
constructor(opts: __ExceptionOptionType<ThrottlingException, __BaseException>) {
247+
super({
248+
name: "ThrottlingException",
249+
$fault: "client",
250+
...opts,
251+
});
252+
Object.setPrototypeOf(this, ThrottlingException.prototype);
253+
this.Message = opts.Message;
254+
}
255+
}
256+
230257
/**
231258
* @public
232259
*/

clients/client-pricing/src/protocols/Aws_json1_1.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ import {
3838
InvalidParameterException,
3939
ListPriceListsRequest,
4040
NotFoundException,
41+
ThrottlingException,
4142
} from "../models/models_0";
4243
import { PricingServiceException as __BaseException } from "../models/PricingServiceException";
4344

@@ -231,6 +232,9 @@ const de_CommandError = async (output: __HttpResponse, context: __SerdeContext):
231232
case "NotFoundException":
232233
case "com.amazonaws.pricing#NotFoundException":
233234
throw await de_NotFoundExceptionRes(parsedOutput, context);
235+
case "ThrottlingException":
236+
case "com.amazonaws.pricing#ThrottlingException":
237+
throw await de_ThrottlingExceptionRes(parsedOutput, context);
234238
case "AccessDeniedException":
235239
case "com.amazonaws.pricing#AccessDeniedException":
236240
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
@@ -337,6 +341,19 @@ const de_NotFoundExceptionRes = async (parsedOutput: any, context: __SerdeContex
337341
return __decorateServiceException(exception, body);
338342
};
339343

344+
/**
345+
* deserializeAws_json1_1ThrottlingExceptionRes
346+
*/
347+
const de_ThrottlingExceptionRes = async (parsedOutput: any, context: __SerdeContext): Promise<ThrottlingException> => {
348+
const body = parsedOutput.body;
349+
const deserialized: any = _json(body);
350+
const exception = new ThrottlingException({
351+
$metadata: deserializeMetadata(parsedOutput),
352+
...deserialized,
353+
});
354+
return __decorateServiceException(exception, body);
355+
};
356+
340357
// se_DescribeServicesRequest omitted.
341358

342359
// se_Filter omitted.
@@ -422,6 +439,8 @@ const de_PriceListJsonItems = (output: any, context: __SerdeContext): (__LazyJso
422439

423440
// de_ServiceList omitted.
424441

442+
// de_ThrottlingException omitted.
443+
425444
const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({
426445
httpStatusCode: output.statusCode,
427446
requestId:

codegen/sdk-codegen/aws-models/pricing.json

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"name": "pricing"
3434
},
3535
"aws.protocols#awsJson1_1": {},
36-
"smithy.api#documentation": "<p>The Amazon Web Services Price List API is a centralized and convenient way to programmatically\n query Amazon Web Services for services, products, and pricing information. The Amazon Web Services Price List uses standardized product attributes such as <code>Location</code>,\n <code>Storage Class</code>, and <code>Operating System</code>, and provides prices at\n the SKU level. You can use the Amazon Web Services Price List to do the following:</p>\n <ul>\n <li>\n <p>Build cost control and scenario planning tools</p>\n </li>\n <li>\n <p>Reconcile billing data</p>\n </li>\n <li>\n <p>Forecast future spend for budgeting purposes</p>\n </li>\n <li>\n <p>Provide cost benefit analysis that compare your internal workloads with Amazon Web Services</p>\n </li>\n </ul>\n <p>Use <code>GetServices</code> without a service code to retrieve the service codes for\n all Amazon Web Services, then <code>GetServices</code> with a service code to\n retrieve the attribute names for that service. After you have the service code and\n attribute names, you can use <code>GetAttributeValues</code> to see what values are\n available for an attribute. With the service code and an attribute name and value, you can\n use <code>GetProducts</code> to find specific products that you're interested in, such as\n an <code>AmazonEC2</code> instance, with a <code>Provisioned IOPS</code>\n <code>volumeType</code>.</p>\n <p>For more information, see <a href=\"https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/price-changes.html\">Using the\n Amazon Web Services Price List API</a> in the <i>Billing User\n Guide</i>.</p>",
36+
"smithy.api#documentation": "<p>The Amazon Web Services Price List API is a centralized and convenient way to programmatically\n query Amazon Web Services for services, products, and pricing information. The Amazon Web Services Price List uses standardized product attributes such as <code>Location</code>,\n <code>Storage Class</code>, and <code>Operating System</code>, and provides prices at\n the SKU level. You can use the Amazon Web Services Price List to do the following:</p>\n <ul>\n <li>\n <p>Build cost control and scenario planning tools</p>\n </li>\n <li>\n <p>Reconcile billing data</p>\n </li>\n <li>\n <p>Forecast future spend for budgeting purposes</p>\n </li>\n <li>\n <p>Provide cost benefit analysis that compare your internal workloads with Amazon Web Services</p>\n </li>\n </ul>\n <p>Use <code>GetServices</code> without a service code to retrieve the service codes for\n all Amazon Web Services, then <code>GetServices</code> with a service code to\n retrieve the attribute names for that service. After you have the service code and\n attribute names, you can use <code>GetAttributeValues</code> to see what values are\n available for an attribute. With the service code and an attribute name and value, you can\n use <code>GetProducts</code> to find specific products that you're interested in, such as\n an <code>AmazonEC2</code> instance, with a <code>Provisioned IOPS</code>\n <code>volumeType</code>.</p>\n <p>For more information, see <a href=\"https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/price-changes.html\">Using the\n Amazon Web Services Price List API</a> in the <i>Billing User\n Guide</i>.</p>",
3737
"smithy.api#title": "AWS Price List Service",
3838
"smithy.rules#endpointRuleSet": {
3939
"version": "1.0",
@@ -781,6 +781,9 @@
781781
},
782782
{
783783
"target": "com.amazonaws.pricing#NotFoundException"
784+
},
785+
{
786+
"target": "com.amazonaws.pricing#ThrottlingException"
784787
}
785788
],
786789
"traits": {
@@ -952,6 +955,9 @@
952955
},
953956
{
954957
"target": "com.amazonaws.pricing#NotFoundException"
958+
},
959+
{
960+
"target": "com.amazonaws.pricing#ThrottlingException"
955961
}
956962
],
957963
"traits": {
@@ -1039,6 +1045,9 @@
10391045
},
10401046
{
10411047
"target": "com.amazonaws.pricing#NotFoundException"
1048+
},
1049+
{
1050+
"target": "com.amazonaws.pricing#ThrottlingException"
10421051
}
10431052
],
10441053
"traits": {
@@ -1104,6 +1113,9 @@
11041113
},
11051114
{
11061115
"target": "com.amazonaws.pricing#NotFoundException"
1116+
},
1117+
{
1118+
"target": "com.amazonaws.pricing#ThrottlingException"
11071119
}
11081120
],
11091121
"traits": {
@@ -1192,7 +1204,8 @@
11921204
"traits": {
11931205
"smithy.api#documentation": "<p>An error on the server occurred during the processing of your request. Try again later.</p>",
11941206
"smithy.api#error": "server",
1195-
"smithy.api#httpError": 500
1207+
"smithy.api#httpError": 500,
1208+
"smithy.api#retryable": {}
11961209
}
11971210
},
11981211
"com.amazonaws.pricing#InvalidNextTokenException": {
@@ -1247,6 +1260,9 @@
12471260
},
12481261
{
12491262
"target": "com.amazonaws.pricing#NotFoundException"
1263+
},
1264+
{
1265+
"target": "com.amazonaws.pricing#ThrottlingException"
12501266
}
12511267
],
12521268
"traits": {
@@ -1389,7 +1405,7 @@
13891405
"min": 18,
13901406
"max": 2048
13911407
},
1392-
"smithy.api#pattern": "^arn:[A-Za-z0-9][-.A-Za-z0-9]{0,62}:pricing:::price-list/[A-Za-z0-9_/.-]{1,1023}$"
1408+
"smithy.api#pattern": "^arn:[A-Za-z0-9][-.A-Za-z0-9]{0,62}:pricing:::price-list/[A-Za-z0-9+_/.-]{1,1023}$"
13931409
}
13941410
},
13951411
"com.amazonaws.pricing#PriceListJsonItems": {
@@ -1458,6 +1474,22 @@
14581474
"smithy.api#mediaType": "application/json"
14591475
}
14601476
},
1477+
"com.amazonaws.pricing#ThrottlingException": {
1478+
"type": "structure",
1479+
"members": {
1480+
"Message": {
1481+
"target": "com.amazonaws.pricing#errorMessage"
1482+
}
1483+
},
1484+
"traits": {
1485+
"smithy.api#documentation": "<p>You've made too many requests exceeding service quotas.\n </p>",
1486+
"smithy.api#error": "client",
1487+
"smithy.api#httpError": 429,
1488+
"smithy.api#retryable": {
1489+
"throttling": true
1490+
}
1491+
}
1492+
},
14611493
"com.amazonaws.pricing#errorMessage": {
14621494
"type": "string"
14631495
}

0 commit comments

Comments
 (0)