Skip to content
Draft
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
11 changes: 11 additions & 0 deletions generator/.DevConfigs/c49077d9-90b3-437f-b316-6d8d8833ae75.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"services": [
{
"serviceName": "S3",
"type": "patch",
"changeLogMessages": [
"Remove AmazonWebServiceResponse as base class for transfer utility repsonse objects."
]
}
]
}
18 changes: 0 additions & 18 deletions sdk/src/Services/S3/Custom/Transfer/Internal/ResponseMapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,6 @@ internal static TransferUtilityUploadResponse MapPutObjectResponse(PutObjectResp
response.ServerSideEncryptionKeyManagementServiceKeyId = source.ServerSideEncryptionKeyManagementServiceKeyId;
response.ServerSideEncryptionMethod = source.ServerSideEncryptionMethod;
response.VersionId = source.VersionId;

// Copy response metadata
response.ResponseMetadata = source.ResponseMetadata;
response.ContentLength = source.ContentLength;
response.HttpStatusCode = source.HttpStatusCode;

return response;
}

Expand Down Expand Up @@ -97,12 +91,6 @@ internal static TransferUtilityUploadResponse MapCompleteMultipartUploadResponse
response.ServerSideEncryptionMethod = source.ServerSideEncryptionMethod;
response.ServerSideEncryptionKeyManagementServiceKeyId = source.ServerSideEncryptionKeyManagementServiceKeyId;
response.VersionId = source.VersionId;

// Copy response metadata
response.ResponseMetadata = source.ResponseMetadata;
response.ContentLength = source.ContentLength;
response.HttpStatusCode = source.HttpStatusCode;

return response;
}

Expand Down Expand Up @@ -153,12 +141,6 @@ internal static TransferUtilityDownloadResponse MapGetObjectResponse(GetObjectRe
response.TagCount = source.TagCount;
response.VersionId = source.VersionId;
response.WebsiteRedirectLocation = source.WebsiteRedirectLocation;

// Copy response metadata
response.ResponseMetadata = source.ResponseMetadata;
response.ContentLength = source.ContentLength;
response.HttpStatusCode = source.HttpStatusCode;

return response;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace Amazon.S3.Transfer
/// Response object for Transfer Utility download operations.
/// Contains response metadata from download operations.
/// </summary>
public class TransferUtilityDownloadResponse : AmazonWebServiceResponse
public class TransferUtilityDownloadResponse
{
/// <summary>
/// Gets and sets the AcceptRanges property.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace Amazon.S3.Transfer
/// Contains unified response fields from both simple uploads (PutObjectResponse)
/// and multipart uploads (CompleteMultipartUploadResponse).
/// </summary>
public class TransferUtilityUploadResponse : AmazonWebServiceResponse
public class TransferUtilityUploadResponse
{
private bool? _bucketKeyEnabled;
private string _checksumCRC32;
Expand Down
13 changes: 5 additions & 8 deletions sdk/test/Services/S3/UnitTests/Custom/ResponseMapperTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,7 @@ public void MapPutObjectResponse_AllMappedProperties_WorkCorrectly()
},
(sourceResponse, targetResponse) =>
{
Assert.AreEqual(sourceResponse.HttpStatusCode, targetResponse.HttpStatusCode, "HttpStatusCode should match");
Assert.AreEqual(sourceResponse.ContentLength, targetResponse.ContentLength, "ContentLength should match");

});
}

Expand Down Expand Up @@ -524,12 +523,11 @@ public void MapCompleteMultipartUploadResponse_AllMappedProperties_WorkCorrectly
(sourceResponse) =>
{
sourceResponse.HttpStatusCode = HttpStatusCode.OK;
sourceResponse.ContentLength = 2048;
sourceResponse.ContentLength = 1024;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

to match the value of 1024 we are populating in the headers too

},
(sourceResponse, targetResponse) =>
{
Assert.AreEqual(sourceResponse.HttpStatusCode, targetResponse.HttpStatusCode, "HttpStatusCode should match");
Assert.AreEqual(sourceResponse.ContentLength, targetResponse.ContentLength, "ContentLength should match");

});
}

Expand Down Expand Up @@ -600,12 +598,11 @@ public void MapGetObjectResponse_AllMappedProperties_WorkCorrectly()
(sourceResponse) =>
{
sourceResponse.HttpStatusCode = HttpStatusCode.OK;
sourceResponse.ContentLength = 2048;
sourceResponse.ContentLength = 1024;
},
(sourceResponse, targetResponse) =>
{
Assert.AreEqual(sourceResponse.HttpStatusCode, targetResponse.HttpStatusCode, "HttpStatusCode should match");
Assert.AreEqual(sourceResponse.ContentLength, targetResponse.ContentLength, "ContentLength should match");

});
}

Expand Down