Skip to content

Commit cdc836b

Browse files
committed
Generate GetBucketAnalyticsConfiguration
1 parent e815bfd commit cdc836b

14 files changed

+607
-401
lines changed

generator/ServiceClientGeneratorLib/ServiceModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ public List<Operation> S3AllowListOperations
548548
new Operation(this, "ListObjectsV2", DocumentRoot[OperationsKey]["ListObjectsV2"]),
549549
// phase 3 (including those moved from phase 1)
550550
new Operation(this, "CreateSession", DocumentRoot[OperationsKey]["CreateSession"]),
551-
//new Operation(this, "GetBucketAnalyticsConfiguration", DocumentRoot[OperationsKey]["GetBucketAnalyticsConfiguration"]),
551+
new Operation(this, "GetBucketAnalyticsConfiguration", DocumentRoot[OperationsKey]["GetBucketAnalyticsConfiguration"]),
552552
//new Operation(this, "GetBucketIntelligentTieringConfiguration", DocumentRoot[OperationsKey]["GetBucketIntelligentTieringConfiguration"]),
553553
//new Operation(this, "GetBucketInventoryConfiguration", DocumentRoot[OperationsKey]["GetBucketInventoryConfiguration"]),
554554
//new Operation(this, "GetBucketLogging", DocumentRoot[OperationsKey]["GetBucketLogging"]),

generator/ServiceModels/s3/s3.customizations.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -886,6 +886,31 @@
886886
"injectXmlMarshallCode": ["AnalyticsFilterCustomMarshall(publicRequest, xmlWriter);"]
887887
}
888888
}
889+
],
890+
"predicateListUnmarshallers": [
891+
{
892+
"AnalyticsFilter" :{
893+
"predicateListUnmarshallerName" : "AnalyticsPredicateListUnmarshaller",
894+
"filterPredicateName": "AnalyticsFilterPredicate"
895+
}
896+
}
897+
]
898+
},
899+
"GetBucketAnalyticsConfigurationRequest":{
900+
"modify" :[
901+
{
902+
"Id" :{"emitPropertyName": "AnalyticsId"}
903+
}
904+
]
905+
},
906+
"AnalyticsS3BucketDestination":{
907+
"modify" :[
908+
{
909+
"Format" :{
910+
"skipContextTestExpressionUnmarshallingLogic" : true,
911+
"injectXmlUnmarshallCode": ["FormatCustomUnmarshall(context, unmarshalledObject);"]
912+
}
913+
}
889914
]
890915
}
891916
},
Lines changed: 15 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -1,98 +1,26 @@
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;
183
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;
1913

2014
namespace Amazon.S3.Model.Internal.MarshallTransformations
2115
{
2216
/// <summary>
23-
/// AnalyticsS3BucketDestination Unmarshaller
17+
/// Custom unmarshaller for AnalyticsS3BucketDestination Object
2418
/// </summary>
25-
public class AnalyticsS3BucketDestinationUnmarshaller : IXmlUnmarshaller<AnalyticsS3BucketDestination, XmlUnmarshallerContext>
19+
public partial class AnalyticsS3BucketDestinationUnmarshaller : IXmlUnmarshaller<AnalyticsS3BucketDestination, XmlUnmarshallerContext>
2620
{
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)
8722
{
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));
9624
}
9725
}
9826
}

sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetBucketAnalyticsConfigurationRequestMarshaller.cs

Lines changed: 3 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -24,49 +24,11 @@ namespace Amazon.S3.Model.Internal.MarshallTransformations
2424
/// <summary>
2525
/// Get BucketAnalyticsConfiguration Request Marshaller
2626
/// </summary>
27-
public class GetBucketAnalyticsConfigurationRequestMarshaller : IMarshaller<IRequest, GetBucketAnalyticsConfigurationRequest>, IMarshaller<IRequest, Amazon.Runtime.AmazonWebServiceRequest>
27+
public partial class GetBucketAnalyticsConfigurationRequestMarshaller : IMarshaller<IRequest, GetBucketAnalyticsConfigurationRequest>, IMarshaller<IRequest, Amazon.Runtime.AmazonWebServiceRequest>
2828
{
29-
public IRequest Marshall(Amazon.Runtime.AmazonWebServiceRequest input)
29+
partial void PreMarshallCustomization(DefaultRequest defaultRequest, GetBucketAnalyticsConfigurationRequest publicRequest)
3030
{
31-
return this.Marshall((GetBucketAnalyticsConfigurationRequest)input);
32-
}
33-
34-
public IRequest Marshall(GetBucketAnalyticsConfigurationRequest getAnalyticsConfigurationRequest)
35-
{
36-
IRequest request = new DefaultRequest(getAnalyticsConfigurationRequest, "AmazonS3");
37-
38-
request.Suppress404Exceptions = true;
39-
request.HttpMethod = "GET";
40-
41-
if (getAnalyticsConfigurationRequest.IsSetExpectedBucketOwner())
42-
request.Headers.Add(S3Constants.AmzHeaderExpectedBucketOwner, S3Transforms.ToStringValue(getAnalyticsConfigurationRequest.ExpectedBucketOwner));
43-
44-
if (string.IsNullOrEmpty(getAnalyticsConfigurationRequest.BucketName))
45-
throw new System.ArgumentException("BucketName is a required property and must be set before making this call.", "GetBucketAnalyticsConfigurationRequest.BucketName");
46-
47-
request.ResourcePath = "/";
48-
request.AddSubResource("analytics");
49-
request.AddSubResource("id", getAnalyticsConfigurationRequest.AnalyticsId);
50-
request.UseQueryString = true;
51-
52-
return request;
53-
}
54-
55-
private static GetBucketAnalyticsConfigurationRequestMarshaller _instance;
56-
57-
/// <summary>
58-
/// Singleton for marshaller
59-
/// </summary>
60-
public static GetBucketAnalyticsConfigurationRequestMarshaller Instance
61-
{
62-
get
63-
{
64-
if (_instance == null)
65-
{
66-
_instance = new GetBucketAnalyticsConfigurationRequestMarshaller();
67-
}
68-
return _instance;
69-
}
31+
defaultRequest.Suppress404Exceptions = true;
7032
}
7133
}
7234
}

sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetBucketAnalyticsConfigurationResponseUnmarshaller.cs

Lines changed: 0 additions & 116 deletions
This file was deleted.

0 commit comments

Comments
 (0)