/*
* Copyright 2010-2013 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 Amazon.Runtime;
using Amazon.S3.Util;
namespace Amazon.S3.Model
{
///
/// Returns information about the HeadObject response and response metadata.
///
public class GetObjectMetadataResponse : AmazonWebServiceResponse
{
private string deleteMarker;
private string acceptRanges;
private string contentRange;
private Expiration expiration;
private DateTime? restoreExpiration;
private bool restoreInProgress;
private DateTime? lastModified;
private string eTag;
private int? missingMeta;
private string versionId;
private DateTime? expires;
private string websiteRedirectLocation;
private string serverSideEncryptionKeyManagementServiceKeyId;
private ServerSideEncryptionMethod serverSideEncryption;
private ServerSideEncryptionCustomerMethod serverSideEncryptionCustomerMethod;
private HeadersCollection headersCollection = new HeadersCollection();
private MetadataCollection metadataCollection = new MetadataCollection();
private ReplicationStatus replicationStatus;
private int? partsCount;
private ObjectLockLegalHoldStatus objectLockLegalHoldStatus;
private ObjectLockMode objectLockMode;
private DateTime? objectLockRetainUntilDate;
private S3StorageClass storageClass;
private RequestCharged requestCharged;
///
/// Flag which returns true if the Expires property has been unmarshalled
/// from the raw value or set by user code.
///
private bool isExpiresUnmarshalled;
internal string RawExpires { get; set; }
///
/// The collection of headers for the request.
///
public HeadersCollection Headers
{
get
{
if (this.headersCollection == null)
this.headersCollection = new HeadersCollection();
return this.headersCollection;
}
}
///
/// The collection of meta data for the request.
///
public MetadataCollection Metadata
{
get
{
if (this.metadataCollection == null)
this.metadataCollection = new MetadataCollection();
return this.metadataCollection;
}
}
///
/// Specifies whether the object retrieved was (true) or was not (false) a Delete Marker. If false, this response header does not appear in the
/// response.
///
///
public string DeleteMarker
{
get { return this.deleteMarker; }
set { this.deleteMarker = value; }
}
// Check to see if DeleteMarker property is set
internal bool IsSetDeleteMarker()
{
return this.deleteMarker != null;
}
///
/// Gets and sets the AcceptRanges.
///
public string AcceptRanges
{
get { return this.acceptRanges; }
set { this.acceptRanges = value; }
}
// Check to see if AcceptRanges property is set
internal bool IsSetAcceptRanges()
{
return this.acceptRanges != null;
}
///
/// Gets and sets the ContentRange.
///
public string ContentRange
{
get { return this.contentRange; }
set { this.contentRange = value; }
}
// Check to see if ContentRange property is set
internal bool IsSetContentRange()
{
return this.contentRange != null;
}
///
/// Gets and sets the Expiration property.
/// Specifies the expiration date for the object and the
/// rule governing the expiration.
/// Is null if expiration is not applicable.
///
public Expiration Expiration
{
get { return this.expiration; }
set { this.expiration = value; }
}
// Check to see if Expiration property is set
internal bool IsSetExpiration()
{
return this.expiration != null;
}
///
/// Gets and sets the RestoreExpiration property.
/// RestoreExpiration will be set for objects that have been restored from Amazon Glacier.
/// It indiciates for those objects how long the restored object will exist.
///
public DateTime? RestoreExpiration
{
get { return this.restoreExpiration; }
set { this.restoreExpiration = value; }
}
///
/// Gets and sets the RestoreInProgress
/// Will be true when the object is in the process of being restored from Amazon Glacier.
///
public bool RestoreInProgress
{
get { return this.restoreInProgress; }
set { this.restoreInProgress = value; }
}
///
/// Last modified date of the object
///
///
public DateTime LastModified
{
get { return this.lastModified ?? default(DateTime); }
set { this.lastModified = value; }
}
// Check to see if LastModified property is set
internal bool IsSetLastModified()
{
return this.lastModified.HasValue;
}
///
/// An ETag is an opaque identifier assigned by a web server to a specific version of a resource found at a URL
///
///
public string ETag
{
get { return this.eTag; }
set { this.eTag = value; }
}
// Check to see if ETag property is set
internal bool IsSetETag()
{
return this.eTag != null;
}
///
/// This is set to the number of metadata entries not returned in x-amz-meta headers. This can happen if you create metadata using an API like
/// SOAP that supports more flexible metadata than the REST API. For example, using SOAP, you can create metadata whose values are not legal
/// HTTP headers.
///
///
public int MissingMeta
{
get { return this.missingMeta ?? default(int); }
set { this.missingMeta = value; }
}
// Check to see if MissingMeta property is set
internal bool IsSetMissingMeta()
{
return this.missingMeta.HasValue;
}
///
/// Version of the object.
///
///
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;
}
///
/// The date and time at which the object is no longer cacheable.
///
///
public DateTime Expires
{
get
{
if (this.isExpiresUnmarshalled)
{
return this.expires.Value;
}
else
{
this.expires = AmazonS3Util.ParseExpiresHeader(this.RawExpires, this.ResponseMetadata.RequestId);
this.isExpiresUnmarshalled = true;
return this.expires.Value;
}
}
set { this.expires = value; this.isExpiresUnmarshalled = true; }
}
// Check to see if Expires property is set
internal bool IsSetExpires()
{
return this.expires.HasValue;
}
///
/// If the bucket is configured as a website, redirects requests for this object to another object in the same bucket or to an external URL.
/// Amazon S3 stores the value of this header in the object metadata.
///
///
public string WebsiteRedirectLocation
{
get { return this.websiteRedirectLocation; }
set { this.websiteRedirectLocation = value; }
}
// Check to see if WebsiteRedirectLocation property is set
internal bool IsSetWebsiteRedirectLocation()
{
return this.websiteRedirectLocation != null;
}
///
/// The Server-side encryption algorithm used when storing this object in S3.
///
///
public ServerSideEncryptionMethod ServerSideEncryptionMethod
{
get
{
if (this.serverSideEncryption == null)
return ServerSideEncryptionMethod.None;
return this.serverSideEncryption;
}
set { this.serverSideEncryption = value; }
}
// Check to see if ServerSideEncryptionCustomerMethod property is set
internal bool IsSetServerSideEncryptionMethod()
{
return this.serverSideEncryptionCustomerMethod != null;
}
///
/// The Server-side encryption algorithm to be used with the customer provided key.
///
///
public ServerSideEncryptionCustomerMethod ServerSideEncryptionCustomerMethod
{
get
{
if (this.serverSideEncryptionCustomerMethod == null)
return ServerSideEncryptionCustomerMethod.None;
return this.serverSideEncryptionCustomerMethod;
}
set { this.serverSideEncryptionCustomerMethod = value; }
}
// Check to see if ServerSideEncryptionCustomerMethod property is set
internal bool IsSetServerSideEncryptionCustomerMethod()
{
return this.serverSideEncryptionCustomerMethod != null;
}
///
/// The id of the AWS Key Management Service key that Amazon S3 uses to encrypt and decrypt the object.
///
public string ServerSideEncryptionKeyManagementServiceKeyId
{
get { return this.serverSideEncryptionKeyManagementServiceKeyId; }
set { this.serverSideEncryptionKeyManagementServiceKeyId = value; }
}
///
/// Checks if ServerSideEncryptionKeyManagementServiceKeyId property is set.
///
/// true if ServerSideEncryptionKeyManagementServiceKeyId property is set.
internal bool IsSetServerSideEncryptionKeyManagementServiceKeyId()
{
return !System.String.IsNullOrEmpty(this.serverSideEncryptionKeyManagementServiceKeyId);
}
///
/// The status of the replication job associated with this source object.
///
public ReplicationStatus ReplicationStatus
{
get { return this.replicationStatus; }
set { this.replicationStatus = value; }
}
///
/// Checks if ReplicationStatus property is set.
///
/// true if ReplicationStatus property is set.
internal bool IsSetReplicationStatus()
{
return ReplicationStatus != null;
}
///
/// The count of parts this object has.
///
public int? PartsCount
{
get { return this.partsCount; }
set { this.partsCount = value; }
}
// Check to see if PartsCount property is set
internal bool IsSetPartsCount()
{
return this.partsCount.HasValue;
}
///
/// Gets and sets the property ObjectLockLegalHoldStatus.
///
/// The Legal Hold status for the specified object.
///
///
public ObjectLockLegalHoldStatus ObjectLockLegalHoldStatus
{
get { return this.objectLockLegalHoldStatus; }
set { this.objectLockLegalHoldStatus = value; }
}
// Check to see if ObjectLockLegalHoldStatus property is set
internal bool IsSetObjectLockLegalHoldStatus()
{
return this.objectLockLegalHoldStatus != null;
}
///
/// Gets and sets the property ObjectLockMode.
///
/// The Object Lock mode currently in place for this object.
///
///
public ObjectLockMode ObjectLockMode
{
get { return this.objectLockMode; }
set { this.objectLockMode = value; }
}
// Check to see if ObjectLockMode property is set
internal bool IsSetObjectLockMode()
{
return this.objectLockMode != null;
}
///
/// Gets and sets the property ObjectLockRetainUntilDate.
///
/// The date and time when this object's Object Lock will expire.
///
///
public DateTime ObjectLockRetainUntilDate
{
get { return this.objectLockRetainUntilDate.GetValueOrDefault(); }
set { this.objectLockRetainUntilDate = value; }
}
// Check to see if ObjectLockRetainUntilDate property is set
internal bool IsSetObjectLockRetainUntilDate()
{
return this.objectLockRetainUntilDate.HasValue;
}
///
/// The class of storage used to store the object.
///
///
public S3StorageClass StorageClass
{
get { return this.storageClass; }
set { this.storageClass = value; }
}
// Check to see if StorageClass property is set
internal bool IsSetStorageClass()
{
return this.storageClass != null;
}
///
/// If present, indicates that the requester was successfully charged for the request.
///
public RequestCharged RequestCharged
{
get { return this.requestCharged; }
set { this.requestCharged = value; }
}
///
/// Checks to see if RequestCharged is set.
///
/// true, if RequestCharged property is set.
internal bool IsSetRequestCharged()
{
return requestCharged != null;
}
}
}