Skip to content

Commit a4e2880

Browse files
authored
Manual s3 sweep for nullability (#3727)
* sweep s3 and update remaining value types to be nullable * fix build errors
1 parent 1fbd248 commit a4e2880

18 files changed

+46
-35
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+
"Update remaining value types to be nullable."
8+
]
9+
}
10+
]
11+
}

sdk/src/Services/S3/Custom/Model/AbortMultipartUploadRequest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,9 +238,9 @@ internal bool IsSetUploadId()
238238
/// </para>
239239
/// </note>
240240
/// </summary>
241-
public DateTime IfMatchInitiatedTime
241+
public DateTime? IfMatchInitiatedTime
242242
{
243-
get { return this.ifMatchInitiatedTime.GetValueOrDefault(); }
243+
get { return this.ifMatchInitiatedTime; }
244244
set { this.ifMatchInitiatedTime = value;}
245245
}
246246

sdk/src/Services/S3/Custom/Model/CSVInput.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,11 @@ internal bool IsSetQuoteCharacter()
9595
/// <summary>
9696
/// Specifies that CSV field values may contain quoted record delimiters and such records should be allowed. Default value is FALSE. Setting this value to TRUE may lower performance.
9797
/// </summary>
98-
public bool AllowQuotedRecordDelimiter
98+
public bool? AllowQuotedRecordDelimiter
9999
{
100100
get
101101
{
102-
return _allowQuotedRecordDelimiter ?? default(bool);
102+
return _allowQuotedRecordDelimiter;
103103
}
104104
set
105105
{
@@ -109,7 +109,7 @@ public bool AllowQuotedRecordDelimiter
109109

110110
internal bool IsSetAllowQuotedRecordDelimiter()
111111
{
112-
return _allowQuotedRecordDelimiter != null;
112+
return _allowQuotedRecordDelimiter.HasValue;
113113
}
114114

115115
internal void Marshall(string memberName, XmlWriter xmlWriter)
@@ -129,7 +129,7 @@ internal void Marshall(string memberName, XmlWriter xmlWriter)
129129
if (IsSetQuoteCharacter())
130130
xmlWriter.WriteElementString("QuoteCharacter", S3Transforms.ToXmlStringValue(QuoteCharacter));
131131
if (IsSetAllowQuotedRecordDelimiter())
132-
xmlWriter.WriteElementString("AllowQuotedRecordDelimiter", S3Transforms.ToXmlStringValue(AllowQuotedRecordDelimiter));
132+
xmlWriter.WriteElementString("AllowQuotedRecordDelimiter", S3Transforms.ToXmlStringValue(AllowQuotedRecordDelimiter.Value));
133133
}
134134
xmlWriter.WriteEndElement();
135135
}

sdk/src/Services/S3/Custom/Model/CopyObjectRequest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -627,9 +627,9 @@ internal bool IsSetObjectLockMode()
627627
/// The date and time when you want the copied object's Object Lock to expire.
628628
/// </para>
629629
/// </summary>
630-
public DateTime ObjectLockRetainUntilDate
630+
public DateTime? ObjectLockRetainUntilDate
631631
{
632-
get { return this.objectLockRetainUntilDate.GetValueOrDefault(); }
632+
get { return this.objectLockRetainUntilDate; }
633633
set { this.objectLockRetainUntilDate = value; }
634634
}
635635

sdk/src/Services/S3/Custom/Model/CopyPartRequest.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -488,9 +488,9 @@ internal bool IsSetETagToNotMatch()
488488
/// Constraints: This property can be used with ETagToNotMatch,
489489
/// but cannot be used with other conditional copy properties.
490490
/// </remarks>
491-
public DateTime ModifiedSinceDate
491+
public DateTime? ModifiedSinceDate
492492
{
493-
get { return this.modifiedSinceDate.GetValueOrDefault(); }
493+
get { return this.modifiedSinceDate; }
494494
set { this.modifiedSinceDate = value; }
495495
}
496496

@@ -513,9 +513,9 @@ internal bool IsSetModifiedSinceDate()
513513
/// Constraints: This property can be used with ETagToMatch,
514514
/// but cannot be used with other conditional copy properties.
515515
/// </remarks>
516-
public DateTime UnmodifiedSinceDate
516+
public DateTime? UnmodifiedSinceDate
517517
{
518-
get { return this.unmodifiedSinceDate.GetValueOrDefault(); }
518+
get { return this.unmodifiedSinceDate; }
519519
set { this.unmodifiedSinceDate = value; }
520520
}
521521

sdk/src/Services/S3/Custom/Model/CreateSessionRequest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,9 @@ internal bool IsSetSSEKMSEncryptionContext()
154154
/// In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object.
155155
/// </para>
156156
/// </summary>
157-
public bool BucketKeyEnabled
157+
public bool? BucketKeyEnabled
158158
{
159-
get { return this._bucketKeyEnabled.GetValueOrDefault(); }
159+
get { return this._bucketKeyEnabled; }
160160
set { this._bucketKeyEnabled = value; }
161161
}
162162

sdk/src/Services/S3/Custom/Model/CreateSessionResponse.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,9 @@ internal bool IsSetSSEKMSEncryptionContext()
108108
/// <summary>
109109
/// Indicates whether to use an S3 Bucket Key for server-side encryption with KMS keys (SSE-KMS).
110110
/// </summary>
111-
public bool BucketKeyEnabled
111+
public bool? BucketKeyEnabled
112112
{
113-
get { return this._bucketKeyEnabled.GetValueOrDefault(); }
113+
get { return this._bucketKeyEnabled; }
114114
set { this._bucketKeyEnabled = value; }
115115
}
116116

sdk/src/Services/S3/Custom/Model/DeleteObjectRequest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,9 +379,9 @@ internal bool IsSetIfMatch()
379379
/// <para>This functionality is only supported for directory buckets.</para>
380380
/// </note>
381381
/// </summary>
382-
public DateTime IfMatchLastModifiedTime
382+
public DateTime? IfMatchLastModifiedTime
383383
{
384-
get { return this.ifMatchLastModifiedTime.GetValueOrDefault(); }
384+
get { return this.ifMatchLastModifiedTime; }
385385
set { this.ifMatchLastModifiedTime = value; }
386386
}
387387

sdk/src/Services/S3/Custom/Model/GetObjectMetadataRequest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -666,9 +666,9 @@ internal bool IsSetResponseContentType()
666666
/// Sets the <c>Expires</c> header of the response.
667667
/// </para>
668668
/// </summary>
669-
public DateTime ResponseExpires
669+
public DateTime? ResponseExpires
670670
{
671-
get { return this._responseExpires.GetValueOrDefault(); }
671+
get { return this._responseExpires; }
672672
set { this._responseExpires = value; }
673673
}
674674

sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/AbortMultipartUploadRequestMarshaller.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public IRequest Marshall(AbortMultipartUploadRequest abortMultipartUploadRequest
4545
request.Headers.Add(S3Constants.AmzHeaderExpectedBucketOwner, S3Transforms.ToStringValue(abortMultipartUploadRequest.ExpectedBucketOwner));
4646

4747
if (abortMultipartUploadRequest.IsSetIfMatchInitiatedTime())
48-
request.Headers.Add(S3Constants.AmzHeaderIfMatchInitiatedTime, S3Transforms.ToStringValue(abortMultipartUploadRequest.IfMatchInitiatedTime));
48+
request.Headers.Add(S3Constants.AmzHeaderIfMatchInitiatedTime, S3Transforms.ToStringValue(abortMultipartUploadRequest.IfMatchInitiatedTime.Value));
4949

5050
if (string.IsNullOrEmpty(abortMultipartUploadRequest.BucketName))
5151
throw new System.ArgumentException("BucketName is a required property and must be set before making this call.", "AbortMultipartUploadRequest.BucketName");

0 commit comments

Comments
 (0)