Skip to content

Commit e3e7974

Browse files
author
awstools
committed
feat(client-budgets): Added BillingViewHealthStatus Exception which is thrown when a Budget is created or updated with a Billing View that is not in the HEALTHY status
1 parent 442403c commit e3e7974

File tree

5 files changed

+79
-0
lines changed

5 files changed

+79
-0
lines changed

clients/client-budgets/src/commands/CreateBudgetCommand.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,11 @@ export interface CreateBudgetCommandOutput extends CreateBudgetResponse, __Metad
222222
* @throws {@link AccessDeniedException} (client fault)
223223
* <p>You are not authorized to use this operation with the given parameters.</p>
224224
*
225+
* @throws {@link BillingViewHealthStatusException} (client fault)
226+
* <p>
227+
* The billing view status must be HEALTHY to perform this action. Try again when the status is HEALTHY.
228+
* </p>
229+
*
225230
* @throws {@link CreationLimitExceededException} (client fault)
226231
* <p>You've exceeded the notification or subscriber limit.</p>
227232
*

clients/client-budgets/src/commands/UpdateBudgetCommand.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,11 @@ export interface UpdateBudgetCommandOutput extends UpdateBudgetResponse, __Metad
199199
* @throws {@link AccessDeniedException} (client fault)
200200
* <p>You are not authorized to use this operation with the given parameters.</p>
201201
*
202+
* @throws {@link BillingViewHealthStatusException} (client fault)
203+
* <p>
204+
* The billing view status must be HEALTHY to perform this action. Try again when the status is HEALTHY.
205+
* </p>
206+
*
202207
* @throws {@link InternalErrorException} (server fault)
203208
* <p>An error on the server occurred during the processing of your request. Try again later.</p>
204209
*

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

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,34 @@ export interface AutoAdjustData {
508508
LastAutoAdjustTime?: Date | undefined;
509509
}
510510

511+
/**
512+
* <p>
513+
* The billing view status must be HEALTHY to perform this action. Try again when the status is HEALTHY.
514+
* </p>
515+
* @public
516+
*/
517+
export class BillingViewHealthStatusException extends __BaseException {
518+
readonly name: "BillingViewHealthStatusException" = "BillingViewHealthStatusException";
519+
readonly $fault: "client" = "client";
520+
/**
521+
* <p>The error message the exception carries.</p>
522+
* @public
523+
*/
524+
Message?: string | undefined;
525+
/**
526+
* @internal
527+
*/
528+
constructor(opts: __ExceptionOptionType<BillingViewHealthStatusException, __BaseException>) {
529+
super({
530+
name: "BillingViewHealthStatusException",
531+
$fault: "client",
532+
...opts,
533+
});
534+
Object.setPrototypeOf(this, BillingViewHealthStatusException.prototype);
535+
this.Message = opts.Message;
536+
}
537+
}
538+
511539
/**
512540
* <p>The amount of cost or usage that's measured for a budget.</p>
513541
* <p>

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

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ import {
8585
ActionHistoryDetails,
8686
ActionThreshold,
8787
AutoAdjustData,
88+
BillingViewHealthStatusException,
8889
Budget,
8990
BudgetedAndActualAmounts,
9091
BudgetNotificationsForAccount,
@@ -1029,6 +1030,9 @@ const de_CommandError = async (output: __HttpResponse, context: __SerdeContext):
10291030
case "AccessDeniedException":
10301031
case "com.amazonaws.budgets#AccessDeniedException":
10311032
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1033+
case "BillingViewHealthStatusException":
1034+
case "com.amazonaws.budgets#BillingViewHealthStatusException":
1035+
throw await de_BillingViewHealthStatusExceptionRes(parsedOutput, context);
10321036
case "CreationLimitExceededException":
10331037
case "com.amazonaws.budgets#CreationLimitExceededException":
10341038
throw await de_CreationLimitExceededExceptionRes(parsedOutput, context);
@@ -1085,6 +1089,22 @@ const de_AccessDeniedExceptionRes = async (
10851089
return __decorateServiceException(exception, body);
10861090
};
10871091

1092+
/**
1093+
* deserializeAws_json1_1BillingViewHealthStatusExceptionRes
1094+
*/
1095+
const de_BillingViewHealthStatusExceptionRes = async (
1096+
parsedOutput: any,
1097+
context: __SerdeContext
1098+
): Promise<BillingViewHealthStatusException> => {
1099+
const body = parsedOutput.body;
1100+
const deserialized: any = _json(body);
1101+
const exception = new BillingViewHealthStatusException({
1102+
$metadata: deserializeMetadata(parsedOutput),
1103+
...deserialized,
1104+
});
1105+
return __decorateServiceException(exception, body);
1106+
};
1107+
10881108
/**
10891109
* deserializeAws_json1_1CreationLimitExceededExceptionRes
10901110
*/
@@ -1708,6 +1728,8 @@ const de_AutoAdjustData = (output: any, context: __SerdeContext): AutoAdjustData
17081728
}) as any;
17091729
};
17101730

1731+
// de_BillingViewHealthStatusException omitted.
1732+
17111733
/**
17121734
* deserializeAws_json1_1Budget
17131735
*/

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1610,6 +1610,19 @@
16101610
"smithy.api#pattern": "^arn:aws[a-z-]*:(billing)::[0-9]{12}:billingview/[a-zA-Z0-9/:_\\+=\\.\\-@]{0,75}[a-zA-Z0-9]$"
16111611
}
16121612
},
1613+
"com.amazonaws.budgets#BillingViewHealthStatusException": {
1614+
"type": "structure",
1615+
"members": {
1616+
"Message": {
1617+
"target": "com.amazonaws.budgets#errorMessage"
1618+
}
1619+
},
1620+
"traits": {
1621+
"smithy.api#documentation": "<p>\n The billing view status must be HEALTHY to perform this action. Try again when the status is HEALTHY.\n </p>",
1622+
"smithy.api#error": "client",
1623+
"smithy.api#httpError": 400
1624+
}
1625+
},
16131626
"com.amazonaws.budgets#Budget": {
16141627
"type": "structure",
16151628
"members": {
@@ -2056,6 +2069,9 @@
20562069
{
20572070
"target": "com.amazonaws.budgets#AccessDeniedException"
20582071
},
2072+
{
2073+
"target": "com.amazonaws.budgets#BillingViewHealthStatusException"
2074+
},
20592075
{
20602076
"target": "com.amazonaws.budgets#CreationLimitExceededException"
20612077
},
@@ -5289,6 +5305,9 @@
52895305
{
52905306
"target": "com.amazonaws.budgets#AccessDeniedException"
52915307
},
5308+
{
5309+
"target": "com.amazonaws.budgets#BillingViewHealthStatusException"
5310+
},
52925311
{
52935312
"target": "com.amazonaws.budgets#InternalErrorException"
52945313
},

0 commit comments

Comments
 (0)