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
3 changes: 2 additions & 1 deletion generator/ServiceClientGeneratorLib/ServiceModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,8 @@ public List<Operation> S3AllowListOperations
new Operation(this, "GetBucketMetadataConfiguration", DocumentRoot[OperationsKey]["GetBucketMetadataConfiguration"]),
new Operation(this, "DeleteBucketMetadataConfiguration", DocumentRoot[OperationsKey]["DeleteBucketMetadataConfiguration"]),
new Operation(this, "ListObjects", DocumentRoot[OperationsKey]["ListObjects"]),
new Operation(this,"UpdateBucketMetadataJournalTableConfiguration", DocumentRoot[OperationsKey]["UpdateBucketMetadataJournalTableConfiguration"])
new Operation(this,"UpdateBucketMetadataJournalTableConfiguration", DocumentRoot[OperationsKey]["UpdateBucketMetadataJournalTableConfiguration"]),
new Operation(this, "ListMultipartUploads", DocumentRoot[OperationsKey]["ListMultipartUploads"])
};
}
return _s3AllowListOperations.Where(operation => operation.data != null).ToList();
Expand Down
39 changes: 39 additions & 0 deletions generator/ServiceModels/s3/s3.customizations.json
Original file line number Diff line number Diff line change
Expand Up @@ -1266,6 +1266,31 @@
}

]
},
"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 @@ -1570,6 +1595,20 @@
"Marshaller": "StringUtils.FromString",
"Unmarshaller" : "CommonPrefixesItemUnmarshaller"
}
},
"ListMultipartUploadsRequest":{
"CommonPrefixes" : {
"Type": "List<string>",
"Marshaller": "StringUtils.FromString",
"Unmarshaller" : "CommonPrefixesItemUnmarshaller"
}
},
Comment on lines +1599 to +1605
Copy link

Copilot AI Dec 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dataTypeSwap configuration includes an entry for ListMultipartUploadsRequest.CommonPrefixes (lines 1596-1602), but CommonPrefixes is a response-only property that doesn't exist in request objects. This entry should likely be removed, as only ListMultipartUploadsOutput.CommonPrefixes (lines 1603-1609) is needed. Compare with similar operations like ListObjects which only has a dataTypeSwap entry for the Output, not the Request.

Suggested change
"ListMultipartUploadsRequest":{
"CommonPrefixes" : {
"Type": "List<string>",
"Marshaller": "StringUtils.FromString",
"Unmarshaller" : "CommonPrefixesItemUnmarshaller"
}
},

Copilot uses AI. Check for mistakes.
"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