Skip to content

Commit 8d88136

Browse files
author
awstools
committed
feat(client-budgets): Add support for custom time periods in budget configuration
1 parent bac6c46 commit 8d88136

File tree

7 files changed

+33
-15
lines changed

7 files changed

+33
-15
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export interface CreateBudgetCommandOutput extends CreateBudgetResponse, __Metad
7979
* IncludeDiscount: true || false,
8080
* UseAmortized: true || false,
8181
* },
82-
* TimeUnit: "DAILY" || "MONTHLY" || "QUARTERLY" || "ANNUALLY", // required
82+
* TimeUnit: "DAILY" || "MONTHLY" || "QUARTERLY" || "ANNUALLY" || "CUSTOM", // required
8383
* TimePeriod: { // TimePeriod
8484
* Start: new Date("TIMESTAMP"),
8585
* End: new Date("TIMESTAMP"),
@@ -177,7 +177,7 @@ export interface CreateBudgetCommandOutput extends CreateBudgetResponse, __Metad
177177
* BillingViewArn: "STRING_VALUE",
178178
* HealthStatus: { // HealthStatus
179179
* Status: "HEALTHY" || "UNHEALTHY",
180-
* StatusReason: "BILLING_VIEW_NO_ACCESS" || "BILLING_VIEW_UNHEALTHY" || "FILTER_INVALID",
180+
* StatusReason: "BILLING_VIEW_NO_ACCESS" || "BILLING_VIEW_UNHEALTHY" || "FILTER_INVALID" || "MULTI_YEAR_HISTORICAL_DATA_DISABLED",
181181
* LastUpdatedTime: new Date("TIMESTAMP"),
182182
* },
183183
* },

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export interface DescribeBudgetCommandOutput extends DescribeBudgetResponse, __M
7777
* // IncludeDiscount: true || false,
7878
* // UseAmortized: true || false,
7979
* // },
80-
* // TimeUnit: "DAILY" || "MONTHLY" || "QUARTERLY" || "ANNUALLY", // required
80+
* // TimeUnit: "DAILY" || "MONTHLY" || "QUARTERLY" || "ANNUALLY" || "CUSTOM", // required
8181
* // TimePeriod: { // TimePeriod
8282
* // Start: new Date("TIMESTAMP"),
8383
* // End: new Date("TIMESTAMP"),
@@ -175,7 +175,7 @@ export interface DescribeBudgetCommandOutput extends DescribeBudgetResponse, __M
175175
* // BillingViewArn: "STRING_VALUE",
176176
* // HealthStatus: { // HealthStatus
177177
* // Status: "HEALTHY" || "UNHEALTHY",
178-
* // StatusReason: "BILLING_VIEW_NO_ACCESS" || "BILLING_VIEW_UNHEALTHY" || "FILTER_INVALID",
178+
* // StatusReason: "BILLING_VIEW_NO_ACCESS" || "BILLING_VIEW_UNHEALTHY" || "FILTER_INVALID" || "MULTI_YEAR_HISTORICAL_DATA_DISABLED",
179179
* // LastUpdatedTime: new Date("TIMESTAMP"),
180180
* // },
181181
* // },

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export interface DescribeBudgetPerformanceHistoryCommandOutput
7474
* // IncludeDiscount: true || false,
7575
* // UseAmortized: true || false,
7676
* // },
77-
* // TimeUnit: "DAILY" || "MONTHLY" || "QUARTERLY" || "ANNUALLY",
77+
* // TimeUnit: "DAILY" || "MONTHLY" || "QUARTERLY" || "ANNUALLY" || "CUSTOM",
7878
* // BillingViewArn: "STRING_VALUE",
7979
* // BudgetedAndActualAmountsList: [ // BudgetedAndActualAmountsList
8080
* // { // BudgetedAndActualAmounts

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export interface DescribeBudgetsCommandOutput extends DescribeBudgetsResponse, _
7979
* // IncludeDiscount: true || false,
8080
* // UseAmortized: true || false,
8181
* // },
82-
* // TimeUnit: "DAILY" || "MONTHLY" || "QUARTERLY" || "ANNUALLY", // required
82+
* // TimeUnit: "DAILY" || "MONTHLY" || "QUARTERLY" || "ANNUALLY" || "CUSTOM", // required
8383
* // TimePeriod: { // TimePeriod
8484
* // Start: new Date("TIMESTAMP"),
8585
* // End: new Date("TIMESTAMP"),
@@ -177,7 +177,7 @@ export interface DescribeBudgetsCommandOutput extends DescribeBudgetsResponse, _
177177
* // BillingViewArn: "STRING_VALUE",
178178
* // HealthStatus: { // HealthStatus
179179
* // Status: "HEALTHY" || "UNHEALTHY",
180-
* // StatusReason: "BILLING_VIEW_NO_ACCESS" || "BILLING_VIEW_UNHEALTHY" || "FILTER_INVALID",
180+
* // StatusReason: "BILLING_VIEW_NO_ACCESS" || "BILLING_VIEW_UNHEALTHY" || "FILTER_INVALID" || "MULTI_YEAR_HISTORICAL_DATA_DISABLED",
181181
* // LastUpdatedTime: new Date("TIMESTAMP"),
182182
* // },
183183
* // },

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export interface UpdateBudgetCommandOutput extends UpdateBudgetResponse, __Metad
7979
* IncludeDiscount: true || false,
8080
* UseAmortized: true || false,
8181
* },
82-
* TimeUnit: "DAILY" || "MONTHLY" || "QUARTERLY" || "ANNUALLY", // required
82+
* TimeUnit: "DAILY" || "MONTHLY" || "QUARTERLY" || "ANNUALLY" || "CUSTOM", // required
8383
* TimePeriod: { // TimePeriod
8484
* Start: new Date("TIMESTAMP"),
8585
* End: new Date("TIMESTAMP"),
@@ -177,7 +177,7 @@ export interface UpdateBudgetCommandOutput extends UpdateBudgetResponse, __Metad
177177
* BillingViewArn: "STRING_VALUE",
178178
* HealthStatus: { // HealthStatus
179179
* Status: "HEALTHY" || "UNHEALTHY",
180-
* StatusReason: "BILLING_VIEW_NO_ACCESS" || "BILLING_VIEW_UNHEALTHY" || "FILTER_INVALID",
180+
* StatusReason: "BILLING_VIEW_NO_ACCESS" || "BILLING_VIEW_UNHEALTHY" || "FILTER_INVALID" || "MULTI_YEAR_HISTORICAL_DATA_DISABLED",
181181
* LastUpdatedTime: new Date("TIMESTAMP"),
182182
* },
183183
* },

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -846,6 +846,7 @@ export const HealthStatusReason = {
846846
BILLING_VIEW_NO_ACCESS: "BILLING_VIEW_NO_ACCESS",
847847
BILLING_VIEW_UNHEALTHY: "BILLING_VIEW_UNHEALTHY",
848848
FILTER_INVALID: "FILTER_INVALID",
849+
MULTI_YEAR_HISTORICAL_DATA_DISABLED: "MULTI_YEAR_HISTORICAL_DATA_DISABLED",
849850
} as const;
850851

851852
/**
@@ -883,6 +884,10 @@ export interface HealthStatus {
883884
* <code>FILTER_INVALID</code>: The filter contains reference to an account you
884885
* do not have access to.</p>
885886
* </li>
887+
* <li>
888+
* <p>
889+
* <code>MULTI_YEAR_HISTORICAL_DATA_DISABLED</code>: The budget is not being updated. Enable multi-year historical data in your Cost Management preferences.</p>
890+
* </li>
886891
* </ul>
887892
* @public
888893
*/
@@ -925,7 +930,7 @@ export interface TimePeriod {
925930
/**
926931
* <p>The start date for a budget. If you created your budget and didn't specify a start
927932
* date, Amazon Web Services defaults to the start of your chosen time period (DAILY,
928-
* MONTHLY, QUARTERLY, or ANNUALLY). For example, if you created your budget on January 24,
933+
* MONTHLY, QUARTERLY, ANNUALLY, or CUSTOM). For example, if you created your budget on January 24,
929934
* 2018, chose <code>DAILY</code>, and didn't set a start date, Amazon Web Services set your
930935
* start date to <code>01/24/18 00:00 UTC</code>. If you chose <code>MONTHLY</code>,
931936
* Amazon Web Services set your start date to <code>01/01/18 00:00 UTC</code>. The
@@ -953,6 +958,7 @@ export interface TimePeriod {
953958
*/
954959
export const TimeUnit = {
955960
ANNUALLY: "ANNUALLY",
961+
CUSTOM: "CUSTOM",
956962
DAILY: "DAILY",
957963
MONTHLY: "MONTHLY",
958964
QUARTERLY: "QUARTERLY",
@@ -2747,7 +2753,7 @@ export interface Budget {
27472753
* start date must come before the end date. The end date must come before <code>06/15/87
27482754
* 00:00 UTC</code>. </p>
27492755
* <p>If you create your budget and don't specify a start date, Amazon Web Services defaults
2750-
* to the start of your chosen time period (DAILY, MONTHLY, QUARTERLY, or ANNUALLY). For
2756+
* to the start of your chosen time period (DAILY, MONTHLY, QUARTERLY, ANNUALLY, or CUSTOM). For
27512757
* example, if you created your budget on January 24, 2018, chose <code>DAILY</code>, and
27522758
* didn't set a start date, Amazon Web Services set your start date to <code>01/24/18 00:00
27532759
* UTC</code>. If you chose <code>MONTHLY</code>, Amazon Web Services set your start

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

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1607,7 +1607,7 @@
16071607
"min": 20,
16081608
"max": 2048
16091609
},
1610-
"smithy.api#pattern": "^arn:aws[a-z-]*:(billing)::[0-9]{12}:billingview/[a-zA-Z0-9/:_+=.\\-@]{0,75}[a-zA-Z0-9]$"
1610+
"smithy.api#pattern": "^arn:aws[a-z-]*:(billing)::[0-9]{12}:billingview/[a-zA-Z0-9/:_\\+=\\.\\-@]{0,75}[a-zA-Z0-9]$"
16111611
}
16121612
},
16131613
"com.amazonaws.budgets#Budget": {
@@ -1662,7 +1662,7 @@
16621662
"TimePeriod": {
16631663
"target": "com.amazonaws.budgets#TimePeriod",
16641664
"traits": {
1665-
"smithy.api#documentation": "<p>The period of time that's covered by a budget. You set the start date and end date. The\n\t\t\tstart date must come before the end date. The end date must come before <code>06/15/87\n\t\t\t\t00:00 UTC</code>. </p>\n <p>If you create your budget and don't specify a start date, Amazon Web Services defaults\n\t\t\tto the start of your chosen time period (DAILY, MONTHLY, QUARTERLY, or ANNUALLY). For\n\t\t\texample, if you created your budget on January 24, 2018, chose <code>DAILY</code>, and\n\t\t\tdidn't set a start date, Amazon Web Services set your start date to <code>01/24/18 00:00\n\t\t\t\tUTC</code>. If you chose <code>MONTHLY</code>, Amazon Web Services set your start\n\t\t\tdate to <code>01/01/18 00:00 UTC</code>. If you didn't specify an end date, Amazon Web Services set your end date to <code>06/15/87 00:00 UTC</code>. The defaults are\n\t\t\tthe same for the Billing and Cost Management console and the API. </p>\n <p>You can change either date with the <code>UpdateBudget</code> operation.</p>\n <p>After the end date, Amazon Web Services deletes the budget and all the associated\n\t\t\tnotifications and subscribers.</p>"
1665+
"smithy.api#documentation": "<p>The period of time that's covered by a budget. You set the start date and end date. The\n\t\t\tstart date must come before the end date. The end date must come before <code>06/15/87\n\t\t\t\t00:00 UTC</code>. </p>\n <p>If you create your budget and don't specify a start date, Amazon Web Services defaults\n\t\t\tto the start of your chosen time period (DAILY, MONTHLY, QUARTERLY, ANNUALLY, or CUSTOM). For\n\t\t\texample, if you created your budget on January 24, 2018, chose <code>DAILY</code>, and\n\t\t\tdidn't set a start date, Amazon Web Services set your start date to <code>01/24/18 00:00\n\t\t\t\tUTC</code>. If you chose <code>MONTHLY</code>, Amazon Web Services set your start\n\t\t\tdate to <code>01/01/18 00:00 UTC</code>. If you didn't specify an end date, Amazon Web Services set your end date to <code>06/15/87 00:00 UTC</code>. The defaults are\n\t\t\tthe same for the Billing and Cost Management console and the API. </p>\n <p>You can change either date with the <code>UpdateBudget</code> operation.</p>\n <p>After the end date, Amazon Web Services deletes the budget and all the associated\n\t\t\tnotifications and subscribers.</p>"
16661666
}
16671667
},
16681668
"CalculatedSpend": {
@@ -4154,7 +4154,7 @@
41544154
"StatusReason": {
41554155
"target": "com.amazonaws.budgets#HealthStatusReason",
41564156
"traits": {
4157-
"smithy.api#documentation": "<p>The reason for the current status.</p>\n <ul>\n <li>\n <p>\n <code>BILLING_VIEW_NO_ACCESS</code>: The billing view resource does not grant\n\t\t\t\t\t\t<code>billing:GetBillingViewData</code> permission to this account.</p>\n </li>\n <li>\n <p>\n <code>BILLING_VIEW_UNHEALTHY</code>: The billing view associated with the\n\t\t\t\t\tbudget is unhealthy.</p>\n </li>\n <li>\n <p>\n <code>FILTER_INVALID</code>: The filter contains reference to an account you\n\t\t\t\t\tdo not have access to.</p>\n </li>\n </ul>"
4157+
"smithy.api#documentation": "<p>The reason for the current status.</p>\n <ul>\n <li>\n <p>\n <code>BILLING_VIEW_NO_ACCESS</code>: The billing view resource does not grant\n\t\t\t\t\t\t<code>billing:GetBillingViewData</code> permission to this account.</p>\n </li>\n <li>\n <p>\n <code>BILLING_VIEW_UNHEALTHY</code>: The billing view associated with the\n\t\t\t\t\tbudget is unhealthy.</p>\n </li>\n <li>\n <p>\n <code>FILTER_INVALID</code>: The filter contains reference to an account you\n\t\t\t\t\tdo not have access to.</p>\n </li>\n <li>\n <p>\n <code>MULTI_YEAR_HISTORICAL_DATA_DISABLED</code>: The budget is not being updated. Enable multi-year historical data in your Cost Management preferences.</p>\n </li>\n </ul>"
41584158
}
41594159
},
41604160
"LastUpdatedTime": {
@@ -4185,6 +4185,12 @@
41854185
"traits": {
41864186
"smithy.api#enumValue": "FILTER_INVALID"
41874187
}
4188+
},
4189+
"MULTI_YEAR_HISTORICAL_DATA_DISABLED": {
4190+
"target": "smithy.api#Unit",
4191+
"traits": {
4192+
"smithy.api#enumValue": "MULTI_YEAR_HISTORICAL_DATA_DISABLED"
4193+
}
41884194
}
41894195
}
41904196
},
@@ -5150,7 +5156,7 @@
51505156
"Start": {
51515157
"target": "com.amazonaws.budgets#GenericTimestamp",
51525158
"traits": {
5153-
"smithy.api#documentation": "<p>The start date for a budget. If you created your budget and didn't specify a start\n\t\t\tdate, Amazon Web Services defaults to the start of your chosen time period (DAILY,\n\t\t\tMONTHLY, QUARTERLY, or ANNUALLY). For example, if you created your budget on January 24,\n\t\t\t2018, chose <code>DAILY</code>, and didn't set a start date, Amazon Web Services set your\n\t\t\tstart date to <code>01/24/18 00:00 UTC</code>. If you chose <code>MONTHLY</code>,\n\t\t\t\tAmazon Web Services set your start date to <code>01/01/18 00:00 UTC</code>. The\n\t\t\tdefaults are the same for the Billing and Cost Management console and the API.</p>\n <p>You can change your start date with the <code>UpdateBudget</code> operation.</p>"
5159+
"smithy.api#documentation": "<p>The start date for a budget. If you created your budget and didn't specify a start\n\t\t\tdate, Amazon Web Services defaults to the start of your chosen time period (DAILY,\n\t\t\tMONTHLY, QUARTERLY, ANNUALLY, or CUSTOM). For example, if you created your budget on January 24,\n\t\t\t2018, chose <code>DAILY</code>, and didn't set a start date, Amazon Web Services set your\n\t\t\tstart date to <code>01/24/18 00:00 UTC</code>. If you chose <code>MONTHLY</code>,\n\t\t\t\tAmazon Web Services set your start date to <code>01/01/18 00:00 UTC</code>. The\n\t\t\tdefaults are the same for the Billing and Cost Management console and the API.</p>\n <p>You can change your start date with the <code>UpdateBudget</code> operation.</p>"
51545160
}
51555161
},
51565162
"End": {
@@ -5190,6 +5196,12 @@
51905196
"traits": {
51915197
"smithy.api#enumValue": "ANNUALLY"
51925198
}
5199+
},
5200+
"CUSTOM": {
5201+
"target": "smithy.api#Unit",
5202+
"traits": {
5203+
"smithy.api#enumValue": "CUSTOM"
5204+
}
51935205
}
51945206
},
51955207
"traits": {

0 commit comments

Comments
 (0)