{-# 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.S3.GetObjectRetention
-- 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)
--
-- Retrieves an object\'s retention settings. For more information, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html Locking Objects>.
--
-- This action is not supported by Amazon S3 on Outposts.
module Amazonka.S3.GetObjectRetention
  ( -- * Creating a Request
    GetObjectRetention (..),
    newGetObjectRetention,

    -- * Request Lenses
    getObjectRetention_versionId,
    getObjectRetention_requestPayer,
    getObjectRetention_expectedBucketOwner,
    getObjectRetention_bucket,
    getObjectRetention_key,

    -- * Destructuring the Response
    GetObjectRetentionResponse (..),
    newGetObjectRetentionResponse,

    -- * Response Lenses
    getObjectRetentionResponse_retention,
    getObjectRetentionResponse_httpStatus,
  )
where

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

-- | /See:/ 'newGetObjectRetention' smart constructor.
data GetObjectRetention = GetObjectRetention'
  { -- | The version ID for the object whose retention settings you want to
    -- retrieve.
    GetObjectRetention -> Maybe ObjectVersionId
versionId :: Prelude.Maybe ObjectVersionId,
    GetObjectRetention -> Maybe RequestPayer
requestPayer :: Prelude.Maybe RequestPayer,
    -- | 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.
    GetObjectRetention -> Maybe Text
expectedBucketOwner :: Prelude.Maybe Prelude.Text,
    -- | The bucket name containing the object whose retention settings you want
    -- to retrieve.
    --
    -- 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
    -- <https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html Using access points>
    -- in the /Amazon S3 User Guide/.
    GetObjectRetention -> BucketName
bucket :: BucketName,
    -- | The key name for the object whose retention settings you want to
    -- retrieve.
    GetObjectRetention -> ObjectKey
key :: ObjectKey
  }
  deriving (GetObjectRetention -> GetObjectRetention -> Bool
(GetObjectRetention -> GetObjectRetention -> Bool)
-> (GetObjectRetention -> GetObjectRetention -> Bool)
-> Eq GetObjectRetention
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetObjectRetention -> GetObjectRetention -> Bool
$c/= :: GetObjectRetention -> GetObjectRetention -> Bool
== :: GetObjectRetention -> GetObjectRetention -> Bool
$c== :: GetObjectRetention -> GetObjectRetention -> Bool
Prelude.Eq, ReadPrec [GetObjectRetention]
ReadPrec GetObjectRetention
Int -> ReadS GetObjectRetention
ReadS [GetObjectRetention]
(Int -> ReadS GetObjectRetention)
-> ReadS [GetObjectRetention]
-> ReadPrec GetObjectRetention
-> ReadPrec [GetObjectRetention]
-> Read GetObjectRetention
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetObjectRetention]
$creadListPrec :: ReadPrec [GetObjectRetention]
readPrec :: ReadPrec GetObjectRetention
$creadPrec :: ReadPrec GetObjectRetention
readList :: ReadS [GetObjectRetention]
$creadList :: ReadS [GetObjectRetention]
readsPrec :: Int -> ReadS GetObjectRetention
$creadsPrec :: Int -> ReadS GetObjectRetention
Prelude.Read, Int -> GetObjectRetention -> ShowS
[GetObjectRetention] -> ShowS
GetObjectRetention -> String
(Int -> GetObjectRetention -> ShowS)
-> (GetObjectRetention -> String)
-> ([GetObjectRetention] -> ShowS)
-> Show GetObjectRetention
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetObjectRetention] -> ShowS
$cshowList :: [GetObjectRetention] -> ShowS
show :: GetObjectRetention -> String
$cshow :: GetObjectRetention -> String
showsPrec :: Int -> GetObjectRetention -> ShowS
$cshowsPrec :: Int -> GetObjectRetention -> ShowS
Prelude.Show, (forall x. GetObjectRetention -> Rep GetObjectRetention x)
-> (forall x. Rep GetObjectRetention x -> GetObjectRetention)
-> Generic GetObjectRetention
forall x. Rep GetObjectRetention x -> GetObjectRetention
forall x. GetObjectRetention -> Rep GetObjectRetention x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetObjectRetention x -> GetObjectRetention
$cfrom :: forall x. GetObjectRetention -> Rep GetObjectRetention x
Prelude.Generic)

-- |
-- Create a value of 'GetObjectRetention' 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:
--
-- 'versionId', 'getObjectRetention_versionId' - The version ID for the object whose retention settings you want to
-- retrieve.
--
-- 'requestPayer', 'getObjectRetention_requestPayer' - Undocumented member.
--
-- 'expectedBucketOwner', 'getObjectRetention_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.
--
-- 'bucket', 'getObjectRetention_bucket' - The bucket name containing the object whose retention settings you want
-- to retrieve.
--
-- 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
-- <https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html Using access points>
-- in the /Amazon S3 User Guide/.
--
-- 'key', 'getObjectRetention_key' - The key name for the object whose retention settings you want to
-- retrieve.
newGetObjectRetention ::
  -- | 'bucket'
  BucketName ->
  -- | 'key'
  ObjectKey ->
  GetObjectRetention
newGetObjectRetention :: BucketName -> ObjectKey -> GetObjectRetention
newGetObjectRetention BucketName
pBucket_ ObjectKey
pKey_ =
  GetObjectRetention' :: Maybe ObjectVersionId
-> Maybe RequestPayer
-> Maybe Text
-> BucketName
-> ObjectKey
-> GetObjectRetention
GetObjectRetention'
    { $sel:versionId:GetObjectRetention' :: Maybe ObjectVersionId
versionId = Maybe ObjectVersionId
forall a. Maybe a
Prelude.Nothing,
      $sel:requestPayer:GetObjectRetention' :: Maybe RequestPayer
requestPayer = Maybe RequestPayer
forall a. Maybe a
Prelude.Nothing,
      $sel:expectedBucketOwner:GetObjectRetention' :: Maybe Text
expectedBucketOwner = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:bucket:GetObjectRetention' :: BucketName
bucket = BucketName
pBucket_,
      $sel:key:GetObjectRetention' :: ObjectKey
key = ObjectKey
pKey_
    }

-- | The version ID for the object whose retention settings you want to
-- retrieve.
getObjectRetention_versionId :: Lens.Lens' GetObjectRetention (Prelude.Maybe ObjectVersionId)
getObjectRetention_versionId :: (Maybe ObjectVersionId -> f (Maybe ObjectVersionId))
-> GetObjectRetention -> f GetObjectRetention
getObjectRetention_versionId = (GetObjectRetention -> Maybe ObjectVersionId)
-> (GetObjectRetention
    -> Maybe ObjectVersionId -> GetObjectRetention)
-> Lens
     GetObjectRetention
     GetObjectRetention
     (Maybe ObjectVersionId)
     (Maybe ObjectVersionId)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetObjectRetention' {Maybe ObjectVersionId
versionId :: Maybe ObjectVersionId
$sel:versionId:GetObjectRetention' :: GetObjectRetention -> Maybe ObjectVersionId
versionId} -> Maybe ObjectVersionId
versionId) (\s :: GetObjectRetention
s@GetObjectRetention' {} Maybe ObjectVersionId
a -> GetObjectRetention
s {$sel:versionId:GetObjectRetention' :: Maybe ObjectVersionId
versionId = Maybe ObjectVersionId
a} :: GetObjectRetention)

-- | Undocumented member.
getObjectRetention_requestPayer :: Lens.Lens' GetObjectRetention (Prelude.Maybe RequestPayer)
getObjectRetention_requestPayer :: (Maybe RequestPayer -> f (Maybe RequestPayer))
-> GetObjectRetention -> f GetObjectRetention
getObjectRetention_requestPayer = (GetObjectRetention -> Maybe RequestPayer)
-> (GetObjectRetention -> Maybe RequestPayer -> GetObjectRetention)
-> Lens
     GetObjectRetention
     GetObjectRetention
     (Maybe RequestPayer)
     (Maybe RequestPayer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetObjectRetention' {Maybe RequestPayer
requestPayer :: Maybe RequestPayer
$sel:requestPayer:GetObjectRetention' :: GetObjectRetention -> Maybe RequestPayer
requestPayer} -> Maybe RequestPayer
requestPayer) (\s :: GetObjectRetention
s@GetObjectRetention' {} Maybe RequestPayer
a -> GetObjectRetention
s {$sel:requestPayer:GetObjectRetention' :: Maybe RequestPayer
requestPayer = Maybe RequestPayer
a} :: GetObjectRetention)

-- | 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.
getObjectRetention_expectedBucketOwner :: Lens.Lens' GetObjectRetention (Prelude.Maybe Prelude.Text)
getObjectRetention_expectedBucketOwner :: (Maybe Text -> f (Maybe Text))
-> GetObjectRetention -> f GetObjectRetention
getObjectRetention_expectedBucketOwner = (GetObjectRetention -> Maybe Text)
-> (GetObjectRetention -> Maybe Text -> GetObjectRetention)
-> Lens
     GetObjectRetention GetObjectRetention (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetObjectRetention' {Maybe Text
expectedBucketOwner :: Maybe Text
$sel:expectedBucketOwner:GetObjectRetention' :: GetObjectRetention -> Maybe Text
expectedBucketOwner} -> Maybe Text
expectedBucketOwner) (\s :: GetObjectRetention
s@GetObjectRetention' {} Maybe Text
a -> GetObjectRetention
s {$sel:expectedBucketOwner:GetObjectRetention' :: Maybe Text
expectedBucketOwner = Maybe Text
a} :: GetObjectRetention)

-- | The bucket name containing the object whose retention settings you want
-- to retrieve.
--
-- 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
-- <https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html Using access points>
-- in the /Amazon S3 User Guide/.
getObjectRetention_bucket :: Lens.Lens' GetObjectRetention BucketName
getObjectRetention_bucket :: (BucketName -> f BucketName)
-> GetObjectRetention -> f GetObjectRetention
getObjectRetention_bucket = (GetObjectRetention -> BucketName)
-> (GetObjectRetention -> BucketName -> GetObjectRetention)
-> Lens GetObjectRetention GetObjectRetention BucketName BucketName
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetObjectRetention' {BucketName
bucket :: BucketName
$sel:bucket:GetObjectRetention' :: GetObjectRetention -> BucketName
bucket} -> BucketName
bucket) (\s :: GetObjectRetention
s@GetObjectRetention' {} BucketName
a -> GetObjectRetention
s {$sel:bucket:GetObjectRetention' :: BucketName
bucket = BucketName
a} :: GetObjectRetention)

-- | The key name for the object whose retention settings you want to
-- retrieve.
getObjectRetention_key :: Lens.Lens' GetObjectRetention ObjectKey
getObjectRetention_key :: (ObjectKey -> f ObjectKey)
-> GetObjectRetention -> f GetObjectRetention
getObjectRetention_key = (GetObjectRetention -> ObjectKey)
-> (GetObjectRetention -> ObjectKey -> GetObjectRetention)
-> Lens GetObjectRetention GetObjectRetention ObjectKey ObjectKey
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetObjectRetention' {ObjectKey
key :: ObjectKey
$sel:key:GetObjectRetention' :: GetObjectRetention -> ObjectKey
key} -> ObjectKey
key) (\s :: GetObjectRetention
s@GetObjectRetention' {} ObjectKey
a -> GetObjectRetention
s {$sel:key:GetObjectRetention' :: ObjectKey
key = ObjectKey
a} :: GetObjectRetention)

instance Core.AWSRequest GetObjectRetention where
  type
    AWSResponse GetObjectRetention =
      GetObjectRetentionResponse
  request :: GetObjectRetention -> Request GetObjectRetention
request =
    Request GetObjectRetention -> Request GetObjectRetention
forall a. Request a -> Request a
Request.s3vhost
      (Request GetObjectRetention -> Request GetObjectRetention)
-> (GetObjectRetention -> Request GetObjectRetention)
-> GetObjectRetention
-> Request GetObjectRetention
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Service -> GetObjectRetention -> Request GetObjectRetention
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy GetObjectRetention
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetObjectRetention)))
response =
    (Int
 -> ResponseHeaders
 -> [Node]
 -> Either String (AWSResponse GetObjectRetention))
-> Logger
-> Service
-> Proxy GetObjectRetention
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetObjectRetention)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXML
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe ObjectLockRetention -> Int -> GetObjectRetentionResponse
GetObjectRetentionResponse'
            (Maybe ObjectLockRetention -> Int -> GetObjectRetentionResponse)
-> Either String (Maybe ObjectLockRetention)
-> Either String (Int -> GetObjectRetentionResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node] -> Either String (Maybe ObjectLockRetention)
forall a. FromXML a => [Node] -> Either String a
Core.parseXML [Node]
x)
            Either String (Int -> GetObjectRetentionResponse)
-> Either String Int -> Either String GetObjectRetentionResponse
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))
      )

instance Prelude.Hashable GetObjectRetention

instance Prelude.NFData GetObjectRetention

instance Core.ToHeaders GetObjectRetention where
  toHeaders :: GetObjectRetention -> ResponseHeaders
toHeaders GetObjectRetention' {Maybe Text
Maybe ObjectVersionId
Maybe RequestPayer
ObjectKey
BucketName
key :: ObjectKey
bucket :: BucketName
expectedBucketOwner :: Maybe Text
requestPayer :: Maybe RequestPayer
versionId :: Maybe ObjectVersionId
$sel:key:GetObjectRetention' :: GetObjectRetention -> ObjectKey
$sel:bucket:GetObjectRetention' :: GetObjectRetention -> BucketName
$sel:expectedBucketOwner:GetObjectRetention' :: GetObjectRetention -> Maybe Text
$sel:requestPayer:GetObjectRetention' :: GetObjectRetention -> Maybe RequestPayer
$sel:versionId:GetObjectRetention' :: GetObjectRetention -> Maybe ObjectVersionId
..} =
    [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ HeaderName
"x-amz-request-payer" HeaderName -> Maybe RequestPayer -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe RequestPayer
requestPayer,
        HeaderName
"x-amz-expected-bucket-owner"
          HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
expectedBucketOwner
      ]

instance Core.ToPath GetObjectRetention where
  toPath :: GetObjectRetention -> ByteString
toPath GetObjectRetention' {Maybe Text
Maybe ObjectVersionId
Maybe RequestPayer
ObjectKey
BucketName
key :: ObjectKey
bucket :: BucketName
expectedBucketOwner :: Maybe Text
requestPayer :: Maybe RequestPayer
versionId :: Maybe ObjectVersionId
$sel:key:GetObjectRetention' :: GetObjectRetention -> ObjectKey
$sel:bucket:GetObjectRetention' :: GetObjectRetention -> BucketName
$sel:expectedBucketOwner:GetObjectRetention' :: GetObjectRetention -> Maybe Text
$sel:requestPayer:GetObjectRetention' :: GetObjectRetention -> Maybe RequestPayer
$sel:versionId:GetObjectRetention' :: GetObjectRetention -> Maybe ObjectVersionId
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/", BucketName -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS BucketName
bucket, ByteString
"/", ObjectKey -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS ObjectKey
key]

instance Core.ToQuery GetObjectRetention where
  toQuery :: GetObjectRetention -> QueryString
toQuery GetObjectRetention' {Maybe Text
Maybe ObjectVersionId
Maybe RequestPayer
ObjectKey
BucketName
key :: ObjectKey
bucket :: BucketName
expectedBucketOwner :: Maybe Text
requestPayer :: Maybe RequestPayer
versionId :: Maybe ObjectVersionId
$sel:key:GetObjectRetention' :: GetObjectRetention -> ObjectKey
$sel:bucket:GetObjectRetention' :: GetObjectRetention -> BucketName
$sel:expectedBucketOwner:GetObjectRetention' :: GetObjectRetention -> Maybe Text
$sel:requestPayer:GetObjectRetention' :: GetObjectRetention -> Maybe RequestPayer
$sel:versionId:GetObjectRetention' :: GetObjectRetention -> Maybe ObjectVersionId
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"versionId" ByteString -> Maybe ObjectVersionId -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe ObjectVersionId
versionId, QueryString
"retention"]

-- | /See:/ 'newGetObjectRetentionResponse' smart constructor.
data GetObjectRetentionResponse = GetObjectRetentionResponse'
  { -- | The container element for an object\'s retention settings.
    GetObjectRetentionResponse -> Maybe ObjectLockRetention
retention :: Prelude.Maybe ObjectLockRetention,
    -- | The response's http status code.
    GetObjectRetentionResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetObjectRetentionResponse -> GetObjectRetentionResponse -> Bool
(GetObjectRetentionResponse -> GetObjectRetentionResponse -> Bool)
-> (GetObjectRetentionResponse
    -> GetObjectRetentionResponse -> Bool)
-> Eq GetObjectRetentionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetObjectRetentionResponse -> GetObjectRetentionResponse -> Bool
$c/= :: GetObjectRetentionResponse -> GetObjectRetentionResponse -> Bool
== :: GetObjectRetentionResponse -> GetObjectRetentionResponse -> Bool
$c== :: GetObjectRetentionResponse -> GetObjectRetentionResponse -> Bool
Prelude.Eq, ReadPrec [GetObjectRetentionResponse]
ReadPrec GetObjectRetentionResponse
Int -> ReadS GetObjectRetentionResponse
ReadS [GetObjectRetentionResponse]
(Int -> ReadS GetObjectRetentionResponse)
-> ReadS [GetObjectRetentionResponse]
-> ReadPrec GetObjectRetentionResponse
-> ReadPrec [GetObjectRetentionResponse]
-> Read GetObjectRetentionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetObjectRetentionResponse]
$creadListPrec :: ReadPrec [GetObjectRetentionResponse]
readPrec :: ReadPrec GetObjectRetentionResponse
$creadPrec :: ReadPrec GetObjectRetentionResponse
readList :: ReadS [GetObjectRetentionResponse]
$creadList :: ReadS [GetObjectRetentionResponse]
readsPrec :: Int -> ReadS GetObjectRetentionResponse
$creadsPrec :: Int -> ReadS GetObjectRetentionResponse
Prelude.Read, Int -> GetObjectRetentionResponse -> ShowS
[GetObjectRetentionResponse] -> ShowS
GetObjectRetentionResponse -> String
(Int -> GetObjectRetentionResponse -> ShowS)
-> (GetObjectRetentionResponse -> String)
-> ([GetObjectRetentionResponse] -> ShowS)
-> Show GetObjectRetentionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetObjectRetentionResponse] -> ShowS
$cshowList :: [GetObjectRetentionResponse] -> ShowS
show :: GetObjectRetentionResponse -> String
$cshow :: GetObjectRetentionResponse -> String
showsPrec :: Int -> GetObjectRetentionResponse -> ShowS
$cshowsPrec :: Int -> GetObjectRetentionResponse -> ShowS
Prelude.Show, (forall x.
 GetObjectRetentionResponse -> Rep GetObjectRetentionResponse x)
-> (forall x.
    Rep GetObjectRetentionResponse x -> GetObjectRetentionResponse)
-> Generic GetObjectRetentionResponse
forall x.
Rep GetObjectRetentionResponse x -> GetObjectRetentionResponse
forall x.
GetObjectRetentionResponse -> Rep GetObjectRetentionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetObjectRetentionResponse x -> GetObjectRetentionResponse
$cfrom :: forall x.
GetObjectRetentionResponse -> Rep GetObjectRetentionResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetObjectRetentionResponse' 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:
--
-- 'retention', 'getObjectRetentionResponse_retention' - The container element for an object\'s retention settings.
--
-- 'httpStatus', 'getObjectRetentionResponse_httpStatus' - The response's http status code.
newGetObjectRetentionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetObjectRetentionResponse
newGetObjectRetentionResponse :: Int -> GetObjectRetentionResponse
newGetObjectRetentionResponse Int
pHttpStatus_ =
  GetObjectRetentionResponse' :: Maybe ObjectLockRetention -> Int -> GetObjectRetentionResponse
GetObjectRetentionResponse'
    { $sel:retention:GetObjectRetentionResponse' :: Maybe ObjectLockRetention
retention =
        Maybe ObjectLockRetention
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetObjectRetentionResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The container element for an object\'s retention settings.
getObjectRetentionResponse_retention :: Lens.Lens' GetObjectRetentionResponse (Prelude.Maybe ObjectLockRetention)
getObjectRetentionResponse_retention :: (Maybe ObjectLockRetention -> f (Maybe ObjectLockRetention))
-> GetObjectRetentionResponse -> f GetObjectRetentionResponse
getObjectRetentionResponse_retention = (GetObjectRetentionResponse -> Maybe ObjectLockRetention)
-> (GetObjectRetentionResponse
    -> Maybe ObjectLockRetention -> GetObjectRetentionResponse)
-> Lens
     GetObjectRetentionResponse
     GetObjectRetentionResponse
     (Maybe ObjectLockRetention)
     (Maybe ObjectLockRetention)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetObjectRetentionResponse' {Maybe ObjectLockRetention
retention :: Maybe ObjectLockRetention
$sel:retention:GetObjectRetentionResponse' :: GetObjectRetentionResponse -> Maybe ObjectLockRetention
retention} -> Maybe ObjectLockRetention
retention) (\s :: GetObjectRetentionResponse
s@GetObjectRetentionResponse' {} Maybe ObjectLockRetention
a -> GetObjectRetentionResponse
s {$sel:retention:GetObjectRetentionResponse' :: Maybe ObjectLockRetention
retention = Maybe ObjectLockRetention
a} :: GetObjectRetentionResponse)

-- | The response's http status code.
getObjectRetentionResponse_httpStatus :: Lens.Lens' GetObjectRetentionResponse Prelude.Int
getObjectRetentionResponse_httpStatus :: (Int -> f Int)
-> GetObjectRetentionResponse -> f GetObjectRetentionResponse
getObjectRetentionResponse_httpStatus = (GetObjectRetentionResponse -> Int)
-> (GetObjectRetentionResponse
    -> Int -> GetObjectRetentionResponse)
-> Lens
     GetObjectRetentionResponse GetObjectRetentionResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetObjectRetentionResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetObjectRetentionResponse' :: GetObjectRetentionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetObjectRetentionResponse
s@GetObjectRetentionResponse' {} Int
a -> GetObjectRetentionResponse
s {$sel:httpStatus:GetObjectRetentionResponse' :: Int
httpStatus = Int
a} :: GetObjectRetentionResponse)

instance Prelude.NFData GetObjectRetentionResponse