Skip to content
Open
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

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ using Amazon.Runtime.Internal.Util;
{
if (structure != null && this.Config.ServiceModel.Customizations.ShapeModifiers.TryGetValue(structure.Name, out var modifier) && modifier.ExcludedMarshallingProperties.Contains(member.ModeledName))
continue;
else if (this.Config.ServiceModel.Customizations.TryGetPropertyModifier(member.OwningShape.Name, member.ModeledName, out var headerPropertyModifier) && headerPropertyModifier.InjectXmlMarshallCode.Count > 0)
{
WriteInjectXmlMarshallCode(0, headerPropertyModifier.InjectXmlMarshallCode);
continue;
}
#>
if (<#=variableName#>.IsSet<#=member.PropertyName#>())
{
Expand All @@ -47,10 +52,6 @@ using Amazon.Runtime.Internal.Util;
request.Headers["<#=member.MarshallLocationName#>"] = <#=member.CustomMarshallerTransformation#>(<#=variableName#>.<#=member.PropertyName#>);
<#+
}
else if (this.Config.ServiceModel.Customizations.TryGetPropertyModifier(member.OwningShape.Name, member.ModeledName, out var headerPropertyModifier) && headerPropertyModifier.InjectXmlMarshallCode.Count > 0)
{
WriteInjectXmlMarshallCode(3, headerPropertyModifier.InjectXmlMarshallCode);
}
else if (member.IsJsonValue)
{
#>
Expand Down
3 changes: 2 additions & 1 deletion generator/ServiceClientGeneratorLib/ServiceModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,8 @@ public List<Operation> S3AllowListOperations
new Operation(this, "ListObjects", DocumentRoot[OperationsKey]["ListObjects"]),
new Operation(this,"UpdateBucketMetadataJournalTableConfiguration", DocumentRoot[OperationsKey]["UpdateBucketMetadataJournalTableConfiguration"]),
new Operation(this, "ListMultipartUploads", DocumentRoot[OperationsKey]["ListMultipartUploads"]),
new Operation(this, "CompleteMultipartUpload", DocumentRoot[OperationsKey]["CompleteMultipartUpload"])
new Operation(this, "CompleteMultipartUpload", DocumentRoot[OperationsKey]["CompleteMultipartUpload"]),
new Operation(this, "DeleteObject", DocumentRoot[OperationsKey]["DeleteObject"])
};
}
return _s3AllowListOperations.Where(operation => operation.data != null).ToList();
Expand Down
44 changes: 43 additions & 1 deletion generator/ServiceModels/s3/s3.customizations.json
Original file line number Diff line number Diff line change
Expand Up @@ -1371,8 +1371,33 @@
"Parts": {"emitPropertyName":"PartETags"}
}
]
},
"DeleteObjectRequest":{
"modify":[
{
"ExpectedBucketOwner":{"injectXmlIsSet": ["return !String.IsNullOrEmpty(this._expectedBucketOwner);"]}
},
{
"IfMatch" : {"injectXmlIsSet":["return !string.IsNullOrEmpty(this._ifMatch);"]}
},
{
"MFA": {"emitPropertyName": "MfaCodes"}
},
{
"MfaCodes":{
"injectXmlIsSet": ["return CustomMfaCodesIsSet();"],
"injectXmlMarshallCode" : ["MfaCodesCustomMarshall(request, publicRequest);"]
}
}
]
},
"DeleteObjectOutput":{
"modify":[
{
"DeleteMarker":{"injectXmlUnmarshallCode": ["DeleteMarkerCustomUnmarshall(context, response);"]}
}
]
}

},
"operationModifiers": {
"CreateBucket": {
Expand Down Expand Up @@ -1529,6 +1554,9 @@
},
"CompletedPart":{
"renameShape":"PartETag"
},
"MFA":{
"renameShape": "MfaCodes"
}
},
"overrideTreatEnumsAsString":{
Expand Down Expand Up @@ -1723,6 +1751,20 @@
"Marshaller":"blah",
"Unmarshaller":"StringUnmarshaller"
}
},
"DeleteObjectOutput":{
"DeleteMarker":{
"Type":"string",
"Marshaller": "StringUtils.FromString",
"Unmarshaller": "StringUnmarshaller"
}
},
"DeleteObjectRequest":{
"MfaCodes":{
"Type": "MfaCodes",
"Marshaller": "StringUtils.FromString",
"Unmarshaller": "StringUnmarshaller"
}
}
},
"excludeMembers":{
Expand Down
262 changes: 2 additions & 260 deletions sdk/src/Services/S3/Custom/Model/DeleteObjectRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,270 +145,12 @@ namespace Amazon.S3.Model
/// </summary>
public partial class DeleteObjectRequest : AmazonWebServiceRequest
{
private string bucketName;
private bool? bypassGovernanceRetention;
private string expectedBucketOwner;
private string key;
private MfaCodes mfaCodes;
private RequestPayer requestPayer;
private string versionId;
private string ifMatch;
private DateTime? ifMatchLastModifiedTime;
private long? ifMatchSize;


/// <summary>
/// Gets and sets the property BucketName.
/// <para>
/// The bucket name of the bucket containing the object.
/// </para>
/// <para>
/// <b>Directory buckets</b> - When you use this operation with a directory bucket, you must use virtual-hosted-style
/// requests in the format <c> <i>Bucket-name</i>.s3express-<i>zone-id</i>.<i>region-code</i>.amazonaws.com</c>. Path-style
/// requests are not supported. Directory bucket names must be unique in the chosen Zone (Availability Zone or Local Zone). Bucket
/// names must follow the format <c> <i>bucket-base-name</i>--<i>zone-id</i>--x-s3</c> (for example, <c> <i>amzn-s3-demo-bucket</i>--<i>usw2-az1</i>--x-s3</c>). For
/// information about bucket naming restrictions, see
/// <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html">Directory bucket naming rules</a> in
/// the <i>Amazon S3 User Guide</i>.
/// </para>
/// <para>
/// <b>Access points</b> - When you use this action with an access point for general purpose buckets, you must provide the alias of
/// the access point in place of the bucket name or specify the access point ARN. When you use this action with an access point for
/// directory buckets, you must provide the access point name in place of the bucket name. When using the access point ARN, you must
/// direct requests to the access point hostname. The access point hostname takes the form <i>AccessPointName</i>-<i>AccountId</i>.s3-accesspoint.<i>Region</i>.amazonaws.com. When
/// using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the
/// bucket name. For more information about access point ARNs, see
/// <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html">Using access points</a> in the <i>Amazon S3 User Guide</i>.
/// </para>
/// <note>
/// <para>
/// Object Lambda access points are not supported by directory buckets.
/// </para>
/// </note>
/// <para>
/// <b>S3 on Outposts</b> - When you use this action with S3 on Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on Outposts
/// hostname takes the form <c> <i>AccessPointName</i>-<i>AccountId</i>.<i>outpostID</i>.s3-outposts.<i>Region</i>.amazonaws.com</c>. When you use
/// this action with S3 on Outposts, the destination bucket must be the Outposts access point ARN or the access point alias. For more information
/// about S3 on Outposts, see
/// <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html">What is S3 on Outposts?</a> in the <i>Amazon S3 User Guide</i>.
/// </para>
/// </summary>
public string BucketName
{
get { return this.bucketName; }
set { this.bucketName = value; }
}

// Check to see if BucketName property is set
internal bool IsSetBucketName()
{
return this.bucketName != null;
}

/// <summary>
/// Gets and sets the property BypassGovernanceRetention.
/// <para>
/// Indicates whether S3 Object Lock should bypass Governance-mode restrictions to process
/// this operation. To use this header, you must have the <c>s3:BypassGovernanceRetention</c>
/// permission.
/// </para>
/// <note>
/// <para>
/// This functionality is not supported for directory buckets.
/// </para>
/// </note>
/// </summary>
public bool? BypassGovernanceRetention
{
get { return this.bypassGovernanceRetention; }
set { this.bypassGovernanceRetention = value; }
}

// Check to see if BypassGovernanceRetention property is set
internal bool IsSetBypassGovernanceRetention()
{
return this.bypassGovernanceRetention.HasValue;
}

/// <summary>
/// Gets and sets the property ExpectedBucketOwner.
/// <para>
/// The account ID of the expected bucket owner. If the account ID that you provide does
/// not match the actual owner of the bucket, the request fails with the HTTP status code
/// <c>403 Forbidden</c> (access denied).
/// </para>
/// </summary>
public string ExpectedBucketOwner
{
get { return this.expectedBucketOwner; }
set { this.expectedBucketOwner = value; }
}

// Check to see if ExpectedBucketOwner property is set
internal bool IsSetExpectedBucketOwner()
{
return !String.IsNullOrEmpty(this.expectedBucketOwner);
}

/// <summary>
/// Gets and sets the property Key.
/// <para>
/// Key name of the object to delete.
/// </para>
/// </summary>
public string Key
{
get { return this.key; }
set { this.key = value; }
}

// Check to see if Key property is set
internal bool IsSetKey()
internal bool CustomMfaCodesIsSet()
{
return this.key != null;
}

/// <summary>
/// Gets and sets the property MFA.
/// <para>
/// The concatenation of the authentication device's serial number, a space, and the value
/// that is displayed on your authentication device. Required to permanently delete a
/// versioned object if versioning is configured with MFA delete enabled.
/// </para>
/// <note>
/// <para>
/// This functionality is not supported for directory buckets.
/// </para>
/// </note>
/// </summary>
/// <remarks>
/// This is a required property for this request if:<br />
/// 1. EnableMfaDelete was configured on the bucket
/// containing this object's version.<br />
/// 2. You are deleting an object's version
/// </remarks>
public MfaCodes MfaCodes
{
get { return this.mfaCodes; }
set { this.mfaCodes = value; }
}

/// <summary>
/// Checks if the MfaCodes property is set.
/// </summary>
/// <returns>true if the MfaCodes property is set.</returns>
internal bool IsSetMfaCodes()
{
return (this.mfaCodes != null) &&
return (this._mfaCodes != null) &&
(!System.String.IsNullOrEmpty(MfaCodes.SerialNumber)) &&
(!System.String.IsNullOrEmpty(MfaCodes.AuthenticationValue));
}

/// <summary>
/// Gets and sets the property RequestPayer.
/// </summary>
public RequestPayer RequestPayer
{
get { return this.requestPayer; }
set { this.requestPayer = value; }
}

// Check to see if RequestPayer property is set
internal bool IsSetRequestPayer()
{
return requestPayer != null;
}

/// <summary>
/// Gets and sets the property VersionId.
/// <para>
/// Version ID used to reference a specific version of the object.
/// </para>
/// <note>
/// <para>
/// For directory buckets in this API operation, only the <c>null</c> value of the
/// version ID is supported.
/// </para>
/// </note>
/// </summary>
public string VersionId
{
get { return this.versionId; }
set { this.versionId = value; }
}

// Check to see if VersionId property is set
internal bool IsSetVersionId()
{
return !System.String.IsNullOrEmpty(this.versionId);
}

/// <summary>
/// Gets and sets the property IfMatch.
/// <para>The <c>If-Match</c> header field makes the request method conditional on ETags. If the ETag value does not match, the operation returns
/// a <c>412 Precondition Failed</c> error. If the ETag matches or if the object doesn't exist, the operation will return a <c>204 Success (No Content) response</c>.</para>
/// <para>For more information about conditional requests, see <a href="https://docs.aws.amazon.com/https:/tools.ietf.org/html/rfc7232">RFC 7232</a>.</para>
/// <note>
/// <para>This functionality is only supported for directory buckets.</para>
/// </note>
/// </summary>
public string IfMatch
{
get { return this.ifMatch; }
set { this.ifMatch = value; }
}

// Check to see if IfMatch property is set
internal bool IsSetIfMatch()
{
return !String.IsNullOrEmpty(this.ifMatch);
}

/// <summary>
/// Gets and sets the property IfMatchLastModifiedTime.
/// <para>If present, the object is deleted only if its modification times matches the provided
/// <c>Timestamp</c>. If the <c>Timestamp</c> values do not match, the operation
/// returns a <c>412 Precondition Failed</c> error. If the <c>Timestamp</c> matches
/// or if the object doesn’t exist, the operation returns a <c>204 Success (No Content)</c> response.</para>
/// <note>
/// <para>This functionality is only supported for directory buckets.</para>
/// </note>
/// </summary>
public DateTime? IfMatchLastModifiedTime
{
get { return this.ifMatchLastModifiedTime; }
set { this.ifMatchLastModifiedTime = value; }
}

// Check to see if IfMatchLastModifiedTime property is set
internal bool IsSetIfMatchLastModifiedTime()
{
return this.ifMatchLastModifiedTime.HasValue;
}

/// <summary>
/// Gets and sets the property IfMatchSize.
/// <para>If present, the object is deleted only if its size matches the provided size in bytes. If the <c>Size</c> value does not match, the operation returns a <c>412 Precondition Failed</c> error. If the <c>Size</c> matches or if the object doesn’t exist,
/// the operation returns a <c>204 Success (No Content)</c> response.</para>
/// <note>
/// <para>This functionality is only supported for directory buckets.</para>
/// </note>
/// <important>
/// <para>You can use the <c>If-Match</c>, <c>x-amz-if-match-last-modified-time</c> and <c>x-amz-if-match-size</c>
/// conditional headers in conjunction with each-other or individually.</para>
/// </important>
/// </summary>
public long IfMatchSize
{
get { return this.ifMatchSize.GetValueOrDefault(); }
set { this.ifMatchSize = value; }
}

// Check to see if MatchSize property is set
internal bool IsSetIfMatchSize()
{
return this.ifMatchSize.HasValue;
}
}
}

Loading