@@ -26,150 +26,21 @@ namespace Amazon.S3.Model.Internal.MarshallTransformations
2626 /// <summary>
2727 /// Response Unmarshaller for ListMultipartUploads operation
2828 /// </summary>
29- public class ListMultipartUploadsResponseUnmarshaller : S3ReponseUnmarshaller
30- {
31- /// <summary>
32- /// Unmarshaller the response from the service to the response class.
33- /// </summary>
34- /// <param name="context"></param>
35- /// <returns></returns>
36- public override AmazonWebServiceResponse Unmarshall ( XmlUnmarshallerContext context )
37- {
38- ListMultipartUploadsResponse response = new ListMultipartUploadsResponse ( ) ;
39-
40- while ( context . Read ( ) )
41- {
42- if ( context . IsStartElement )
43- {
44- UnmarshallResult ( context , response ) ;
45- continue ;
46- }
47- }
48-
49- IWebResponseData responseData = context . ResponseData ;
50- if ( responseData . IsHeaderPresent ( S3Constants . AmzHeaderRequestCharged ) )
51- response . RequestCharged = RequestCharged . FindValue ( responseData . GetHeaderValue ( S3Constants . AmzHeaderRequestCharged ) ) ;
52-
53- return response ;
54- }
55-
56- private static void UnmarshallResult ( XmlUnmarshallerContext context , ListMultipartUploadsResponse response )
29+ public partial class ListMultipartUploadsResponseUnmarshaller : S3ReponseUnmarshaller
30+ {
31+ private static void CommonPrefixesCustomUnmarshall ( XmlUnmarshallerContext context , ListMultipartUploadsResponse response )
5732 {
58-
59- int originalDepth = context . CurrentDepth ;
60- int targetDepth = originalDepth + 1 ;
61-
62- if ( context . IsStartOfDocument )
63- targetDepth += 2 ;
64-
65- while ( context . Read ( ) )
66- {
67- if ( context . IsStartElement || context . IsAttribute )
68- {
69- if ( context . TestExpression ( "Bucket" , targetDepth ) )
70- {
71- response . BucketName = StringUnmarshaller . GetInstance ( ) . Unmarshall ( context ) ;
72-
73- continue ;
74- }
75- if ( context . TestExpression ( "KeyMarker" , targetDepth ) )
76- {
77- response . KeyMarker = StringUnmarshaller . GetInstance ( ) . Unmarshall ( context ) ;
78-
79- continue ;
80- }
81- if ( context . TestExpression ( "UploadIdMarker" , targetDepth ) )
82- {
83- response . UploadIdMarker = StringUnmarshaller . GetInstance ( ) . Unmarshall ( context ) ;
84-
85- continue ;
86- }
87- if ( context . TestExpression ( "NextKeyMarker" , targetDepth ) )
88- {
89- response . NextKeyMarker = StringUnmarshaller . GetInstance ( ) . Unmarshall ( context ) ;
90-
91- continue ;
92- }
93- if ( context . TestExpression ( "NextUploadIdMarker" , targetDepth ) )
94- {
95- response . NextUploadIdMarker = StringUnmarshaller . GetInstance ( ) . Unmarshall ( context ) ;
96-
97- continue ;
98- }
99- if ( context . TestExpression ( "MaxUploads" , targetDepth ) )
100- {
101- response . MaxUploads = IntUnmarshaller . GetInstance ( ) . Unmarshall ( context ) ;
102-
103- continue ;
104- }
105- if ( context . TestExpression ( "IsTruncated" , targetDepth ) )
106- {
107- response . IsTruncated = BoolUnmarshaller . GetInstance ( ) . Unmarshall ( context ) ;
108-
109- continue ;
110- }
111- if ( context . TestExpression ( "Upload" , targetDepth ) )
112- {
113- if ( response . MultipartUploads == null )
114- {
115- response . MultipartUploads = new List < MultipartUpload > ( ) ;
116- }
117-
118- response . MultipartUploads . Add ( MultipartUploadUnmarshaller . Instance . Unmarshall ( context ) ) ;
119- continue ;
120- }
121- if ( context . TestExpression ( "Delimiter" , targetDepth ) )
122- {
123- response . Delimiter = StringUnmarshaller . GetInstance ( ) . Unmarshall ( context ) ;
124-
125- continue ;
126- }
127- if ( context . TestExpression ( "Prefix" , targetDepth ) )
128- {
129- response . Prefix = StringUnmarshaller . GetInstance ( ) . Unmarshall ( context ) ;
130-
131- continue ;
132- }
133- if ( context . TestExpression ( "CommonPrefixes" , targetDepth ) )
134- {
135- var prefix = CommonPrefixesItemUnmarshaller . Instance . Unmarshall ( context ) ;
136-
137- if ( prefix != null )
138- {
139- if ( response . CommonPrefixes == null )
140- {
141- response . CommonPrefixes = new List < string > ( ) ;
142- }
143- response . CommonPrefixes . Add ( prefix ) ;
144- }
33+ var prefix = CommonPrefixesItemUnmarshaller . Instance . Unmarshall ( context ) ;
14534
146- continue ;
147- }
148- }
149- else if ( context . IsEndElement && context . CurrentDepth < originalDepth )
150- {
151- return ;
152- }
153- }
154-
155- return ;
156- }
157-
158- private static ListMultipartUploadsResponseUnmarshaller _instance ;
159-
160- /// <summary>
161- /// Singleton for the unmarshaller
162- /// </summary>
163- public static ListMultipartUploadsResponseUnmarshaller Instance
164- {
165- get
35+ if ( prefix != null )
16636 {
167- if ( _instance == null )
37+ if ( response . CommonPrefixes == null )
16838 {
169- _instance = new ListMultipartUploadsResponseUnmarshaller ( ) ;
39+ response . CommonPrefixes = new List < string > ( ) ;
17040 }
171- return _instance ;
41+ response . CommonPrefixes . Add ( prefix ) ;
17242 }
43+ return ;
17344 }
17445 }
17546}
0 commit comments