@@ -238,12 +238,12 @@ public void Write(IndentedTextWriter writer, string awsSignerAttributeTypeValue)
238238
239239 private void WriteSensitiveDataFlags ( IndentedTextWriter writer )
240240 {
241- if ( ContainsSensitiveData ( MethodAnalysis . RequestType ) )
241+ if ( MethodAnalysis . RequestType . ContainsSensitiveData ( ) )
242242 {
243243 writer . WriteLine ( ) ;
244244 writer . WriteLine ( "protected override bool IsSensitiveRequest { get; set; } = true;" ) ;
245245 }
246- if ( ContainsSensitiveData ( MethodAnalysis . ResponseType ) )
246+ if ( MethodAnalysis . ResponseType . ContainsSensitiveData ( ) )
247247 {
248248 writer . WriteLine ( ) ;
249249 writer . WriteLine ( "protected override bool IsSensitiveResponse { get; set; } = true;" ) ;
@@ -255,35 +255,6 @@ private void WriteGeneratedCmdletFlag(IndentedTextWriter writer)
255255 writer . WriteLine ( "protected override bool IsGeneratedCmdlet { get; set; } = true;" ) ;
256256 }
257257
258- /// <summary>
259- /// Checks if the type contains any sensitive data by going recursivly over all the internal properties
260- /// </summary>
261- private bool ContainsSensitiveData ( Type type , Dictionary < Type , bool > visitedTypes = null )
262- {
263- if ( visitedTypes == null )
264- visitedTypes = new Dictionary < Type , bool > ( ) ;
265-
266- if ( visitedTypes . ContainsKey ( type ) )
267- return false ;
268-
269- visitedTypes . Add ( type , true ) ;
270-
271- foreach ( var childProperty in type . GetProperties ( ) )
272- {
273- if ( IsSensitive ( childProperty ) || ContainsSensitiveData ( childProperty . PropertyType , visitedTypes ) )
274- return true ;
275- }
276- return false ;
277- }
278-
279- private bool IsSensitive ( PropertyInfo propertyInfo )
280- {
281- dynamic awsPropertyAttribute = propertyInfo . GetCustomAttributes ( )
282- . Where ( attribute => attribute . GetType ( ) . FullName == "Amazon.Runtime.Internal.AWSPropertyAttribute" ) . SingleOrDefault ( ) ;
283-
284- return awsPropertyAttribute != null && awsPropertyAttribute . Sensitive ;
285- }
286-
287258 private void WriteConverters ( IndentedTextWriter writer , SimplePropertyInfo property , Param paramCustomization )
288259 {
289260 if ( paramCustomization ? . AutoConvert == Param . AutoConversion . ToBase64 )
0 commit comments