/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ using System; using System.Collections.Generic; using System.Xml.Serialization; using System.Text; using System.IO; using System.Net; using Amazon.Runtime; using Amazon.Runtime.Internal; namespace Amazon.S3.Model { /// /// Container for the parameters to the GetObjectAttributes operation. /// Retrieves all the metadata from an object without returning the object iteself. This /// action is useful if you're only interested in an object's metadata. To use GetObjectAttributes, /// you must have READ access to the object. /// /// /// /// GetObjectAttributes combines the functionality of GetObjectAcl, /// GetObjectLegelHold, GetObjectLockConfiguration, GetObjectRetention, /// GetObjectTagging, HeadObject, and ListParts. /// All of the data returned with each of those individual calls can be returned with /// a single call to GetObjectAttributes. /// /// /// /// If you encrypt an object by using server-side encryption with customer-provided encryption /// keys (SSE-C) when you store the object in Amazon S3, then when you retrieve the metadata /// from the object, you must use the following headers: /// /// /// /// For more information about SSE-C, see Server-Side /// Encryption (Using Customer-Provided Encryption Keys). /// /// /// /// Consider the following when using request headers: /// /// /// /// For more information about conditional requests, see RFC /// 7232. /// ///
Permissions
/// /// The permissions you need to use this operation depend on whether or not the bucket /// is versioned. If the bucket is versioned, you need both the s3:GetObjectVersion /// and s3:GetObjectVersionAttributes permissions for this operation. If /// the bucket is not versioned, you need the s3:GetObject and s3:GetObjectAttributes /// permissions. For more information, see Specifying /// Permissions in a Policy. If the object you request does not exist, the error Amazon /// S3 returns depends on whether you also have the s3:ListBucket permission. /// ///
  • /// /// If you have the s3:ListBucket permission on the bucket, Amazon S3 returns /// an HTTP status code 404 ("no such key") error. /// ///
  • /// /// If you don't have the s3:ListBucket permission, Amazon S3 returns an /// HTTP status code 403 ("access denied") error. /// ///
/// /// The following actions are related to GetObjectAttributes: /// /// ///
public partial class GetObjectAttributesRequest : AmazonWebServiceRequest { private string _bucketName; private string _expectedBucketOwner; private string _key; private int? _maxParts; private List _objectAttributes = new List(); private int? _partNumberMarker; private RequestPayer _requestPayer; private string _sseCustomerAlgorithm; private string _sseCustomerKey; private string _sseCustomerKeyMD5; private string _versionId; /// /// Gets and sets the property BucketName. /// /// The name of the bucket that contains the object. /// /// /// /// When using this action with an access point, you must direct requests to the access /// point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.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 Using /// access points in the Amazon S3 User Guide. /// /// /// /// When you use this action with Amazon S3 on Outposts, you must direct requests to the /// S3 on Outposts hostname. The S3 on Outposts hostname takes the form AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. /// When you use this action with S3 on Outposts through the Amazon Web Services SDKs, /// you provide the Outposts access point ARN in place of the bucket name. For more information /// about S3 on Outposts ARNs, see What /// is S3 on Outposts? in the Amazon S3 User Guide. /// /// 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; } /// /// Gets and sets the property ExpectedBucketOwner. /// /// The account ID of the expected bucket owner. If the bucket is owned by a different /// account, the request will fail with an HTTP 403 (Access Denied) error. /// /// public string ExpectedBucketOwner { get { return this._expectedBucketOwner; } set { this._expectedBucketOwner = value; } } // Check to see if ExpectedBucketOwner property is set internal bool IsSetExpectedBucketOwner() { return this._expectedBucketOwner != null; } /// /// Gets and sets the property Key. /// /// The object key. /// /// [AWSProperty(Required = true, Min = 1)] public string Key { get { return this._key; } set { this._key = value; } } // Check to see if Key property is set internal bool IsSetKey() { return this._key != null; } /// /// Gets and sets the property MaxParts. /// /// Sets the maximum number of parts to return. /// /// public int MaxParts { get { return this._maxParts.GetValueOrDefault(); } set { this._maxParts = value; } } // Check to see if MaxParts property is set internal bool IsSetMaxParts() { return this._maxParts.HasValue; } /// /// Gets and sets the property ObjectAttributes. /// /// Specifies the fields at the root level that you want returned in the response. Fields /// that you do not specify are not returned. /// /// public List ObjectAttributes { get { return this._objectAttributes; } set { this._objectAttributes = value; } } // Check to see if ObjectAttributes property is set internal bool IsSetObjectAttributes() { return this._objectAttributes != null && this._objectAttributes.Count > 0; } /// /// Gets and sets the property PartNumberMarker. /// /// Specifies the part after which listing should begin. Only parts with higher part numbers /// will be listed. /// /// public int PartNumberMarker { get { return this._partNumberMarker.GetValueOrDefault(); } set { this._partNumberMarker = value; } } // Check to see if PartNumberMarker property is set internal bool IsSetPartNumberMarker() { return this._partNumberMarker.HasValue; } /// /// Gets and sets the property RequestPayer. /// public RequestPayer RequestPayer { get { return this._requestPayer; } set { this._requestPayer = value; } } // Check to see if RequestPayer property is set internal bool IsSetRequestPayer() { return this._requestPayer != null; } /// /// Gets and sets the property SSECustomerAlgorithm. /// /// Specifies the algorithm to use to when encrypting the object (for example, AES256). /// /// public string SSECustomerAlgorithm { get { return this._sseCustomerAlgorithm; } set { this._sseCustomerAlgorithm = value; } } // Check to see if SSECustomerAlgorithm property is set internal bool IsSetSSECustomerAlgorithm() { return this._sseCustomerAlgorithm != null; } /// /// Gets and sets the property SSECustomerKey. /// /// Specifies the customer-provided encryption key for Amazon S3 to use in encrypting /// data. This value is used to store the object and then it is discarded; Amazon S3 does /// not store the encryption key. The key must be appropriate for use with the algorithm /// specified in the x-amz-server-side-encryption-customer-algorithm header. /// /// public string SSECustomerKey { get { return this._sseCustomerKey; } set { this._sseCustomerKey = value; } } // Check to see if SSECustomerKey property is set internal bool IsSetSSECustomerKey() { return this._sseCustomerKey != null; } /// /// Gets and sets the property SSECustomerKeyMD5. /// /// Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. Amazon /// S3 uses this header for a message integrity check to ensure that the encryption key /// was transmitted without error. /// /// public string SSECustomerKeyMD5 { get { return this._sseCustomerKeyMD5; } set { this._sseCustomerKeyMD5 = value; } } // Check to see if SSECustomerKeyMD5 property is set internal bool IsSetSSECustomerKeyMD5() { return this._sseCustomerKeyMD5 != null; } /// /// Gets and sets the property VersionId. /// public string VersionId { get { return this._versionId; } set { this._versionId = value; } } // Check to see if VersionId property is set internal bool IsSetVersionId() { return this._versionId != null; } } }