amazonka-s3-1.4.5: Amazon Simple Storage Service SDK.

Copyright(c) 2013-2016 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay@gmail.com>
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellNone
LanguageHaskell2010

Network.AWS.S3.GetObject

Contents

Description

Retrieves objects from Amazon S3.

Synopsis

Creating a Request

getObject Source #

Creates a value of GetObject with the minimum fields required to make a request.

Use one of the following lenses to modify other fields as desired:

  • goIfMatch - Return the object only if its entity tag (ETag) is the same as the one specified, otherwise return a 412 (precondition failed).
  • goVersionId - VersionId used to reference a specific version of the object.
  • goResponseContentType - Sets the Content-Type header of the response.
  • goResponseContentDisposition - Sets the Content-Disposition header of the response
  • goResponseContentLanguage - Sets the Content-Language header of the response.
  • goSSECustomerAlgorithm - Specifies the algorithm to use to when encrypting the object (e.g., AES256).
  • goSSECustomerKey - 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 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.
  • goRequestPayer - Undocumented member.
  • goResponseContentEncoding - Sets the Content-Encoding header of the response.
  • goIfModifiedSince - Return the object only if it has been modified since the specified time, otherwise return a 304 (not modified).
  • goPartNumber - Part number of the object being read. This is a positive integer between 1 and 10,000. Effectively performs a ranged GET request for the part specified. Useful for downloading just a part of an object.
  • goRange - Downloads the specified range bytes of an object. For more information about the HTTP Range header, go to http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35.
  • goIfUnmodifiedSince - Return the object only if it has not been modified since the specified time, otherwise return a 412 (precondition failed).
  • goSSECustomerKeyMD5 - 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 the encryption key was transmitted without error.
  • goResponseCacheControl - Sets the Cache-Control header of the response.
  • goResponseExpires - Sets the Expires header of the response.
  • goIfNoneMatch - Return the object only if its entity tag (ETag) is different from the one specified, otherwise return a 304 (not modified).
  • goBucket - Undocumented member.
  • goKey - Undocumented member.

data GetObject Source #

See: getObject smart constructor.

Instances

Eq GetObject Source # 
Data GetObject Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> GetObject -> c GetObject #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c GetObject #

toConstr :: GetObject -> Constr #

dataTypeOf :: GetObject -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c GetObject) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c GetObject) #

gmapT :: (forall b. Data b => b -> b) -> GetObject -> GetObject #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> GetObject -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> GetObject -> r #

gmapQ :: (forall d. Data d => d -> u) -> GetObject -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> GetObject -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> GetObject -> m GetObject #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> GetObject -> m GetObject #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> GetObject -> m GetObject #

Read GetObject Source # 
Show GetObject Source # 
Generic GetObject Source # 

Associated Types

type Rep GetObject :: * -> * #

Hashable GetObject Source # 
NFData GetObject Source # 

Methods

rnf :: GetObject -> () #

AWSRequest GetObject Source # 
ToPath GetObject Source # 
ToHeaders GetObject Source # 

Methods

toHeaders :: GetObject -> [Header] #

ToQuery GetObject Source # 
type Rep GetObject Source # 
type Rep GetObject = D1 (MetaData "GetObject" "Network.AWS.S3.GetObject" "amazonka-s3-1.4.5-2ONtLrikxBNLJwnoUGaFyq" False) (C1 (MetaCons "GetObject'" PrefixI True) ((:*:) ((:*:) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "_goIfMatch") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text))) (S1 (MetaSel (Just Symbol "_goVersionId") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe ObjectVersionId)))) ((:*:) (S1 (MetaSel (Just Symbol "_goResponseContentType") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text))) (S1 (MetaSel (Just Symbol "_goResponseContentDisposition") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text))))) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "_goResponseContentLanguage") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text))) (S1 (MetaSel (Just Symbol "_goSSECustomerAlgorithm") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text)))) ((:*:) (S1 (MetaSel (Just Symbol "_goSSECustomerKey") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe (Sensitive Text)))) ((:*:) (S1 (MetaSel (Just Symbol "_goRequestPayer") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe RequestPayer))) (S1 (MetaSel (Just Symbol "_goResponseContentEncoding") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text))))))) ((:*:) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "_goIfModifiedSince") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe RFC822))) (S1 (MetaSel (Just Symbol "_goPartNumber") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Int)))) ((:*:) (S1 (MetaSel (Just Symbol "_goRange") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text))) ((:*:) (S1 (MetaSel (Just Symbol "_goIfUnmodifiedSince") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe RFC822))) (S1 (MetaSel (Just Symbol "_goSSECustomerKeyMD5") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text)))))) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "_goResponseCacheControl") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text))) (S1 (MetaSel (Just Symbol "_goResponseExpires") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe RFC822)))) ((:*:) (S1 (MetaSel (Just Symbol "_goIfNoneMatch") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text))) ((:*:) (S1 (MetaSel (Just Symbol "_goBucket") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 BucketName)) (S1 (MetaSel (Just Symbol "_goKey") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 ObjectKey))))))))
type Rs GetObject Source # 

Request Lenses

goIfMatch :: Lens' GetObject (Maybe Text) Source #

Return the object only if its entity tag (ETag) is the same as the one specified, otherwise return a 412 (precondition failed).

goVersionId :: Lens' GetObject (Maybe ObjectVersionId) Source #

VersionId used to reference a specific version of the object.

goResponseContentType :: Lens' GetObject (Maybe Text) Source #

Sets the Content-Type header of the response.

goResponseContentDisposition :: Lens' GetObject (Maybe Text) Source #

Sets the Content-Disposition header of the response

goResponseContentLanguage :: Lens' GetObject (Maybe Text) Source #

Sets the Content-Language header of the response.

goSSECustomerAlgorithm :: Lens' GetObject (Maybe Text) Source #

Specifies the algorithm to use to when encrypting the object (e.g., AES256).

goSSECustomerKey :: Lens' GetObject (Maybe Text) Source #

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 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.

goResponseContentEncoding :: Lens' GetObject (Maybe Text) Source #

Sets the Content-Encoding header of the response.

goIfModifiedSince :: Lens' GetObject (Maybe UTCTime) Source #

Return the object only if it has been modified since the specified time, otherwise return a 304 (not modified).

goPartNumber :: Lens' GetObject (Maybe Int) Source #

Part number of the object being read. This is a positive integer between 1 and 10,000. Effectively performs a ranged GET request for the part specified. Useful for downloading just a part of an object.

goRange :: Lens' GetObject (Maybe Text) Source #

Downloads the specified range bytes of an object. For more information about the HTTP Range header, go to http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35.

goIfUnmodifiedSince :: Lens' GetObject (Maybe UTCTime) Source #

Return the object only if it has not been modified since the specified time, otherwise return a 412 (precondition failed).

goSSECustomerKeyMD5 :: Lens' GetObject (Maybe Text) Source #

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 the encryption key was transmitted without error.

goResponseCacheControl :: Lens' GetObject (Maybe Text) Source #

Sets the Cache-Control header of the response.

goResponseExpires :: Lens' GetObject (Maybe UTCTime) Source #

Sets the Expires header of the response.

goIfNoneMatch :: Lens' GetObject (Maybe Text) Source #

Return the object only if its entity tag (ETag) is different from the one specified, otherwise return a 304 (not modified).

goBucket :: Lens' GetObject BucketName Source #

Undocumented member.

goKey :: Lens' GetObject ObjectKey Source #

Undocumented member.

Destructuring the Response

getObjectResponse Source #

Creates a value of GetObjectResponse with the minimum fields required to make a request.

Use one of the following lenses to modify other fields as desired:

  • gorsRequestCharged - Undocumented member.
  • gorsPartsCount - The count of parts this object has.
  • gorsETag - An ETag is an opaque identifier assigned by a web server to a specific version of a resource found at a URL
  • gorsVersionId - Version of the object.
  • gorsContentLength - Size of the body in bytes.
  • gorsExpires - The date and time at which the object is no longer cacheable.
  • gorsRestore - Provides information about object restoration operation and expiration time of the restored object copy.
  • gorsExpiration - If the object expiration is configured (see PUT Bucket lifecycle), the response includes this header. It includes the expiry-date and rule-id key value pairs providing object expiration information. The value of the rule-id is URL encoded.
  • gorsDeleteMarker - 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.
  • gorsSSECustomerAlgorithm - If server-side encryption with a customer-provided encryption key was requested, the response will include this header confirming the encryption algorithm used.
  • gorsTagCount - The number of tags, if any, on the object.
  • gorsMissingMeta - 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.
  • gorsWebsiteRedirectLocation - 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.
  • gorsAcceptRanges - Undocumented member.
  • gorsStorageClass - Undocumented member.
  • gorsSSECustomerKeyMD5 - If server-side encryption with a customer-provided encryption key was requested, the response will include this header to provide round trip message integrity verification of the customer-provided encryption key.
  • gorsSSEKMSKeyId - If present, specifies the ID of the AWS Key Management Service (KMS) master encryption key that was used for the object.
  • gorsContentEncoding - Specifies what content encodings have been applied to the object and thus what decoding mechanisms must be applied to obtain the media-type referenced by the Content-Type header field.
  • gorsMetadata - A map of metadata to store with the object in S3.
  • gorsReplicationStatus - Undocumented member.
  • gorsCacheControl - Specifies caching behavior along the request/reply chain.
  • gorsContentLanguage - The language the content is in.
  • gorsLastModified - Last modified date of the object
  • gorsContentDisposition - Specifies presentational information for the object.
  • gorsContentRange - The portion of the object returned in the response.
  • gorsServerSideEncryption - The Server-side encryption algorithm used when storing this object in S3 (e.g., AES256, aws:kms).
  • gorsContentType - A standard MIME type describing the format of the object data.
  • gorsResponseStatus - -- | The response status code.
  • gorsBody - Object data.

data GetObjectResponse Source #

See: getObjectResponse smart constructor.

Instances

Show GetObjectResponse Source # 
Generic GetObjectResponse Source # 
type Rep GetObjectResponse Source # 
type Rep GetObjectResponse = D1 (MetaData "GetObjectResponse" "Network.AWS.S3.GetObject" "amazonka-s3-1.4.5-2ONtLrikxBNLJwnoUGaFyq" False) (C1 (MetaCons "GetObjectResponse'" PrefixI True) ((:*:) ((:*:) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "_gorsRequestCharged") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe RequestCharged))) ((:*:) (S1 (MetaSel (Just Symbol "_gorsPartsCount") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Int))) (S1 (MetaSel (Just Symbol "_gorsETag") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe ETag))))) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "_gorsVersionId") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe ObjectVersionId))) (S1 (MetaSel (Just Symbol "_gorsContentLength") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Integer)))) ((:*:) (S1 (MetaSel (Just Symbol "_gorsExpires") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe RFC822))) (S1 (MetaSel (Just Symbol "_gorsRestore") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text)))))) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "_gorsExpiration") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text))) ((:*:) (S1 (MetaSel (Just Symbol "_gorsDeleteMarker") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Bool))) (S1 (MetaSel (Just Symbol "_gorsSSECustomerAlgorithm") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text))))) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "_gorsTagCount") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Int))) (S1 (MetaSel (Just Symbol "_gorsMissingMeta") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Int)))) ((:*:) (S1 (MetaSel (Just Symbol "_gorsWebsiteRedirectLocation") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text))) (S1 (MetaSel (Just Symbol "_gorsAcceptRanges") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text))))))) ((:*:) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "_gorsStorageClass") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe StorageClass))) ((:*:) (S1 (MetaSel (Just Symbol "_gorsSSECustomerKeyMD5") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text))) (S1 (MetaSel (Just Symbol "_gorsSSEKMSKeyId") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe (Sensitive Text)))))) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "_gorsContentEncoding") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text))) (S1 (MetaSel (Just Symbol "_gorsMetadata") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Map Text Text)))) ((:*:) (S1 (MetaSel (Just Symbol "_gorsReplicationStatus") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe ReplicationStatus))) (S1 (MetaSel (Just Symbol "_gorsCacheControl") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text)))))) ((:*:) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "_gorsContentLanguage") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text))) (S1 (MetaSel (Just Symbol "_gorsLastModified") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe RFC822)))) ((:*:) (S1 (MetaSel (Just Symbol "_gorsContentDisposition") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text))) (S1 (MetaSel (Just Symbol "_gorsContentRange") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text))))) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "_gorsServerSideEncryption") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe ServerSideEncryption))) (S1 (MetaSel (Just Symbol "_gorsContentType") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text)))) ((:*:) (S1 (MetaSel (Just Symbol "_gorsResponseStatus") NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Int)) (S1 (MetaSel (Just Symbol "_gorsBody") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 RsBody))))))))

Response Lenses

gorsPartsCount :: Lens' GetObjectResponse (Maybe Int) Source #

The count of parts this object has.

gorsETag :: Lens' GetObjectResponse (Maybe ETag) Source #

An ETag is an opaque identifier assigned by a web server to a specific version of a resource found at a URL

gorsExpires :: Lens' GetObjectResponse (Maybe UTCTime) Source #

The date and time at which the object is no longer cacheable.

gorsRestore :: Lens' GetObjectResponse (Maybe Text) Source #

Provides information about object restoration operation and expiration time of the restored object copy.

gorsExpiration :: Lens' GetObjectResponse (Maybe Text) Source #

If the object expiration is configured (see PUT Bucket lifecycle), the response includes this header. It includes the expiry-date and rule-id key value pairs providing object expiration information. The value of the rule-id is URL encoded.

gorsDeleteMarker :: Lens' GetObjectResponse (Maybe Bool) Source #

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.

gorsSSECustomerAlgorithm :: Lens' GetObjectResponse (Maybe Text) Source #

If server-side encryption with a customer-provided encryption key was requested, the response will include this header confirming the encryption algorithm used.

gorsTagCount :: Lens' GetObjectResponse (Maybe Int) Source #

The number of tags, if any, on the object.

gorsMissingMeta :: Lens' GetObjectResponse (Maybe Int) Source #

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.

gorsWebsiteRedirectLocation :: Lens' GetObjectResponse (Maybe Text) Source #

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.

gorsSSECustomerKeyMD5 :: Lens' GetObjectResponse (Maybe Text) Source #

If server-side encryption with a customer-provided encryption key was requested, the response will include this header to provide round trip message integrity verification of the customer-provided encryption key.

gorsSSEKMSKeyId :: Lens' GetObjectResponse (Maybe Text) Source #

If present, specifies the ID of the AWS Key Management Service (KMS) master encryption key that was used for the object.

gorsContentEncoding :: Lens' GetObjectResponse (Maybe Text) Source #

Specifies what content encodings have been applied to the object and thus what decoding mechanisms must be applied to obtain the media-type referenced by the Content-Type header field.

gorsMetadata :: Lens' GetObjectResponse (HashMap Text Text) Source #

A map of metadata to store with the object in S3.

gorsCacheControl :: Lens' GetObjectResponse (Maybe Text) Source #

Specifies caching behavior along the request/reply chain.

gorsContentLanguage :: Lens' GetObjectResponse (Maybe Text) Source #

The language the content is in.

gorsLastModified :: Lens' GetObjectResponse (Maybe UTCTime) Source #

Last modified date of the object

gorsContentDisposition :: Lens' GetObjectResponse (Maybe Text) Source #

Specifies presentational information for the object.

gorsContentRange :: Lens' GetObjectResponse (Maybe Text) Source #

The portion of the object returned in the response.

gorsServerSideEncryption :: Lens' GetObjectResponse (Maybe ServerSideEncryption) Source #

The Server-side encryption algorithm used when storing this object in S3 (e.g., AES256, aws:kms).

gorsContentType :: Lens' GetObjectResponse (Maybe Text) Source #

A standard MIME type describing the format of the object data.

gorsResponseStatus :: Lens' GetObjectResponse Int Source #

  • - | The response status code.