Skip to content

Commit d301626

Browse files
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 866e868 commit d301626

13 files changed

+308
-0
lines changed

generator/ServiceModels/budgets/budgets-2016-10-20.api.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"output":{"shape":"CreateBudgetResponse"},
2626
"errors":[
2727
{"shape":"InvalidParameterException"},
28+
{"shape":"BillingViewHealthStatusException"},
2829
{"shape":"InternalErrorException"},
2930
{"shape":"CreationLimitExceededException"},
3031
{"shape":"DuplicateRecordException"},
@@ -403,6 +404,7 @@
403404
"errors":[
404405
{"shape":"InternalErrorException"},
405406
{"shape":"InvalidParameterException"},
407+
{"shape":"BillingViewHealthStatusException"},
406408
{"shape":"NotFoundException"},
407409
{"shape":"AccessDeniedException"},
408410
{"shape":"ThrottlingException"}
@@ -626,6 +628,13 @@
626628
"min":20,
627629
"pattern":"^arn:aws[a-z-]*:(billing)::[0-9]{12}:billingview/[a-zA-Z0-9/:_\\+=\\.\\-@]{0,75}[a-zA-Z0-9]$"
628630
},
631+
"BillingViewHealthStatusException":{
632+
"type":"structure",
633+
"members":{
634+
"Message":{"shape":"errorMessage"}
635+
},
636+
"exception":true
637+
},
629638
"Budget":{
630639
"type":"structure",
631640
"required":[

generator/ServiceModels/budgets/budgets-2016-10-20.docs.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,10 @@
186186
"BudgetPerformanceHistory$BillingViewArn": "<p>The Amazon Resource Name (ARN) that uniquely identifies a specific billing view. The ARN is used to specify which particular billing view you want to interact with or retrieve information from when making API calls related to Amazon Web Services Billing and Cost Management features. The BillingViewArn can be retrieved by calling the ListBillingViews API.</p>"
187187
}
188188
},
189+
"BillingViewHealthStatusException": {
190+
"base": "<p> The billing view status must be HEALTHY to perform this action. Try again when the status is HEALTHY. </p>",
191+
"refs": {}
192+
},
189193
"Budget": {
190194
"base": "<p>Represents the output of the <code>CreateBudget</code> operation. The content consists of the detailed metadata and data file information, and the current status of the <code>budget</code> object.</p> <p>This is the Amazon Resource Name (ARN) pattern for a budget: </p> <p> <code>arn:aws:budgets::AccountId:budget/budgetName</code> </p>",
191195
"refs": {
@@ -1051,6 +1055,7 @@
10511055
"base": "<p>The error message the exception carries.</p>",
10521056
"refs": {
10531057
"AccessDeniedException$Message": null,
1058+
"BillingViewHealthStatusException$Message": null,
10541059
"CreationLimitExceededException$Message": null,
10551060
"DuplicateRecordException$Message": null,
10561061
"ExpiredNextTokenException$Message": null,

generator/ServiceModels/budgets/budgets-2016-10-20.normal.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"output":{"shape":"CreateBudgetResponse"},
2626
"errors":[
2727
{"shape":"InvalidParameterException"},
28+
{"shape":"BillingViewHealthStatusException"},
2829
{"shape":"InternalErrorException"},
2930
{"shape":"CreationLimitExceededException"},
3031
{"shape":"DuplicateRecordException"},
@@ -425,6 +426,7 @@
425426
"errors":[
426427
{"shape":"InternalErrorException"},
427428
{"shape":"InvalidParameterException"},
429+
{"shape":"BillingViewHealthStatusException"},
428430
{"shape":"NotFoundException"},
429431
{"shape":"AccessDeniedException"},
430432
{"shape":"ThrottlingException"}
@@ -701,6 +703,14 @@
701703
"min":20,
702704
"pattern":"^arn:aws[a-z-]*:(billing)::[0-9]{12}:billingview/[a-zA-Z0-9/:_\\+=\\.\\-@]{0,75}[a-zA-Z0-9]$"
703705
},
706+
"BillingViewHealthStatusException":{
707+
"type":"structure",
708+
"members":{
709+
"Message":{"shape":"errorMessage"}
710+
},
711+
"documentation":"<p> The billing view status must be HEALTHY to perform this action. Try again when the status is HEALTHY. </p>",
712+
"exception":true
713+
},
704714
"Budget":{
705715
"type":"structure",
706716
"required":[
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
/*
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License").
5+
* You may not use this file except in compliance with the License.
6+
* A copy of the License is located at
7+
*
8+
* http://aws.amazon.com/apache2.0
9+
*
10+
* or in the "license" file accompanying this file. This file is distributed
11+
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12+
* express or implied. See the License for the specific language governing
13+
* permissions and limitations under the License.
14+
*/
15+
16+
/*
17+
* Do not modify this file. This file is generated from the budgets-2016-10-20.normal.json service model.
18+
*/
19+
using System;
20+
using System.Collections.Generic;
21+
using System.Xml.Serialization;
22+
using System.Text;
23+
using System.IO;
24+
using System.Net;
25+
26+
using Amazon.Runtime;
27+
using Amazon.Runtime.Internal;
28+
29+
#pragma warning disable CS0612,CS0618,CS1570
30+
namespace Amazon.Budgets.Model
31+
{
32+
/// <summary>
33+
/// The billing view status must be HEALTHY to perform this action. Try again when the
34+
/// status is HEALTHY.
35+
/// </summary>
36+
#if !NETSTANDARD
37+
[Serializable]
38+
#endif
39+
public partial class BillingViewHealthStatusException : AmazonBudgetsException
40+
{
41+
42+
/// <summary>
43+
/// Constructs a new BillingViewHealthStatusException with the specified error
44+
/// message.
45+
/// </summary>
46+
/// <param name="message">
47+
/// Describes the error encountered.
48+
/// </param>
49+
public BillingViewHealthStatusException(string message)
50+
: base(message) {}
51+
52+
/// <summary>
53+
/// Construct instance of BillingViewHealthStatusException
54+
/// </summary>
55+
/// <param name="message"></param>
56+
/// <param name="innerException"></param>
57+
public BillingViewHealthStatusException(string message, Exception innerException)
58+
: base(message, innerException) {}
59+
60+
/// <summary>
61+
/// Construct instance of BillingViewHealthStatusException
62+
/// </summary>
63+
/// <param name="innerException"></param>
64+
public BillingViewHealthStatusException(Exception innerException)
65+
: base(innerException) {}
66+
67+
/// <summary>
68+
/// Construct instance of BillingViewHealthStatusException
69+
/// </summary>
70+
/// <param name="message"></param>
71+
/// <param name="innerException"></param>
72+
/// <param name="errorType"></param>
73+
/// <param name="errorCode"></param>
74+
/// <param name="requestId"></param>
75+
/// <param name="statusCode"></param>
76+
public BillingViewHealthStatusException(string message, Exception innerException, Amazon.Runtime.ErrorType errorType, string errorCode, string requestId, HttpStatusCode statusCode)
77+
: base(message, innerException, errorType, errorCode, requestId, statusCode) {}
78+
79+
/// <summary>
80+
/// Construct instance of BillingViewHealthStatusException
81+
/// </summary>
82+
/// <param name="message"></param>
83+
/// <param name="errorType"></param>
84+
/// <param name="errorCode"></param>
85+
/// <param name="requestId"></param>
86+
/// <param name="statusCode"></param>
87+
public BillingViewHealthStatusException(string message, Amazon.Runtime.ErrorType errorType, string errorCode, string requestId, HttpStatusCode statusCode)
88+
: base(message, errorType, errorCode, requestId, statusCode) {}
89+
90+
91+
#if !NETSTANDARD
92+
/// <summary>
93+
/// Constructs a new instance of the BillingViewHealthStatusException class with serialized data.
94+
/// </summary>
95+
/// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo" /> that holds the serialized object data about the exception being thrown.</param>
96+
/// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext" /> that contains contextual information about the source or destination.</param>
97+
/// <exception cref="T:System.ArgumentNullException">The <paramref name="info" /> parameter is null. </exception>
98+
/// <exception cref="T:System.Runtime.Serialization.SerializationException">The class name is null or <see cref="P:System.Exception.HResult" /> is zero (0). </exception>
99+
protected BillingViewHealthStatusException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
100+
: base(info, context)
101+
{
102+
}
103+
104+
/// <summary>
105+
/// Sets the <see cref="T:System.Runtime.Serialization.SerializationInfo" /> with information about the exception.
106+
/// </summary>
107+
/// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo" /> that holds the serialized object data about the exception being thrown.</param>
108+
/// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext" /> that contains contextual information about the source or destination.</param>
109+
/// <exception cref="T:System.ArgumentNullException">The <paramref name="info" /> parameter is a null reference (Nothing in Visual Basic). </exception>
110+
#if BCL35
111+
[System.Security.Permissions.SecurityPermission(
112+
System.Security.Permissions.SecurityAction.LinkDemand,
113+
Flags = System.Security.Permissions.SecurityPermissionFlag.SerializationFormatter)]
114+
#endif
115+
[System.Security.SecurityCritical]
116+
// These FxCop rules are giving false-positives for this method
117+
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")]
118+
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2134:MethodsMustOverrideWithConsistentTransparencyFxCopRule")]
119+
public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
120+
{
121+
base.GetObjectData(info, context);
122+
}
123+
#endif
124+
125+
}
126+
}
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
/*
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License").
5+
* You may not use this file except in compliance with the License.
6+
* A copy of the License is located at
7+
*
8+
* http://aws.amazon.com/apache2.0
9+
*
10+
* or in the "license" file accompanying this file. This file is distributed
11+
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12+
* express or implied. See the License for the specific language governing
13+
* permissions and limitations under the License.
14+
*/
15+
16+
/*
17+
* Do not modify this file. This file is generated from the budgets-2016-10-20.normal.json service model.
18+
*/
19+
using System;
20+
using System.Collections.Generic;
21+
using System.Globalization;
22+
using System.IO;
23+
using System.Net;
24+
using System.Text;
25+
using System.Xml.Serialization;
26+
27+
using Amazon.Budgets.Model;
28+
using Amazon.Runtime;
29+
using Amazon.Runtime.Internal;
30+
using Amazon.Runtime.Internal.Transform;
31+
using Amazon.Runtime.Internal.Util;
32+
using ThirdParty.Json.LitJson;
33+
34+
#pragma warning disable CS0612,CS0618
35+
namespace Amazon.Budgets.Model.Internal.MarshallTransformations
36+
{
37+
/// <summary>
38+
/// Response Unmarshaller for BillingViewHealthStatusException Object
39+
/// </summary>
40+
public class BillingViewHealthStatusExceptionUnmarshaller : IErrorResponseUnmarshaller<BillingViewHealthStatusException, JsonUnmarshallerContext>
41+
{
42+
/// <summary>
43+
/// Unmarshaller the response from the service to the response class.
44+
/// </summary>
45+
/// <param name="context"></param>
46+
/// <returns></returns>
47+
public BillingViewHealthStatusException Unmarshall(JsonUnmarshallerContext context)
48+
{
49+
return this.Unmarshall(context, new Amazon.Runtime.Internal.ErrorResponse());
50+
}
51+
52+
/// <summary>
53+
/// Unmarshaller the response from the service to the response class.
54+
/// </summary>
55+
/// <param name="context"></param>
56+
/// <param name="errorResponse"></param>
57+
/// <returns></returns>
58+
public BillingViewHealthStatusException Unmarshall(JsonUnmarshallerContext context, Amazon.Runtime.Internal.ErrorResponse errorResponse)
59+
{
60+
context.Read();
61+
62+
BillingViewHealthStatusException unmarshalledObject = new BillingViewHealthStatusException(errorResponse.Message, errorResponse.InnerException,
63+
errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode);
64+
65+
int targetDepth = context.CurrentDepth;
66+
while (context.ReadAtDepth(targetDepth))
67+
{
68+
}
69+
70+
return unmarshalledObject;
71+
}
72+
73+
private static BillingViewHealthStatusExceptionUnmarshaller _instance = new BillingViewHealthStatusExceptionUnmarshaller();
74+
75+
/// <summary>
76+
/// Gets the singleton.
77+
/// </summary>
78+
public static BillingViewHealthStatusExceptionUnmarshaller Instance
79+
{
80+
get
81+
{
82+
return _instance;
83+
}
84+
}
85+
}
86+
}

sdk/src/Services/Budgets/Generated/Model/Internal/MarshallTransformations/CreateBudgetResponseUnmarshaller.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ public override AmazonServiceException UnmarshallException(JsonUnmarshallerConte
7474
{
7575
return AccessDeniedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
7676
}
77+
if (errorResponse.Code != null && errorResponse.Code.Equals("BillingViewHealthStatusException"))
78+
{
79+
return BillingViewHealthStatusExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
80+
}
7781
if (errorResponse.Code != null && errorResponse.Code.Equals("CreationLimitExceededException"))
7882
{
7983
return CreationLimitExceededExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);

sdk/src/Services/Budgets/Generated/Model/Internal/MarshallTransformations/UpdateBudgetResponseUnmarshaller.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ public override AmazonServiceException UnmarshallException(JsonUnmarshallerConte
7474
{
7575
return AccessDeniedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
7676
}
77+
if (errorResponse.Code != null && errorResponse.Code.Equals("BillingViewHealthStatusException"))
78+
{
79+
return BillingViewHealthStatusExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
80+
}
7781
if (errorResponse.Code != null && errorResponse.Code.Equals("InternalErrorException"))
7882
{
7983
return InternalErrorExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);

sdk/src/Services/Budgets/Generated/_bcl35/AmazonBudgetsClient.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,10 @@ protected override void Dispose(bool disposing)
362362
/// <exception cref="Amazon.Budgets.Model.AccessDeniedException">
363363
/// You are not authorized to use this operation with the given parameters.
364364
/// </exception>
365+
/// <exception cref="Amazon.Budgets.Model.BillingViewHealthStatusException">
366+
/// The billing view status must be HEALTHY to perform this action. Try again when the
367+
/// status is HEALTHY.
368+
/// </exception>
365369
/// <exception cref="Amazon.Budgets.Model.CreationLimitExceededException">
366370
/// You've exceeded the notification or subscriber limit.
367371
/// </exception>
@@ -2037,6 +2041,10 @@ public virtual UntagResourceResponse EndUntagResource(IAsyncResult asyncResult)
20372041
/// <exception cref="Amazon.Budgets.Model.AccessDeniedException">
20382042
/// You are not authorized to use this operation with the given parameters.
20392043
/// </exception>
2044+
/// <exception cref="Amazon.Budgets.Model.BillingViewHealthStatusException">
2045+
/// The billing view status must be HEALTHY to perform this action. Try again when the
2046+
/// status is HEALTHY.
2047+
/// </exception>
20402048
/// <exception cref="Amazon.Budgets.Model.InternalErrorException">
20412049
/// An error on the server occurred during the processing of your request. Try again later.
20422050
/// </exception>

sdk/src/Services/Budgets/Generated/_bcl35/IAmazonBudgets.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,10 @@ public partial interface IAmazonBudgets : IAmazonService, IDisposable
144144
/// <exception cref="Amazon.Budgets.Model.AccessDeniedException">
145145
/// You are not authorized to use this operation with the given parameters.
146146
/// </exception>
147+
/// <exception cref="Amazon.Budgets.Model.BillingViewHealthStatusException">
148+
/// The billing view status must be HEALTHY to perform this action. Try again when the
149+
/// status is HEALTHY.
150+
/// </exception>
147151
/// <exception cref="Amazon.Budgets.Model.CreationLimitExceededException">
148152
/// You've exceeded the notification or subscriber limit.
149153
/// </exception>
@@ -1511,6 +1515,10 @@ public partial interface IAmazonBudgets : IAmazonService, IDisposable
15111515
/// <exception cref="Amazon.Budgets.Model.AccessDeniedException">
15121516
/// You are not authorized to use this operation with the given parameters.
15131517
/// </exception>
1518+
/// <exception cref="Amazon.Budgets.Model.BillingViewHealthStatusException">
1519+
/// The billing view status must be HEALTHY to perform this action. Try again when the
1520+
/// status is HEALTHY.
1521+
/// </exception>
15141522
/// <exception cref="Amazon.Budgets.Model.InternalErrorException">
15151523
/// An error on the server occurred during the processing of your request. Try again later.
15161524
/// </exception>

0 commit comments

Comments
 (0)