Skip to content

Commit a5ef97c

Browse files
committed
Generate HeadBucket, ListParts, PutBucketPolicy, PutObjectLegalHold, PutObjectLockConfiguration, PutObjectRetention, PutObjectTagging, and PutPublicAccessBlock. Update s3 exception tt files
1 parent c7dee2d commit a5ef97c

File tree

70 files changed

+4414
-3289
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+4414
-3289
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"services": [
3+
{
4+
"serviceName": "S3",
5+
"type": "patch",
6+
"changeLogMessages": [
7+
"Update ExceptionUnmarshallers and add S3 Exception t4 file. Generate PutBucketPolicy, PutObjectLegalHold, PutObjectLock, PutObjectRetention, PutPublicAccessBlock, HeadBucket, ListParts"
8+
]
9+
}
10+
]
11+
}

generator/ServiceClientGeneratorLib/Customizations.cs

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,8 @@ public class CustomizationsModel
425425
public const string StopPaginationOnSameTokenKey = "stopPaginationOnSameToken";
426426
public const string OriginalMemberKey = "originalMember";
427427
public const string OverrideTreatEnumsAsStringKey = "overrideTreatEnumsAsString";
428+
public const string ExcludeMembersKey = "excludeMembers";
429+
428430
JsonData _documentRoot;
429431

430432
SimpleMethodFormsModel _simpleMethodsModel;
@@ -560,6 +562,40 @@ public bool RetainOriginalMemberOrdering
560562
}
561563
}
562564

565+
/// <summary>
566+
/// Used to exclude property generation, but not at the marshaller level and only at the shape level.
567+
/// To use this customization add an entry like below, where the top-level key is the name of the shape and
568+
/// the array is filled with members to exclude. To exclude members from marshalling, use ShapeModifiers.Exclude key.
569+
/// "excludeMembers":{
570+
/// "PartDetail":[
571+
/// "ChecksumCRC32",
572+
/// "ChecksumCRC32C",
573+
/// "ChecksumCRC64NVME",
574+
/// "ChecksumSHA1",
575+
/// "ChecksumSHA256",
576+
/// "ETag",
577+
/// "LastModified",
578+
/// "PartNumber"
579+
/// ]
580+
/// }
581+
/// </summary>
582+
public List<string> ExcludeMembers(string shapeName)
583+
{
584+
var data = _documentRoot[ExcludeMembersKey];
585+
if (data == null || data[shapeName] == null) return null;
586+
if (!data[shapeName].IsArray)
587+
throw new InvalidDataException("The members to exclude must be within an array.");
588+
589+
590+
var excludedMembers = new List<string>();
591+
foreach (var member in data[shapeName])
592+
{
593+
excludedMembers.Add(member.ToString());
594+
}
595+
return excludedMembers;
596+
597+
}
598+
563599
/// <summary>
564600
/// A list of uri properties for the service where we should not do validation for presence.
565601
/// </summary>

generator/ServiceClientGeneratorLib/Generators/Marshallers/RestXmlExceptionUnmarshaller.cs

Lines changed: 72 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -96,30 +96,79 @@ public override string TransformText()
9696
#line default
9797
#line hidden
9898
this.Write(" Unmarshall(XmlUnmarshallerContext context, Amazon.Runtime.Internal.ErrorResponse" +
99-
" errorResponse)\r\n {\r\n ");
99+
" errorResponse)\r\n {\r\n");
100100

101101
#line 38 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt"
102+
103+
if (this.Config.ServiceId == "S3")
104+
{
105+
106+
107+
#line default
108+
#line hidden
109+
this.Write(@" string id2 = null, amzCfId = null;
110+
var s3ErrorResponse = errorResponse as S3ErrorResponse;
111+
if (s3ErrorResponse != null)
112+
{
113+
id2 = s3ErrorResponse.Id2;
114+
amzCfId = s3ErrorResponse.AmzCfId;
115+
}
116+
");
117+
118+
#line 49 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt"
102119
this.Write(this.ToStringHelper.ToStringWithCulture(this.UnmarshallerBaseName));
103120

104121
#line default
105122
#line hidden
106123
this.Write(" response = new ");
107124

108-
#line 38 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt"
125+
#line 49 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt"
109126
this.Write(this.ToStringHelper.ToStringWithCulture(this.UnmarshallerBaseName));
110127

111128
#line default
112129
#line hidden
113-
this.Write(@"(errorResponse.Message, errorResponse.InnerException,
114-
errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode);
130+
this.Write("(errorResponse.Message, errorResponse.InnerException,\r\n errorRespo" +
131+
"nse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode," +
132+
" id2, amzCfId);\r\n\r\n");
133+
134+
#line 52 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt"
115135

116-
while (context.Read())
117-
{
118-
if (context.IsStartElement || context.IsAttribute)
119-
{
120-
");
136+
}
137+
else
138+
{
139+
140+
141+
#line default
142+
#line hidden
143+
this.Write(" ");
144+
145+
#line 57 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt"
146+
this.Write(this.ToStringHelper.ToStringWithCulture(this.UnmarshallerBaseName));
147+
148+
#line default
149+
#line hidden
150+
this.Write(" response = new ");
151+
152+
#line 57 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt"
153+
this.Write(this.ToStringHelper.ToStringWithCulture(this.UnmarshallerBaseName));
154+
155+
#line default
156+
#line hidden
157+
this.Write("(errorResponse.Message, errorResponse.InnerException, \r\n errorResp" +
158+
"onse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode" +
159+
");\r\n");
160+
161+
#line 59 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt"
162+
163+
}
164+
165+
166+
#line default
167+
#line hidden
168+
this.Write("\r\n while (context.Read())\r\n {\r\n if (context." +
169+
"IsStartElement || context.IsAttribute)\r\n {\r\n");
121170

122-
#line 45 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt"
171+
#line 67 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt"
123172

124173
foreach (var member in this.Structure.Members)
125174
{
@@ -132,56 +181,56 @@ public override string TransformText()
132181
#line hidden
133182
this.Write(" if (context.TestExpression(\"");
134183

135-
#line 52 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt"
184+
#line 74 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt"
136185
this.Write(this.ToStringHelper.ToStringWithCulture(member.MarshallName));
137186

138187
#line default
139188
#line hidden
140189
this.Write("/");
141190

142-
#line 52 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt"
191+
#line 74 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt"
143192
this.Write(this.ToStringHelper.ToStringWithCulture(listMarshallName));
144193

145194
#line default
146195
#line hidden
147196
this.Write("\"))\r\n {\r\n var unmarshaller = ");
148197

149-
#line 54 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt"
198+
#line 76 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt"
150199
this.Write(this.ToStringHelper.ToStringWithCulture(member.DetermineTypeUnmarshallerInstantiate()));
151200

152201
#line default
153202
#line hidden
154203
this.Write(";\r\n if (response.");
155204

156-
#line 55 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt"
205+
#line 77 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt"
157206
this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName));
158207

159208
#line default
160209
#line hidden
161210
this.Write(" == null)\r\n {\r\n response.");
162211

163-
#line 57 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt"
212+
#line 79 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt"
164213
this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName));
165214

166215
#line default
167216
#line hidden
168217
this.Write(" = new ");
169218

170-
#line 57 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt"
219+
#line 79 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt"
171220
this.Write(this.ToStringHelper.ToStringWithCulture(member.DetermineType()));
172221

173222
#line default
174223
#line hidden
175224
this.Write("();\r\n }\r\n response.");
176225

177-
#line 59 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt"
226+
#line 81 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt"
178227
this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName));
179228

180229
#line default
181230
#line hidden
182231
this.Write(".Add(unmarshaller.Unmarshall(context));\r\n }\r\n");
183232

184-
#line 61 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt"
233+
#line 83 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt"
185234

186235
}
187236
else
@@ -192,28 +241,28 @@ public override string TransformText()
192241
#line hidden
193242
this.Write(" if (context.TestExpression(\"");
194243

195-
#line 66 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt"
244+
#line 88 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt"
196245
this.Write(this.ToStringHelper.ToStringWithCulture(member.MarshallName));
197246

198247
#line default
199248
#line hidden
200249
this.Write("\"))\r\n {\r\n var unmarshaller = ");
201250

202-
#line 68 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt"
251+
#line 90 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt"
203252
this.Write(this.ToStringHelper.ToStringWithCulture(member.DetermineTypeUnmarshallerInstantiate()));
204253

205254
#line default
206255
#line hidden
207256
this.Write(";\r\n response.");
208257

209-
#line 69 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt"
258+
#line 91 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt"
210259
this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName));
211260

212261
#line default
213262
#line hidden
214263
this.Write(" = unmarshaller.Unmarshall(context);\r\n }\r\n");
215264

216-
#line 71 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt"
265+
#line 93 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt"
217266

218267
}
219268
}
@@ -223,7 +272,7 @@ public override string TransformText()
223272
#line hidden
224273
this.Write(" }\r\n }\r\n return response;\r\n }\r\n\r\n");
225274

226-
#line 80 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt"
275+
#line 102 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt"
227276

228277
this.AddStructureSingletonMethod();
229278

generator/ServiceClientGeneratorLib/Generators/Marshallers/RestXmlExceptionUnmarshaller.tt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,30 @@ namespace <#=this.Config.Namespace #>.Model.Internal.MarshallTransformations
3535
/// <returns></returns>
3636
public <#=this.UnmarshallerBaseName #> Unmarshall(XmlUnmarshallerContext context, Amazon.Runtime.Internal.ErrorResponse errorResponse)
3737
{
38+
<#
39+
if (this.Config.ServiceId == "S3")
40+
{
41+
#>
42+
string id2 = null, amzCfId = null;
43+
var s3ErrorResponse = errorResponse as S3ErrorResponse;
44+
if (s3ErrorResponse != null)
45+
{
46+
id2 = s3ErrorResponse.Id2;
47+
amzCfId = s3ErrorResponse.AmzCfId;
48+
}
49+
<#=this.UnmarshallerBaseName #> response = new <#=this.UnmarshallerBaseName #>(errorResponse.Message, errorResponse.InnerException,
50+
errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode, id2, amzCfId);
51+
52+
<#
53+
}
54+
else
55+
{
56+
#>
3857
<#=this.UnmarshallerBaseName #> response = new <#=this.UnmarshallerBaseName #>(errorResponse.Message, errorResponse.InnerException,
3958
errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode);
59+
<#
60+
}
61+
#>
4062

4163
while (context.Read())
4264
{

0 commit comments

Comments
 (0)