{-# 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.PutPublicAccessBlock
(
PutPublicAccessBlock (..),
newPutPublicAccessBlock,
putPublicAccessBlock_contentMD5,
putPublicAccessBlock_expectedBucketOwner,
putPublicAccessBlock_bucket,
putPublicAccessBlock_publicAccessBlockConfiguration,
PutPublicAccessBlockResponse (..),
newPutPublicAccessBlockResponse,
)
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 PutPublicAccessBlock = PutPublicAccessBlock'
{
PutPublicAccessBlock -> Maybe Text
contentMD5 :: Prelude.Maybe Prelude.Text,
PutPublicAccessBlock -> Maybe Text
expectedBucketOwner :: Prelude.Maybe Prelude.Text,
PutPublicAccessBlock -> BucketName
bucket :: BucketName,
PutPublicAccessBlock -> PublicAccessBlockConfiguration
publicAccessBlockConfiguration :: PublicAccessBlockConfiguration
}
deriving (PutPublicAccessBlock -> PutPublicAccessBlock -> Bool
(PutPublicAccessBlock -> PutPublicAccessBlock -> Bool)
-> (PutPublicAccessBlock -> PutPublicAccessBlock -> Bool)
-> Eq PutPublicAccessBlock
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutPublicAccessBlock -> PutPublicAccessBlock -> Bool
$c/= :: PutPublicAccessBlock -> PutPublicAccessBlock -> Bool
== :: PutPublicAccessBlock -> PutPublicAccessBlock -> Bool
$c== :: PutPublicAccessBlock -> PutPublicAccessBlock -> Bool
Prelude.Eq, ReadPrec [PutPublicAccessBlock]
ReadPrec PutPublicAccessBlock
Int -> ReadS PutPublicAccessBlock
ReadS [PutPublicAccessBlock]
(Int -> ReadS PutPublicAccessBlock)
-> ReadS [PutPublicAccessBlock]
-> ReadPrec PutPublicAccessBlock
-> ReadPrec [PutPublicAccessBlock]
-> Read PutPublicAccessBlock
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutPublicAccessBlock]
$creadListPrec :: ReadPrec [PutPublicAccessBlock]
readPrec :: ReadPrec PutPublicAccessBlock
$creadPrec :: ReadPrec PutPublicAccessBlock
readList :: ReadS [PutPublicAccessBlock]
$creadList :: ReadS [PutPublicAccessBlock]
readsPrec :: Int -> ReadS PutPublicAccessBlock
$creadsPrec :: Int -> ReadS PutPublicAccessBlock
Prelude.Read, Int -> PutPublicAccessBlock -> ShowS
[PutPublicAccessBlock] -> ShowS
PutPublicAccessBlock -> String
(Int -> PutPublicAccessBlock -> ShowS)
-> (PutPublicAccessBlock -> String)
-> ([PutPublicAccessBlock] -> ShowS)
-> Show PutPublicAccessBlock
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutPublicAccessBlock] -> ShowS
$cshowList :: [PutPublicAccessBlock] -> ShowS
show :: PutPublicAccessBlock -> String
$cshow :: PutPublicAccessBlock -> String
showsPrec :: Int -> PutPublicAccessBlock -> ShowS
$cshowsPrec :: Int -> PutPublicAccessBlock -> ShowS
Prelude.Show, (forall x. PutPublicAccessBlock -> Rep PutPublicAccessBlock x)
-> (forall x. Rep PutPublicAccessBlock x -> PutPublicAccessBlock)
-> Generic PutPublicAccessBlock
forall x. Rep PutPublicAccessBlock x -> PutPublicAccessBlock
forall x. PutPublicAccessBlock -> Rep PutPublicAccessBlock x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutPublicAccessBlock x -> PutPublicAccessBlock
$cfrom :: forall x. PutPublicAccessBlock -> Rep PutPublicAccessBlock x
Prelude.Generic)
newPutPublicAccessBlock ::
BucketName ->
PublicAccessBlockConfiguration ->
PutPublicAccessBlock
newPutPublicAccessBlock :: BucketName
-> PublicAccessBlockConfiguration -> PutPublicAccessBlock
newPutPublicAccessBlock
BucketName
pBucket_
PublicAccessBlockConfiguration
pPublicAccessBlockConfiguration_ =
PutPublicAccessBlock' :: Maybe Text
-> Maybe Text
-> BucketName
-> PublicAccessBlockConfiguration
-> PutPublicAccessBlock
PutPublicAccessBlock'
{ $sel:contentMD5:PutPublicAccessBlock' :: Maybe Text
contentMD5 = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:expectedBucketOwner:PutPublicAccessBlock' :: Maybe Text
expectedBucketOwner = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:bucket:PutPublicAccessBlock' :: BucketName
bucket = BucketName
pBucket_,
$sel:publicAccessBlockConfiguration:PutPublicAccessBlock' :: PublicAccessBlockConfiguration
publicAccessBlockConfiguration =
PublicAccessBlockConfiguration
pPublicAccessBlockConfiguration_
}
putPublicAccessBlock_contentMD5 :: Lens.Lens' PutPublicAccessBlock (Prelude.Maybe Prelude.Text)
putPublicAccessBlock_contentMD5 :: (Maybe Text -> f (Maybe Text))
-> PutPublicAccessBlock -> f PutPublicAccessBlock
putPublicAccessBlock_contentMD5 = (PutPublicAccessBlock -> Maybe Text)
-> (PutPublicAccessBlock -> Maybe Text -> PutPublicAccessBlock)
-> Lens
PutPublicAccessBlock PutPublicAccessBlock (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutPublicAccessBlock' {Maybe Text
contentMD5 :: Maybe Text
$sel:contentMD5:PutPublicAccessBlock' :: PutPublicAccessBlock -> Maybe Text
contentMD5} -> Maybe Text
contentMD5) (\s :: PutPublicAccessBlock
s@PutPublicAccessBlock' {} Maybe Text
a -> PutPublicAccessBlock
s {$sel:contentMD5:PutPublicAccessBlock' :: Maybe Text
contentMD5 = Maybe Text
a} :: PutPublicAccessBlock)
putPublicAccessBlock_expectedBucketOwner :: Lens.Lens' PutPublicAccessBlock (Prelude.Maybe Prelude.Text)
putPublicAccessBlock_expectedBucketOwner :: (Maybe Text -> f (Maybe Text))
-> PutPublicAccessBlock -> f PutPublicAccessBlock
putPublicAccessBlock_expectedBucketOwner = (PutPublicAccessBlock -> Maybe Text)
-> (PutPublicAccessBlock -> Maybe Text -> PutPublicAccessBlock)
-> Lens
PutPublicAccessBlock PutPublicAccessBlock (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutPublicAccessBlock' {Maybe Text
expectedBucketOwner :: Maybe Text
$sel:expectedBucketOwner:PutPublicAccessBlock' :: PutPublicAccessBlock -> Maybe Text
expectedBucketOwner} -> Maybe Text
expectedBucketOwner) (\s :: PutPublicAccessBlock
s@PutPublicAccessBlock' {} Maybe Text
a -> PutPublicAccessBlock
s {$sel:expectedBucketOwner:PutPublicAccessBlock' :: Maybe Text
expectedBucketOwner = Maybe Text
a} :: PutPublicAccessBlock)
putPublicAccessBlock_bucket :: Lens.Lens' PutPublicAccessBlock BucketName
putPublicAccessBlock_bucket :: (BucketName -> f BucketName)
-> PutPublicAccessBlock -> f PutPublicAccessBlock
putPublicAccessBlock_bucket = (PutPublicAccessBlock -> BucketName)
-> (PutPublicAccessBlock -> BucketName -> PutPublicAccessBlock)
-> Lens
PutPublicAccessBlock PutPublicAccessBlock BucketName BucketName
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutPublicAccessBlock' {BucketName
bucket :: BucketName
$sel:bucket:PutPublicAccessBlock' :: PutPublicAccessBlock -> BucketName
bucket} -> BucketName
bucket) (\s :: PutPublicAccessBlock
s@PutPublicAccessBlock' {} BucketName
a -> PutPublicAccessBlock
s {$sel:bucket:PutPublicAccessBlock' :: BucketName
bucket = BucketName
a} :: PutPublicAccessBlock)
putPublicAccessBlock_publicAccessBlockConfiguration :: Lens.Lens' PutPublicAccessBlock PublicAccessBlockConfiguration
putPublicAccessBlock_publicAccessBlockConfiguration :: (PublicAccessBlockConfiguration
-> f PublicAccessBlockConfiguration)
-> PutPublicAccessBlock -> f PutPublicAccessBlock
putPublicAccessBlock_publicAccessBlockConfiguration = (PutPublicAccessBlock -> PublicAccessBlockConfiguration)
-> (PutPublicAccessBlock
-> PublicAccessBlockConfiguration -> PutPublicAccessBlock)
-> Lens
PutPublicAccessBlock
PutPublicAccessBlock
PublicAccessBlockConfiguration
PublicAccessBlockConfiguration
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutPublicAccessBlock' {PublicAccessBlockConfiguration
publicAccessBlockConfiguration :: PublicAccessBlockConfiguration
$sel:publicAccessBlockConfiguration:PutPublicAccessBlock' :: PutPublicAccessBlock -> PublicAccessBlockConfiguration
publicAccessBlockConfiguration} -> PublicAccessBlockConfiguration
publicAccessBlockConfiguration) (\s :: PutPublicAccessBlock
s@PutPublicAccessBlock' {} PublicAccessBlockConfiguration
a -> PutPublicAccessBlock
s {$sel:publicAccessBlockConfiguration:PutPublicAccessBlock' :: PublicAccessBlockConfiguration
publicAccessBlockConfiguration = PublicAccessBlockConfiguration
a} :: PutPublicAccessBlock)
instance Core.AWSRequest PutPublicAccessBlock where
type
AWSResponse PutPublicAccessBlock =
PutPublicAccessBlockResponse
request :: PutPublicAccessBlock -> Request PutPublicAccessBlock
request =
Request PutPublicAccessBlock -> Request PutPublicAccessBlock
forall a. Request a -> Request a
Request.s3vhost
(Request PutPublicAccessBlock -> Request PutPublicAccessBlock)
-> (PutPublicAccessBlock -> Request PutPublicAccessBlock)
-> PutPublicAccessBlock
-> Request PutPublicAccessBlock
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Service -> PutPublicAccessBlock -> Request PutPublicAccessBlock
forall a. (ToRequest a, ToElement a) => Service -> a -> Request a
Request.putXML Service
defaultService
response :: Logger
-> Service
-> Proxy PutPublicAccessBlock
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse PutPublicAccessBlock)))
response =
AWSResponse PutPublicAccessBlock
-> Logger
-> Service
-> Proxy PutPublicAccessBlock
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse PutPublicAccessBlock)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse PutPublicAccessBlock
PutPublicAccessBlockResponse
PutPublicAccessBlockResponse'
instance Prelude.Hashable PutPublicAccessBlock
instance Prelude.NFData PutPublicAccessBlock
instance Core.ToElement PutPublicAccessBlock where
toElement :: PutPublicAccessBlock -> Element
toElement PutPublicAccessBlock' {Maybe Text
BucketName
PublicAccessBlockConfiguration
publicAccessBlockConfiguration :: PublicAccessBlockConfiguration
bucket :: BucketName
expectedBucketOwner :: Maybe Text
contentMD5 :: Maybe Text
$sel:publicAccessBlockConfiguration:PutPublicAccessBlock' :: PutPublicAccessBlock -> PublicAccessBlockConfiguration
$sel:bucket:PutPublicAccessBlock' :: PutPublicAccessBlock -> BucketName
$sel:expectedBucketOwner:PutPublicAccessBlock' :: PutPublicAccessBlock -> Maybe Text
$sel:contentMD5:PutPublicAccessBlock' :: PutPublicAccessBlock -> Maybe Text
..} =
Name -> PublicAccessBlockConfiguration -> Element
forall a. ToXML a => Name -> a -> Element
Core.mkElement
Name
"{http://s3.amazonaws.com/doc/2006-03-01/}PublicAccessBlockConfiguration"
PublicAccessBlockConfiguration
publicAccessBlockConfiguration
instance Core.ToHeaders PutPublicAccessBlock where
toHeaders :: PutPublicAccessBlock -> [Header]
toHeaders PutPublicAccessBlock' {Maybe Text
BucketName
PublicAccessBlockConfiguration
publicAccessBlockConfiguration :: PublicAccessBlockConfiguration
bucket :: BucketName
expectedBucketOwner :: Maybe Text
contentMD5 :: Maybe Text
$sel:publicAccessBlockConfiguration:PutPublicAccessBlock' :: PutPublicAccessBlock -> PublicAccessBlockConfiguration
$sel:bucket:PutPublicAccessBlock' :: PutPublicAccessBlock -> BucketName
$sel:expectedBucketOwner:PutPublicAccessBlock' :: PutPublicAccessBlock -> Maybe Text
$sel:contentMD5:PutPublicAccessBlock' :: PutPublicAccessBlock -> Maybe Text
..} =
[[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-MD5" HeaderName -> Maybe Text -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# Maybe Text
contentMD5,
HeaderName
"x-amz-expected-bucket-owner"
HeaderName -> Maybe Text -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# Maybe Text
expectedBucketOwner
]
instance Core.ToPath PutPublicAccessBlock where
toPath :: PutPublicAccessBlock -> ByteString
toPath PutPublicAccessBlock' {Maybe Text
BucketName
PublicAccessBlockConfiguration
publicAccessBlockConfiguration :: PublicAccessBlockConfiguration
bucket :: BucketName
expectedBucketOwner :: Maybe Text
contentMD5 :: Maybe Text
$sel:publicAccessBlockConfiguration:PutPublicAccessBlock' :: PutPublicAccessBlock -> PublicAccessBlockConfiguration
$sel:bucket:PutPublicAccessBlock' :: PutPublicAccessBlock -> BucketName
$sel:expectedBucketOwner:PutPublicAccessBlock' :: PutPublicAccessBlock -> Maybe Text
$sel:contentMD5:PutPublicAccessBlock' :: PutPublicAccessBlock -> Maybe Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"/", BucketName -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS BucketName
bucket]
instance Core.ToQuery PutPublicAccessBlock where
toQuery :: PutPublicAccessBlock -> QueryString
toQuery =
QueryString -> PutPublicAccessBlock -> QueryString
forall a b. a -> b -> a
Prelude.const
([QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat [QueryString
"publicAccessBlock"])
data PutPublicAccessBlockResponse = PutPublicAccessBlockResponse'
{
}
deriving (PutPublicAccessBlockResponse
-> PutPublicAccessBlockResponse -> Bool
(PutPublicAccessBlockResponse
-> PutPublicAccessBlockResponse -> Bool)
-> (PutPublicAccessBlockResponse
-> PutPublicAccessBlockResponse -> Bool)
-> Eq PutPublicAccessBlockResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutPublicAccessBlockResponse
-> PutPublicAccessBlockResponse -> Bool
$c/= :: PutPublicAccessBlockResponse
-> PutPublicAccessBlockResponse -> Bool
== :: PutPublicAccessBlockResponse
-> PutPublicAccessBlockResponse -> Bool
$c== :: PutPublicAccessBlockResponse
-> PutPublicAccessBlockResponse -> Bool
Prelude.Eq, ReadPrec [PutPublicAccessBlockResponse]
ReadPrec PutPublicAccessBlockResponse
Int -> ReadS PutPublicAccessBlockResponse
ReadS [PutPublicAccessBlockResponse]
(Int -> ReadS PutPublicAccessBlockResponse)
-> ReadS [PutPublicAccessBlockResponse]
-> ReadPrec PutPublicAccessBlockResponse
-> ReadPrec [PutPublicAccessBlockResponse]
-> Read PutPublicAccessBlockResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutPublicAccessBlockResponse]
$creadListPrec :: ReadPrec [PutPublicAccessBlockResponse]
readPrec :: ReadPrec PutPublicAccessBlockResponse
$creadPrec :: ReadPrec PutPublicAccessBlockResponse
readList :: ReadS [PutPublicAccessBlockResponse]
$creadList :: ReadS [PutPublicAccessBlockResponse]
readsPrec :: Int -> ReadS PutPublicAccessBlockResponse
$creadsPrec :: Int -> ReadS PutPublicAccessBlockResponse
Prelude.Read, Int -> PutPublicAccessBlockResponse -> ShowS
[PutPublicAccessBlockResponse] -> ShowS
PutPublicAccessBlockResponse -> String
(Int -> PutPublicAccessBlockResponse -> ShowS)
-> (PutPublicAccessBlockResponse -> String)
-> ([PutPublicAccessBlockResponse] -> ShowS)
-> Show PutPublicAccessBlockResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutPublicAccessBlockResponse] -> ShowS
$cshowList :: [PutPublicAccessBlockResponse] -> ShowS
show :: PutPublicAccessBlockResponse -> String
$cshow :: PutPublicAccessBlockResponse -> String
showsPrec :: Int -> PutPublicAccessBlockResponse -> ShowS
$cshowsPrec :: Int -> PutPublicAccessBlockResponse -> ShowS
Prelude.Show, (forall x.
PutPublicAccessBlockResponse -> Rep PutPublicAccessBlockResponse x)
-> (forall x.
Rep PutPublicAccessBlockResponse x -> PutPublicAccessBlockResponse)
-> Generic PutPublicAccessBlockResponse
forall x.
Rep PutPublicAccessBlockResponse x -> PutPublicAccessBlockResponse
forall x.
PutPublicAccessBlockResponse -> Rep PutPublicAccessBlockResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutPublicAccessBlockResponse x -> PutPublicAccessBlockResponse
$cfrom :: forall x.
PutPublicAccessBlockResponse -> Rep PutPublicAccessBlockResponse x
Prelude.Generic)
newPutPublicAccessBlockResponse ::
PutPublicAccessBlockResponse
newPutPublicAccessBlockResponse :: PutPublicAccessBlockResponse
newPutPublicAccessBlockResponse =
PutPublicAccessBlockResponse
PutPublicAccessBlockResponse'
instance Prelude.NFData PutPublicAccessBlockResponse