Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions generator/ServiceClientGeneratorLib/ServiceModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -575,8 +575,10 @@ public List<Operation> S3AllowListOperations
new Operation(this,"PutBucketRequestPayment", DocumentRoot[OperationsKey]["PutBucketRequestPayment"]),
new Operation(this, "CreateBucketMetadataConfiguration",DocumentRoot[OperationsKey]["CreateBucketMetadataConfiguration"]),
new Operation(this, "GetBucketMetadataConfiguration", DocumentRoot[OperationsKey]["GetBucketMetadataConfiguration"]),
new Operation(this, "DeleteBucketMetadataConfiguration", DocumentRoot[OperationsKey]["DeleteBucketMetadataConfiguration"])

new Operation(this, "DeleteBucketMetadataConfiguration", DocumentRoot[OperationsKey]["DeleteBucketMetadataConfiguration"]),
new Operation(this, "ListObjects", DocumentRoot[OperationsKey]["ListObjects"]),
new Operation(this,"UpdateBucketMetadataJournalTableConfiguration", DocumentRoot[OperationsKey]["UpdateBucketMetadataJournalTableConfiguration"]),
new Operation(this, "ListMultipartUploads", DocumentRoot[OperationsKey]["ListMultipartUploads"])
};
}
return _s3AllowListOperations.Where(operation => operation.data != null).ToList();
Expand Down
88 changes: 88 additions & 0 deletions generator/ServiceModels/s3/s3.customizations.json
Original file line number Diff line number Diff line change
Expand Up @@ -1222,6 +1222,73 @@
"modify":[
{
"ExpectedBucketOwner":{"injectXmlIsSet":["return !String.IsNullOrEmpty(this._expectedBucketOwner);"]}
}
]
},
"ListObjectsRequest":{
"modify":[
{
"EncodingType":{"emitPropertyName":"Encoding"}
},
{
"ExpectedBucketOwner":{"injectXmlIsSet":["return !String.IsNullOrEmpty(this._expectedBucketOwner);"]}
}
]
},
"ListObjectsOutput":{
"modify":[
{
"Contents":{
"emitPropertyName":"S3Objects"
}
},
{
"S3Objects":{
"injectXmlUnmarshallCode":["ContentsCustomUnmarshall(context, response);"],
"skipContextTestExpressionUnmarshallingLogic" : true
}
},
{
"NextMarker":{"injectXmlPropertyGetter":["get { return NextMarkerCustomGetter(); }"]}
},
{
"EncodingType":{"emitPropertyName":"Encoding"}
}
]
},
"UpdateBucketMetadataJournalTableConfigurationRequest":{
"modify":[
{
"ContentMD5":{"injectXmlIsSet":["return !String.IsNullOrEmpty(this._contentMD5);"]}
},
{
"ExpectedBucketOwner":{"injectXmlIsSet":["return !String.IsNullOrEmpty(this._expectedBucketOwner);"]}
}

]
},
"ListMultipartUploadsRequest":{
"modify":[
{
"EncodingType":{"emitPropertyName":"Encoding"}
},
{
"ExpectedBucketOwner":{"injectXmlIsSet":["return !String.IsNullOrEmpty(this._expectedBucketOwner);"]}
}
]
},
"ListMultipartUploadsOutput":{
"modify":[
{
"CommonPrefixes":{
"injectXmlUnmarshallCode":["CommonPrefixesCustomUnmarshall(context, response);"],
"skipContextTestExpressionUnmarshallingLogic" : true
}
},
{
"Uploads":{"emitPropertyName":"MultipartUploads"}


}
]
}
Expand Down Expand Up @@ -1521,6 +1588,27 @@
"Marshaller": "StringUtils.FromString",
"Unmarshaller": "StringUnmarshaller"
}
},
"ListObjectsOutput": {
"CommonPrefixes" : {
"Type": "List<string>",
"Marshaller": "StringUtils.FromString",
"Unmarshaller" : "CommonPrefixesItemUnmarshaller"
}
},
"ListMultipartUploadsRequest":{
"CommonPrefixes" : {
"Type": "List<string>",
"Marshaller": "StringUtils.FromString",
"Unmarshaller" : "CommonPrefixesItemUnmarshaller"
}
},
"ListMultipartUploadsOutput":{
"CommonPrefixes" : {
"Type": "List<string>",
"Marshaller": "StringUtils.FromString",
"Unmarshaller" : "CommonPrefixesItemUnmarshaller"
}
}
},
"excludeMembers":{
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -26,150 +26,21 @@ namespace Amazon.S3.Model.Internal.MarshallTransformations
/// <summary>
/// Response Unmarshaller for ListMultipartUploads operation
/// </summary>
public class ListMultipartUploadsResponseUnmarshaller : S3ReponseUnmarshaller
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context)
{
ListMultipartUploadsResponse response = new ListMultipartUploadsResponse();

while (context.Read())
{
if (context.IsStartElement)
{
UnmarshallResult(context,response);
continue;
}
}

IWebResponseData responseData = context.ResponseData;
if (responseData.IsHeaderPresent(S3Constants.AmzHeaderRequestCharged))
response.RequestCharged = RequestCharged.FindValue(responseData.GetHeaderValue(S3Constants.AmzHeaderRequestCharged));

return response;
}

private static void UnmarshallResult(XmlUnmarshallerContext context,ListMultipartUploadsResponse response)
public partial class ListMultipartUploadsResponseUnmarshaller : S3ReponseUnmarshaller
{
private static void CommonPrefixesCustomUnmarshall(XmlUnmarshallerContext context, ListMultipartUploadsResponse 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("Bucket", targetDepth))
{
response.BucketName = StringUnmarshaller.GetInstance().Unmarshall(context);

continue;
}
if (context.TestExpression("KeyMarker", targetDepth))
{
response.KeyMarker = StringUnmarshaller.GetInstance().Unmarshall(context);

continue;
}
if (context.TestExpression("UploadIdMarker", targetDepth))
{
response.UploadIdMarker = StringUnmarshaller.GetInstance().Unmarshall(context);

continue;
}
if (context.TestExpression("NextKeyMarker", targetDepth))
{
response.NextKeyMarker = StringUnmarshaller.GetInstance().Unmarshall(context);

continue;
}
if (context.TestExpression("NextUploadIdMarker", targetDepth))
{
response.NextUploadIdMarker = StringUnmarshaller.GetInstance().Unmarshall(context);

continue;
}
if (context.TestExpression("MaxUploads", targetDepth))
{
response.MaxUploads = IntUnmarshaller.GetInstance().Unmarshall(context);

continue;
}
if (context.TestExpression("IsTruncated", targetDepth))
{
response.IsTruncated = BoolUnmarshaller.GetInstance().Unmarshall(context);

continue;
}
if (context.TestExpression("Upload", targetDepth))
{
if (response.MultipartUploads == null)
{
response.MultipartUploads = new List<MultipartUpload>();
}

response.MultipartUploads.Add(MultipartUploadUnmarshaller.Instance.Unmarshall(context));
continue;
}
if (context.TestExpression("Delimiter", targetDepth))
{
response.Delimiter = StringUnmarshaller.GetInstance().Unmarshall(context);

continue;
}
if (context.TestExpression("Prefix", targetDepth))
{
response.Prefix = StringUnmarshaller.GetInstance().Unmarshall(context);

continue;
}
if (context.TestExpression("CommonPrefixes", targetDepth))
{
var prefix = CommonPrefixesItemUnmarshaller.Instance.Unmarshall(context);

if (prefix != null)
{
if (response.CommonPrefixes == null)
{
response.CommonPrefixes = new List<string>();
}
response.CommonPrefixes.Add(prefix);
}
var prefix = CommonPrefixesItemUnmarshaller.Instance.Unmarshall(context);

continue;
}
}
else if (context.IsEndElement && context.CurrentDepth < originalDepth)
{
return;
}
}

return;
}

private static ListMultipartUploadsResponseUnmarshaller _instance;

/// <summary>
/// Singleton for the unmarshaller
/// </summary>
public static ListMultipartUploadsResponseUnmarshaller Instance
{
get
if (prefix != null)
{
if (_instance == null)
if (response.CommonPrefixes == null)
{
_instance = new ListMultipartUploadsResponseUnmarshaller();
response.CommonPrefixes = new List<string>();
}
return _instance;
response.CommonPrefixes.Add(prefix);
}
return;
}
}
}
Expand Down
Loading