From 9c13e38504fc41be90bbca5c5a2bcbe0ff89c5c1 Mon Sep 17 00:00:00 2001 From: Muhammad Othman Date: Mon, 3 Nov 2025 12:01:09 -0500 Subject: [PATCH] Rename ErrorType exception properties to avoid hiding inherited member --- .../e2fd4917-66af-4f7a-a019-8c8fec7a1899.json | 13 +++++++++++++ generator/ServiceClientGeneratorLib/Member.cs | 4 ++++ .../account/account.customizations.json | 13 ------------- .../Generated/Model/AccessDeniedException.cs | 8 ++++---- .../Account/Generated/Model/ConflictException.cs | 8 ++++---- .../Generated/Model/InternalServerException.cs | 8 ++++---- .../Generated/Model/ResourceNotFoundException.cs | 8 ++++---- .../Generated/Model/TooManyRequestsException.cs | 8 ++++---- 8 files changed, 37 insertions(+), 33 deletions(-) create mode 100644 generator/.DevConfigs/e2fd4917-66af-4f7a-a019-8c8fec7a1899.json delete mode 100644 generator/ServiceModels/account/account.customizations.json diff --git a/generator/.DevConfigs/e2fd4917-66af-4f7a-a019-8c8fec7a1899.json b/generator/.DevConfigs/e2fd4917-66af-4f7a-a019-8c8fec7a1899.json new file mode 100644 index 000000000000..b217dec716d6 --- /dev/null +++ b/generator/.DevConfigs/e2fd4917-66af-4f7a-a019-8c8fec7a1899.json @@ -0,0 +1,13 @@ + + +{ + "services": [ + { + "serviceName": "Account", + "type": "patch", + "changeLogMessages": [ + "Rename internal exception property to avoid hiding inherited AmazonServiceException member." + ] + } + ] +} \ No newline at end of file diff --git a/generator/ServiceClientGeneratorLib/Member.cs b/generator/ServiceClientGeneratorLib/Member.cs index bd1a40c797ea..8cd0841fcd1b 100644 --- a/generator/ServiceClientGeneratorLib/Member.cs +++ b/generator/ServiceClientGeneratorLib/Member.cs @@ -253,6 +253,10 @@ public string BasePropertyName } } + // Rename ErrorType exception properties to avoid hiding AmazonServiceException.ErrorType inherited member. + if (OwningShape.IsException && _name.ToUpperFirstCharacter() == "ErrorType") + return "RequestErrorType"; + return _name.ToUpperFirstCharacter(); } } diff --git a/generator/ServiceModels/account/account.customizations.json b/generator/ServiceModels/account/account.customizations.json deleted file mode 100644 index 7d7ac70f495c..000000000000 --- a/generator/ServiceModels/account/account.customizations.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "shapeModifiers": { - "*": { - "modify": [ - { - "errorType": { - "emitPropertyName": "RequestErrorType" - } - } - ] - } - } -} \ No newline at end of file diff --git a/sdk/src/Services/Account/Generated/Model/AccessDeniedException.cs b/sdk/src/Services/Account/Generated/Model/AccessDeniedException.cs index 74dfc0e1b181..5b259263dd5b 100644 --- a/sdk/src/Services/Account/Generated/Model/AccessDeniedException.cs +++ b/sdk/src/Services/Account/Generated/Model/AccessDeniedException.cs @@ -38,7 +38,7 @@ namespace Amazon.Account.Model #endif public partial class AccessDeniedException : AmazonAccountException { - private string _requestErrorType; + private string _errorType; /// /// Constructs a new AccessDeniedException with the specified error @@ -133,14 +133,14 @@ public override void GetObjectData(System.Runtime.Serialization.SerializationInf /// public string RequestErrorType { - get { return this._requestErrorType; } - set { this._requestErrorType = value; } + get { return this._errorType; } + set { this._errorType = value; } } // Check to see if RequestErrorType property is set internal bool IsSetRequestErrorType() { - return !string.IsNullOrEmpty(this._requestErrorType); + return !string.IsNullOrEmpty(this._errorType); } } diff --git a/sdk/src/Services/Account/Generated/Model/ConflictException.cs b/sdk/src/Services/Account/Generated/Model/ConflictException.cs index 8a4a84d7cd8d..5bb7d0397fcd 100644 --- a/sdk/src/Services/Account/Generated/Model/ConflictException.cs +++ b/sdk/src/Services/Account/Generated/Model/ConflictException.cs @@ -40,7 +40,7 @@ namespace Amazon.Account.Model #endif public partial class ConflictException : AmazonAccountException { - private string _requestErrorType; + private string _errorType; /// /// Constructs a new ConflictException with the specified error @@ -135,14 +135,14 @@ public override void GetObjectData(System.Runtime.Serialization.SerializationInf /// public string RequestErrorType { - get { return this._requestErrorType; } - set { this._requestErrorType = value; } + get { return this._errorType; } + set { this._errorType = value; } } // Check to see if RequestErrorType property is set internal bool IsSetRequestErrorType() { - return !string.IsNullOrEmpty(this._requestErrorType); + return !string.IsNullOrEmpty(this._errorType); } } diff --git a/sdk/src/Services/Account/Generated/Model/InternalServerException.cs b/sdk/src/Services/Account/Generated/Model/InternalServerException.cs index 9cc739e218b2..2efade034ec2 100644 --- a/sdk/src/Services/Account/Generated/Model/InternalServerException.cs +++ b/sdk/src/Services/Account/Generated/Model/InternalServerException.cs @@ -38,7 +38,7 @@ namespace Amazon.Account.Model #endif public partial class InternalServerException : AmazonAccountException { - private string _requestErrorType; + private string _errorType; private RetryableDetails _retryableDetails = new RetryableDetails(false); @@ -135,14 +135,14 @@ public override void GetObjectData(System.Runtime.Serialization.SerializationInf /// public string RequestErrorType { - get { return this._requestErrorType; } - set { this._requestErrorType = value; } + get { return this._errorType; } + set { this._errorType = value; } } // Check to see if RequestErrorType property is set internal bool IsSetRequestErrorType() { - return !string.IsNullOrEmpty(this._requestErrorType); + return !string.IsNullOrEmpty(this._errorType); } /// diff --git a/sdk/src/Services/Account/Generated/Model/ResourceNotFoundException.cs b/sdk/src/Services/Account/Generated/Model/ResourceNotFoundException.cs index 6f233e397010..81d89befa657 100644 --- a/sdk/src/Services/Account/Generated/Model/ResourceNotFoundException.cs +++ b/sdk/src/Services/Account/Generated/Model/ResourceNotFoundException.cs @@ -37,7 +37,7 @@ namespace Amazon.Account.Model #endif public partial class ResourceNotFoundException : AmazonAccountException { - private string _requestErrorType; + private string _errorType; /// /// Constructs a new ResourceNotFoundException with the specified error @@ -132,14 +132,14 @@ public override void GetObjectData(System.Runtime.Serialization.SerializationInf /// public string RequestErrorType { - get { return this._requestErrorType; } - set { this._requestErrorType = value; } + get { return this._errorType; } + set { this._errorType = value; } } // Check to see if RequestErrorType property is set internal bool IsSetRequestErrorType() { - return !string.IsNullOrEmpty(this._requestErrorType); + return !string.IsNullOrEmpty(this._errorType); } } diff --git a/sdk/src/Services/Account/Generated/Model/TooManyRequestsException.cs b/sdk/src/Services/Account/Generated/Model/TooManyRequestsException.cs index c937c9ec436d..cd9c21b31b72 100644 --- a/sdk/src/Services/Account/Generated/Model/TooManyRequestsException.cs +++ b/sdk/src/Services/Account/Generated/Model/TooManyRequestsException.cs @@ -38,7 +38,7 @@ namespace Amazon.Account.Model #endif public partial class TooManyRequestsException : AmazonAccountException { - private string _requestErrorType; + private string _errorType; private RetryableDetails _retryableDetails = new RetryableDetails(true); @@ -135,14 +135,14 @@ public override void GetObjectData(System.Runtime.Serialization.SerializationInf /// public string RequestErrorType { - get { return this._requestErrorType; } - set { this._requestErrorType = value; } + get { return this._errorType; } + set { this._errorType = value; } } // Check to see if RequestErrorType property is set internal bool IsSetRequestErrorType() { - return !string.IsNullOrEmpty(this._requestErrorType); + return !string.IsNullOrEmpty(this._errorType); } ///