{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.MediaStoreData.GetObject
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Downloads the object at the specified path. If the object’s upload
-- availability is set to @streaming@, AWS Elemental MediaStore downloads
-- the object even if it’s still uploading the object.
module Amazonka.MediaStoreData.GetObject
  ( -- * Creating a Request
    GetObject (..),
    newGetObject,

    -- * Request Lenses
    getObject_range,
    getObject_path,

    -- * Destructuring the Response
    GetObjectResponse (..),
    newGetObjectResponse,

    -- * Response Lenses
    getObjectResponse_eTag,
    getObjectResponse_contentLength,
    getObjectResponse_cacheControl,
    getObjectResponse_lastModified,
    getObjectResponse_contentRange,
    getObjectResponse_contentType,
    getObjectResponse_statusCode,
    getObjectResponse_body,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaStoreData.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newGetObject' smart constructor.
data GetObject = GetObject'
  { -- | The range bytes of an object to retrieve. For more information about the
    -- @Range@ header, see
    -- <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35>. AWS
    -- Elemental MediaStore ignores this header for partially uploaded objects
    -- that have streaming upload availability.
    GetObject -> Maybe Text
range :: Prelude.Maybe Prelude.Text,
    -- | The path (including the file name) where the object is stored in the
    -- container. Format: \<folder name>\/\<folder name>\/\<file name>
    --
    -- For example, to upload the file @mlaw.avi@ to the folder path
    -- @premium\\canada@ in the container @movies@, enter the path
    -- @premium\/canada\/mlaw.avi@.
    --
    -- Do not include the container name in this path.
    --
    -- If the path includes any folders that don\'t exist yet, the service
    -- creates them. For example, suppose you have an existing @premium\/usa@
    -- subfolder. If you specify @premium\/canada@, the service creates a
    -- @canada@ subfolder in the @premium@ folder. You then have two
    -- subfolders, @usa@ and @canada@, in the @premium@ folder.
    --
    -- There is no correlation between the path to the source and the path
    -- (folders) in the container in AWS Elemental MediaStore.
    --
    -- For more information about folders and how they exist in a container,
    -- see the
    -- <http://docs.aws.amazon.com/mediastore/latest/ug/ AWS Elemental MediaStore User Guide>.
    --
    -- The file name is the name that is assigned to the file that you upload.
    -- The file can have the same name inside and outside of AWS Elemental
    -- MediaStore, or it can have the same name. The file name can include or
    -- omit an extension.
    GetObject -> Text
path :: Prelude.Text
  }
  deriving (GetObject -> GetObject -> Bool
(GetObject -> GetObject -> Bool)
-> (GetObject -> GetObject -> Bool) -> Eq GetObject
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetObject -> GetObject -> Bool
$c/= :: GetObject -> GetObject -> Bool
== :: GetObject -> GetObject -> Bool
$c== :: GetObject -> GetObject -> Bool
Prelude.Eq, ReadPrec [GetObject]
ReadPrec GetObject
Int -> ReadS GetObject
ReadS [GetObject]
(Int -> ReadS GetObject)
-> ReadS [GetObject]
-> ReadPrec GetObject
-> ReadPrec [GetObject]
-> Read GetObject
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetObject]
$creadListPrec :: ReadPrec [GetObject]
readPrec :: ReadPrec GetObject
$creadPrec :: ReadPrec GetObject
readList :: ReadS [GetObject]
$creadList :: ReadS [GetObject]
readsPrec :: Int -> ReadS GetObject
$creadsPrec :: Int -> ReadS GetObject
Prelude.Read, Int -> GetObject -> ShowS
[GetObject] -> ShowS
GetObject -> String
(Int -> GetObject -> ShowS)
-> (GetObject -> String)
-> ([GetObject] -> ShowS)
-> Show GetObject
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetObject] -> ShowS
$cshowList :: [GetObject] -> ShowS
show :: GetObject -> String
$cshow :: GetObject -> String
showsPrec :: Int -> GetObject -> ShowS
$cshowsPrec :: Int -> GetObject -> ShowS
Prelude.Show, (forall x. GetObject -> Rep GetObject x)
-> (forall x. Rep GetObject x -> GetObject) -> Generic GetObject
forall x. Rep GetObject x -> GetObject
forall x. GetObject -> Rep GetObject x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetObject x -> GetObject
$cfrom :: forall x. GetObject -> Rep GetObject x
Prelude.Generic)

-- |
-- Create a value of 'GetObject' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'range', 'getObject_range' - The range bytes of an object to retrieve. For more information about the
-- @Range@ header, see
-- <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35>. AWS
-- Elemental MediaStore ignores this header for partially uploaded objects
-- that have streaming upload availability.
--
-- 'path', 'getObject_path' - The path (including the file name) where the object is stored in the
-- container. Format: \<folder name>\/\<folder name>\/\<file name>
--
-- For example, to upload the file @mlaw.avi@ to the folder path
-- @premium\\canada@ in the container @movies@, enter the path
-- @premium\/canada\/mlaw.avi@.
--
-- Do not include the container name in this path.
--
-- If the path includes any folders that don\'t exist yet, the service
-- creates them. For example, suppose you have an existing @premium\/usa@
-- subfolder. If you specify @premium\/canada@, the service creates a
-- @canada@ subfolder in the @premium@ folder. You then have two
-- subfolders, @usa@ and @canada@, in the @premium@ folder.
--
-- There is no correlation between the path to the source and the path
-- (folders) in the container in AWS Elemental MediaStore.
--
-- For more information about folders and how they exist in a container,
-- see the
-- <http://docs.aws.amazon.com/mediastore/latest/ug/ AWS Elemental MediaStore User Guide>.
--
-- The file name is the name that is assigned to the file that you upload.
-- The file can have the same name inside and outside of AWS Elemental
-- MediaStore, or it can have the same name. The file name can include or
-- omit an extension.
newGetObject ::
  -- | 'path'
  Prelude.Text ->
  GetObject
newGetObject :: Text -> GetObject
newGetObject Text
pPath_ =
  GetObject' :: Maybe Text -> Text -> GetObject
GetObject' {$sel:range:GetObject' :: Maybe Text
range = Maybe Text
forall a. Maybe a
Prelude.Nothing, $sel:path:GetObject' :: Text
path = Text
pPath_}

-- | The range bytes of an object to retrieve. For more information about the
-- @Range@ header, see
-- <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35>. AWS
-- Elemental MediaStore ignores this header for partially uploaded objects
-- that have streaming upload availability.
getObject_range :: Lens.Lens' GetObject (Prelude.Maybe Prelude.Text)
getObject_range :: (Maybe Text -> f (Maybe Text)) -> GetObject -> f GetObject
getObject_range = (GetObject -> Maybe Text)
-> (GetObject -> Maybe Text -> GetObject)
-> Lens GetObject GetObject (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetObject' {Maybe Text
range :: Maybe Text
$sel:range:GetObject' :: GetObject -> Maybe Text
range} -> Maybe Text
range) (\s :: GetObject
s@GetObject' {} Maybe Text
a -> GetObject
s {$sel:range:GetObject' :: Maybe Text
range = Maybe Text
a} :: GetObject)

-- | The path (including the file name) where the object is stored in the
-- container. Format: \<folder name>\/\<folder name>\/\<file name>
--
-- For example, to upload the file @mlaw.avi@ to the folder path
-- @premium\\canada@ in the container @movies@, enter the path
-- @premium\/canada\/mlaw.avi@.
--
-- Do not include the container name in this path.
--
-- If the path includes any folders that don\'t exist yet, the service
-- creates them. For example, suppose you have an existing @premium\/usa@
-- subfolder. If you specify @premium\/canada@, the service creates a
-- @canada@ subfolder in the @premium@ folder. You then have two
-- subfolders, @usa@ and @canada@, in the @premium@ folder.
--
-- There is no correlation between the path to the source and the path
-- (folders) in the container in AWS Elemental MediaStore.
--
-- For more information about folders and how they exist in a container,
-- see the
-- <http://docs.aws.amazon.com/mediastore/latest/ug/ AWS Elemental MediaStore User Guide>.
--
-- The file name is the name that is assigned to the file that you upload.
-- The file can have the same name inside and outside of AWS Elemental
-- MediaStore, or it can have the same name. The file name can include or
-- omit an extension.
getObject_path :: Lens.Lens' GetObject Prelude.Text
getObject_path :: (Text -> f Text) -> GetObject -> f GetObject
getObject_path = (GetObject -> Text)
-> (GetObject -> Text -> GetObject)
-> Lens GetObject GetObject Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetObject' {Text
path :: Text
$sel:path:GetObject' :: GetObject -> Text
path} -> Text
path) (\s :: GetObject
s@GetObject' {} Text
a -> GetObject
s {$sel:path:GetObject' :: Text
path = Text
a} :: GetObject)

instance Core.AWSRequest GetObject where
  type AWSResponse GetObject = GetObjectResponse
  request :: GetObject -> Request GetObject
request = Service -> GetObject -> Request GetObject
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy GetObject
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetObject)))
response =
    (Int
 -> ResponseHeaders
 -> ResponseBody
 -> Either String (AWSResponse GetObject))
-> Logger
-> Service
-> Proxy GetObject
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetObject)))
forall (m :: * -> *) a.
MonadResource m =>
(Int
 -> ResponseHeaders
 -> ResponseBody
 -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveBody
      ( \Int
s ResponseHeaders
h ResponseBody
x ->
          Maybe Text
-> Maybe Natural
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Int
-> ResponseBody
-> GetObjectResponse
GetObjectResponse'
            (Maybe Text
 -> Maybe Natural
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> Int
 -> ResponseBody
 -> GetObjectResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Natural
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> ResponseBody
      -> GetObjectResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (ResponseHeaders
h ResponseHeaders -> HeaderName -> Either String (Maybe Text)
forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Core..#? HeaderName
"ETag")
            Either
  String
  (Maybe Natural
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> ResponseBody
   -> GetObjectResponse)
-> Either String (Maybe Natural)
-> Either
     String
     (Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> ResponseBody
      -> GetObjectResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (ResponseHeaders
h ResponseHeaders -> HeaderName -> Either String (Maybe Natural)
forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Core..#? HeaderName
"Content-Length")
            Either
  String
  (Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> ResponseBody
   -> GetObjectResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> ResponseBody
      -> GetObjectResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (ResponseHeaders
h ResponseHeaders -> HeaderName -> Either String (Maybe Text)
forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Core..#? HeaderName
"Cache-Control")
            Either
  String
  (Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> ResponseBody
   -> GetObjectResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe Text
      -> Maybe Text -> Int -> ResponseBody -> GetObjectResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (ResponseHeaders
h ResponseHeaders -> HeaderName -> Either String (Maybe POSIX)
forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Core..#? HeaderName
"Last-Modified")
            Either
  String
  (Maybe Text
   -> Maybe Text -> Int -> ResponseBody -> GetObjectResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe Text -> Int -> ResponseBody -> GetObjectResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (ResponseHeaders
h ResponseHeaders -> HeaderName -> Either String (Maybe Text)
forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Core..#? HeaderName
"Content-Range")
            Either
  String (Maybe Text -> Int -> ResponseBody -> GetObjectResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ResponseBody -> GetObjectResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (ResponseHeaders
h ResponseHeaders -> HeaderName -> Either String (Maybe Text)
forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Core..#? HeaderName
"Content-Type")
            Either String (Int -> ResponseBody -> GetObjectResponse)
-> Either String Int
-> Either String (ResponseBody -> GetObjectResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            Either String (ResponseBody -> GetObjectResponse)
-> Either String ResponseBody -> Either String GetObjectResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (ResponseBody -> Either String ResponseBody
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure ResponseBody
x)
      )

instance Prelude.Hashable GetObject

instance Prelude.NFData GetObject

instance Core.ToHeaders GetObject where
  toHeaders :: GetObject -> ResponseHeaders
toHeaders GetObject' {Maybe Text
Text
path :: Text
range :: Maybe Text
$sel:path:GetObject' :: GetObject -> Text
$sel:range:GetObject' :: GetObject -> Maybe Text
..} =
    [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat [HeaderName
"Range" HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
range]

instance Core.ToPath GetObject where
  toPath :: GetObject -> ByteString
toPath GetObject' {Maybe Text
Text
path :: Text
range :: Maybe Text
$sel:path:GetObject' :: GetObject -> Text
$sel:range:GetObject' :: GetObject -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
path]

instance Core.ToQuery GetObject where
  toQuery :: GetObject -> QueryString
toQuery = QueryString -> GetObject -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newGetObjectResponse' smart constructor.
data GetObjectResponse = GetObjectResponse'
  { -- | The ETag that represents a unique instance of the object.
    GetObjectResponse -> Maybe Text
eTag :: Prelude.Maybe Prelude.Text,
    -- | The length of the object in bytes.
    GetObjectResponse -> Maybe Natural
contentLength :: Prelude.Maybe Prelude.Natural,
    -- | An optional @CacheControl@ header that allows the caller to control the
    -- object\'s cache behavior. Headers can be passed in as specified in the
    -- HTTP spec at
    -- <https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9>.
    --
    -- Headers with a custom user-defined value are also accepted.
    GetObjectResponse -> Maybe Text
cacheControl :: Prelude.Maybe Prelude.Text,
    -- | The date and time that the object was last modified.
    GetObjectResponse -> Maybe POSIX
lastModified :: Prelude.Maybe Core.POSIX,
    -- | The range of bytes to retrieve.
    GetObjectResponse -> Maybe Text
contentRange :: Prelude.Maybe Prelude.Text,
    -- | The content type of the object.
    GetObjectResponse -> Maybe Text
contentType :: Prelude.Maybe Prelude.Text,
    -- | The HTML status code of the request. Status codes ranging from 200 to
    -- 299 indicate success. All other status codes indicate the type of error
    -- that occurred.
    GetObjectResponse -> Int
statusCode :: Prelude.Int,
    -- | The bytes of the object.
    GetObjectResponse -> ResponseBody
body :: Core.ResponseBody
  }
  deriving (Int -> GetObjectResponse -> ShowS
[GetObjectResponse] -> ShowS
GetObjectResponse -> String
(Int -> GetObjectResponse -> ShowS)
-> (GetObjectResponse -> String)
-> ([GetObjectResponse] -> ShowS)
-> Show GetObjectResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetObjectResponse] -> ShowS
$cshowList :: [GetObjectResponse] -> ShowS
show :: GetObjectResponse -> String
$cshow :: GetObjectResponse -> String
showsPrec :: Int -> GetObjectResponse -> ShowS
$cshowsPrec :: Int -> GetObjectResponse -> ShowS
Prelude.Show, (forall x. GetObjectResponse -> Rep GetObjectResponse x)
-> (forall x. Rep GetObjectResponse x -> GetObjectResponse)
-> Generic GetObjectResponse
forall x. Rep GetObjectResponse x -> GetObjectResponse
forall x. GetObjectResponse -> Rep GetObjectResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetObjectResponse x -> GetObjectResponse
$cfrom :: forall x. GetObjectResponse -> Rep GetObjectResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetObjectResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'eTag', 'getObjectResponse_eTag' - The ETag that represents a unique instance of the object.
--
-- 'contentLength', 'getObjectResponse_contentLength' - The length of the object in bytes.
--
-- 'cacheControl', 'getObjectResponse_cacheControl' - An optional @CacheControl@ header that allows the caller to control the
-- object\'s cache behavior. Headers can be passed in as specified in the
-- HTTP spec at
-- <https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9>.
--
-- Headers with a custom user-defined value are also accepted.
--
-- 'lastModified', 'getObjectResponse_lastModified' - The date and time that the object was last modified.
--
-- 'contentRange', 'getObjectResponse_contentRange' - The range of bytes to retrieve.
--
-- 'contentType', 'getObjectResponse_contentType' - The content type of the object.
--
-- 'statusCode', 'getObjectResponse_statusCode' - The HTML status code of the request. Status codes ranging from 200 to
-- 299 indicate success. All other status codes indicate the type of error
-- that occurred.
--
-- 'body', 'getObjectResponse_body' - The bytes of the object.
newGetObjectResponse ::
  -- | 'statusCode'
  Prelude.Int ->
  -- | 'body'
  Core.ResponseBody ->
  GetObjectResponse
newGetObjectResponse :: Int -> ResponseBody -> GetObjectResponse
newGetObjectResponse Int
pStatusCode_ ResponseBody
pBody_ =
  GetObjectResponse' :: Maybe Text
-> Maybe Natural
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Int
-> ResponseBody
-> GetObjectResponse
GetObjectResponse'
    { $sel:eTag:GetObjectResponse' :: Maybe Text
eTag = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:contentLength:GetObjectResponse' :: Maybe Natural
contentLength = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:cacheControl:GetObjectResponse' :: Maybe Text
cacheControl = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:lastModified:GetObjectResponse' :: Maybe POSIX
lastModified = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:contentRange:GetObjectResponse' :: Maybe Text
contentRange = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:contentType:GetObjectResponse' :: Maybe Text
contentType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:statusCode:GetObjectResponse' :: Int
statusCode = Int
pStatusCode_,
      $sel:body:GetObjectResponse' :: ResponseBody
body = ResponseBody
pBody_
    }

-- | The ETag that represents a unique instance of the object.
getObjectResponse_eTag :: Lens.Lens' GetObjectResponse (Prelude.Maybe Prelude.Text)
getObjectResponse_eTag :: (Maybe Text -> f (Maybe Text))
-> GetObjectResponse -> f GetObjectResponse
getObjectResponse_eTag = (GetObjectResponse -> Maybe Text)
-> (GetObjectResponse -> Maybe Text -> GetObjectResponse)
-> Lens
     GetObjectResponse GetObjectResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetObjectResponse' {Maybe Text
eTag :: Maybe Text
$sel:eTag:GetObjectResponse' :: GetObjectResponse -> Maybe Text
eTag} -> Maybe Text
eTag) (\s :: GetObjectResponse
s@GetObjectResponse' {} Maybe Text
a -> GetObjectResponse
s {$sel:eTag:GetObjectResponse' :: Maybe Text
eTag = Maybe Text
a} :: GetObjectResponse)

-- | The length of the object in bytes.
getObjectResponse_contentLength :: Lens.Lens' GetObjectResponse (Prelude.Maybe Prelude.Natural)
getObjectResponse_contentLength :: (Maybe Natural -> f (Maybe Natural))
-> GetObjectResponse -> f GetObjectResponse
getObjectResponse_contentLength = (GetObjectResponse -> Maybe Natural)
-> (GetObjectResponse -> Maybe Natural -> GetObjectResponse)
-> Lens
     GetObjectResponse GetObjectResponse (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetObjectResponse' {Maybe Natural
contentLength :: Maybe Natural
$sel:contentLength:GetObjectResponse' :: GetObjectResponse -> Maybe Natural
contentLength} -> Maybe Natural
contentLength) (\s :: GetObjectResponse
s@GetObjectResponse' {} Maybe Natural
a -> GetObjectResponse
s {$sel:contentLength:GetObjectResponse' :: Maybe Natural
contentLength = Maybe Natural
a} :: GetObjectResponse)

-- | An optional @CacheControl@ header that allows the caller to control the
-- object\'s cache behavior. Headers can be passed in as specified in the
-- HTTP spec at
-- <https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9>.
--
-- Headers with a custom user-defined value are also accepted.
getObjectResponse_cacheControl :: Lens.Lens' GetObjectResponse (Prelude.Maybe Prelude.Text)
getObjectResponse_cacheControl :: (Maybe Text -> f (Maybe Text))
-> GetObjectResponse -> f GetObjectResponse
getObjectResponse_cacheControl = (GetObjectResponse -> Maybe Text)
-> (GetObjectResponse -> Maybe Text -> GetObjectResponse)
-> Lens
     GetObjectResponse GetObjectResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetObjectResponse' {Maybe Text
cacheControl :: Maybe Text
$sel:cacheControl:GetObjectResponse' :: GetObjectResponse -> Maybe Text
cacheControl} -> Maybe Text
cacheControl) (\s :: GetObjectResponse
s@GetObjectResponse' {} Maybe Text
a -> GetObjectResponse
s {$sel:cacheControl:GetObjectResponse' :: Maybe Text
cacheControl = Maybe Text
a} :: GetObjectResponse)

-- | The date and time that the object was last modified.
getObjectResponse_lastModified :: Lens.Lens' GetObjectResponse (Prelude.Maybe Prelude.UTCTime)
getObjectResponse_lastModified :: (Maybe UTCTime -> f (Maybe UTCTime))
-> GetObjectResponse -> f GetObjectResponse
getObjectResponse_lastModified = (GetObjectResponse -> Maybe POSIX)
-> (GetObjectResponse -> Maybe POSIX -> GetObjectResponse)
-> Lens
     GetObjectResponse GetObjectResponse (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetObjectResponse' {Maybe POSIX
lastModified :: Maybe POSIX
$sel:lastModified:GetObjectResponse' :: GetObjectResponse -> Maybe POSIX
lastModified} -> Maybe POSIX
lastModified) (\s :: GetObjectResponse
s@GetObjectResponse' {} Maybe POSIX
a -> GetObjectResponse
s {$sel:lastModified:GetObjectResponse' :: Maybe POSIX
lastModified = Maybe POSIX
a} :: GetObjectResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> GetObjectResponse -> f GetObjectResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> GetObjectResponse
-> f GetObjectResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The range of bytes to retrieve.
getObjectResponse_contentRange :: Lens.Lens' GetObjectResponse (Prelude.Maybe Prelude.Text)
getObjectResponse_contentRange :: (Maybe Text -> f (Maybe Text))
-> GetObjectResponse -> f GetObjectResponse
getObjectResponse_contentRange = (GetObjectResponse -> Maybe Text)
-> (GetObjectResponse -> Maybe Text -> GetObjectResponse)
-> Lens
     GetObjectResponse GetObjectResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetObjectResponse' {Maybe Text
contentRange :: Maybe Text
$sel:contentRange:GetObjectResponse' :: GetObjectResponse -> Maybe Text
contentRange} -> Maybe Text
contentRange) (\s :: GetObjectResponse
s@GetObjectResponse' {} Maybe Text
a -> GetObjectResponse
s {$sel:contentRange:GetObjectResponse' :: Maybe Text
contentRange = Maybe Text
a} :: GetObjectResponse)

-- | The content type of the object.
getObjectResponse_contentType :: Lens.Lens' GetObjectResponse (Prelude.Maybe Prelude.Text)
getObjectResponse_contentType :: (Maybe Text -> f (Maybe Text))
-> GetObjectResponse -> f GetObjectResponse
getObjectResponse_contentType = (GetObjectResponse -> Maybe Text)
-> (GetObjectResponse -> Maybe Text -> GetObjectResponse)
-> Lens
     GetObjectResponse GetObjectResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetObjectResponse' {Maybe Text
contentType :: Maybe Text
$sel:contentType:GetObjectResponse' :: GetObjectResponse -> Maybe Text
contentType} -> Maybe Text
contentType) (\s :: GetObjectResponse
s@GetObjectResponse' {} Maybe Text
a -> GetObjectResponse
s {$sel:contentType:GetObjectResponse' :: Maybe Text
contentType = Maybe Text
a} :: GetObjectResponse)

-- | The HTML status code of the request. Status codes ranging from 200 to
-- 299 indicate success. All other status codes indicate the type of error
-- that occurred.
getObjectResponse_statusCode :: Lens.Lens' GetObjectResponse Prelude.Int
getObjectResponse_statusCode :: (Int -> f Int) -> GetObjectResponse -> f GetObjectResponse
getObjectResponse_statusCode = (GetObjectResponse -> Int)
-> (GetObjectResponse -> Int -> GetObjectResponse)
-> Lens GetObjectResponse GetObjectResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetObjectResponse' {Int
statusCode :: Int
$sel:statusCode:GetObjectResponse' :: GetObjectResponse -> Int
statusCode} -> Int
statusCode) (\s :: GetObjectResponse
s@GetObjectResponse' {} Int
a -> GetObjectResponse
s {$sel:statusCode:GetObjectResponse' :: Int
statusCode = Int
a} :: GetObjectResponse)

-- | The bytes of the object.
getObjectResponse_body :: Lens.Lens' GetObjectResponse Core.ResponseBody
getObjectResponse_body :: (ResponseBody -> f ResponseBody)
-> GetObjectResponse -> f GetObjectResponse
getObjectResponse_body = (GetObjectResponse -> ResponseBody)
-> (GetObjectResponse -> ResponseBody -> GetObjectResponse)
-> Lens
     GetObjectResponse GetObjectResponse ResponseBody ResponseBody
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetObjectResponse' {ResponseBody
body :: ResponseBody
$sel:body:GetObjectResponse' :: GetObjectResponse -> ResponseBody
body} -> ResponseBody
body) (\s :: GetObjectResponse
s@GetObjectResponse' {} ResponseBody
a -> GetObjectResponse
s {$sel:body:GetObjectResponse' :: ResponseBody
body = ResponseBody
a} :: GetObjectResponse)