{-# 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 #-}
module Amazonka.S3.PutObjectRetention
(
PutObjectRetention (..),
newPutObjectRetention,
putObjectRetention_retention,
putObjectRetention_versionId,
putObjectRetention_requestPayer,
putObjectRetention_contentMD5,
putObjectRetention_bypassGovernanceRetention,
putObjectRetention_expectedBucketOwner,
putObjectRetention_bucket,
putObjectRetention_key,
PutObjectRetentionResponse (..),
newPutObjectRetentionResponse,
putObjectRetentionResponse_requestCharged,
putObjectRetentionResponse_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
data PutObjectRetention = PutObjectRetention'
{
PutObjectRetention -> Maybe ObjectLockRetention
retention :: Prelude.Maybe ObjectLockRetention,
PutObjectRetention -> Maybe ObjectVersionId
versionId :: Prelude.Maybe ObjectVersionId,
PutObjectRetention -> Maybe RequestPayer
requestPayer :: Prelude.Maybe RequestPayer,
PutObjectRetention -> Maybe Text
contentMD5 :: Prelude.Maybe Prelude.Text,
PutObjectRetention -> Maybe Bool
bypassGovernanceRetention :: Prelude.Maybe Prelude.Bool,
PutObjectRetention -> Maybe Text
expectedBucketOwner :: Prelude.Maybe Prelude.Text,
PutObjectRetention -> BucketName
bucket :: BucketName,
PutObjectRetention -> ObjectKey
key :: ObjectKey
}
deriving (PutObjectRetention -> PutObjectRetention -> Bool
(PutObjectRetention -> PutObjectRetention -> Bool)
-> (PutObjectRetention -> PutObjectRetention -> Bool)
-> Eq PutObjectRetention
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutObjectRetention -> PutObjectRetention -> Bool
$c/= :: PutObjectRetention -> PutObjectRetention -> Bool
== :: PutObjectRetention -> PutObjectRetention -> Bool
$c== :: PutObjectRetention -> PutObjectRetention -> Bool
Prelude.Eq, ReadPrec [PutObjectRetention]
ReadPrec PutObjectRetention
Int -> ReadS PutObjectRetention
ReadS [PutObjectRetention]
(Int -> ReadS PutObjectRetention)
-> ReadS [PutObjectRetention]
-> ReadPrec PutObjectRetention
-> ReadPrec [PutObjectRetention]
-> Read PutObjectRetention
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutObjectRetention]
$creadListPrec :: ReadPrec [PutObjectRetention]
readPrec :: ReadPrec PutObjectRetention
$creadPrec :: ReadPrec PutObjectRetention
readList :: ReadS [PutObjectRetention]
$creadList :: ReadS [PutObjectRetention]
readsPrec :: Int -> ReadS PutObjectRetention
$creadsPrec :: Int -> ReadS PutObjectRetention
Prelude.Read, Int -> PutObjectRetention -> ShowS
[PutObjectRetention] -> ShowS
PutObjectRetention -> String
(Int -> PutObjectRetention -> ShowS)
-> (PutObjectRetention -> String)
-> ([PutObjectRetention] -> ShowS)
-> Show PutObjectRetention
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutObjectRetention] -> ShowS
$cshowList :: [PutObjectRetention] -> ShowS
show :: PutObjectRetention -> String
$cshow :: PutObjectRetention -> String
showsPrec :: Int -> PutObjectRetention -> ShowS
$cshowsPrec :: Int -> PutObjectRetention -> ShowS
Prelude.Show, (forall x. PutObjectRetention -> Rep PutObjectRetention x)
-> (forall x. Rep PutObjectRetention x -> PutObjectRetention)
-> Generic PutObjectRetention
forall x. Rep PutObjectRetention x -> PutObjectRetention
forall x. PutObjectRetention -> Rep PutObjectRetention x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutObjectRetention x -> PutObjectRetention
$cfrom :: forall x. PutObjectRetention -> Rep PutObjectRetention x
Prelude.Generic)
newPutObjectRetention ::
BucketName ->
ObjectKey ->
PutObjectRetention
newPutObjectRetention :: BucketName -> ObjectKey -> PutObjectRetention
newPutObjectRetention BucketName
pBucket_ ObjectKey
pKey_ =
PutObjectRetention' :: Maybe ObjectLockRetention
-> Maybe ObjectVersionId
-> Maybe RequestPayer
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> BucketName
-> ObjectKey
-> PutObjectRetention
PutObjectRetention'
{ $sel:retention:PutObjectRetention' :: Maybe ObjectLockRetention
retention = Maybe ObjectLockRetention
forall a. Maybe a
Prelude.Nothing,
$sel:versionId:PutObjectRetention' :: Maybe ObjectVersionId
versionId = Maybe ObjectVersionId
forall a. Maybe a
Prelude.Nothing,
$sel:requestPayer:PutObjectRetention' :: Maybe RequestPayer
requestPayer = Maybe RequestPayer
forall a. Maybe a
Prelude.Nothing,
$sel:contentMD5:PutObjectRetention' :: Maybe Text
contentMD5 = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:bypassGovernanceRetention:PutObjectRetention' :: Maybe Bool
bypassGovernanceRetention = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:expectedBucketOwner:PutObjectRetention' :: Maybe Text
expectedBucketOwner = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:bucket:PutObjectRetention' :: BucketName
bucket = BucketName
pBucket_,
$sel:key:PutObjectRetention' :: ObjectKey
key = ObjectKey
pKey_
}
putObjectRetention_retention :: Lens.Lens' PutObjectRetention (Prelude.Maybe ObjectLockRetention)
putObjectRetention_retention :: (Maybe ObjectLockRetention -> f (Maybe ObjectLockRetention))
-> PutObjectRetention -> f PutObjectRetention
putObjectRetention_retention = (PutObjectRetention -> Maybe ObjectLockRetention)
-> (PutObjectRetention
-> Maybe ObjectLockRetention -> PutObjectRetention)
-> Lens
PutObjectRetention
PutObjectRetention
(Maybe ObjectLockRetention)
(Maybe ObjectLockRetention)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObjectRetention' {Maybe ObjectLockRetention
retention :: Maybe ObjectLockRetention
$sel:retention:PutObjectRetention' :: PutObjectRetention -> Maybe ObjectLockRetention
retention} -> Maybe ObjectLockRetention
retention) (\s :: PutObjectRetention
s@PutObjectRetention' {} Maybe ObjectLockRetention
a -> PutObjectRetention
s {$sel:retention:PutObjectRetention' :: Maybe ObjectLockRetention
retention = Maybe ObjectLockRetention
a} :: PutObjectRetention)
putObjectRetention_versionId :: Lens.Lens' PutObjectRetention (Prelude.Maybe ObjectVersionId)
putObjectRetention_versionId :: (Maybe ObjectVersionId -> f (Maybe ObjectVersionId))
-> PutObjectRetention -> f PutObjectRetention
putObjectRetention_versionId = (PutObjectRetention -> Maybe ObjectVersionId)
-> (PutObjectRetention
-> Maybe ObjectVersionId -> PutObjectRetention)
-> Lens
PutObjectRetention
PutObjectRetention
(Maybe ObjectVersionId)
(Maybe ObjectVersionId)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObjectRetention' {Maybe ObjectVersionId
versionId :: Maybe ObjectVersionId
$sel:versionId:PutObjectRetention' :: PutObjectRetention -> Maybe ObjectVersionId
versionId} -> Maybe ObjectVersionId
versionId) (\s :: PutObjectRetention
s@PutObjectRetention' {} Maybe ObjectVersionId
a -> PutObjectRetention
s {$sel:versionId:PutObjectRetention' :: Maybe ObjectVersionId
versionId = Maybe ObjectVersionId
a} :: PutObjectRetention)
putObjectRetention_requestPayer :: Lens.Lens' PutObjectRetention (Prelude.Maybe RequestPayer)
putObjectRetention_requestPayer :: (Maybe RequestPayer -> f (Maybe RequestPayer))
-> PutObjectRetention -> f PutObjectRetention
putObjectRetention_requestPayer = (PutObjectRetention -> Maybe RequestPayer)
-> (PutObjectRetention -> Maybe RequestPayer -> PutObjectRetention)
-> Lens
PutObjectRetention
PutObjectRetention
(Maybe RequestPayer)
(Maybe RequestPayer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObjectRetention' {Maybe RequestPayer
requestPayer :: Maybe RequestPayer
$sel:requestPayer:PutObjectRetention' :: PutObjectRetention -> Maybe RequestPayer
requestPayer} -> Maybe RequestPayer
requestPayer) (\s :: PutObjectRetention
s@PutObjectRetention' {} Maybe RequestPayer
a -> PutObjectRetention
s {$sel:requestPayer:PutObjectRetention' :: Maybe RequestPayer
requestPayer = Maybe RequestPayer
a} :: PutObjectRetention)
putObjectRetention_contentMD5 :: Lens.Lens' PutObjectRetention (Prelude.Maybe Prelude.Text)
putObjectRetention_contentMD5 :: (Maybe Text -> f (Maybe Text))
-> PutObjectRetention -> f PutObjectRetention
putObjectRetention_contentMD5 = (PutObjectRetention -> Maybe Text)
-> (PutObjectRetention -> Maybe Text -> PutObjectRetention)
-> Lens
PutObjectRetention PutObjectRetention (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObjectRetention' {Maybe Text
contentMD5 :: Maybe Text
$sel:contentMD5:PutObjectRetention' :: PutObjectRetention -> Maybe Text
contentMD5} -> Maybe Text
contentMD5) (\s :: PutObjectRetention
s@PutObjectRetention' {} Maybe Text
a -> PutObjectRetention
s {$sel:contentMD5:PutObjectRetention' :: Maybe Text
contentMD5 = Maybe Text
a} :: PutObjectRetention)
putObjectRetention_bypassGovernanceRetention :: Lens.Lens' PutObjectRetention (Prelude.Maybe Prelude.Bool)
putObjectRetention_bypassGovernanceRetention :: (Maybe Bool -> f (Maybe Bool))
-> PutObjectRetention -> f PutObjectRetention
putObjectRetention_bypassGovernanceRetention = (PutObjectRetention -> Maybe Bool)
-> (PutObjectRetention -> Maybe Bool -> PutObjectRetention)
-> Lens
PutObjectRetention PutObjectRetention (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObjectRetention' {Maybe Bool
bypassGovernanceRetention :: Maybe Bool
$sel:bypassGovernanceRetention:PutObjectRetention' :: PutObjectRetention -> Maybe Bool
bypassGovernanceRetention} -> Maybe Bool
bypassGovernanceRetention) (\s :: PutObjectRetention
s@PutObjectRetention' {} Maybe Bool
a -> PutObjectRetention
s {$sel:bypassGovernanceRetention:PutObjectRetention' :: Maybe Bool
bypassGovernanceRetention = Maybe Bool
a} :: PutObjectRetention)
putObjectRetention_expectedBucketOwner :: Lens.Lens' PutObjectRetention (Prelude.Maybe Prelude.Text)
putObjectRetention_expectedBucketOwner :: (Maybe Text -> f (Maybe Text))
-> PutObjectRetention -> f PutObjectRetention
putObjectRetention_expectedBucketOwner = (PutObjectRetention -> Maybe Text)
-> (PutObjectRetention -> Maybe Text -> PutObjectRetention)
-> Lens
PutObjectRetention PutObjectRetention (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObjectRetention' {Maybe Text
expectedBucketOwner :: Maybe Text
$sel:expectedBucketOwner:PutObjectRetention' :: PutObjectRetention -> Maybe Text
expectedBucketOwner} -> Maybe Text
expectedBucketOwner) (\s :: PutObjectRetention
s@PutObjectRetention' {} Maybe Text
a -> PutObjectRetention
s {$sel:expectedBucketOwner:PutObjectRetention' :: Maybe Text
expectedBucketOwner = Maybe Text
a} :: PutObjectRetention)
putObjectRetention_bucket :: Lens.Lens' PutObjectRetention BucketName
putObjectRetention_bucket :: (BucketName -> f BucketName)
-> PutObjectRetention -> f PutObjectRetention
putObjectRetention_bucket = (PutObjectRetention -> BucketName)
-> (PutObjectRetention -> BucketName -> PutObjectRetention)
-> Lens PutObjectRetention PutObjectRetention BucketName BucketName
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObjectRetention' {BucketName
bucket :: BucketName
$sel:bucket:PutObjectRetention' :: PutObjectRetention -> BucketName
bucket} -> BucketName
bucket) (\s :: PutObjectRetention
s@PutObjectRetention' {} BucketName
a -> PutObjectRetention
s {$sel:bucket:PutObjectRetention' :: BucketName
bucket = BucketName
a} :: PutObjectRetention)
putObjectRetention_key :: Lens.Lens' PutObjectRetention ObjectKey
putObjectRetention_key :: (ObjectKey -> f ObjectKey)
-> PutObjectRetention -> f PutObjectRetention
putObjectRetention_key = (PutObjectRetention -> ObjectKey)
-> (PutObjectRetention -> ObjectKey -> PutObjectRetention)
-> Lens PutObjectRetention PutObjectRetention ObjectKey ObjectKey
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObjectRetention' {ObjectKey
key :: ObjectKey
$sel:key:PutObjectRetention' :: PutObjectRetention -> ObjectKey
key} -> ObjectKey
key) (\s :: PutObjectRetention
s@PutObjectRetention' {} ObjectKey
a -> PutObjectRetention
s {$sel:key:PutObjectRetention' :: ObjectKey
key = ObjectKey
a} :: PutObjectRetention)
instance Core.AWSRequest PutObjectRetention where
type
AWSResponse PutObjectRetention =
PutObjectRetentionResponse
request :: PutObjectRetention -> Request PutObjectRetention
request =
Request PutObjectRetention -> Request PutObjectRetention
forall a. Request a -> Request a
Request.s3vhost
(Request PutObjectRetention -> Request PutObjectRetention)
-> (PutObjectRetention -> Request PutObjectRetention)
-> PutObjectRetention
-> Request PutObjectRetention
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Service -> PutObjectRetention -> Request PutObjectRetention
forall a. (ToRequest a, ToElement a) => Service -> a -> Request a
Request.putXML Service
defaultService
response :: Logger
-> Service
-> Proxy PutObjectRetention
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse PutObjectRetention)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse PutObjectRetention))
-> Logger
-> Service
-> Proxy PutObjectRetention
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse PutObjectRetention)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Maybe RequestCharged -> Int -> PutObjectRetentionResponse
PutObjectRetentionResponse'
(Maybe RequestCharged -> Int -> PutObjectRetentionResponse)
-> Either String (Maybe RequestCharged)
-> Either String (Int -> PutObjectRetentionResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (ResponseHeaders
h ResponseHeaders
-> HeaderName -> Either String (Maybe RequestCharged)
forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Core..#? HeaderName
"x-amz-request-charged")
Either String (Int -> PutObjectRetentionResponse)
-> Either String Int -> Either String PutObjectRetentionResponse
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 PutObjectRetention
instance Prelude.NFData PutObjectRetention
instance Core.ToElement PutObjectRetention where
toElement :: PutObjectRetention -> Element
toElement PutObjectRetention' {Maybe Bool
Maybe Text
Maybe ObjectVersionId
Maybe ObjectLockRetention
Maybe RequestPayer
ObjectKey
BucketName
key :: ObjectKey
bucket :: BucketName
expectedBucketOwner :: Maybe Text
bypassGovernanceRetention :: Maybe Bool
contentMD5 :: Maybe Text
requestPayer :: Maybe RequestPayer
versionId :: Maybe ObjectVersionId
retention :: Maybe ObjectLockRetention
$sel:key:PutObjectRetention' :: PutObjectRetention -> ObjectKey
$sel:bucket:PutObjectRetention' :: PutObjectRetention -> BucketName
$sel:expectedBucketOwner:PutObjectRetention' :: PutObjectRetention -> Maybe Text
$sel:bypassGovernanceRetention:PutObjectRetention' :: PutObjectRetention -> Maybe Bool
$sel:contentMD5:PutObjectRetention' :: PutObjectRetention -> Maybe Text
$sel:requestPayer:PutObjectRetention' :: PutObjectRetention -> Maybe RequestPayer
$sel:versionId:PutObjectRetention' :: PutObjectRetention -> Maybe ObjectVersionId
$sel:retention:PutObjectRetention' :: PutObjectRetention -> Maybe ObjectLockRetention
..} =
Name -> Maybe ObjectLockRetention -> Element
forall a. ToXML a => Name -> a -> Element
Core.mkElement
Name
"{http://s3.amazonaws.com/doc/2006-03-01/}Retention"
Maybe ObjectLockRetention
retention
instance Core.ToHeaders PutObjectRetention where
toHeaders :: PutObjectRetention -> ResponseHeaders
toHeaders PutObjectRetention' {Maybe Bool
Maybe Text
Maybe ObjectVersionId
Maybe ObjectLockRetention
Maybe RequestPayer
ObjectKey
BucketName
key :: ObjectKey
bucket :: BucketName
expectedBucketOwner :: Maybe Text
bypassGovernanceRetention :: Maybe Bool
contentMD5 :: Maybe Text
requestPayer :: Maybe RequestPayer
versionId :: Maybe ObjectVersionId
retention :: Maybe ObjectLockRetention
$sel:key:PutObjectRetention' :: PutObjectRetention -> ObjectKey
$sel:bucket:PutObjectRetention' :: PutObjectRetention -> BucketName
$sel:expectedBucketOwner:PutObjectRetention' :: PutObjectRetention -> Maybe Text
$sel:bypassGovernanceRetention:PutObjectRetention' :: PutObjectRetention -> Maybe Bool
$sel:contentMD5:PutObjectRetention' :: PutObjectRetention -> Maybe Text
$sel:requestPayer:PutObjectRetention' :: PutObjectRetention -> Maybe RequestPayer
$sel:versionId:PutObjectRetention' :: PutObjectRetention -> Maybe ObjectVersionId
$sel:retention:PutObjectRetention' :: PutObjectRetention -> Maybe ObjectLockRetention
..} =
[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
"Content-MD5" HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
contentMD5,
HeaderName
"x-amz-bypass-governance-retention"
HeaderName -> Maybe Bool -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Bool
bypassGovernanceRetention,
HeaderName
"x-amz-expected-bucket-owner"
HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
expectedBucketOwner
]
instance Core.ToPath PutObjectRetention where
toPath :: PutObjectRetention -> ByteString
toPath PutObjectRetention' {Maybe Bool
Maybe Text
Maybe ObjectVersionId
Maybe ObjectLockRetention
Maybe RequestPayer
ObjectKey
BucketName
key :: ObjectKey
bucket :: BucketName
expectedBucketOwner :: Maybe Text
bypassGovernanceRetention :: Maybe Bool
contentMD5 :: Maybe Text
requestPayer :: Maybe RequestPayer
versionId :: Maybe ObjectVersionId
retention :: Maybe ObjectLockRetention
$sel:key:PutObjectRetention' :: PutObjectRetention -> ObjectKey
$sel:bucket:PutObjectRetention' :: PutObjectRetention -> BucketName
$sel:expectedBucketOwner:PutObjectRetention' :: PutObjectRetention -> Maybe Text
$sel:bypassGovernanceRetention:PutObjectRetention' :: PutObjectRetention -> Maybe Bool
$sel:contentMD5:PutObjectRetention' :: PutObjectRetention -> Maybe Text
$sel:requestPayer:PutObjectRetention' :: PutObjectRetention -> Maybe RequestPayer
$sel:versionId:PutObjectRetention' :: PutObjectRetention -> Maybe ObjectVersionId
$sel:retention:PutObjectRetention' :: PutObjectRetention -> Maybe ObjectLockRetention
..} =
[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 PutObjectRetention where
toQuery :: PutObjectRetention -> QueryString
toQuery PutObjectRetention' {Maybe Bool
Maybe Text
Maybe ObjectVersionId
Maybe ObjectLockRetention
Maybe RequestPayer
ObjectKey
BucketName
key :: ObjectKey
bucket :: BucketName
expectedBucketOwner :: Maybe Text
bypassGovernanceRetention :: Maybe Bool
contentMD5 :: Maybe Text
requestPayer :: Maybe RequestPayer
versionId :: Maybe ObjectVersionId
retention :: Maybe ObjectLockRetention
$sel:key:PutObjectRetention' :: PutObjectRetention -> ObjectKey
$sel:bucket:PutObjectRetention' :: PutObjectRetention -> BucketName
$sel:expectedBucketOwner:PutObjectRetention' :: PutObjectRetention -> Maybe Text
$sel:bypassGovernanceRetention:PutObjectRetention' :: PutObjectRetention -> Maybe Bool
$sel:contentMD5:PutObjectRetention' :: PutObjectRetention -> Maybe Text
$sel:requestPayer:PutObjectRetention' :: PutObjectRetention -> Maybe RequestPayer
$sel:versionId:PutObjectRetention' :: PutObjectRetention -> Maybe ObjectVersionId
$sel:retention:PutObjectRetention' :: PutObjectRetention -> Maybe ObjectLockRetention
..} =
[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"]
data PutObjectRetentionResponse = PutObjectRetentionResponse'
{ PutObjectRetentionResponse -> Maybe RequestCharged
requestCharged :: Prelude.Maybe RequestCharged,
PutObjectRetentionResponse -> Int
httpStatus :: Prelude.Int
}
deriving (PutObjectRetentionResponse -> PutObjectRetentionResponse -> Bool
(PutObjectRetentionResponse -> PutObjectRetentionResponse -> Bool)
-> (PutObjectRetentionResponse
-> PutObjectRetentionResponse -> Bool)
-> Eq PutObjectRetentionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutObjectRetentionResponse -> PutObjectRetentionResponse -> Bool
$c/= :: PutObjectRetentionResponse -> PutObjectRetentionResponse -> Bool
== :: PutObjectRetentionResponse -> PutObjectRetentionResponse -> Bool
$c== :: PutObjectRetentionResponse -> PutObjectRetentionResponse -> Bool
Prelude.Eq, ReadPrec [PutObjectRetentionResponse]
ReadPrec PutObjectRetentionResponse
Int -> ReadS PutObjectRetentionResponse
ReadS [PutObjectRetentionResponse]
(Int -> ReadS PutObjectRetentionResponse)
-> ReadS [PutObjectRetentionResponse]
-> ReadPrec PutObjectRetentionResponse
-> ReadPrec [PutObjectRetentionResponse]
-> Read PutObjectRetentionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutObjectRetentionResponse]
$creadListPrec :: ReadPrec [PutObjectRetentionResponse]
readPrec :: ReadPrec PutObjectRetentionResponse
$creadPrec :: ReadPrec PutObjectRetentionResponse
readList :: ReadS [PutObjectRetentionResponse]
$creadList :: ReadS [PutObjectRetentionResponse]
readsPrec :: Int -> ReadS PutObjectRetentionResponse
$creadsPrec :: Int -> ReadS PutObjectRetentionResponse
Prelude.Read, Int -> PutObjectRetentionResponse -> ShowS
[PutObjectRetentionResponse] -> ShowS
PutObjectRetentionResponse -> String
(Int -> PutObjectRetentionResponse -> ShowS)
-> (PutObjectRetentionResponse -> String)
-> ([PutObjectRetentionResponse] -> ShowS)
-> Show PutObjectRetentionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutObjectRetentionResponse] -> ShowS
$cshowList :: [PutObjectRetentionResponse] -> ShowS
show :: PutObjectRetentionResponse -> String
$cshow :: PutObjectRetentionResponse -> String
showsPrec :: Int -> PutObjectRetentionResponse -> ShowS
$cshowsPrec :: Int -> PutObjectRetentionResponse -> ShowS
Prelude.Show, (forall x.
PutObjectRetentionResponse -> Rep PutObjectRetentionResponse x)
-> (forall x.
Rep PutObjectRetentionResponse x -> PutObjectRetentionResponse)
-> Generic PutObjectRetentionResponse
forall x.
Rep PutObjectRetentionResponse x -> PutObjectRetentionResponse
forall x.
PutObjectRetentionResponse -> Rep PutObjectRetentionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutObjectRetentionResponse x -> PutObjectRetentionResponse
$cfrom :: forall x.
PutObjectRetentionResponse -> Rep PutObjectRetentionResponse x
Prelude.Generic)
newPutObjectRetentionResponse ::
Prelude.Int ->
PutObjectRetentionResponse
newPutObjectRetentionResponse :: Int -> PutObjectRetentionResponse
newPutObjectRetentionResponse Int
pHttpStatus_ =
PutObjectRetentionResponse' :: Maybe RequestCharged -> Int -> PutObjectRetentionResponse
PutObjectRetentionResponse'
{ $sel:requestCharged:PutObjectRetentionResponse' :: Maybe RequestCharged
requestCharged =
Maybe RequestCharged
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:PutObjectRetentionResponse' :: Int
httpStatus = Int
pHttpStatus_
}
putObjectRetentionResponse_requestCharged :: Lens.Lens' PutObjectRetentionResponse (Prelude.Maybe RequestCharged)
putObjectRetentionResponse_requestCharged :: (Maybe RequestCharged -> f (Maybe RequestCharged))
-> PutObjectRetentionResponse -> f PutObjectRetentionResponse
putObjectRetentionResponse_requestCharged = (PutObjectRetentionResponse -> Maybe RequestCharged)
-> (PutObjectRetentionResponse
-> Maybe RequestCharged -> PutObjectRetentionResponse)
-> Lens
PutObjectRetentionResponse
PutObjectRetentionResponse
(Maybe RequestCharged)
(Maybe RequestCharged)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObjectRetentionResponse' {Maybe RequestCharged
requestCharged :: Maybe RequestCharged
$sel:requestCharged:PutObjectRetentionResponse' :: PutObjectRetentionResponse -> Maybe RequestCharged
requestCharged} -> Maybe RequestCharged
requestCharged) (\s :: PutObjectRetentionResponse
s@PutObjectRetentionResponse' {} Maybe RequestCharged
a -> PutObjectRetentionResponse
s {$sel:requestCharged:PutObjectRetentionResponse' :: Maybe RequestCharged
requestCharged = Maybe RequestCharged
a} :: PutObjectRetentionResponse)
putObjectRetentionResponse_httpStatus :: Lens.Lens' PutObjectRetentionResponse Prelude.Int
putObjectRetentionResponse_httpStatus :: (Int -> f Int)
-> PutObjectRetentionResponse -> f PutObjectRetentionResponse
putObjectRetentionResponse_httpStatus = (PutObjectRetentionResponse -> Int)
-> (PutObjectRetentionResponse
-> Int -> PutObjectRetentionResponse)
-> Lens
PutObjectRetentionResponse PutObjectRetentionResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObjectRetentionResponse' {Int
httpStatus :: Int
$sel:httpStatus:PutObjectRetentionResponse' :: PutObjectRetentionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: PutObjectRetentionResponse
s@PutObjectRetentionResponse' {} Int
a -> PutObjectRetentionResponse
s {$sel:httpStatus:PutObjectRetentionResponse' :: Int
httpStatus = Int
a} :: PutObjectRetentionResponse)
instance Prelude.NFData PutObjectRetentionResponse