Skip to content

Commit bedfd9d

Browse files
committed
Remove AmazonWebServiceResponse as base class for transfer utility repsonse objects.
stack-info: PR: #4087, branch: GarrettBeatty/stacked/12
1 parent 88673e8 commit bedfd9d

File tree

5 files changed

+18
-26
lines changed

5 files changed

+18
-26
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"services": [
3+
{
4+
"serviceName": "S3",
5+
"type": "patch",
6+
"changeLogMessages": [
7+
"Remove AmazonWebServiceResponse as base class for transfer utility repsonse objects."
8+
]
9+
}
10+
]
11+
}

sdk/src/Services/S3/Custom/Transfer/Internal/ResponseMapper.cs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,6 @@ internal static TransferUtilityUploadResponse MapPutObjectResponse(PutObjectResp
6363
response.VersionId = source.VersionId;
6464
response.Size = source.Size;
6565

66-
// Copy response metadata
67-
response.ResponseMetadata = source.ResponseMetadata;
68-
response.ContentLength = source.ContentLength;
69-
response.HttpStatusCode = source.HttpStatusCode;
70-
7166
return response;
7267
}
7368

@@ -102,11 +97,6 @@ internal static TransferUtilityUploadResponse MapCompleteMultipartUploadResponse
10297
response.Key = source.Key;
10398
response.Location = source.Location;
10499

105-
// Copy response metadata
106-
response.ResponseMetadata = source.ResponseMetadata;
107-
response.ContentLength = source.ContentLength;
108-
response.HttpStatusCode = source.HttpStatusCode;
109-
110100
return response;
111101
}
112102

@@ -157,12 +147,6 @@ internal static TransferUtilityDownloadResponse MapGetObjectResponse(GetObjectRe
157147
response.TagCount = source.TagCount;
158148
response.VersionId = source.VersionId;
159149
response.WebsiteRedirectLocation = source.WebsiteRedirectLocation;
160-
161-
// Copy response metadata
162-
response.ResponseMetadata = source.ResponseMetadata;
163-
response.ContentLength = source.ContentLength;
164-
response.HttpStatusCode = source.HttpStatusCode;
165-
166150
return response;
167151
}
168152

sdk/src/Services/S3/Custom/Transfer/TransferUtilityDownloadResponse.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ namespace Amazon.S3.Transfer
3131
/// Response object for Transfer Utility download operations.
3232
/// Contains response metadata from download operations.
3333
/// </summary>
34-
public class TransferUtilityDownloadResponse : AmazonWebServiceResponse
34+
public class TransferUtilityDownloadResponse
3535
{
3636
/// <summary>
3737
/// Gets and sets the AcceptRanges property.

sdk/src/Services/S3/Custom/Transfer/TransferUtilityUploadResponse.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ namespace Amazon.S3.Transfer
3232
/// Contains unified response fields from both simple uploads (PutObjectResponse)
3333
/// and multipart uploads (CompleteMultipartUploadResponse).
3434
/// </summary>
35-
public class TransferUtilityUploadResponse : AmazonWebServiceResponse
35+
public class TransferUtilityUploadResponse
3636
{
3737
private bool? _bucketKeyEnabled;
3838
private string _bucketName;

sdk/test/Services/S3/UnitTests/Custom/ResponseMapperTests.cs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,7 @@ public void MapPutObjectResponse_AllMappedProperties_WorkCorrectly()
149149
},
150150
(sourceResponse, targetResponse) =>
151151
{
152-
Assert.AreEqual(sourceResponse.HttpStatusCode, targetResponse.HttpStatusCode, "HttpStatusCode should match");
153-
Assert.AreEqual(sourceResponse.ContentLength, targetResponse.ContentLength, "ContentLength should match");
152+
154153
});
155154
}
156155

@@ -644,12 +643,11 @@ public void MapCompleteMultipartUploadResponse_AllMappedProperties_WorkCorrectly
644643
(sourceResponse) =>
645644
{
646645
sourceResponse.HttpStatusCode = HttpStatusCode.OK;
647-
sourceResponse.ContentLength = 2048;
646+
sourceResponse.ContentLength = 1024;
648647
},
649648
(sourceResponse, targetResponse) =>
650649
{
651-
Assert.AreEqual(sourceResponse.HttpStatusCode, targetResponse.HttpStatusCode, "HttpStatusCode should match");
652-
Assert.AreEqual(sourceResponse.ContentLength, targetResponse.ContentLength, "ContentLength should match");
650+
653651
});
654652
}
655653

@@ -720,12 +718,11 @@ public void MapGetObjectResponse_AllMappedProperties_WorkCorrectly()
720718
(sourceResponse) =>
721719
{
722720
sourceResponse.HttpStatusCode = HttpStatusCode.OK;
723-
sourceResponse.ContentLength = 2048;
721+
sourceResponse.ContentLength = 1024;
724722
},
725723
(sourceResponse, targetResponse) =>
726724
{
727-
Assert.AreEqual(sourceResponse.HttpStatusCode, targetResponse.HttpStatusCode, "HttpStatusCode should match");
728-
Assert.AreEqual(sourceResponse.ContentLength, targetResponse.ContentLength, "ContentLength should match");
725+
729726
});
730727
}
731728

0 commit comments

Comments
 (0)