diff --git a/generator/.DevConfigs/fc91462d-3430-4b70-bc03-4363f2696619.json b/generator/.DevConfigs/fc91462d-3430-4b70-bc03-4363f2696619.json new file mode 100644 index 000000000000..18da0132ffc0 --- /dev/null +++ b/generator/.DevConfigs/fc91462d-3430-4b70-bc03-4363f2696619.json @@ -0,0 +1,12 @@ +{ + "services": [ + { + "serviceName": "S3", + "type": "patch", + "changeLogMessages": [ + "Generate CopyPart.", + "[Breaking Change] Amazon.S3.Model.CopyPartResponse's BucketKeyEnabled will now return bool? instead of bool, in line with other S3 nullable types." + ] + } + ] +} \ No newline at end of file diff --git a/generator/ServiceClientGeneratorLib/Customizations.cs b/generator/ServiceClientGeneratorLib/Customizations.cs index 6b30418d8242..814dae04d7ee 100644 --- a/generator/ServiceClientGeneratorLib/Customizations.cs +++ b/generator/ServiceClientGeneratorLib/Customizations.cs @@ -1066,7 +1066,6 @@ public ShapeModifier(JsonData data) _shapeModifierXmlNamespace = ParseXmlNamespace(data); _predicateListUnmarshallers = ParsePredicateListUnmarshallers(data); _excludedUnmarshallingProperties = ParseExcludedUnmarshallingProperties(data); - Validate(data); } @@ -1087,20 +1086,6 @@ public ShapeModifier(JsonData data) // } // }, // Above is an example of how to specify the originalMember on the injected member. - private void Validate(JsonData data) - { - // if a property was excluded, then the injected member must reference the original member that it is replacing - // unless the originalMember isn't part of the members array and is from a different shape. - if (_excludedProperties.Count == 0 || _injectedProperties.Count == 0) - return; - int injectedPropertyOriginalMemberCount = _injectedProperties.Values - .Count(jsonData => jsonData[CustomizationsModel.OriginalMemberKey] != null || jsonData[ShapeModifier.OriginalMemberIsOutsideContainingShapeKey] != null); - if (_excludedProperties.Count != injectedPropertyOriginalMemberCount) - { - throw new InvalidDataException($"The customization excludes and injects members without specifying the originalMember. If you are excluding a member and injecting a different member, make sure to specify the original member that" + - $" was excluded on the injected member in the customizations.json file."); - } - } #region Property Exclusion diff --git a/generator/ServiceClientGeneratorLib/Generators/Marshallers/BaseResponseUnmarshaller.cs b/generator/ServiceClientGeneratorLib/Generators/Marshallers/BaseResponseUnmarshaller.cs index c85d929564b3..a39cbad491eb 100644 --- a/generator/ServiceClientGeneratorLib/Generators/Marshallers/BaseResponseUnmarshaller.cs +++ b/generator/ServiceClientGeneratorLib/Generators/Marshallers/BaseResponseUnmarshaller.cs @@ -1742,6 +1742,8 @@ protected void ProcessResponseBodyOrStructureMembers(Member member, bool isStruc if (dataTypeOverride.IsFlattened) dataTypeSwapIsFlattened = true; } + if (this.Config.ServiceModel.Customizations.FlattenShapes(member.OwningShape.Name).Contains(member.ModeledName)) + return; string unmarshalledVariable = isStructure ? "unmarshalledObject" : "response"; if (member.Shape.IsList || isDataTypeSwapList) { @@ -1755,28 +1757,28 @@ protected void ProcessResponseBodyOrStructureMembers(Member member, bool isStruc #line default #line hidden - #line 456 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 458 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write("\t\t\t\t\tif (context.TestExpression(\""); #line default #line hidden - #line 457 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 459 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(DetermineXmlMarshallName(member))); #line default #line hidden - #line 457 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 459 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write("\", targetDepth))\r\n\t\t\t\t\t{\r\n"); #line default #line hidden - #line 459 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 461 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" } if (!skipXmlTestExpressionInnerLogic) @@ -1786,126 +1788,126 @@ protected void ProcessResponseBodyOrStructureMembers(Member member, bool isStruc #line default #line hidden - #line 463 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 465 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write(" if ("); #line default #line hidden - #line 464 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 466 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(unmarshalledVariable)); #line default #line hidden - #line 464 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 466 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write("."); #line default #line hidden - #line 464 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 466 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName)); #line default #line hidden - #line 464 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 466 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write(" == null)\r\n {\r\n "); #line default #line hidden - #line 466 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 468 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(unmarshalledVariable)); #line default #line hidden - #line 466 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 468 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write("."); #line default #line hidden - #line 466 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 468 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName)); #line default #line hidden - #line 466 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 468 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write(" = new "); #line default #line hidden - #line 466 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 468 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(member.DetermineType())); #line default #line hidden - #line 466 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 468 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write("();\r\n }\r\n\t\t\t\t\t\tvar unmarshaller = "); #line default #line hidden - #line 468 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 470 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(member.DetermineTypeUnmarshallerInstantiate())); #line default #line hidden - #line 468 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 470 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write(";\r\n\t\t\t\t\t\t"); #line default #line hidden - #line 469 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 471 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(unmarshalledVariable)); #line default #line hidden - #line 469 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 471 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write("."); #line default #line hidden - #line 469 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 471 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName)); #line default #line hidden - #line 469 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 471 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write(".Add(unmarshaller.Unmarshall(context));\r\n"); #line default #line hidden - #line 470 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 472 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" } @@ -1913,20 +1915,20 @@ protected void ProcessResponseBodyOrStructureMembers(Member member, bool isStruc #line default #line hidden - #line 473 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 475 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" WriteInjectXmlUnmarshallCode(member); #line default #line hidden - #line 473 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 475 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write("\t\t\t\t\t\tcontinue;\r\n"); #line default #line hidden - #line 475 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 477 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" if (!skipXmlTestExpression) { @@ -1935,14 +1937,14 @@ protected void ProcessResponseBodyOrStructureMembers(Member member, bool isStruc #line default #line hidden - #line 478 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 480 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write("\t\t\t\t\t}\r\n"); #line default #line hidden - #line 480 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 482 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" } } @@ -1955,42 +1957,42 @@ protected void ProcessResponseBodyOrStructureMembers(Member member, bool isStruc #line default #line hidden - #line 487 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 489 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write("\t\t\t\t if (context.TestExpression(\""); #line default #line hidden - #line 488 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 490 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(DetermineXmlMarshallName(member))); #line default #line hidden - #line 488 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 490 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write("/"); #line default #line hidden - #line 488 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 490 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(listMarshallName)); #line default #line hidden - #line 488 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 490 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write("\", targetDepth))\r\n\t\t\t\t {\r\n"); #line default #line hidden - #line 490 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 492 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" } if (!skipXmlTestExpressionInnerLogic) @@ -2000,126 +2002,126 @@ protected void ProcessResponseBodyOrStructureMembers(Member member, bool isStruc #line default #line hidden - #line 494 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 496 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write(" if ("); #line default #line hidden - #line 495 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 497 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(unmarshalledVariable)); #line default #line hidden - #line 495 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 497 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write("."); #line default #line hidden - #line 495 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 497 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName)); #line default #line hidden - #line 495 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 497 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write(" == null)\r\n {\r\n "); #line default #line hidden - #line 497 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 499 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(unmarshalledVariable)); #line default #line hidden - #line 497 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 499 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write("."); #line default #line hidden - #line 497 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 499 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName)); #line default #line hidden - #line 497 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 499 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write(" = new "); #line default #line hidden - #line 497 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 499 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(member.DetermineType())); #line default #line hidden - #line 497 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 499 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write("();\r\n }\r\n\t\t\t\t\t var unmarshaller = "); #line default #line hidden - #line 499 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 501 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(member.DetermineTypeUnmarshallerInstantiate())); #line default #line hidden - #line 499 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 501 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write(";\r\n\t\t\t\t\t "); #line default #line hidden - #line 500 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 502 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(unmarshalledVariable)); #line default #line hidden - #line 500 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 502 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write("."); #line default #line hidden - #line 500 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 502 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName)); #line default #line hidden - #line 500 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 502 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write(".Add(unmarshaller.Unmarshall(context));\r\n"); #line default #line hidden - #line 501 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 503 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" } @@ -2127,20 +2129,20 @@ protected void ProcessResponseBodyOrStructureMembers(Member member, bool isStruc #line default #line hidden - #line 504 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 506 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" WriteInjectXmlUnmarshallCode(member); #line default #line hidden - #line 504 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 506 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write("\t\t\t\t\t continue;\r\n"); #line default #line hidden - #line 506 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 508 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" if (!skipXmlTestExpression) { @@ -2149,14 +2151,14 @@ protected void ProcessResponseBodyOrStructureMembers(Member member, bool isStruc #line default #line hidden - #line 509 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 511 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write("\t\t\t\t }\r\n"); #line default #line hidden - #line 511 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 513 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" } } @@ -2172,28 +2174,28 @@ protected void ProcessResponseBodyOrStructureMembers(Member member, bool isStruc #line default #line hidden - #line 521 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 523 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write("\t\t\t\t\tif (context.TestExpression(\""); #line default #line hidden - #line 522 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 524 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(DetermineXmlMarshallName(member))); #line default #line hidden - #line 522 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 524 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write("\", targetDepth))\r\n\t\t\t\t\t{\r\n"); #line default #line hidden - #line 524 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 526 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" } if (!skipXmlTestExpressionInnerLogic) @@ -2203,98 +2205,98 @@ protected void ProcessResponseBodyOrStructureMembers(Member member, bool isStruc #line default #line hidden - #line 528 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 530 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write(" if (response."); #line default #line hidden - #line 529 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 531 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName)); #line default #line hidden - #line 529 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 531 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write(" == null)\r\n {\r\n response."); #line default #line hidden - #line 531 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 533 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName)); #line default #line hidden - #line 531 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 533 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write(" = new "); #line default #line hidden - #line 531 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 533 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(member.DetermineType())); #line default #line hidden - #line 531 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 533 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write("();\r\n }\r\n\t\t\t\t\t\tvar unmarshaller = "); #line default #line hidden - #line 533 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 535 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(member.DetermineTypeUnmarshallerInstantiate())); #line default #line hidden - #line 533 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 535 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write(";\r\n\t\t\t\t\t\t"); #line default #line hidden - #line 534 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 536 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(unmarshalledVariable)); #line default #line hidden - #line 534 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 536 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write("."); #line default #line hidden - #line 534 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 536 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName)); #line default #line hidden - #line 534 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 536 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write(".Add(unmarshaller.Unmarshall(context));\r\n"); #line default #line hidden - #line 535 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 537 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" } @@ -2302,20 +2304,20 @@ protected void ProcessResponseBodyOrStructureMembers(Member member, bool isStruc #line default #line hidden - #line 538 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 540 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" WriteInjectXmlUnmarshallCode(member); #line default #line hidden - #line 538 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 540 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write("\t\t\t\t\t\tcontinue;\r\n"); #line default #line hidden - #line 540 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 542 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" if (!skipXmlTestExpression) { @@ -2324,14 +2326,14 @@ protected void ProcessResponseBodyOrStructureMembers(Member member, bool isStruc #line default #line hidden - #line 543 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 545 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write("\t\t\t\t\t}\r\n"); #line default #line hidden - #line 545 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 547 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" } } @@ -2344,28 +2346,28 @@ protected void ProcessResponseBodyOrStructureMembers(Member member, bool isStruc #line default #line hidden - #line 552 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 554 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write("\t\t\t\t\tif (context.TestExpression(\""); #line default #line hidden - #line 553 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 555 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(DetermineXmlMarshallName(member))); #line default #line hidden - #line 553 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 555 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write("\", targetDepth))\r\n\t\t\t\t\t{\r\n"); #line default #line hidden - #line 555 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 557 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" } if (!skipXmlTestExpressionInnerLogic) @@ -2375,56 +2377,56 @@ protected void ProcessResponseBodyOrStructureMembers(Member member, bool isStruc #line default #line hidden - #line 559 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 561 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write("\t\t\t\t\t\tvar unmarshaller = "); #line default #line hidden - #line 560 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 562 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(member.DetermineTypeUnmarshallerInstantiate())); #line default #line hidden - #line 560 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 562 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write(";\r\n\t\t\t\t\t\t"); #line default #line hidden - #line 561 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 563 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(unmarshalledVariable)); #line default #line hidden - #line 561 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 563 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write("."); #line default #line hidden - #line 561 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 563 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName)); #line default #line hidden - #line 561 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 563 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write(" = unmarshaller.Unmarshall(context);\r\n"); #line default #line hidden - #line 562 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 564 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" } @@ -2432,20 +2434,20 @@ protected void ProcessResponseBodyOrStructureMembers(Member member, bool isStruc #line default #line hidden - #line 565 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 567 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" WriteInjectXmlUnmarshallCode(member); #line default #line hidden - #line 565 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 567 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write("\t\t\t\t\t\tcontinue;\r\n"); #line default #line hidden - #line 567 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 569 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" if (!skipXmlTestExpression) { @@ -2454,14 +2456,14 @@ protected void ProcessResponseBodyOrStructureMembers(Member member, bool isStruc #line default #line hidden - #line 570 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 572 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write("\t\t\t\t\t}\r\n"); #line default #line hidden - #line 572 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 574 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" } } @@ -2475,28 +2477,28 @@ protected void ProcessResponseBodyOrStructureMembers(Member member, bool isStruc #line default #line hidden - #line 580 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 582 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write("\t\t\t\t\tif (context.TestExpression(\""); #line default #line hidden - #line 581 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 583 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(DetermineXmlMarshallName(member))); #line default #line hidden - #line 581 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 583 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write("\", targetDepth))\r\n\t\t\t\t\t{\r\n"); #line default #line hidden - #line 583 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 585 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" } else @@ -2508,28 +2510,28 @@ protected void ProcessResponseBodyOrStructureMembers(Member member, bool isStruc #line default #line hidden - #line 589 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 591 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write(" if (context.TestExpression(\"@"); #line default #line hidden - #line 590 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 592 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(DetermineXmlMarshallName(member, false))); #line default #line hidden - #line 590 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 592 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write("\", targetDepth - 1))\r\n\t\t\t\t\t{\r\n"); #line default #line hidden - #line 592 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 594 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" } } @@ -2542,56 +2544,56 @@ protected void ProcessResponseBodyOrStructureMembers(Member member, bool isStruc #line default #line hidden - #line 599 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 601 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write("\t\t\t\t\t\tvar unmarshaller = "); #line default #line hidden - #line 600 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 602 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(member.DetermineTypeUnmarshallerInstantiate())); #line default #line hidden - #line 600 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 602 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write(";\r\n\t\t\t\t\t\t"); #line default #line hidden - #line 601 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 603 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(unmarshalledVariable)); #line default #line hidden - #line 601 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 603 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write("."); #line default #line hidden - #line 601 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 603 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName)); #line default #line hidden - #line 601 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 603 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write(" = unmarshaller.Unmarshall(context);\r\n"); #line default #line hidden - #line 602 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 604 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" } @@ -2599,20 +2601,20 @@ protected void ProcessResponseBodyOrStructureMembers(Member member, bool isStruc #line default #line hidden - #line 605 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 607 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" WriteInjectXmlUnmarshallCode(member); #line default #line hidden - #line 605 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 607 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write("\t\t\t\t\t\tcontinue;\r\n"); #line default #line hidden - #line 607 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 609 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" } if (member.HasPredicateListUnmarshaller) @@ -2627,112 +2629,112 @@ protected void ProcessResponseBodyOrStructureMembers(Member member, bool isStruc #line default #line hidden - #line 616 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 618 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write("\t\t\t\t\t\tvar predicateList = "); #line default #line hidden - #line 617 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 619 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(predicateListUnmarshallerName)); #line default #line hidden - #line 617 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 619 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write(".Instance.Unmarshall(context);\r\n\t\t\t\t\t\t"); #line default #line hidden - #line 618 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 620 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(unmarshalledVariable)); #line default #line hidden - #line 618 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 620 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write("."); #line default #line hidden - #line 618 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 620 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName)); #line default #line hidden - #line 618 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 620 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write(" = new "); #line default #line hidden - #line 618 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 620 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(member.DetermineType())); #line default #line hidden - #line 618 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 620 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write("();\r\n\t\t\t\t\t\t"); #line default #line hidden - #line 619 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 621 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(unmarshalledVariable)); #line default #line hidden - #line 619 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 621 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write("."); #line default #line hidden - #line 619 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 621 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName)); #line default #line hidden - #line 619 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 621 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write("."); #line default #line hidden - #line 619 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 621 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(filterPredicateName)); #line default #line hidden - #line 619 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 621 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write(" = predicateList[0];\r\n"); #line default #line hidden - #line 620 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 622 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" } @@ -2740,20 +2742,20 @@ protected void ProcessResponseBodyOrStructureMembers(Member member, bool isStruc #line default #line hidden - #line 623 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 625 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" WriteInjectXmlUnmarshallCode(member); #line default #line hidden - #line 623 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 625 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write("\t\t\t\t\t\tcontinue;\r\n"); #line default #line hidden - #line 625 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 627 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" } if (!skipXmlTestExpression) @@ -2763,14 +2765,14 @@ protected void ProcessResponseBodyOrStructureMembers(Member member, bool isStruc #line default #line hidden - #line 629 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 631 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write("\t\t\t\t\t}\r\n"); #line default #line hidden - #line 631 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 633 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" } } @@ -2780,7 +2782,7 @@ protected void ProcessResponseBodyOrStructureMembers(Member member, bool isStruc #line default #line hidden - #line 636 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 638 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" protected void WriteInjectXmlUnmarshallCode(Member member) { @@ -2793,28 +2795,28 @@ protected void WriteInjectXmlUnmarshallCode(Member member) #line default #line hidden - #line 643 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 645 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write(" "); #line default #line hidden - #line 644 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 646 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(code)); #line default #line hidden - #line 644 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 646 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" this.Write("\r\n"); #line default #line hidden - #line 645 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" + #line 647 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\BaseResponseUnmarshaller.tt" } } diff --git a/generator/ServiceClientGeneratorLib/Generators/Marshallers/BaseResponseUnmarshaller.tt b/generator/ServiceClientGeneratorLib/Generators/Marshallers/BaseResponseUnmarshaller.tt index 24b9745d2972..87e1305dba6f 100644 --- a/generator/ServiceClientGeneratorLib/Generators/Marshallers/BaseResponseUnmarshaller.tt +++ b/generator/ServiceClientGeneratorLib/Generators/Marshallers/BaseResponseUnmarshaller.tt @@ -445,6 +445,8 @@ using Amazon.Runtime.Internal.Util; if (dataTypeOverride.IsFlattened) dataTypeSwapIsFlattened = true; } + if (this.Config.ServiceModel.Customizations.FlattenShapes(member.OwningShape.Name).Contains(member.ModeledName)) + return; string unmarshalledVariable = isStructure ? "unmarshalledObject" : "response"; if (member.Shape.IsList || isDataTypeSwapList) { diff --git a/generator/ServiceClientGeneratorLib/Generators/Marshallers/RestXmlResponseUnmarshaller.cs b/generator/ServiceClientGeneratorLib/Generators/Marshallers/RestXmlResponseUnmarshaller.cs index 227e2ec95750..1db2a0218aec 100644 --- a/generator/ServiceClientGeneratorLib/Generators/Marshallers/RestXmlResponseUnmarshaller.cs +++ b/generator/ServiceClientGeneratorLib/Generators/Marshallers/RestXmlResponseUnmarshaller.cs @@ -298,6 +298,19 @@ public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext conte #line 135 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlResponseUnmarshaller.tt" } + if (payload != null && this.Config.ServiceModel.Customizations.FlattenShapes(this.Structure.Name).Contains(payload.ModeledName)) + { + + + #line default + #line hidden + this.Write(" // payload has been flattened so that members of the result object ar" + + "e directly unmarshalled instead of unmarshalled\r\n // as part of the c" + + "ontainer class, so look one level deeper\r\n targetDepth += 1;\r\n"); + + #line 143 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlResponseUnmarshaller.tt" + + } } @@ -307,7 +320,7 @@ public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext conte "\n }\r\n while (context.Read())\r\n {\r\n\t\t\t\tif (conte" + "xt.IsStartElement || context.IsAttribute)\r\n {\r\n"); - #line 147 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlResponseUnmarshaller.tt" + #line 155 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlResponseUnmarshaller.tt" foreach (var member in this.Operation.ResponseBodyMembers) { @@ -326,7 +339,7 @@ public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext conte "\r\n {\r\n return;\r\n }\r\n " + " }\r\n return;\r\n }\r\n"); - #line 166 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlResponseUnmarshaller.tt" + #line 174 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlResponseUnmarshaller.tt" } @@ -346,7 +359,7 @@ public override AmazonServiceException UnmarshallException(XmlUnmarshallerContex { "); - #line 179 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlResponseUnmarshaller.tt" + #line 187 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlResponseUnmarshaller.tt" if (this.Config.ServiceId == "S3") { @@ -357,7 +370,7 @@ public override AmazonServiceException UnmarshallException(XmlUnmarshallerContex this.Write(" S3ErrorResponse errorResponse = S3ErrorResponseUnmarshaller.Instance." + "Unmarshall(context);\r\n"); - #line 184 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlResponseUnmarshaller.tt" + #line 192 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlResponseUnmarshaller.tt" } else @@ -369,7 +382,7 @@ public override AmazonServiceException UnmarshallException(XmlUnmarshallerContex this.Write(" ErrorResponse errorResponse = XmlErrorResponseUnmarshaller.GetInstanc" + "e().Unmarshall(context);\r\n"); - #line 190 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlResponseUnmarshaller.tt" + #line 198 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlResponseUnmarshaller.tt" } @@ -386,7 +399,7 @@ public override AmazonServiceException UnmarshallException(XmlUnmarshallerContex { "); - #line 201 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlResponseUnmarshaller.tt" + #line 209 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlResponseUnmarshaller.tt" foreach (var exception in this.Operation.Exceptions) { @@ -396,14 +409,14 @@ public override AmazonServiceException UnmarshallException(XmlUnmarshallerContex #line hidden this.Write(" if (errorResponse.Code != null && errorResponse.Code.Equals(\""); - #line 205 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlResponseUnmarshaller.tt" + #line 213 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlResponseUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(exception.Code)); #line default #line hidden this.Write("\"))\r\n {\r\n return "); - #line 207 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlResponseUnmarshaller.tt" + #line 215 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlResponseUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(exception.Name)); #line default @@ -411,7 +424,7 @@ public override AmazonServiceException UnmarshallException(XmlUnmarshallerContex this.Write("Unmarshaller.Instance.Unmarshall(contextCopy, errorResponse);\r\n }\r" + "\n"); - #line 209 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlResponseUnmarshaller.tt" + #line 217 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlResponseUnmarshaller.tt" } @@ -420,7 +433,7 @@ public override AmazonServiceException UnmarshallException(XmlUnmarshallerContex #line hidden this.Write(" }\r\n"); - #line 213 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlResponseUnmarshaller.tt" + #line 221 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlResponseUnmarshaller.tt" if (this.Config.ServiceId == "S3") { @@ -431,7 +444,7 @@ public override AmazonServiceException UnmarshallException(XmlUnmarshallerContex this.Write(" return base.ConstructS3Exception(context, errorResponse, innerExcepti" + "on, statusCode);\r\n"); - #line 218 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlResponseUnmarshaller.tt" + #line 226 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlResponseUnmarshaller.tt" } else @@ -442,7 +455,7 @@ public override AmazonServiceException UnmarshallException(XmlUnmarshallerContex #line hidden this.Write(" return new "); - #line 223 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlResponseUnmarshaller.tt" + #line 231 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlResponseUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(this.BaseException)); #line default @@ -450,7 +463,7 @@ public override AmazonServiceException UnmarshallException(XmlUnmarshallerContex this.Write("(errorResponse.Message, innerException, errorResponse.Type, errorResponse.Code, e" + "rrorResponse.RequestId, statusCode);\r\n"); - #line 224 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlResponseUnmarshaller.tt" + #line 232 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlResponseUnmarshaller.tt" } @@ -460,14 +473,14 @@ public override AmazonServiceException UnmarshallException(XmlUnmarshallerContex this.Write(" }\r\n\r\n partial void PostUnmarshallCustomization(XmlUnmarshallerCont" + "ext context, "); - #line 229 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlResponseUnmarshaller.tt" + #line 237 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlResponseUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(this.Operation.Name)); #line default #line hidden this.Write("Response response);\r\n\r\n"); - #line 231 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlResponseUnmarshaller.tt" + #line 239 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlResponseUnmarshaller.tt" this.AddResponseSingletonMethod(); diff --git a/generator/ServiceClientGeneratorLib/Generators/Marshallers/RestXmlResponseUnmarshaller.tt b/generator/ServiceClientGeneratorLib/Generators/Marshallers/RestXmlResponseUnmarshaller.tt index 8f0eb5c25e5a..118d15efcfbd 100644 --- a/generator/ServiceClientGeneratorLib/Generators/Marshallers/RestXmlResponseUnmarshaller.tt +++ b/generator/ServiceClientGeneratorLib/Generators/Marshallers/RestXmlResponseUnmarshaller.tt @@ -132,6 +132,14 @@ namespace <#=this.Config.Namespace #>.Model.Internal.MarshallTransformations #> if (context.IsStartOfDocument) targetDepth += 1; +<# + } + if (payload != null && this.Config.ServiceModel.Customizations.FlattenShapes(this.Structure.Name).Contains(payload.ModeledName)) + { +#> + // payload has been flattened so that members of the result object are directly unmarshalled instead of unmarshalled + // as part of the container class, so look one level deeper + targetDepth += 1; <# } } diff --git a/generator/ServiceClientGeneratorLib/ServiceModel.cs b/generator/ServiceClientGeneratorLib/ServiceModel.cs index 7731c19bccb6..9ddca91dc1fa 100644 --- a/generator/ServiceClientGeneratorLib/ServiceModel.cs +++ b/generator/ServiceClientGeneratorLib/ServiceModel.cs @@ -546,7 +546,7 @@ public List S3AllowListOperations new Operation(this, "PutBucketLifecycleConfiguration", DocumentRoot[OperationsKey]["PutBucketLifecycleConfiguration"]), new Operation(this, "PutBucketNotificationConfiguration", DocumentRoot[OperationsKey]["PutBucketNotificationConfiguration"]), new Operation(this, "PutObjectAcl", DocumentRoot[OperationsKey]["PutObjectAcl"]), - //////new Operation(this, "UploadPartCopy", DocumentRoot[OperationsKey]["UploadPartCopy"]), + new Operation(this, "UploadPartCopy", DocumentRoot[OperationsKey]["UploadPartCopy"]), new Operation(this, "ListObjectsV2", DocumentRoot[OperationsKey]["ListObjectsV2"]), }; diff --git a/generator/ServiceModels/s3/s3.customizations.json b/generator/ServiceModels/s3/s3.customizations.json index 9edcfd0db37c..0d133a68b70f 100644 --- a/generator/ServiceModels/s3/s3.customizations.json +++ b/generator/ServiceModels/s3/s3.customizations.json @@ -388,41 +388,82 @@ "UploadPartCopyRequest": { "modify": [ { - "Bucket": { "emitPropertyName": "DestinationBucket" } + "CopySourceIfModifiedSince":{"emitPropertyName":"ModifiedSinceDate"} + }, + { + "CopySourceIfUnmodifiedSince":{"emitPropertyName":"UnmodifiedSinceDate"} + }, + { + "SSECustomerAlgorithm" : {"emitPropertyName": "ServerSideEncryptionCustomerMethod"} + }, + { + "SSECustomerKey" : {"emitPropertyName" : "ServerSideEncryptionCustomerProvidedKey"} + }, + { + "SSECustomerKeyMD5" : {"emitPropertyName":"ServerSideEncryptionCustomerProvidedKeyMD5"} + }, + { + "CopySourceSSECustomerAlgorithm" : {"emitPropertyName" : "CopySourceServerSideEncryptionCustomerMethod"} + }, + { + "CopySourceSSECustomerKey" : {"emitPropertyName" : "CopySourceServerSideEncryptionCustomerProvidedKey"} + }, + { + "CopySourceSSECustomerKeyMD5" : {"emitPropertyName":"CopySourceServerSideEncryptionCustomerProvidedKeyMD5"} + }, + { + "CopySourceIfMatch" : {"emitPropertyName" : "ETagToMatch"} + }, + { + "CopySourceIfNoneMatch" : {"emitPropertyName" : "ETagsToNotMatch"} + }, + { + "Bucket" : {"emitPropertyName" : "DestinationBucket"} } ], "exclude": [ "CopySource", - "Key" + "Key", + "CopySourceRange" ], "inject": [ { "SourceBucket": { - "shape": "BucketName" + "shape": "BucketName", + "location":"header" } }, { "SourceKey": { "shape": "ObjectKey", - "originalMember":"CopySource" + "originalMember":"CopySource", + "location":"header" } }, { "SourceVersionId": { - "shape": "CopySourceVersionId" - } - }, - { - "DestinationBucket": { - "shape": "BucketName" + "shape": "CopySourceVersionId", + "location":"header" } }, { "DestinationKey": { "shape": "ObjectKey", - "originalMember": "Key" + "originalMember": "Key", + "location":"header" } } + ], + "excludeFromMarshalling":[ + "ServerSideEncryptionCustomerProvidedKey", + "ServerSideEncryptionCustomerProvidedKeyMD5", + "CopySourceServerSideEncryptionCustomerProvidedKey", + "CopySourceServerSideEncryptionCustomerProvidedKeyMD5", + "SourceKey", + "SourceBucket", + "DestinationKey", + "DestinationBucket", + "SourceVersionId" ] }, "S3Grantee":{ @@ -636,6 +677,16 @@ "EncodingType" : {"emitPropertyName" : "Encoding"} } ] + }, + "UploadPartCopyOutput" :{ + "modify" : [ + { + "SSEKMSKeyId" : {"emitPropertyName" : "ServerSideEncryptionKeyManagementServiceKeyId"} + }, + { + "ServerSideEncryption" : {"emitPropertyName" : "ServerSideEncryptionMethod"} + } + ] } }, "operationModifiers": { @@ -896,6 +947,28 @@ "Marshaller": "StringUtils.FromString", "Unmarshaller" : "CommonPrefixesItemUnmarshaller" } + }, + "UploadPartCopyRequest":{ + "ServerSideEncryptionCustomerMethod" : { + "Type": "ServerSideEncryptionCustomerMethod", + "Marshaller": "StringUtils.FromString", + "Unmarshaller": "StringUnmarshaller" + }, + "CopySourceServerSideEncryptionCustomerMethod":{ + "Type": "ServerSideEncryptionCustomerMethod", + "Marshaller": "StringUtils.FromString", + "Unmarshaller": "StringUnmarshaller" + }, + "ETagToMatch":{ + "Type" : "List", + "Marshaller": "Amazon.Util.AWSSDKUtils.Join", + "Unmarshaller": "StringUnmarshaller" + }, + "ETagsToNotMatch" : { + "Type" : "List", + "Marshaller" : "Amazon.Util.AWSSDKUtils.Join", + "Unmarshaller" : "StringUnmarshaller" + } } }, "excludeMembers":{ @@ -971,10 +1044,14 @@ "flattenShapes" : { "PutBucketNotificationConfigurationRequest" : [ "NotificationConfiguration" + ], + "UploadPartCopyOutput" : [ + "CopyPartResult" ] }, "excludeShapes":[ - "NotificationConfiguration" + "NotificationConfiguration", + "CopyPartResult" ], "implementsVisitorPattern":{ "LifecycleFilter":{ diff --git a/sdk/src/Services/S3/Custom/Model/CopyPartRequest.cs b/sdk/src/Services/S3/Custom/Model/CopyPartRequest.cs index 828dcba26d7e..5a5aa3069e63 100644 --- a/sdk/src/Services/S3/Custom/Model/CopyPartRequest.cs +++ b/sdk/src/Services/S3/Custom/Model/CopyPartRequest.cs @@ -23,536 +23,10 @@ namespace Amazon.S3.Model { - /// - /// Container for the parameters to the CopyPart operation. - /// Uploads a part by copying data from an existing object as data source. To specify - /// the data source, you add the request header x-amz-copy-source in your - /// request. To specify a byte range, you add the request header x-amz-copy-source-range - /// in your request. - /// - /// - /// - /// For information about maximum and minimum part sizes and other multipart upload specifications, - /// see Multipart - /// upload limits in the Amazon S3 User Guide. - /// - /// - /// - /// Instead of copying data from an existing object as part data, you might use the UploadPart - /// action to upload new data as a part of an object in your request. - /// - /// - /// - /// You must initiate a multipart upload before you can upload any part. In response to - /// your initiate request, Amazon S3 returns the upload ID, a unique identifier that you - /// must include in your upload part request. - /// - /// - /// - /// For conceptual information about multipart uploads, see Uploading - /// Objects Using Multipart Upload in the Amazon S3 User Guide. For information - /// about copying objects using a single atomic action vs. a multipart upload, see Operations - /// on Objects in the Amazon S3 User Guide. - /// - /// - /// - /// Directory buckets - For directory buckets, you must make requests for this - /// API operation to the Zonal endpoint. These endpoints support virtual-hosted-style - /// requests in the format https://bucket_name.s3express-az_id.region.amazonaws.com/key-name - /// . Path-style requests are not supported. For more information, see Regional - /// and Zonal endpoints in the Amazon S3 User Guide. - /// - ///
Authentication and authorization
- /// - /// All UploadPartCopy requests must be authenticated and signed by using - /// IAM credentials (access key ID and secret access key for the IAM identities). All - /// headers with the x-amz- prefix, including x-amz-copy-source, - /// must be signed. For more information, see REST - /// Authentication. - /// - /// - /// - /// Directory buckets - You must use IAM credentials to authenticate and authorize - /// your access to the UploadPartCopy API operation, instead of using the - /// temporary security credentials through the CreateSession API operation. - /// - /// - /// - /// Amazon Web Services CLI or SDKs handles authentication and authorization on your behalf. - /// - ///
Permissions
- /// - /// You must have READ access to the source object and WRITE - /// access to the destination bucket. - /// - ///
  • - /// - /// General purpose bucket permissions - You must have the permissions in a policy - /// based on the bucket types of your source bucket and destination bucket in an UploadPartCopy - /// operation. - /// - ///
    • - /// - /// If the source object is in a general purpose bucket, you must have the s3:GetObject - /// permission to read the source object that is being copied. - /// - ///
    • - /// - /// If the destination bucket is a general purpose bucket, you must have the s3:PutObject - /// permission to write the object copy to the destination bucket. - /// - ///
    - /// - /// For information about permissions required to use the multipart upload API, see Multipart - /// Upload and Permissions in the Amazon S3 User Guide. - /// - ///
  • - /// - /// Directory bucket permissions - You must have permissions in a bucket policy - /// or an IAM identity-based policy based on the source and destination bucket types in - /// an UploadPartCopy operation. - /// - ///
    • - /// - /// If the source object that you want to copy is in a directory bucket, you must have - /// the s3express:CreateSession permission in the Action - /// element of a policy to read the object . By default, the session is in the ReadWrite - /// mode. If you want to restrict the access, you can explicitly set the s3express:SessionMode - /// condition key to ReadOnly on the copy source bucket. - /// - ///
    • - /// - /// If the copy destination is a directory bucket, you must have the s3express:CreateSession - /// permission in the Action element of a policy to write the object - /// to the destination. The s3express:SessionMode condition key cannot be - /// set to ReadOnly on the copy destination. - /// - ///
    - /// - /// For example policies, see Example - /// bucket policies for S3 Express One Zone and Amazon - /// Web Services Identity and Access Management (IAM) identity-based policies for S3 Express - /// One Zone in the Amazon S3 User Guide. - /// - ///
Encryption
  • - /// - /// General purpose buckets - For information about using server-side encryption - /// with customer-provided encryption keys with the UploadPartCopy operation, - /// see CopyObject - /// and UploadPart. - /// - /// - ///
  • - /// - /// Directory buckets - For directory buckets, only server-side encryption with - /// Amazon S3 managed keys (SSE-S3) (AES256) is supported. - /// - ///
Special errors
  • - /// - /// Error Code: NoSuchUpload - /// - ///
    • - /// - /// Description: The specified multipart upload does not exist. The upload ID might be - /// invalid, or the multipart upload might have been aborted or completed. - /// - ///
    • - /// - /// HTTP Status Code: 404 Not Found - /// - ///
  • - /// - /// Error Code: InvalidRequest - /// - ///
    • - /// - /// Description: The specified copy source is not supported as a byte-range copy source. - /// - ///
    • - /// - /// HTTP Status Code: 400 Bad Request - /// - ///
HTTP Host header syntax
- /// - /// Directory buckets - The HTTP Host header syntax is Bucket_name.s3express-az_id.region.amazonaws.com. - /// - ///
- /// - /// The following operations are related to UploadPartCopy: - /// - /// - ///
public partial class CopyPartRequest : AmazonWebServiceRequest { - private string srcBucket; - private string srcKey; - private string srcVersionId; - private string dstBucket; - private string dstKey; - private string uploadId; - private List etagsToMatch = AWSConfigs.InitializeCollections ? new List() : null; - private List etagsToNotMatch = AWSConfigs.InitializeCollections ? new List() : null; - private DateTime? modifiedSinceDate; - private DateTime? unmodifiedSinceDate; - private int? partNumber; private long? firstByte; private long? lastByte; - private string expectedBucketOwner; - private string expectedSourceBucketOwner; - private RequestPayer requestPayer; - - private ServerSideEncryptionCustomerMethod serverSideCustomerEncryption; - private string serverSideEncryptionCustomerProvidedKey; - private string serverSideEncryptionCustomerProvidedKeyMD5; - - private ServerSideEncryptionCustomerMethod copySourceServerSideCustomerEncryption; - private string copySourceServerSideEncryptionCustomerProvidedKey; - private string copySourceServerSideEncryptionCustomerProvidedKeyMD5; - - - /// - /// The name of the bucket containing the object to copy. - /// - public string SourceBucket - { - get { return this.srcBucket; } - set { this.srcBucket = value; } - } - - - /// - /// Checks if SourceBucket property is set. - /// - /// true if SourceBucket property is set. - internal bool IsSetSourceBucket() - { - return !System.String.IsNullOrEmpty(this.srcBucket); - } - - - /// - /// The key of the object to copy. - /// - /// - /// - /// This property will be used as part of the resource path of the HTTP request. In .NET the System.Uri class - /// is used to construct the uri for the request. The System.Uri class will canonicalize the uri string by compacting characters like "..". - /// For example an object key of "foo/../bar/file.txt" will be transformed into "bar/file.txt" because the ".." - /// is interpreted as use parent directory. - /// - /// - /// Starting with .NET 8, the AWS .NET SDK disables System.Uri's feature of canonicalizing the resource path. This allows S3 keys like - /// "foo/../bar/file.txt" to work correctly with the AWS .NET SDK. - /// - /// - /// For further information view the documentation for the Uri class: https://docs.microsoft.com/en-us/dotnet/api/system.uri - /// - /// - public string SourceKey - { - get { return this.srcKey; } - set { this.srcKey = value; } - } - - - /// - /// Checks if SourceKey property is set. - /// - /// true if SourceKey property is set. - internal bool IsSetSourceKey() - { - return !System.String.IsNullOrEmpty(this.srcKey); - } - - - /// - /// Specifies a particular version of the source object to copy. By default the latest version is copied. - /// - public string SourceVersionId - { - get { return this.srcVersionId; } - set { this.srcVersionId = value; } - } - - - /// - /// Checks if SourceVersionId property is set. - /// - /// true if SourceVersionId property is set. - internal bool IsSetSourceVersionId() - { - return !System.String.IsNullOrEmpty(this.srcVersionId); - } - - - /// - /// Gets and sets the property DestinationBucket. - /// - /// The bucket name. - /// - /// - /// Directory buckets - When you use this operation with a directory bucket, you must use virtual-hosted-style requests in the - /// format Bucket-name.s3express-zone-id.region-code.amazonaws.com. Path-style requests are not - /// supported. Directory bucket names must be unique in the chosen Zone (Availability Zone or Local Zone). Bucket names must follow the - /// format bucket-base-name--zone-id--x-s3 (for example, amzn-s3-demo-bucket--usw2-az1--x-s3). For - /// information about bucket naming restrictions, see - /// Directory bucket naming rules in - /// the Amazon S3 User Guide. - /// - /// - /// - /// Copying objects across different Amazon Web Services Regions isn't supported when the source or destination bucket is in Amazon Web Services - /// Local Zones. The source and destination buckets must have the same parent Amazon Web Services Region. Otherwise, you get an - /// HTTP 400 Bad Request error with the error code InvalidRequest. - /// - /// - /// - /// Access points - When you use this action with an access point for general purpose buckets, you must provide the alias of the access - /// point in place of the bucket name or specify the access point ARN. When you use this action with an access point for directory buckets, you - /// must provide the access point name in place of the bucket name. When using the access point ARN, you must direct requests to the access - /// point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When - /// using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For - /// more information about access point ARNs, see - /// Using access points in the Amazon S3 User Guide. - /// - /// - /// - /// Object Lambda access points are not supported by directory buckets. - /// - /// - /// - /// S3 on Outposts - When you use this action with S3 on Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on Outposts - /// hostname takes the form AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When you use this - /// action with S3 on Outposts, the destination bucket must be the Outposts access point ARN or the access point alias. For more information about S3 - /// on Outposts, see - /// What is S3 on Outposts? in the Amazon S3 User Guide. - /// - /// - public string DestinationBucket - { - get { return this.dstBucket; } - set { this.dstBucket = value; } - } - - - /// - /// Checks if DestinationBucket property is set. - /// - /// true if DestinationBucket property is set. - internal bool IsSetDestinationBucket() - { - return !System.String.IsNullOrEmpty(this.dstBucket); - } - - /// - /// The key to be given to the copy of the source object. - /// - /// - /// - /// This property will be used as part of the resource path of the HTTP request. In .NET the System.Uri class - /// is used to construct the uri for the request. The System.Uri class will canonicalize the uri string by compacting characters like "..". - /// For example an object key of "foo/../bar/file.txt" will be transformed into "bar/file.txt" because the ".." - /// is interpreted as use parent directory. - /// - /// - /// Starting with .NET 8, the AWS .NET SDK disables System.Uri's feature of canonicalizing the resource path. This allows S3 keys like - /// "foo/../bar/file.txt" to work correctly with the AWS .NET SDK. - /// - /// - /// For further information view the documentation for the Uri class: https://docs.microsoft.com/en-us/dotnet/api/system.uri - /// - /// - public string DestinationKey - { - get { return this.dstKey; } - set { this.dstKey = value; } - } - - /// - /// Checks if DestinationKey property is set. - /// - /// true if DestinationKey property is set. - internal bool IsSetDestinationKey() - { - return !System.String.IsNullOrEmpty(this.dstKey); - } - - /// - /// The ID identifying multipart upload for which we are copying a part. - /// - public string UploadId - { - get { return this.uploadId; } - set { this.uploadId = value; } - } - - - /// - /// Checks if UploadId property is set. - /// - /// true if UploadId property is set. - internal bool IsSetUploadId() - { - return !System.String.IsNullOrEmpty(this.uploadId); - } - - /// - /// Collection of ETags to be matched as a pre-condition for copying the source object - /// otherwise returns a PreconditionFailed. - /// - /// - /// Copies the object if its entity tag (ETag) matches one of - /// the specified tags; otherwise return a 412 (precondition failed). - /// Constraints: This property can be used with IfUnmodifiedSince, - /// but cannot be used with other conditional copy properties. - /// - public List ETagToMatch - { - get{ return this.etagsToMatch;} - set { this.etagsToMatch = value; } - } - - - /// - /// Checks if ETagsToMatch property is set. - /// - /// true if ETagToMatch property is set. - internal bool IsSetETagToMatch() - { - return ((etagsToMatch != null) && (etagsToMatch.Count > 0)); - } - - /// - /// Collection of ETags that must not be matched as a pre-condition for copying the source object - /// otherwise returns a PreconditionFailed. - /// - /// - /// Copies the object if its entity tag (ETag) does not match any of the specified - /// tags; otherwise returns a 412 (failed condition). - /// Constraints: This header can be used with IfModifiedSince, but cannot - /// be used with other conditional copy properties. - /// - public List ETagsToNotMatch - { - get { return this.etagsToNotMatch; } - set { this.etagsToNotMatch = value; } - } - - - /// - /// Checks if ETagToNotMatch property is set. - /// - /// true if ETagToNotMatch property is set. - internal bool IsSetETagToNotMatch() - { - return ((etagsToNotMatch != null) && (etagsToNotMatch.Count > 0)); - } - - /// - /// Copies the object if it has been modified since the specified time, otherwise returns a PreconditionFailed. - /// - /// - /// Copies the object if it has been modified since the - /// specified time; otherwise returns a 412 (failed condition). - /// Constraints: This property can be used with ETagToNotMatch, - /// but cannot be used with other conditional copy properties. - /// - public DateTime? ModifiedSinceDate - { - get { return this.modifiedSinceDate; } - set { this.modifiedSinceDate = value; } - } - - - /// - /// Checks if ModifiedSinceDate property is set. - /// - /// true if ModifiedSinceDate property is set. - internal bool IsSetModifiedSinceDate() - { - return this.modifiedSinceDate.HasValue; - } - - /// - /// Copies the object if it has not been modified since the specified time, otherwise returns a PreconditionFailed. - /// - /// - /// Copies the object if it hasn't been modified since the - /// specified time; otherwise returns a 412 (precondition failed). - /// Constraints: This property can be used with ETagToMatch, - /// but cannot be used with other conditional copy properties. - /// - public DateTime? UnmodifiedSinceDate - { - get { return this.unmodifiedSinceDate; } - set { this.unmodifiedSinceDate = value; } - } - - /// - /// Checks if UnmodifiedSinceDate property is set. - /// - /// true if UnmodifiedSinceDate property is set. - internal bool IsSetUnmodifiedSinceDate() - { - return this.unmodifiedSinceDate.HasValue; - } - - /// - /// The number of the part to be copied. - /// - /// - /// Valid part numbers are from 1 to 10,000 inclusive and will uniquely identify the part - /// and determine the relative ordering within the destination object. If a part already - /// exists with the PartNumber it will be overwritten. - /// - public int? PartNumber - { - get { return this.partNumber; } - set { this.partNumber = value; } - } - - /// - /// Checks if PartNumber property is set. - /// - /// true if PartNumber property is set. - internal bool IsSetPartNumber() - { - return this.partNumber.HasValue; - } - /// /// The location of the first byte in the range if only a portion of the /// source object is to be copied as the part. @@ -596,183 +70,5 @@ internal bool IsSetLastByte() { return this.lastByte.HasValue; } - - /// - /// The Server-side encryption algorithm to be used with the customer provided key. - /// - /// - public ServerSideEncryptionCustomerMethod ServerSideEncryptionCustomerMethod - { - get { return this.serverSideCustomerEncryption; } - set { this.serverSideCustomerEncryption = value; } - } - - // Check to see if ServerSideEncryptionCustomerMethod property is set - internal bool IsSetServerSideEncryptionCustomerMethod() - { - return this.serverSideCustomerEncryption != null && this.serverSideCustomerEncryption != ServerSideEncryptionCustomerMethod.None; - } - - /// - /// The base64-encoded encryption key for Amazon S3 to use to encrypt the object - /// - /// Using the encryption key you provide as part of your request Amazon S3 manages both the encryption, as it writes - /// to disks, and decryption, when you access your objects. Therefore, you don't need to maintain any data encryption code. The only - /// thing you do is manage the encryption keys you provide. - /// - /// - /// When you retrieve an object, you must provide the same encryption key as part of your request. Amazon S3 first verifies - /// the encryption key you provided matches, and then decrypts the object before returning the object data to you. - /// - /// - /// Important: Amazon S3 does not store the encryption key you provide. - /// - /// - [AWSProperty(Sensitive=true)] - public string ServerSideEncryptionCustomerProvidedKey - { - get { return this.serverSideEncryptionCustomerProvidedKey; } - set { this.serverSideEncryptionCustomerProvidedKey = value; } - } - - /// - /// Checks if ServerSideEncryptionCustomerProvidedKey property is set. - /// - /// true if ServerSideEncryptionCustomerProvidedKey property is set. - internal bool IsSetServerSideEncryptionCustomerProvidedKey() - { - return !System.String.IsNullOrEmpty(this.serverSideEncryptionCustomerProvidedKey); - } - - /// - /// The MD5 of the customer encryption key specified in the ServerSideEncryptionCustomerProvidedKey property. The MD5 is - /// base 64 encoded. This field is optional, the SDK will calculate the MD5 if this is not set. - /// - public string ServerSideEncryptionCustomerProvidedKeyMD5 - { - get { return this.serverSideEncryptionCustomerProvidedKeyMD5; } - set { this.serverSideEncryptionCustomerProvidedKeyMD5 = value; } - } - - /// - /// Checks if ServerSideEncryptionCustomerProvidedKeyMD5 property is set. - /// - /// true if ServerSideEncryptionCustomerProvidedKey property is set. - internal bool IsSetServerSideEncryptionCustomerProvidedKeyMD5() - { - return !System.String.IsNullOrEmpty(this.serverSideEncryptionCustomerProvidedKeyMD5); - } - - /// - /// The Server-side encryption algorithm to be used with the customer provided key. - /// - /// - public ServerSideEncryptionCustomerMethod CopySourceServerSideEncryptionCustomerMethod - { - get { return this.copySourceServerSideCustomerEncryption; } - set { this.copySourceServerSideCustomerEncryption = value; } - } - - // Check to see if CopySourceServerSideEncryptionCustomerMethod property is set - internal bool IsSetCopySourceServerSideEncryptionCustomerMethod() - { - return this.copySourceServerSideCustomerEncryption != null && this.copySourceServerSideCustomerEncryption != ServerSideEncryptionCustomerMethod.None; - } - - /// - /// The customer provided encryption key for the source object of the copy. - /// - /// Important: Amazon S3 does not store the encryption key you provide. - /// - /// - [AWSProperty(Sensitive=true)] - public string CopySourceServerSideEncryptionCustomerProvidedKey - { - get { return this.copySourceServerSideEncryptionCustomerProvidedKey; } - set { this.copySourceServerSideEncryptionCustomerProvidedKey = value; } - } - - /// - /// Checks if CopySourceServerSideEncryptionCustomerProvidedKey property is set. - /// - /// true if CopySourceServerSideEncryptionCustomerProvidedKey property is set. - internal bool IsSetCopySourceServerSideEncryptionCustomerProvidedKey() - { - return !System.String.IsNullOrEmpty(this.copySourceServerSideEncryptionCustomerProvidedKey); - } - - /// - /// The MD5 of the customer encryption key specified in the CopySourceServerSideEncryptionCustomerProvidedKey property. The MD5 is - /// base 64 encoded. This field is optional, the SDK will calculate the MD5 if this is not set. - /// - public string CopySourceServerSideEncryptionCustomerProvidedKeyMD5 - { - get { return this.copySourceServerSideEncryptionCustomerProvidedKeyMD5; } - set { this.copySourceServerSideEncryptionCustomerProvidedKeyMD5 = value; } - } - - /// - /// Checks if CopySourceServerSideEncryptionCustomerProvidedKeyMD5 property is set. - /// - /// true if CopySourceServerSideEncryptionCustomerProvidedKey property is set. - internal bool IsSetCopySourceServerSideEncryptionCustomerProvidedKeyMD5() - { - return !System.String.IsNullOrEmpty(this.copySourceServerSideEncryptionCustomerProvidedKeyMD5); - } - - /// - /// The account ID of the expected destination bucket owner. - /// If the destination bucket is owned by a different account, the request will fail with an HTTP 403 (Access Denied) error. - /// - public string ExpectedBucketOwner - { - get { return this.expectedBucketOwner; } - set { this.expectedBucketOwner = value; } - } - - /// - /// Checks to see if ExpectedBucketOwner is set. - /// - /// true, if ExpectedBucketOwner property is set. - internal bool IsSetExpectedBucketOwner() - { - return !String.IsNullOrEmpty(this.expectedBucketOwner); - } - - /// - /// The account ID of the expected source bucket owner. - /// If the source bucket is owned by a different account, the request will fail with an HTTP 403 (Access Denied) error. - /// - public string ExpectedSourceBucketOwner - { - get { return this.expectedSourceBucketOwner; } - set { this.expectedSourceBucketOwner = value; } - } - - /// - /// Checks to see if ExpectedSourceBucketOwner is set. - /// - /// true, if ExpectedSourceBucketOwner property is set. - internal bool IsSetExpectedSourceBucketOwner() - { - return !String.IsNullOrEmpty(this.expectedSourceBucketOwner); - } - - /// - /// Confirms that the requester knows that they will be charged for the request. - /// Bucket owners need not specify this parameter in their requests. - /// - public RequestPayer RequestPayer - { - get { return this.requestPayer; } - set { this.requestPayer = value; } - } - - // Check to see if RequestPayer property is set - internal bool IsSetRequestPayer() - { - return requestPayer != null; - } - } } diff --git a/sdk/src/Services/S3/Custom/Model/CopyPartResponse.cs b/sdk/src/Services/S3/Custom/Model/CopyPartResponse.cs index 1bd4b8d0e388..5f47c283320d 100644 --- a/sdk/src/Services/S3/Custom/Model/CopyPartResponse.cs +++ b/sdk/src/Services/S3/Custom/Model/CopyPartResponse.cs @@ -22,201 +22,9 @@ namespace Amazon.S3.Model { - /// - /// Returns information about the CopyPart response and response metadata. - /// - public class CopyPartResponse : AmazonWebServiceResponse + public partial class CopyPartResponse : AmazonWebServiceResponse { - private string _checksumCRC32; - private string _checksumCRC32C; - private string _checksumCRC64NVME; - private string _checksumSHA1; - private string _checksumSHA256; - private DateTime? lastModified; - private string eTag; - private string copySourceVersionId; private int? partNumber; - private ServerSideEncryptionMethod serverSideEncryption; - private string serverSideEncryptionKeyManagementServiceKeyId; - private bool? bucketKeyEnabled; - - /// - /// The version of the source object that was copied, if you have enabled versioning on the source bucketName. - /// - /// - public string CopySourceVersionId - { - get { return this.copySourceVersionId; } - set { this.copySourceVersionId = value; } - } - - // Check to see if CopySourceVersionId property is set - internal bool IsSetCopySourceVersionId() - { - return this.copySourceVersionId != null; - } - - /// - /// Gets and sets the property ChecksumCRC32. - /// - /// This header can be used as a data integrity check to verify that the data received - /// is the same data that was originally sent. This specifies the Base64 encoded, 32-bit - /// CRC-32 checksum of the part. For more information, see - /// Checking object integrity in the Amazon S3 User Guide. - /// - /// - public string ChecksumCRC32 - { - get { return this._checksumCRC32; } - set { this._checksumCRC32 = value; } - } - - // Check to see if ChecksumCRC32 property is set - internal bool IsSetChecksumCRC32() - { - return this._checksumCRC32 != null; - } - - /// - /// Gets and sets the property ChecksumCRC32C. - /// - /// This header can be used as a data integrity check to verify that the data received - /// is the same data that was originally sent. This specifies the Base64 encoded, 32-bit - /// CRC-32C checksum of the part. For more information, see - /// Checking object integrity in the Amazon S3 User Guide. - /// - /// - public string ChecksumCRC32C - { - get { return this._checksumCRC32C; } - set { this._checksumCRC32C = value; } - } - - // Check to see if ChecksumCRC32C property is set - internal bool IsSetChecksumCRC32C() - { - return this._checksumCRC32C != null; - } - - /// - /// Gets and sets the property ChecksumCRC64NVME. - /// - /// This header can be used as a data integrity check to verify that the data received - /// is the same data that was originally sent. This specifies the Base64 encoded, 64-bit - /// CRC-64NVME checksum of the part. For more information, see - /// Checking object integrity in the Amazon S3 User Guide. - /// - /// - public string ChecksumCRC64NVME - { - get { return this._checksumCRC64NVME; } - set { this._checksumCRC64NVME = value; } - } - - // Check to see if ChecksumCRC64NVME property is set - internal bool IsSetChecksumCRC64NVME() - { - return this._checksumCRC64NVME != null; - } - - /// - /// Gets and sets the property ChecksumSHA1. - /// - /// This header can be used as a data integrity check to verify that the data received - /// is the same data that was originally sent. This specifies the Base64 encoded, 160-bit - /// SHA-1 checksum of the part. For more information, see - /// Checking object integrity in the Amazon S3 User Guide. - /// - /// - public string ChecksumSHA1 - { - get { return this._checksumSHA1; } - set { this._checksumSHA1 = value; } - } - - // Check to see if ChecksumSHA1 property is set - internal bool IsSetChecksumSHA1() - { - return this._checksumSHA1 != null; - } - - /// - /// Gets and sets the property ChecksumSHA256. - /// - /// This header can be used as a data integrity check to verify that the data received - /// is the same data that was originally sent. This specifies the Base64 encoded, 256-bit - /// SHA-256 checksum of the part. For more information, see - /// Checking object integrity in the Amazon S3 User Guide. - /// - /// - public string ChecksumSHA256 - { - get { return this._checksumSHA256; } - set { this._checksumSHA256 = value; } - } - - // Check to see if ChecksumSHA256 property is set - internal bool IsSetChecksumSHA256() - { - return this._checksumSHA256 != null; - } - - /// - /// Entity tag of the object. - /// - /// - public string ETag - { - get { return this.eTag; } - set { this.eTag = value; } - } - - // Check to see if ETag property is set - internal bool IsSetETag() - { - return this.eTag != null; - } - - /// - /// Date and time at which the object was uploaded. - /// - /// - public DateTime? LastModified - { - get { return this.lastModified; } - set { this.lastModified = value; } - } - - // Check to see if LastModified property is set - internal bool IsSetLastModified() - { - return this.lastModified.HasValue; - } - - /// - /// - /// The server-side encryption algorithm used when you store this object in Amazon S3 - /// or Amazon FSx. - /// - /// - /// - /// When accessing data stored in Amazon FSx file systems using S3 access points, the - /// only valid server side encryption option is aws:fsx. - /// - /// - /// - public ServerSideEncryptionMethod ServerSideEncryptionMethod - { - get { return this.serverSideEncryption; } - set { this.serverSideEncryption = value; } - } - - // Check to see if ServerSideEncryption property is set - internal bool IsSetServerSideEncryptionMethod() - { - return this.serverSideEncryption != null; - } - /// /// Gets and sets the PartNumber property. /// This is the part number in it's multi-part upload that will uniquely identify the part @@ -227,44 +35,6 @@ public int? PartNumber get { return this.partNumber; } set { this.partNumber = value; } } - - /// - /// - /// If present, indicates the ID of the KMS key that was used for object encryption. - /// - /// - [AWSProperty(Sensitive=true)] - public string ServerSideEncryptionKeyManagementServiceKeyId - { - get { return this.serverSideEncryptionKeyManagementServiceKeyId; } - set { this.serverSideEncryptionKeyManagementServiceKeyId = value; } - } - - /// - /// Checks if ServerSideEncryptionKeyManagementServiceKeyId property is set. - /// - /// true if ServerSideEncryptionKeyManagementServiceKeyId property is set. - internal bool IsSetServerSideEncryptionKeyManagementServiceKeyId() - { - return !System.String.IsNullOrEmpty(this.serverSideEncryptionKeyManagementServiceKeyId); - } - - /// - /// - /// Indicates whether the multipart upload uses an S3 Bucket Key for server-side encryption - /// with Key Management Service (KMS) keys (SSE-KMS). - /// - /// - public bool BucketKeyEnabled - { - get { return this.bucketKeyEnabled.GetValueOrDefault(); } - set { this.bucketKeyEnabled = value; } - } - - internal bool IsSetBucketKeyEnabled() - { - return bucketKeyEnabled.HasValue; - } } } diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/CopyPartRequestMarshaller.cs b/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/CopyPartRequestMarshaller.cs index d8a1c1d09aa2..cafed0676296 100644 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/CopyPartRequestMarshaller.cs +++ b/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/CopyPartRequestMarshaller.cs @@ -27,92 +27,8 @@ namespace Amazon.S3.Model.Internal.MarshallTransformations /// /// Upload Part Copy Request Marshaller /// - public class CopyPartRequestMarshaller : IMarshaller ,IMarshaller + public partial class CopyPartRequestMarshaller : IMarshaller ,IMarshaller { - public IRequest Marshall(Amazon.Runtime.AmazonWebServiceRequest input) - { - return this.Marshall((CopyPartRequest)input); - } - - public IRequest Marshall(CopyPartRequest copyPartRequest) - { - IRequest request = new DefaultRequest(copyPartRequest, "AmazonS3"); - - var sourceKey = copyPartRequest.SourceKey; - - var destinationKey = copyPartRequest.DestinationKey; - - request.HttpMethod = "PUT"; - - if (copyPartRequest.IsSetSourceBucket()) - request.Headers.Add(HeaderKeys.XAmzCopySourceHeader, ConstructCopySourceHeaderValue(copyPartRequest.SourceBucket, sourceKey, copyPartRequest.SourceVersionId)); - - if (copyPartRequest.IsSetETagToMatch()) - request.Headers.Add(HeaderKeys.XAmzCopySourceIfMatchHeader, AWSSDKUtils.Join(copyPartRequest.ETagToMatch)); - - if (copyPartRequest.IsSetETagToNotMatch()) - request.Headers.Add(HeaderKeys.XAmzCopySourceIfNoneMatchHeader, AWSSDKUtils.Join(copyPartRequest.ETagsToNotMatch)); - - if (copyPartRequest.IsSetModifiedSinceDate()) - request.Headers.Add(HeaderKeys.XAmzCopySourceIfModifiedSinceHeader, copyPartRequest.ModifiedSinceDate.Value.ToUniversalTime().ToString(AWSSDKUtils.GMTDateFormat, CultureInfo.InvariantCulture)); - - if (copyPartRequest.IsSetUnmodifiedSinceDate()) - request.Headers.Add(HeaderKeys.XAmzCopySourceIfUnmodifiedSinceHeader, copyPartRequest.UnmodifiedSinceDate.Value.ToUniversalTime().ToString(AWSSDKUtils.GMTDateFormat, CultureInfo.InvariantCulture)); - - if (copyPartRequest.IsSetServerSideEncryptionCustomerMethod()) - request.Headers.Add(HeaderKeys.XAmzSSECustomerAlgorithmHeader, copyPartRequest.ServerSideEncryptionCustomerMethod); - - if (copyPartRequest.IsSetServerSideEncryptionCustomerProvidedKey()) - { - request.Headers.Add(HeaderKeys.XAmzSSECustomerKeyHeader, copyPartRequest.ServerSideEncryptionCustomerProvidedKey); - if (copyPartRequest.IsSetServerSideEncryptionCustomerProvidedKeyMD5()) - request.Headers.Add(HeaderKeys.XAmzSSECustomerKeyMD5Header, copyPartRequest.ServerSideEncryptionCustomerProvidedKeyMD5); - else - request.Headers.Add(HeaderKeys.XAmzSSECustomerKeyMD5Header, AmazonS3Util.ComputeEncodedMD5FromEncodedString(copyPartRequest.ServerSideEncryptionCustomerProvidedKey)); - } - - if (copyPartRequest.IsSetCopySourceServerSideEncryptionCustomerMethod()) - request.Headers.Add(HeaderKeys.XAmzCopySourceSSECustomerAlgorithmHeader, copyPartRequest.CopySourceServerSideEncryptionCustomerMethod); - - if (copyPartRequest.IsSetCopySourceServerSideEncryptionCustomerProvidedKey()) - { - request.Headers.Add(HeaderKeys.XAmzCopySourceSSECustomerKeyHeader, copyPartRequest.CopySourceServerSideEncryptionCustomerProvidedKey); - if (copyPartRequest.IsSetCopySourceServerSideEncryptionCustomerProvidedKeyMD5()) - request.Headers.Add(HeaderKeys.XAmzCopySourceSSECustomerKeyMD5Header, copyPartRequest.CopySourceServerSideEncryptionCustomerProvidedKeyMD5); - else - request.Headers.Add(HeaderKeys.XAmzCopySourceSSECustomerKeyMD5Header, AmazonS3Util.ComputeEncodedMD5FromEncodedString(copyPartRequest.CopySourceServerSideEncryptionCustomerProvidedKey)); - } - - if(copyPartRequest.IsSetFirstByte() && copyPartRequest.IsSetLastByte()) - request.Headers.Add(HeaderKeys.XAmzCopySourceRangeHeader, ConstructCopySourceRangeHeader(copyPartRequest.FirstByte.Value, copyPartRequest.LastByte.Value)); - - if (copyPartRequest.IsSetExpectedBucketOwner()) - request.Headers.Add(S3Constants.AmzHeaderExpectedBucketOwner, S3Transforms.ToStringValue(copyPartRequest.ExpectedBucketOwner)); - - if (copyPartRequest.IsSetRequestPayer()) - request.Headers.Add(S3Constants.AmzHeaderRequestPayer, S3Transforms.ToStringValue(copyPartRequest.RequestPayer)); - - if (copyPartRequest.IsSetExpectedSourceBucketOwner()) - request.Headers.Add(S3Constants.AmzHeaderExpectedSourceBucketOwner, S3Transforms.ToStringValue(copyPartRequest.ExpectedSourceBucketOwner)); - - if (string.IsNullOrEmpty(copyPartRequest.DestinationBucket)) - throw new System.ArgumentException("DestinationBucket is a required property and must be set before making this call.", "CopyPartRequest.DestinationBucket"); - - if (string.IsNullOrEmpty(destinationKey)) - throw new System.ArgumentException("DestinationKey is a required property and must be set before making this call.", "CopyPartRequest.DestinationKey"); - request.AddPathResource("{Key+}", S3Transforms.ToStringValue(destinationKey)); - - - request.ResourcePath = "/{Key+}"; - - request.AddSubResource("partNumber", S3Transforms.ToStringValue(copyPartRequest.PartNumber.Value)); - request.AddSubResource("uploadId", S3Transforms.ToStringValue(copyPartRequest.UploadId)); - - request.UseQueryString = true; - - return request; - } - static string ConstructCopySourceHeaderValue(string bucket, string key, string version) { string source; @@ -139,22 +55,38 @@ static string ConstructCopySourceRangeHeader(long firstByte, long lastByte) return string.Format(CultureInfo.InvariantCulture, "bytes={0}-{1}", firstByte, lastByte); } - private static CopyPartRequestMarshaller _instance; + partial void PostMarshallCustomization(DefaultRequest defaultRequest, CopyPartRequest publicRequest) + { + var sourceKey = publicRequest.SourceKey; + var destinationKey = publicRequest.DestinationKey; + if (string.IsNullOrEmpty(destinationKey)) + throw new System.ArgumentException("DestinationKey is a required property and must be set before making this call.", "CopyPartRequest.DestinationKey"); + // since Key is excluded via customization.json entry we set the path resource here. + defaultRequest.AddPathResource("{Key+}", S3Transforms.ToStringValue(destinationKey)); + + if (publicRequest.IsSetServerSideEncryptionCustomerProvidedKey()) + { + defaultRequest.Headers.Add(HeaderKeys.XAmzSSECustomerKeyHeader, publicRequest.ServerSideEncryptionCustomerProvidedKey); + if (publicRequest.IsSetServerSideEncryptionCustomerProvidedKeyMD5()) + defaultRequest.Headers.Add(HeaderKeys.XAmzSSECustomerKeyMD5Header, publicRequest.ServerSideEncryptionCustomerProvidedKeyMD5); + else + defaultRequest.Headers.Add(HeaderKeys.XAmzSSECustomerKeyMD5Header, AmazonS3Util.ComputeEncodedMD5FromEncodedString(publicRequest.ServerSideEncryptionCustomerProvidedKey)); + } - /// - /// Singleton for marshaller - /// - public static CopyPartRequestMarshaller Instance - { - get - { - if (_instance == null) - { - _instance = new CopyPartRequestMarshaller(); - } - return _instance; - } - } + if (publicRequest.IsSetCopySourceServerSideEncryptionCustomerProvidedKey()) + { + defaultRequest.Headers.Add(HeaderKeys.XAmzCopySourceSSECustomerKeyHeader, publicRequest.CopySourceServerSideEncryptionCustomerProvidedKey); + if (publicRequest.IsSetCopySourceServerSideEncryptionCustomerProvidedKeyMD5()) + defaultRequest.Headers.Add(HeaderKeys.XAmzCopySourceSSECustomerKeyMD5Header, publicRequest.CopySourceServerSideEncryptionCustomerProvidedKeyMD5); + else + defaultRequest.Headers.Add(HeaderKeys.XAmzCopySourceSSECustomerKeyMD5Header, AmazonS3Util.ComputeEncodedMD5FromEncodedString(publicRequest.CopySourceServerSideEncryptionCustomerProvidedKey)); + } + + if (publicRequest.IsSetFirstByte() && publicRequest.IsSetLastByte()) + defaultRequest.Headers.Add(HeaderKeys.XAmzCopySourceRangeHeader, ConstructCopySourceRangeHeader(publicRequest.FirstByte.Value, publicRequest.LastByte.Value)); + if (publicRequest.IsSetSourceBucket()) + defaultRequest.Headers.Add(HeaderKeys.XAmzCopySourceHeader, ConstructCopySourceHeaderValue(publicRequest.SourceBucket, sourceKey, publicRequest.SourceVersionId)); + } } } diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/CopyPartResponseUnmarshaller.cs b/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/CopyPartResponseUnmarshaller.cs deleted file mode 100644 index ced32cbec378..000000000000 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/CopyPartResponseUnmarshaller.cs +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://aws.amazon.com/apache2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. - */ -using System; -using System.Net; -using System.Collections.Generic; -using Amazon.S3.Model; -using Amazon.Runtime; -using Amazon.Runtime.Internal; -using Amazon.Runtime.Internal.Transform; -using Amazon.Util; -using Amazon.S3.Util; - -namespace Amazon.S3.Model.Internal.MarshallTransformations -{ - /// - /// Response Unmarshaller for CopyPart operation - /// - public class CopyPartResponseUnmarshaller : S3ReponseUnmarshaller - { - /// - /// Unmarshaller the response from the service to the response class. - /// - /// - /// - public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) - { - CopyPartResponse response = new CopyPartResponse(); - - while (context.Read()) - { - if (context.IsStartElement) - { - UnmarshallResult(context,response); - continue; - } - } - - - return response; - } - - private static void UnmarshallResult(XmlUnmarshallerContext context,CopyPartResponse response) - { - - int originalDepth = context.CurrentDepth; - int targetDepth = originalDepth + 1; - - if (context.IsStartOfDocument) - targetDepth += 2; - - while (context.Read()) - { - if (context.IsStartElement || context.IsAttribute) - { - if (context.TestExpression("ChecksumCRC32", targetDepth)) - { - response.ChecksumCRC32 = StringUnmarshaller.GetInstance().Unmarshall(context); - continue; - } - if (context.TestExpression("ChecksumCRC32C", targetDepth)) - { - response.ChecksumCRC32C = StringUnmarshaller.GetInstance().Unmarshall(context); - continue; - } - if (context.TestExpression("ChecksumCRC64NVME", targetDepth)) - { - response.ChecksumCRC64NVME = StringUnmarshaller.GetInstance().Unmarshall(context); - continue; - } - if (context.TestExpression("ChecksumSHA1", targetDepth)) - { - response.ChecksumSHA1 = StringUnmarshaller.GetInstance().Unmarshall(context); - continue; - } - if (context.TestExpression("ChecksumSHA256", targetDepth)) - { - response.ChecksumSHA256 = StringUnmarshaller.GetInstance().Unmarshall(context); - continue; - } - if (context.TestExpression("ETag", targetDepth)) - { - response.ETag = StringUnmarshaller.GetInstance().Unmarshall(context); - - continue; - } - if (context.TestExpression("LastModified", targetDepth)) - { - response.LastModified = DateTimeUnmarshaller.GetInstance().Unmarshall(context); - - continue; - } - } - else if (context.IsEndElement && context.CurrentDepth < originalDepth) - { - return; - } - } - - - IWebResponseData responseData = context.ResponseData; - if (responseData.IsHeaderPresent("x-amz-copy-source-version-id")) - response.CopySourceVersionId = S3Transforms.ToString(responseData.GetHeaderValue("x-amz-copy-source-version-id")); - if (responseData.IsHeaderPresent("x-amz-server-side-encryption")) - response.ServerSideEncryptionMethod = S3Transforms.ToString(responseData.GetHeaderValue("x-amz-server-side-encryption")); - if (responseData.IsHeaderPresent(HeaderKeys.XAmzServerSideEncryptionAwsKmsKeyIdHeader)) - response.ServerSideEncryptionKeyManagementServiceKeyId = S3Transforms.ToString(responseData.GetHeaderValue(HeaderKeys.XAmzServerSideEncryptionAwsKmsKeyIdHeader)); - if (responseData.IsHeaderPresent(S3Constants.AmzHeaderBucketKeyEnabled)) - response.BucketKeyEnabled = S3Transforms.ToBool(responseData.GetHeaderValue(S3Constants.AmzHeaderBucketKeyEnabled)); - - return; - } - - private static CopyPartResponseUnmarshaller _instance; - - /// - /// Singleton for the unmarshaller - /// - public static CopyPartResponseUnmarshaller Instance - { - get - { - if (_instance == null) - { - _instance = new CopyPartResponseUnmarshaller(); - } - return _instance; - } - } - } -} - diff --git a/sdk/src/Services/S3/Generated/Model/CopyPartRequest.cs b/sdk/src/Services/S3/Generated/Model/CopyPartRequest.cs new file mode 100644 index 000000000000..2b5886812e51 --- /dev/null +++ b/sdk/src/Services/S3/Generated/Model/CopyPartRequest.cs @@ -0,0 +1,802 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +/* + * Do not modify this file. This file is generated from the s3-2006-03-01.normal.json service model. + */ +using System; +using System.Collections.Generic; +using System.Xml.Serialization; +using System.Text; +using System.IO; +using System.Net; + +using Amazon.Runtime; +using Amazon.Runtime.Internal; + +#pragma warning disable CS0612,CS0618,CS1570 +namespace Amazon.S3.Model +{ + /// + /// Container for the parameters to the CopyPart operation. + /// Uploads a part by copying data from an existing object as data source. To specify + /// the data source, you add the request header x-amz-copy-source in your request. + /// To specify a byte range, you add the request header x-amz-copy-source-range + /// in your request. + /// + /// + /// + /// For information about maximum and minimum part sizes and other multipart upload specifications, + /// see Multipart + /// upload limits in the Amazon S3 User Guide. + /// + /// + /// + /// Instead of copying data from an existing object as part data, you might use the UploadPart + /// action to upload new data as a part of an object in your request. + /// + /// + /// + /// You must initiate a multipart upload before you can upload any part. In response to + /// your initiate request, Amazon S3 returns the upload ID, a unique identifier that you + /// must include in your upload part request. + /// + /// + /// + /// For conceptual information about multipart uploads, see Uploading + /// Objects Using Multipart Upload in the Amazon S3 User Guide. For information + /// about copying objects using a single atomic action vs. a multipart upload, see Operations + /// on Objects in the Amazon S3 User Guide. + /// + /// + /// + /// Directory buckets - For directory buckets, you must make requests for this + /// API operation to the Zonal endpoint. These endpoints support virtual-hosted-style + /// requests in the format https://amzn-s3-demo-bucket.s3express-zone-id.region-code.amazonaws.com/key-name + /// . Path-style requests are not supported. For more information about endpoints + /// in Availability Zones, see Regional + /// and Zonal endpoints for directory buckets in Availability Zones in the Amazon + /// S3 User Guide. For more information about endpoints in Local Zones, see Concepts + /// for directory buckets in Local Zones in the Amazon S3 User Guide. + /// + ///
Authentication and authorization
+ /// + /// All UploadPartCopy requests must be authenticated and signed by using IAM credentials + /// (access key ID and secret access key for the IAM identities). All headers with the + /// x-amz- prefix, including x-amz-copy-source, must be signed. For more + /// information, see REST + /// Authentication. + /// + /// + /// + /// Directory buckets - You must use IAM credentials to authenticate and authorize + /// your access to the UploadPartCopy API operation, instead of using the temporary + /// security credentials through the CreateSession API operation. + /// + /// + /// + /// Amazon Web Services CLI or SDKs handles authentication and authorization on your behalf. + /// + ///
Permissions
+ /// + /// You must have READ access to the source object and WRITE access to the + /// destination bucket. + /// + ///
  • + /// + /// General purpose bucket permissions - You must have the permissions in a policy + /// based on the bucket types of your source bucket and destination bucket in an UploadPartCopy + /// operation. + /// + ///
    • + /// + /// If the source object is in a general purpose bucket, you must have the s3:GetObject + /// permission to read the source object that is being copied. + /// + ///
    • + /// + /// If the destination bucket is a general purpose bucket, you must have the s3:PutObject + /// permission to write the object copy to the destination bucket. + /// + ///
    • + /// + /// To perform a multipart upload with encryption using an Key Management Service key, + /// the requester must have permission to the kms:Decrypt and kms:GenerateDataKey + /// actions on the key. The requester must also have permissions for the kms:GenerateDataKey + /// action for the CreateMultipartUpload API. Then, the requester needs permissions + /// for the kms:Decrypt action on the UploadPart and UploadPartCopy + /// APIs. These permissions are required because Amazon S3 must decrypt and read data + /// from the encrypted file parts before it completes the multipart upload. For more information + /// about KMS permissions, see Protecting + /// data using server-side encryption with KMS in the Amazon S3 User Guide. + /// For information about the permissions required to use the multipart upload API, see + /// Multipart + /// upload and permissions and Multipart + /// upload API and permissions in the Amazon S3 User Guide. + /// + ///
  • + /// + /// Directory bucket permissions - You must have permissions in a bucket policy + /// or an IAM identity-based policy based on the source and destination bucket types in + /// an UploadPartCopy operation. + /// + ///
    • + /// + /// If the source object that you want to copy is in a directory bucket, you must have + /// the s3express:CreateSession permission in the Action element + /// of a policy to read the object. By default, the session is in the ReadWrite + /// mode. If you want to restrict the access, you can explicitly set the s3express:SessionMode + /// condition key to ReadOnly on the copy source bucket. + /// + ///
    • + /// + /// If the copy destination is a directory bucket, you must have the s3express:CreateSession + /// permission in the Action element of a policy to write the object to the + /// destination. The s3express:SessionMode condition key cannot be set to ReadOnly + /// on the copy destination. + /// + ///
    + /// + /// If the object is encrypted with SSE-KMS, you must also have the kms:GenerateDataKey + /// and kms:Decrypt permissions in IAM identity-based policies and KMS key policies + /// for the KMS key. + /// + /// + /// + /// For example policies, see Example + /// bucket policies for S3 Express One Zone and Amazon + /// Web Services Identity and Access Management (IAM) identity-based policies for S3 Express + /// One Zone in the Amazon S3 User Guide. + /// + ///
Encryption
  • + /// + /// General purpose buckets - For information about using server-side encryption + /// with customer-provided encryption keys with the UploadPartCopy operation, see + /// CopyObject + /// and UploadPart. + /// + /// + ///
  • + /// + /// Directory buckets - For directory buckets, there are only two supported options + /// for server-side encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) + /// (AES256) and server-side encryption with KMS keys (SSE-KMS) (aws:kms). + /// For more information, see Protecting + /// data with server-side encryption in the Amazon S3 User Guide. + /// + /// + /// + /// For directory buckets, when you perform a CreateMultipartUpload operation and + /// an UploadPartCopy operation, the request headers you provide in the CreateMultipartUpload + /// request must match the default encryption configuration of the destination bucket. + /// + /// + /// + /// + /// S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from general + /// purpose buckets to directory buckets, from directory buckets to general purpose buckets, + /// or between directory buckets, through UploadPartCopy. + /// In this case, Amazon S3 makes a call to KMS every time a copy request is made for + /// a KMS-encrypted object. + /// + ///
Special errors
  • + /// + /// Error Code: NoSuchUpload + /// + ///
    • + /// + /// Description: The specified multipart upload does not exist. The upload ID might be + /// invalid, or the multipart upload might have been aborted or completed. + /// + ///
    • + /// + /// HTTP Status Code: 404 Not Found + /// + ///
  • + /// + /// Error Code: InvalidRequest + /// + ///
    • + /// + /// Description: The specified copy source is not supported as a byte-range copy source. + /// + ///
    • + /// + /// HTTP Status Code: 400 Bad Request + /// + ///
HTTP Host header syntax
+ /// + /// Directory buckets - The HTTP Host header syntax is Bucket-name.s3express-zone-id.region-code.amazonaws.com. + /// + ///
+ /// + /// The following operations are related to UploadPartCopy: + /// + /// + ///
+ public partial class CopyPartRequest : AmazonWebServiceRequest + { + private ServerSideEncryptionCustomerMethod _copySourceServerSideEncryptionCustomerMethod; + private string _copySourceServerSideEncryptionCustomerProvidedKey; + private string _copySourceServerSideEncryptionCustomerProvidedKeyMD5; + private string _destinationBucket; + private string _destinationKey; + private List _eTagsToNotMatch = AWSConfigs.InitializeCollections ? new List() : null; + private List _eTagToMatch = AWSConfigs.InitializeCollections ? new List() : null; + private string _expectedBucketOwner; + private string _expectedSourceBucketOwner; + private DateTime? _modifiedSinceDate; + private int? _partNumber; + private RequestPayer _requestPayer; + private ServerSideEncryptionCustomerMethod _serverSideEncryptionCustomerMethod; + private string _serverSideEncryptionCustomerProvidedKey; + private string _serverSideEncryptionCustomerProvidedKeyMD5; + private string _sourceBucket; + private string _sourceKey; + private string _sourceVersionId; + private DateTime? _unmodifiedSinceDate; + private string _uploadId; + + /// + /// Gets and sets the property CopySourceServerSideEncryptionCustomerMethod. + /// + /// Specifies the algorithm to use when decrypting the source object (for example, AES256). + /// + /// + /// + /// This functionality is not supported when the source object is in a directory bucket. + /// + /// + /// + public ServerSideEncryptionCustomerMethod CopySourceServerSideEncryptionCustomerMethod + { + get { return this._copySourceServerSideEncryptionCustomerMethod; } + set { this._copySourceServerSideEncryptionCustomerMethod = value; } + } + + // Check to see if CopySourceServerSideEncryptionCustomerMethod property is set + internal bool IsSetCopySourceServerSideEncryptionCustomerMethod() + { + return this._copySourceServerSideEncryptionCustomerMethod != null; + } + + /// + /// Gets and sets the property CopySourceServerSideEncryptionCustomerProvidedKey. + /// + /// Specifies the customer-provided encryption key for Amazon S3 to use to decrypt the + /// source object. The encryption key provided in this header must be one that was used + /// when the source object was created. + /// + /// + /// + /// This functionality is not supported when the source object is in a directory bucket. + /// + /// + /// + [AWSProperty(Sensitive=true)] + public string CopySourceServerSideEncryptionCustomerProvidedKey + { + get { return this._copySourceServerSideEncryptionCustomerProvidedKey; } + set { this._copySourceServerSideEncryptionCustomerProvidedKey = value; } + } + + // Check to see if CopySourceServerSideEncryptionCustomerProvidedKey property is set + internal bool IsSetCopySourceServerSideEncryptionCustomerProvidedKey() + { + return this._copySourceServerSideEncryptionCustomerProvidedKey != null; + } + + /// + /// Gets and sets the property CopySourceServerSideEncryptionCustomerProvidedKeyMD5. + /// + /// Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. Amazon + /// S3 uses this header for a message integrity check to ensure that the encryption key + /// was transmitted without error. + /// + /// + /// + /// This functionality is not supported when the source object is in a directory bucket. + /// + /// + /// + public string CopySourceServerSideEncryptionCustomerProvidedKeyMD5 + { + get { return this._copySourceServerSideEncryptionCustomerProvidedKeyMD5; } + set { this._copySourceServerSideEncryptionCustomerProvidedKeyMD5 = value; } + } + + // Check to see if CopySourceServerSideEncryptionCustomerProvidedKeyMD5 property is set + internal bool IsSetCopySourceServerSideEncryptionCustomerProvidedKeyMD5() + { + return this._copySourceServerSideEncryptionCustomerProvidedKeyMD5 != null; + } + + /// + /// Gets and sets the property DestinationBucket. + /// + /// The bucket name. + /// + /// + /// + /// Directory buckets - When you use this operation with a directory bucket, you + /// must use virtual-hosted-style requests in the format Bucket-name.s3express-zone-id.region-code.amazonaws.com. + /// Path-style requests are not supported. Directory bucket names must be unique in the + /// chosen Zone (Availability Zone or Local Zone). Bucket names must follow the format + /// bucket-base-name--zone-id--x-s3 (for example, amzn-s3-demo-bucket--usw2-az1--x-s3). + /// For information about bucket naming restrictions, see Directory + /// bucket naming rules in the Amazon S3 User Guide. + /// + /// + /// + /// Copying objects across different Amazon Web Services Regions isn't supported when + /// the source or destination bucket is in Amazon Web Services Local Zones. The source + /// and destination buckets must have the same parent Amazon Web Services Region. Otherwise, + /// you get an HTTP 400 Bad Request error with the error code InvalidRequest. + /// + /// + /// + /// Access points - When you use this action with an access point for general + /// purpose buckets, you must provide the alias of the access point in place of the bucket + /// name or specify the access point ARN. When you use this action with an access point + /// for directory buckets, you must provide the access point name in place of the bucket + /// name. When using the access point ARN, you must direct requests to the access point + /// hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. + /// When using this action with an access point through the Amazon Web Services SDKs, + /// you provide the access point ARN in place of the bucket name. For more information + /// about access point ARNs, see Using + /// access points in the Amazon S3 User Guide. + /// + /// + /// + /// Object Lambda access points are not supported by directory buckets. + /// + /// + /// + /// S3 on Outposts - When you use this action with S3 on Outposts, you must direct + /// requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form + /// AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. + /// When you use this action with S3 on Outposts, the destination bucket must be the Outposts + /// access point ARN or the access point alias. For more information about S3 on Outposts, + /// see What + /// is S3 on Outposts? in the Amazon S3 User Guide. + /// + /// + public string DestinationBucket + { + get { return this._destinationBucket; } + set { this._destinationBucket = value; } + } + + // Check to see if DestinationBucket property is set + internal bool IsSetDestinationBucket() + { + return this._destinationBucket != null; + } + + /// + /// Gets and sets the property DestinationKey. + /// + [AWSProperty(Min=1)] + public string DestinationKey + { + get { return this._destinationKey; } + set { this._destinationKey = value; } + } + + // Check to see if DestinationKey property is set + internal bool IsSetDestinationKey() + { + return this._destinationKey != null; + } + + /// + /// Gets and sets the property ETagsToNotMatch. + /// + /// Copies the object if its entity tag (ETag) is different than the specified ETag. + /// + /// + /// + /// If both of the x-amz-copy-source-if-none-match and x-amz-copy-source-if-modified-since + /// headers are present in the request as follows: + /// + /// + /// + /// x-amz-copy-source-if-none-match condition evaluates to false, and; + /// + /// + /// + /// x-amz-copy-source-if-modified-since condition evaluates to true; + /// + /// + /// + /// Amazon S3 returns 412 Precondition Failed response code. + /// + /// + /// Starting with version 4 of the SDK this property will default to null. If no data for this property is returned + /// from the service the property will also be null. This was changed to improve performance and allow the SDK and caller + /// to distinguish between a property not set or a property being empty to clear out a value. To retain the previous + /// SDK behavior set the AWSConfigs.InitializeCollections static property to true. + /// + public List ETagsToNotMatch + { + get { return this._eTagsToNotMatch; } + set { this._eTagsToNotMatch = value; } + } + + // Check to see if ETagsToNotMatch property is set + internal bool IsSetETagsToNotMatch() + { + return this._eTagsToNotMatch != null && (this._eTagsToNotMatch.Count > 0 || !AWSConfigs.InitializeCollections); + } + + /// + /// Gets and sets the property ETagToMatch. + /// + /// Copies the object if its entity tag (ETag) matches the specified tag. + /// + /// + /// + /// If both of the x-amz-copy-source-if-match and x-amz-copy-source-if-unmodified-since + /// headers are present in the request as follows: + /// + /// + /// + /// x-amz-copy-source-if-match condition evaluates to true, and; + /// + /// + /// + /// x-amz-copy-source-if-unmodified-since condition evaluates to false; + /// + /// + /// + /// Amazon S3 returns 200 OK and copies the data. + /// + /// + /// Starting with version 4 of the SDK this property will default to null. If no data for this property is returned + /// from the service the property will also be null. This was changed to improve performance and allow the SDK and caller + /// to distinguish between a property not set or a property being empty to clear out a value. To retain the previous + /// SDK behavior set the AWSConfigs.InitializeCollections static property to true. + /// + public List ETagToMatch + { + get { return this._eTagToMatch; } + set { this._eTagToMatch = value; } + } + + // Check to see if ETagToMatch property is set + internal bool IsSetETagToMatch() + { + return this._eTagToMatch != null && (this._eTagToMatch.Count > 0 || !AWSConfigs.InitializeCollections); + } + + /// + /// Gets and sets the property ExpectedBucketOwner. + /// + /// The account ID of the expected destination bucket owner. If the account ID that you + /// provide does not match the actual owner of the destination bucket, the request fails + /// with the HTTP status code 403 Forbidden (access denied). + /// + /// + public string ExpectedBucketOwner + { + get { return this._expectedBucketOwner; } + set { this._expectedBucketOwner = value; } + } + + // Check to see if ExpectedBucketOwner property is set + internal bool IsSetExpectedBucketOwner() + { + return this._expectedBucketOwner != null; + } + + /// + /// Gets and sets the property ExpectedSourceBucketOwner. + /// + /// The account ID of the expected source bucket owner. If the account ID that you provide + /// does not match the actual owner of the source bucket, the request fails with the HTTP + /// status code 403 Forbidden (access denied). + /// + /// + public string ExpectedSourceBucketOwner + { + get { return this._expectedSourceBucketOwner; } + set { this._expectedSourceBucketOwner = value; } + } + + // Check to see if ExpectedSourceBucketOwner property is set + internal bool IsSetExpectedSourceBucketOwner() + { + return this._expectedSourceBucketOwner != null; + } + + /// + /// Gets and sets the property ModifiedSinceDate. + /// + /// Copies the object if it has been modified since the specified time. + /// + /// + /// + /// If both of the x-amz-copy-source-if-none-match and x-amz-copy-source-if-modified-since + /// headers are present in the request as follows: + /// + /// + /// + /// x-amz-copy-source-if-none-match condition evaluates to false, and; + /// + /// + /// + /// x-amz-copy-source-if-modified-since condition evaluates to true; + /// + /// + /// + /// Amazon S3 returns 412 Precondition Failed response code. + /// + /// + public DateTime? ModifiedSinceDate + { + get { return this._modifiedSinceDate; } + set { this._modifiedSinceDate = value; } + } + + // Check to see if ModifiedSinceDate property is set + internal bool IsSetModifiedSinceDate() + { + return this._modifiedSinceDate.HasValue; + } + + /// + /// Gets and sets the property PartNumber. + /// + /// Part number of part being copied. This is a positive integer between 1 and 10,000. + /// + /// + [AWSProperty(Required=true)] + public int? PartNumber + { + get { return this._partNumber; } + set { this._partNumber = value; } + } + + // Check to see if PartNumber property is set + internal bool IsSetPartNumber() + { + return this._partNumber.HasValue; + } + + /// + /// Gets and sets the property RequestPayer. + /// + public RequestPayer RequestPayer + { + get { return this._requestPayer; } + set { this._requestPayer = value; } + } + + // Check to see if RequestPayer property is set + internal bool IsSetRequestPayer() + { + return this._requestPayer != null; + } + + /// + /// Gets and sets the property ServerSideEncryptionCustomerMethod. + /// + /// Specifies the algorithm to use when encrypting the object (for example, AES256). + /// + /// + /// + /// This functionality is not supported when the destination bucket is a directory bucket. + /// + /// + /// + public ServerSideEncryptionCustomerMethod ServerSideEncryptionCustomerMethod + { + get { return this._serverSideEncryptionCustomerMethod; } + set { this._serverSideEncryptionCustomerMethod = value; } + } + + // Check to see if ServerSideEncryptionCustomerMethod property is set + internal bool IsSetServerSideEncryptionCustomerMethod() + { + return this._serverSideEncryptionCustomerMethod != null; + } + + /// + /// Gets and sets the property ServerSideEncryptionCustomerProvidedKey. + /// + /// Specifies the customer-provided encryption key for Amazon S3 to use in encrypting + /// data. This value is used to store the object and then it is discarded; Amazon S3 does + /// not store the encryption key. The key must be appropriate for use with the algorithm + /// specified in the x-amz-server-side-encryption-customer-algorithm header. This + /// must be the same encryption key specified in the initiate multipart upload request. + /// + /// + /// + /// This functionality is not supported when the destination bucket is a directory bucket. + /// + /// + /// + [AWSProperty(Sensitive=true)] + public string ServerSideEncryptionCustomerProvidedKey + { + get { return this._serverSideEncryptionCustomerProvidedKey; } + set { this._serverSideEncryptionCustomerProvidedKey = value; } + } + + // Check to see if ServerSideEncryptionCustomerProvidedKey property is set + internal bool IsSetServerSideEncryptionCustomerProvidedKey() + { + return this._serverSideEncryptionCustomerProvidedKey != null; + } + + /// + /// Gets and sets the property ServerSideEncryptionCustomerProvidedKeyMD5. + /// + /// Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. Amazon + /// S3 uses this header for a message integrity check to ensure that the encryption key + /// was transmitted without error. + /// + /// + /// + /// This functionality is not supported when the destination bucket is a directory bucket. + /// + /// + /// + public string ServerSideEncryptionCustomerProvidedKeyMD5 + { + get { return this._serverSideEncryptionCustomerProvidedKeyMD5; } + set { this._serverSideEncryptionCustomerProvidedKeyMD5 = value; } + } + + // Check to see if ServerSideEncryptionCustomerProvidedKeyMD5 property is set + internal bool IsSetServerSideEncryptionCustomerProvidedKeyMD5() + { + return this._serverSideEncryptionCustomerProvidedKeyMD5 != null; + } + + /// + /// Gets and sets the property SourceBucket. + /// + public string SourceBucket + { + get { return this._sourceBucket; } + set { this._sourceBucket = value; } + } + + // Check to see if SourceBucket property is set + internal bool IsSetSourceBucket() + { + return this._sourceBucket != null; + } + + /// + /// Gets and sets the property SourceKey. + /// + [AWSProperty(Min=1)] + public string SourceKey + { + get { return this._sourceKey; } + set { this._sourceKey = value; } + } + + // Check to see if SourceKey property is set + internal bool IsSetSourceKey() + { + return this._sourceKey != null; + } + + /// + /// Gets and sets the property SourceVersionId. + /// + public string SourceVersionId + { + get { return this._sourceVersionId; } + set { this._sourceVersionId = value; } + } + + // Check to see if SourceVersionId property is set + internal bool IsSetSourceVersionId() + { + return this._sourceVersionId != null; + } + + /// + /// Gets and sets the property UnmodifiedSinceDate. + /// + /// Copies the object if it hasn't been modified since the specified time. + /// + /// + /// + /// If both of the x-amz-copy-source-if-match and x-amz-copy-source-if-unmodified-since + /// headers are present in the request as follows: + /// + /// + /// + /// x-amz-copy-source-if-match condition evaluates to true, and; + /// + /// + /// + /// x-amz-copy-source-if-unmodified-since condition evaluates to false; + /// + /// + /// + /// Amazon S3 returns 200 OK and copies the data. + /// + /// + public DateTime? UnmodifiedSinceDate + { + get { return this._unmodifiedSinceDate; } + set { this._unmodifiedSinceDate = value; } + } + + // Check to see if UnmodifiedSinceDate property is set + internal bool IsSetUnmodifiedSinceDate() + { + return this._unmodifiedSinceDate.HasValue; + } + + /// + /// Gets and sets the property UploadId. + /// + /// Upload ID identifying the multipart upload whose part is being copied. + /// + /// + [AWSProperty(Required=true)] + public string UploadId + { + get { return this._uploadId; } + set { this._uploadId = value; } + } + + // Check to see if UploadId property is set + internal bool IsSetUploadId() + { + return this._uploadId != null; + } + + } +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Generated/Model/CopyPartResponse.cs b/sdk/src/Services/S3/Generated/Model/CopyPartResponse.cs new file mode 100644 index 000000000000..2777824e4975 --- /dev/null +++ b/sdk/src/Services/S3/Generated/Model/CopyPartResponse.cs @@ -0,0 +1,345 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +/* + * Do not modify this file. This file is generated from the s3-2006-03-01.normal.json service model. + */ +using System; +using System.Collections.Generic; +using System.Xml.Serialization; +using System.Text; +using System.IO; +using System.Net; + +using Amazon.Runtime; +using Amazon.Runtime.Internal; + +#pragma warning disable CS0612,CS0618,CS1570 +namespace Amazon.S3.Model +{ + /// + /// This is the response object from the CopyPart operation. + /// + public partial class CopyPartResponse : AmazonWebServiceResponse + { + private bool? _bucketKeyEnabled; + private string _checksumCRC32; + private string _checksumCRC32C; + private string _checksumCRC64NVME; + private string _checksumSHA1; + private string _checksumSHA256; + private string _copySourceVersionId; + private string _eTag; + private DateTime? _lastModified; + private RequestCharged _requestCharged; + private string _serverSideEncryptionKeyManagementServiceKeyId; + private ServerSideEncryptionMethod _serverSideEncryptionMethod; + private string _sseCustomerAlgorithm; + private string _sseCustomerKeyMD5; + + /// + /// Gets and sets the property BucketKeyEnabled. + /// + /// Indicates whether the multipart upload uses an S3 Bucket Key for server-side encryption + /// with Key Management Service (KMS) keys (SSE-KMS). + /// + /// + public bool? BucketKeyEnabled + { + get { return this._bucketKeyEnabled; } + set { this._bucketKeyEnabled = value; } + } + + // Check to see if BucketKeyEnabled property is set + internal bool IsSetBucketKeyEnabled() + { + return this._bucketKeyEnabled.HasValue; + } + + /// + /// Gets and sets the property ChecksumCRC32. + /// + /// This header can be used as a data integrity check to verify that the data received + /// is the same data that was originally sent. This header specifies the Base64 encoded, + /// 32-bit CRC32 checksum of the part. For more information, see Checking + /// object integrity in the Amazon S3 User Guide. + /// + /// + public string ChecksumCRC32 + { + get { return this._checksumCRC32; } + set { this._checksumCRC32 = value; } + } + + // Check to see if ChecksumCRC32 property is set + internal bool IsSetChecksumCRC32() + { + return this._checksumCRC32 != null; + } + + /// + /// Gets and sets the property ChecksumCRC32C. + /// + /// This header can be used as a data integrity check to verify that the data received + /// is the same data that was originally sent. This header specifies the Base64 encoded, + /// 32-bit CRC32C checksum of the part. For more information, see Checking + /// object integrity in the Amazon S3 User Guide. + /// + /// + public string ChecksumCRC32C + { + get { return this._checksumCRC32C; } + set { this._checksumCRC32C = value; } + } + + // Check to see if ChecksumCRC32C property is set + internal bool IsSetChecksumCRC32C() + { + return this._checksumCRC32C != null; + } + + /// + /// Gets and sets the property ChecksumCRC64NVME. + /// + /// The Base64 encoded, 64-bit CRC64NVME checksum of the part. This checksum is + /// present if the multipart upload request was created with the CRC64NVME checksum + /// algorithm to the uploaded object). For more information, see Checking + /// object integrity in the Amazon S3 User Guide. + /// + /// + public string ChecksumCRC64NVME + { + get { return this._checksumCRC64NVME; } + set { this._checksumCRC64NVME = value; } + } + + // Check to see if ChecksumCRC64NVME property is set + internal bool IsSetChecksumCRC64NVME() + { + return this._checksumCRC64NVME != null; + } + + /// + /// Gets and sets the property ChecksumSHA1. + /// + /// This header can be used as a data integrity check to verify that the data received + /// is the same data that was originally sent. This header specifies the Base64 encoded, + /// 160-bit SHA1 checksum of the part. For more information, see Checking + /// object integrity in the Amazon S3 User Guide. + /// + /// + public string ChecksumSHA1 + { + get { return this._checksumSHA1; } + set { this._checksumSHA1 = value; } + } + + // Check to see if ChecksumSHA1 property is set + internal bool IsSetChecksumSHA1() + { + return this._checksumSHA1 != null; + } + + /// + /// Gets and sets the property ChecksumSHA256. + /// + /// This header can be used as a data integrity check to verify that the data received + /// is the same data that was originally sent. This header specifies the Base64 encoded, + /// 256-bit SHA256 checksum of the part. For more information, see Checking + /// object integrity in the Amazon S3 User Guide. + /// + /// + public string ChecksumSHA256 + { + get { return this._checksumSHA256; } + set { this._checksumSHA256 = value; } + } + + // Check to see if ChecksumSHA256 property is set + internal bool IsSetChecksumSHA256() + { + return this._checksumSHA256 != null; + } + + /// + /// Gets and sets the property CopySourceVersionId. + /// + /// The version of the source object that was copied, if you have enabled versioning on + /// the source bucket. + /// + /// + /// + /// This functionality is not supported when the source object is in a directory bucket. + /// + /// + /// + public string CopySourceVersionId + { + get { return this._copySourceVersionId; } + set { this._copySourceVersionId = value; } + } + + // Check to see if CopySourceVersionId property is set + internal bool IsSetCopySourceVersionId() + { + return this._copySourceVersionId != null; + } + + /// + /// Gets and sets the property ETag. + /// + /// Entity tag of the object. + /// + /// + public string ETag + { + get { return this._eTag; } + set { this._eTag = value; } + } + + // Check to see if ETag property is set + internal bool IsSetETag() + { + return this._eTag != null; + } + + /// + /// Gets and sets the property LastModified. + /// + /// Date and time at which the object was uploaded. + /// + /// + public DateTime? LastModified + { + get { return this._lastModified; } + set { this._lastModified = value; } + } + + // Check to see if LastModified property is set + internal bool IsSetLastModified() + { + return this._lastModified.HasValue; + } + + /// + /// Gets and sets the property RequestCharged. + /// + public RequestCharged RequestCharged + { + get { return this._requestCharged; } + set { this._requestCharged = value; } + } + + // Check to see if RequestCharged property is set + internal bool IsSetRequestCharged() + { + return this._requestCharged != null; + } + + /// + /// Gets and sets the property ServerSideEncryptionKeyManagementServiceKeyId. + /// + /// If present, indicates the ID of the KMS key that was used for object encryption. + /// + /// + [AWSProperty(Sensitive=true)] + public string ServerSideEncryptionKeyManagementServiceKeyId + { + get { return this._serverSideEncryptionKeyManagementServiceKeyId; } + set { this._serverSideEncryptionKeyManagementServiceKeyId = value; } + } + + // Check to see if ServerSideEncryptionKeyManagementServiceKeyId property is set + internal bool IsSetServerSideEncryptionKeyManagementServiceKeyId() + { + return this._serverSideEncryptionKeyManagementServiceKeyId != null; + } + + /// + /// Gets and sets the property ServerSideEncryptionMethod. + /// + /// The server-side encryption algorithm used when you store this object in Amazon S3 + /// or Amazon FSx. + /// + /// + /// + /// When accessing data stored in Amazon FSx file systems using S3 access points, the + /// only valid server side encryption option is aws:fsx. + /// + /// + /// + public ServerSideEncryptionMethod ServerSideEncryptionMethod + { + get { return this._serverSideEncryptionMethod; } + set { this._serverSideEncryptionMethod = value; } + } + + // Check to see if ServerSideEncryptionMethod property is set + internal bool IsSetServerSideEncryptionMethod() + { + return this._serverSideEncryptionMethod != null; + } + + /// + /// Gets and sets the property SSECustomerAlgorithm. + /// + /// If server-side encryption with a customer-provided encryption key was requested, the + /// response will include this header to confirm the encryption algorithm that's used. + /// + /// + /// + /// This functionality is not supported for directory buckets. + /// + /// + /// + public string SSECustomerAlgorithm + { + get { return this._sseCustomerAlgorithm; } + set { this._sseCustomerAlgorithm = value; } + } + + // Check to see if SSECustomerAlgorithm property is set + internal bool IsSetSSECustomerAlgorithm() + { + return this._sseCustomerAlgorithm != null; + } + + /// + /// Gets and sets the property SSECustomerKeyMD5. + /// + /// If server-side encryption with a customer-provided encryption key was requested, the + /// response will include this header to provide the round-trip message integrity verification + /// of the customer-provided encryption key. + /// + /// + /// + /// This functionality is not supported for directory buckets. + /// + /// + /// + public string SSECustomerKeyMD5 + { + get { return this._sseCustomerKeyMD5; } + set { this._sseCustomerKeyMD5 = value; } + } + + // Check to see if SSECustomerKeyMD5 property is set + internal bool IsSetSSECustomerKeyMD5() + { + return this._sseCustomerKeyMD5 != null; + } + + } +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/CopyPartRequestMarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/CopyPartRequestMarshaller.cs new file mode 100644 index 000000000000..9436bf540e09 --- /dev/null +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/CopyPartRequestMarshaller.cs @@ -0,0 +1,139 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +/* + * Do not modify this file. This file is generated from the s3-2006-03-01.normal.json service model. + */ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Text; +using System.Xml.Serialization; + +using Amazon.S3.Model; +using Amazon.Runtime; +using Amazon.Runtime.Internal; +using Amazon.Runtime.Internal.Transform; +using Amazon.Runtime.Internal.Util; +using System.Xml; + +#pragma warning disable CS0612,CS0618 +namespace Amazon.S3.Model.Internal.MarshallTransformations +{ + /// + /// CopyPart Request Marshaller + /// + public partial class CopyPartRequestMarshaller : IMarshaller , IMarshaller + { + /// + /// Marshaller the request object to the HTTP request. + /// + /// + /// + public IRequest Marshall(AmazonWebServiceRequest input) + { + return this.Marshall((CopyPartRequest)input); + } + + /// + /// Marshaller the request object to the HTTP request. + /// + /// + /// + public IRequest Marshall(CopyPartRequest publicRequest) + { + var request = new DefaultRequest(publicRequest, "Amazon.S3"); + request.HttpMethod = "PUT"; + + if (publicRequest.IsSetCopySourceServerSideEncryptionCustomerMethod()) + { + request.Headers["x-amz-copy-source-server-side-encryption-customer-algorithm"] = StringUtils.FromString(publicRequest.CopySourceServerSideEncryptionCustomerMethod); + } + + if (publicRequest.IsSetETagsToNotMatch()) + { + request.Headers["x-amz-copy-source-if-none-match"] = Amazon.Util.AWSSDKUtils.Join(publicRequest.ETagsToNotMatch); + } + + if (publicRequest.IsSetETagToMatch()) + { + request.Headers["x-amz-copy-source-if-match"] = Amazon.Util.AWSSDKUtils.Join(publicRequest.ETagToMatch); + } + + if (publicRequest.IsSetExpectedBucketOwner()) + { + request.Headers["x-amz-expected-bucket-owner"] = publicRequest.ExpectedBucketOwner; + } + + if (publicRequest.IsSetExpectedSourceBucketOwner()) + { + request.Headers["x-amz-source-expected-bucket-owner"] = publicRequest.ExpectedSourceBucketOwner; + } + + if (publicRequest.IsSetModifiedSinceDate()) + { + request.Headers["x-amz-copy-source-if-modified-since"] = StringUtils.FromDateTimeToRFC822(publicRequest.ModifiedSinceDate); + } + + if (publicRequest.IsSetRequestPayer()) + { + request.Headers["x-amz-request-payer"] = publicRequest.RequestPayer; + } + + if (publicRequest.IsSetServerSideEncryptionCustomerMethod()) + { + request.Headers["x-amz-server-side-encryption-customer-algorithm"] = StringUtils.FromString(publicRequest.ServerSideEncryptionCustomerMethod); + } + + if (publicRequest.IsSetUnmodifiedSinceDate()) + { + request.Headers["x-amz-copy-source-if-unmodified-since"] = StringUtils.FromDateTimeToRFC822(publicRequest.UnmodifiedSinceDate); + } + if (string.IsNullOrEmpty(publicRequest.DestinationBucket)) + throw new System.ArgumentException("DestinationBucket is a required property and must be set before making this call.", "CopyPartRequest.DestinationBucket"); + + if (publicRequest.IsSetPartNumber()) + request.AddSubResource("partNumber", StringUtils.FromInt(publicRequest.PartNumber)); + + if (publicRequest.IsSetUploadId()) + request.AddSubResource("uploadId", StringUtils.FromString(publicRequest.UploadId)); + request.ResourcePath = "/{Key+}"; + + PostMarshallCustomization(request, publicRequest); + request.UseQueryString = true; + return request; + } + private static CopyPartRequestMarshaller _instance = new CopyPartRequestMarshaller(); + + internal static CopyPartRequestMarshaller GetInstance() + { + return _instance; + } + + /// + /// Gets the singleton. + /// + public static CopyPartRequestMarshaller Instance + { + get + { + return _instance; + } + } + + partial void PostMarshallCustomization(DefaultRequest defaultRequest, CopyPartRequest publicRequest); + } +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/CopyPartResponseUnmarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/CopyPartResponseUnmarshaller.cs new file mode 100644 index 000000000000..fd84e74f3be7 --- /dev/null +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/CopyPartResponseUnmarshaller.cs @@ -0,0 +1,179 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +/* + * Do not modify this file. This file is generated from the s3-2006-03-01.normal.json service model. + */ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Net; +using System.Text; +using System.Xml.Serialization; + +using Amazon.S3.Model; +using Amazon.Runtime; +using Amazon.Runtime.Internal; +using Amazon.Runtime.Internal.Transform; +using Amazon.Runtime.Internal.Util; + +#pragma warning disable CS0612,CS0618 +namespace Amazon.S3.Model.Internal.MarshallTransformations +{ + /// + /// Response Unmarshaller for CopyPart operation + /// + public partial class CopyPartResponseUnmarshaller : S3ReponseUnmarshaller + { + /// + /// Unmarshaller the response from the service to the response class. + /// + /// + /// + public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) + { + CopyPartResponse response = new CopyPartResponse(); + UnmarshallResult(context,response); + if (context.ResponseData.IsHeaderPresent("x-amz-server-side-encryption-bucket-key-enabled")) + response.BucketKeyEnabled = bool.Parse(context.ResponseData.GetHeaderValue("x-amz-server-side-encryption-bucket-key-enabled")); + if (context.ResponseData.IsHeaderPresent("x-amz-copy-source-version-id")) + response.CopySourceVersionId = context.ResponseData.GetHeaderValue("x-amz-copy-source-version-id"); + if (context.ResponseData.IsHeaderPresent("x-amz-request-charged")) + response.RequestCharged = context.ResponseData.GetHeaderValue("x-amz-request-charged"); + if (context.ResponseData.IsHeaderPresent("x-amz-server-side-encryption-aws-kms-key-id")) + response.ServerSideEncryptionKeyManagementServiceKeyId = context.ResponseData.GetHeaderValue("x-amz-server-side-encryption-aws-kms-key-id"); + if (context.ResponseData.IsHeaderPresent("x-amz-server-side-encryption")) + response.ServerSideEncryptionMethod = context.ResponseData.GetHeaderValue("x-amz-server-side-encryption"); + if (context.ResponseData.IsHeaderPresent("x-amz-server-side-encryption-customer-algorithm")) + response.SSECustomerAlgorithm = context.ResponseData.GetHeaderValue("x-amz-server-side-encryption-customer-algorithm"); + if (context.ResponseData.IsHeaderPresent("x-amz-server-side-encryption-customer-key-MD5")) + response.SSECustomerKeyMD5 = context.ResponseData.GetHeaderValue("x-amz-server-side-encryption-customer-key-MD5"); + + PostUnmarshallCustomization(context, response); + return response; + } + + private static void UnmarshallResult(XmlUnmarshallerContext context, CopyPartResponse response) + { + int originalDepth = context.CurrentDepth; + int targetDepth = originalDepth + 1; + // payload has been flattened so that members of the result object are directly unmarshalled instead of unmarshalled + // as part of the container class, so look one level deeper + targetDepth += 1; + if (context.IsEmptyResponse) + { + return; + } + while (context.Read()) + { + if (context.IsStartElement || context.IsAttribute) + { + if (context.TestExpression("ChecksumCRC32", targetDepth)) + { + var unmarshaller = StringUnmarshaller.Instance; + response.ChecksumCRC32 = unmarshaller.Unmarshall(context); + continue; + } + if (context.TestExpression("ChecksumCRC32C", targetDepth)) + { + var unmarshaller = StringUnmarshaller.Instance; + response.ChecksumCRC32C = unmarshaller.Unmarshall(context); + continue; + } + if (context.TestExpression("ChecksumCRC64NVME", targetDepth)) + { + var unmarshaller = StringUnmarshaller.Instance; + response.ChecksumCRC64NVME = unmarshaller.Unmarshall(context); + continue; + } + if (context.TestExpression("ChecksumSHA1", targetDepth)) + { + var unmarshaller = StringUnmarshaller.Instance; + response.ChecksumSHA1 = unmarshaller.Unmarshall(context); + continue; + } + if (context.TestExpression("ChecksumSHA256", targetDepth)) + { + var unmarshaller = StringUnmarshaller.Instance; + response.ChecksumSHA256 = unmarshaller.Unmarshall(context); + continue; + } + if (context.TestExpression("ETag", targetDepth)) + { + var unmarshaller = StringUnmarshaller.Instance; + response.ETag = unmarshaller.Unmarshall(context); + continue; + } + if (context.TestExpression("LastModified", targetDepth)) + { + var unmarshaller = NullableDateTimeUnmarshaller.Instance; + response.LastModified = unmarshaller.Unmarshall(context); + continue; + } + } + else if (context.IsEndElement && context.CurrentDepth < originalDepth) + { + return; + } + } + return; + } + + + /// + /// Unmarshaller error response to exception. + /// + /// + /// + /// + /// + public override AmazonServiceException UnmarshallException(XmlUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) + { + S3ErrorResponse errorResponse = S3ErrorResponseUnmarshaller.Instance.Unmarshall(context); + errorResponse.InnerException = innerException; + errorResponse.StatusCode = statusCode; + + var responseBodyBytes = context.GetResponseBodyBytes(); + + using (var streamCopy = new MemoryStream(responseBodyBytes)) + using (var contextCopy = new XmlUnmarshallerContext(streamCopy, false, null)) + { + } + return base.ConstructS3Exception(context, errorResponse, innerException, statusCode); + } + + partial void PostUnmarshallCustomization(XmlUnmarshallerContext context, CopyPartResponse response); + + private static CopyPartResponseUnmarshaller _instance = new CopyPartResponseUnmarshaller(); + + internal static CopyPartResponseUnmarshaller GetInstance() + { + return _instance; + } + + /// + /// Gets the singleton. + /// + public static CopyPartResponseUnmarshaller Instance + { + get + { + return _instance; + } + } + + } +} \ No newline at end of file