|
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 | | -using System.Collections.Generic; |
16 | | - |
17 | | -using Amazon.S3.Model; |
| 1 | +using Amazon.Runtime; |
| 2 | +using Amazon.Runtime.Internal; |
18 | 3 | using Amazon.Runtime.Internal.Transform; |
| 4 | +using Amazon.Runtime.Internal.Util; |
| 5 | +using Amazon.S3.Model; |
| 6 | +using System; |
| 7 | +using System.Collections.Generic; |
| 8 | +using System.Globalization; |
| 9 | +using System.IO; |
| 10 | +using System.Net; |
| 11 | +using System.Text; |
| 12 | +using System.Xml.Serialization; |
19 | 13 |
|
20 | 14 | namespace Amazon.S3.Model.Internal.MarshallTransformations |
21 | 15 | { |
22 | 16 | /// <summary> |
23 | | - /// AnalyticsS3BucketDestination Unmarshaller |
| 17 | + /// Custom unmarshaller for AnalyticsS3BucketDestination Object |
24 | 18 | /// </summary> |
25 | | - public class AnalyticsS3BucketDestinationUnmarshaller : IXmlUnmarshaller<AnalyticsS3BucketDestination, XmlUnmarshallerContext> |
| 19 | + public partial class AnalyticsS3BucketDestinationUnmarshaller : IXmlUnmarshaller<AnalyticsS3BucketDestination, XmlUnmarshallerContext> |
26 | 20 | { |
27 | | - /// <summary> |
28 | | - /// Unmarshaller the response from the service to the response class. |
29 | | - /// </summary> |
30 | | - /// <param name="context"></param> |
31 | | - /// <returns></returns> |
32 | | - public AnalyticsS3BucketDestination Unmarshall(XmlUnmarshallerContext context) |
33 | | - { |
34 | | - AnalyticsS3BucketDestination AnalyticsS3BucketDestination = new AnalyticsS3BucketDestination(); |
35 | | - int originalDepth = context.CurrentDepth; |
36 | | - int targetDepth = originalDepth + 1; |
37 | | - |
38 | | - if (context.IsStartOfDocument) |
39 | | - targetDepth += 2; |
40 | | - |
41 | | - while (context.Read()) |
42 | | - { |
43 | | - if (context.IsStartElement || context.IsAttribute) |
44 | | - { |
45 | | - if (context.TestExpression("Format", targetDepth)) |
46 | | - { |
47 | | - AnalyticsS3BucketDestination.Format = AnalyticsS3ExportFileFormat.FindValue(StringUnmarshaller.Instance.Unmarshall(context)); |
48 | | - |
49 | | - continue; |
50 | | - } |
51 | | - if (context.TestExpression("BucketAccountId", targetDepth)) |
52 | | - { |
53 | | - AnalyticsS3BucketDestination.BucketAccountId = StringUnmarshaller.Instance.Unmarshall(context); |
54 | | - |
55 | | - continue; |
56 | | - } |
57 | | - if (context.TestExpression("Bucket", targetDepth)) |
58 | | - { |
59 | | - AnalyticsS3BucketDestination.BucketName = StringUnmarshaller.Instance.Unmarshall(context); |
60 | | - |
61 | | - continue; |
62 | | - } |
63 | | - if (context.TestExpression("Prefix", targetDepth)) |
64 | | - { |
65 | | - AnalyticsS3BucketDestination.Prefix = StringUnmarshaller.Instance.Unmarshall(context); |
66 | | - |
67 | | - continue; |
68 | | - } |
69 | | - } |
70 | | - else if (context.IsEndElement && context.CurrentDepth < originalDepth) |
71 | | - { |
72 | | - return AnalyticsS3BucketDestination; |
73 | | - } |
74 | | - } |
75 | | - |
76 | | - |
77 | | - |
78 | | - return AnalyticsS3BucketDestination; |
79 | | - } |
80 | | - |
81 | | - private static AnalyticsS3BucketDestinationUnmarshaller _instance; |
82 | | - |
83 | | - /// <summary> |
84 | | - /// Singleton for the unmarshaller |
85 | | - /// </summary> |
86 | | - public static AnalyticsS3BucketDestinationUnmarshaller Instance |
| 21 | + void FormatCustomUnmarshall(XmlUnmarshallerContext context, AnalyticsS3BucketDestination unmarshalledObject) |
87 | 22 | { |
88 | | - get |
89 | | - { |
90 | | - if (_instance == null) |
91 | | - { |
92 | | - _instance = new AnalyticsS3BucketDestinationUnmarshaller(); |
93 | | - } |
94 | | - return _instance; |
95 | | - } |
| 23 | + unmarshalledObject.Format = AnalyticsS3ExportFileFormat.FindValue(StringUnmarshaller.Instance.Unmarshall(context)); |
96 | 24 | } |
97 | 25 | } |
98 | 26 | } |
0 commit comments