Skip to content

Commit

Permalink
feat(client-pricing): Add Throttling Exception to all APIs.
Browse files Browse the repository at this point in the history
  • Loading branch information
awstools committed Feb 9, 2024
1 parent 36a775b commit 022ccd4
Show file tree
Hide file tree
Showing 11 changed files with 104 additions and 6 deletions.
2 changes: 1 addition & 1 deletion clients/client-pricing/src/Pricing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export interface Pricing {
* an <code>AmazonEC2</code> instance, with a <code>Provisioned IOPS</code>
* <code>volumeType</code>.</p>
* <p>For more information, see <a href="https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/price-changes.html">Using the
* Amazon Web Services Price List API</a> in the <i>Billing User
* Amazon Web Services Price List API</a> in the <i>Billing User
* Guide</i>.</p>
*/
export class Pricing extends PricingClient implements Pricing {}
Expand Down
2 changes: 1 addition & 1 deletion clients/client-pricing/src/PricingClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ export interface PricingClientResolvedConfig extends PricingClientResolvedConfig
* an <code>AmazonEC2</code> instance, with a <code>Provisioned IOPS</code>
* <code>volumeType</code>.</p>
* <p>For more information, see <a href="https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/price-changes.html">Using the
* Amazon Web Services Price List API</a> in the <i>Billing User
* Amazon Web Services Price List API</a> in the <i>Billing User
* Guide</i>.</p>
*/
export class PricingClient extends __Client<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ export interface DescribeServicesCommandOutput extends DescribeServicesResponse,
* @throws {@link NotFoundException} (client fault)
* <p>The requested resource can't be found.</p>
*
* @throws {@link ThrottlingException} (client fault)
* <p>You've made too many requests exceeding service quotas.
* </p>
*
* @throws {@link PricingServiceException}
* <p>Base exception class for all service exceptions from Pricing service.</p>
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ export interface GetAttributeValuesCommandOutput extends GetAttributeValuesRespo
* @throws {@link NotFoundException} (client fault)
* <p>The requested resource can't be found.</p>
*
* @throws {@link ThrottlingException} (client fault)
* <p>You've made too many requests exceeding service quotas.
* </p>
*
* @throws {@link PricingServiceException}
* <p>Base exception class for all service exceptions from Pricing service.</p>
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ export interface GetPriceListFileUrlCommandOutput extends GetPriceListFileUrlRes
* @throws {@link NotFoundException} (client fault)
* <p>The requested resource can't be found.</p>
*
* @throws {@link ThrottlingException} (client fault)
* <p>You've made too many requests exceeding service quotas.
* </p>
*
* @throws {@link PricingServiceException}
* <p>Base exception class for all service exceptions from Pricing service.</p>
*
Expand Down
4 changes: 4 additions & 0 deletions clients/client-pricing/src/commands/GetProductsCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ export interface GetProductsCommandOutput extends GetProductsResponse, __Metadat
* @throws {@link NotFoundException} (client fault)
* <p>The requested resource can't be found.</p>
*
* @throws {@link ThrottlingException} (client fault)
* <p>You've made too many requests exceeding service quotas.
* </p>
*
* @throws {@link PricingServiceException}
* <p>Base exception class for all service exceptions from Pricing service.</p>
*
Expand Down
4 changes: 4 additions & 0 deletions clients/client-pricing/src/commands/ListPriceListsCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ export interface ListPriceListsCommandOutput extends ListPriceListsResponse, __M
* @throws {@link NotFoundException} (client fault)
* <p>The requested resource can't be found.</p>
*
* @throws {@link ThrottlingException} (client fault)
* <p>You've made too many requests exceeding service quotas.
* </p>
*
* @throws {@link PricingServiceException}
* <p>Base exception class for all service exceptions from Pricing service.</p>
*
Expand Down
2 changes: 1 addition & 1 deletion clients/client-pricing/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* an <code>AmazonEC2</code> instance, with a <code>Provisioned IOPS</code>
* <code>volumeType</code>.</p>
* <p>For more information, see <a href="https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/price-changes.html">Using the
* Amazon Web Services Price List API</a> in the <i>Billing User
* Amazon Web Services Price List API</a> in the <i>Billing User
* Guide</i>.</p>
*
* @packageDocumentation
Expand Down
27 changes: 27 additions & 0 deletions clients/client-pricing/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ export class ExpiredNextTokenException extends __BaseException {
export class InternalErrorException extends __BaseException {
readonly name: "InternalErrorException" = "InternalErrorException";
readonly $fault: "server" = "server";
$retryable = {};
Message?: string;
/**
* @internal
Expand Down Expand Up @@ -227,6 +228,32 @@ export class NotFoundException extends __BaseException {
}
}

/**
* @public
* <p>You've made too many requests exceeding service quotas.
* </p>
*/
export class ThrottlingException extends __BaseException {
readonly name: "ThrottlingException" = "ThrottlingException";
readonly $fault: "client" = "client";
$retryable = {
throttling: true,
};
Message?: string;
/**
* @internal
*/
constructor(opts: __ExceptionOptionType<ThrottlingException, __BaseException>) {
super({
name: "ThrottlingException",
$fault: "client",
...opts,
});
Object.setPrototypeOf(this, ThrottlingException.prototype);
this.Message = opts.Message;
}
}

/**
* @public
*/
Expand Down
19 changes: 19 additions & 0 deletions clients/client-pricing/src/protocols/Aws_json1_1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import {
InvalidParameterException,
ListPriceListsRequest,
NotFoundException,
ThrottlingException,
} from "../models/models_0";
import { PricingServiceException as __BaseException } from "../models/PricingServiceException";

Expand Down Expand Up @@ -231,6 +232,9 @@ const de_CommandError = async (output: __HttpResponse, context: __SerdeContext):
case "NotFoundException":
case "com.amazonaws.pricing#NotFoundException":
throw await de_NotFoundExceptionRes(parsedOutput, context);
case "ThrottlingException":
case "com.amazonaws.pricing#ThrottlingException":
throw await de_ThrottlingExceptionRes(parsedOutput, context);
case "AccessDeniedException":
case "com.amazonaws.pricing#AccessDeniedException":
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
Expand Down Expand Up @@ -337,6 +341,19 @@ const de_NotFoundExceptionRes = async (parsedOutput: any, context: __SerdeContex
return __decorateServiceException(exception, body);
};

/**
* deserializeAws_json1_1ThrottlingExceptionRes
*/
const de_ThrottlingExceptionRes = async (parsedOutput: any, context: __SerdeContext): Promise<ThrottlingException> => {
const body = parsedOutput.body;
const deserialized: any = _json(body);
const exception = new ThrottlingException({
$metadata: deserializeMetadata(parsedOutput),
...deserialized,
});
return __decorateServiceException(exception, body);
};

// se_DescribeServicesRequest omitted.

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

// de_ServiceList omitted.

// de_ThrottlingException omitted.

const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({
httpStatusCode: output.statusCode,
requestId:
Expand Down
38 changes: 35 additions & 3 deletions codegen/sdk-codegen/aws-models/pricing.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"name": "pricing"
},
"aws.protocols#awsJson1_1": {},
"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>",
"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>",
"smithy.api#title": "AWS Price List Service",
"smithy.rules#endpointRuleSet": {
"version": "1.0",
Expand Down Expand Up @@ -781,6 +781,9 @@
},
{
"target": "com.amazonaws.pricing#NotFoundException"
},
{
"target": "com.amazonaws.pricing#ThrottlingException"
}
],
"traits": {
Expand Down Expand Up @@ -952,6 +955,9 @@
},
{
"target": "com.amazonaws.pricing#NotFoundException"
},
{
"target": "com.amazonaws.pricing#ThrottlingException"
}
],
"traits": {
Expand Down Expand Up @@ -1039,6 +1045,9 @@
},
{
"target": "com.amazonaws.pricing#NotFoundException"
},
{
"target": "com.amazonaws.pricing#ThrottlingException"
}
],
"traits": {
Expand Down Expand Up @@ -1104,6 +1113,9 @@
},
{
"target": "com.amazonaws.pricing#NotFoundException"
},
{
"target": "com.amazonaws.pricing#ThrottlingException"
}
],
"traits": {
Expand Down Expand Up @@ -1192,7 +1204,8 @@
"traits": {
"smithy.api#documentation": "<p>An error on the server occurred during the processing of your request. Try again later.</p>",
"smithy.api#error": "server",
"smithy.api#httpError": 500
"smithy.api#httpError": 500,
"smithy.api#retryable": {}
}
},
"com.amazonaws.pricing#InvalidNextTokenException": {
Expand Down Expand Up @@ -1247,6 +1260,9 @@
},
{
"target": "com.amazonaws.pricing#NotFoundException"
},
{
"target": "com.amazonaws.pricing#ThrottlingException"
}
],
"traits": {
Expand Down Expand Up @@ -1389,7 +1405,7 @@
"min": 18,
"max": 2048
},
"smithy.api#pattern": "^arn:[A-Za-z0-9][-.A-Za-z0-9]{0,62}:pricing:::price-list/[A-Za-z0-9_/.-]{1,1023}$"
"smithy.api#pattern": "^arn:[A-Za-z0-9][-.A-Za-z0-9]{0,62}:pricing:::price-list/[A-Za-z0-9+_/.-]{1,1023}$"
}
},
"com.amazonaws.pricing#PriceListJsonItems": {
Expand Down Expand Up @@ -1458,6 +1474,22 @@
"smithy.api#mediaType": "application/json"
}
},
"com.amazonaws.pricing#ThrottlingException": {
"type": "structure",
"members": {
"Message": {
"target": "com.amazonaws.pricing#errorMessage"
}
},
"traits": {
"smithy.api#documentation": "<p>You've made too many requests exceeding service quotas.\n </p>",
"smithy.api#error": "client",
"smithy.api#httpError": 429,
"smithy.api#retryable": {
"throttling": true
}
}
},
"com.amazonaws.pricing#errorMessage": {
"type": "string"
}
Expand Down

0 comments on commit 022ccd4

Please sign in to comment.