{-# 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.PutPublicAccessBlock
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates or modifies the @PublicAccessBlock@ configuration for an Amazon
-- S3 bucket. To use this operation, you must have the
-- @s3:PutBucketPublicAccessBlock@ permission. For more information about
-- Amazon S3 permissions, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html Specifying Permissions in a Policy>.
--
-- When Amazon S3 evaluates the @PublicAccessBlock@ configuration for a
-- bucket or an object, it checks the @PublicAccessBlock@ configuration for
-- both the bucket (or the bucket that contains the object) and the bucket
-- owner\'s account. If the @PublicAccessBlock@ configurations are
-- different between the bucket and the account, Amazon S3 uses the most
-- restrictive combination of the bucket-level and account-level settings.
--
-- For more information about when Amazon S3 considers a bucket or an
-- object public, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html#access-control-block-public-access-policy-status The Meaning of \"Public\">.
--
-- __Related Resources__
--
-- -   <https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetPublicAccessBlock.html GetPublicAccessBlock>
--
-- -   <https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeletePublicAccessBlock.html DeletePublicAccessBlock>
--
-- -   <https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketPolicyStatus.html GetBucketPolicyStatus>
--
-- -   <https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html Using Amazon S3 Block Public Access>
module Amazonka.S3.PutPublicAccessBlock
  ( -- * Creating a Request
    PutPublicAccessBlock (..),
    newPutPublicAccessBlock,

    -- * Request Lenses
    putPublicAccessBlock_checksumAlgorithm,
    putPublicAccessBlock_contentMD5,
    putPublicAccessBlock_expectedBucketOwner,
    putPublicAccessBlock_bucket,
    putPublicAccessBlock_publicAccessBlockConfiguration,

    -- * Destructuring the Response
    PutPublicAccessBlockResponse (..),
    newPutPublicAccessBlockResponse,
  )
where

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

-- | /See:/ 'newPutPublicAccessBlock' smart constructor.
data PutPublicAccessBlock = PutPublicAccessBlock'
  { -- | Indicates the algorithm used to create the checksum for the object when
    -- using the SDK. This header will not provide any additional functionality
    -- if not using the SDK. When sending this header, there must be a
    -- corresponding @x-amz-checksum@ or @x-amz-trailer@ header sent.
    -- Otherwise, Amazon S3 fails the request with the HTTP status code
    -- @400 Bad Request@. For more information, see
    -- <https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html Checking object integrity>
    -- in the /Amazon S3 User Guide/.
    --
    -- If you provide an individual checksum, Amazon S3 ignores any provided
    -- @ChecksumAlgorithm@ parameter.
    PutPublicAccessBlock -> Maybe ChecksumAlgorithm
checksumAlgorithm :: Prelude.Maybe ChecksumAlgorithm,
    -- | The MD5 hash of the @PutPublicAccessBlock@ request body.
    --
    -- For requests made using the Amazon Web Services Command Line Interface
    -- (CLI) or Amazon Web Services SDKs, this field is calculated
    -- automatically.
    PutPublicAccessBlock -> Maybe Text
contentMD5 :: Prelude.Maybe Prelude.Text,
    -- | The account ID of the expected bucket owner. If the bucket is owned by a
    -- different account, the request fails with the HTTP status code
    -- @403 Forbidden@ (access denied).
    PutPublicAccessBlock -> Maybe Text
expectedBucketOwner :: Prelude.Maybe Prelude.Text,
    -- | The name of the Amazon S3 bucket whose @PublicAccessBlock@ configuration
    -- you want to set.
    PutPublicAccessBlock -> BucketName
bucket :: BucketName,
    -- | The @PublicAccessBlock@ configuration that you want to apply to this
    -- Amazon S3 bucket. You can enable the configuration options in any
    -- combination. For more information about when Amazon S3 considers a
    -- bucket or object public, see
    -- <https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html#access-control-block-public-access-policy-status The Meaning of \"Public\">
    -- in the /Amazon S3 User Guide/.
    PutPublicAccessBlock -> PublicAccessBlockConfiguration
publicAccessBlockConfiguration :: PublicAccessBlockConfiguration
  }
  deriving (PutPublicAccessBlock -> PutPublicAccessBlock -> Bool
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]
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
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. 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)

-- |
-- Create a value of 'PutPublicAccessBlock' 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:
--
-- 'checksumAlgorithm', 'putPublicAccessBlock_checksumAlgorithm' - Indicates the algorithm used to create the checksum for the object when
-- using the SDK. This header will not provide any additional functionality
-- if not using the SDK. When sending this header, there must be a
-- corresponding @x-amz-checksum@ or @x-amz-trailer@ header sent.
-- Otherwise, Amazon S3 fails the request with the HTTP status code
-- @400 Bad Request@. For more information, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html Checking object integrity>
-- in the /Amazon S3 User Guide/.
--
-- If you provide an individual checksum, Amazon S3 ignores any provided
-- @ChecksumAlgorithm@ parameter.
--
-- 'contentMD5', 'putPublicAccessBlock_contentMD5' - The MD5 hash of the @PutPublicAccessBlock@ request body.
--
-- For requests made using the Amazon Web Services Command Line Interface
-- (CLI) or Amazon Web Services SDKs, this field is calculated
-- automatically.
--
-- 'expectedBucketOwner', 'putPublicAccessBlock_expectedBucketOwner' - The account ID of the expected bucket owner. If the bucket is owned by a
-- different account, the request fails with the HTTP status code
-- @403 Forbidden@ (access denied).
--
-- 'bucket', 'putPublicAccessBlock_bucket' - The name of the Amazon S3 bucket whose @PublicAccessBlock@ configuration
-- you want to set.
--
-- 'publicAccessBlockConfiguration', 'putPublicAccessBlock_publicAccessBlockConfiguration' - The @PublicAccessBlock@ configuration that you want to apply to this
-- Amazon S3 bucket. You can enable the configuration options in any
-- combination. For more information about when Amazon S3 considers a
-- bucket or object public, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html#access-control-block-public-access-policy-status The Meaning of \"Public\">
-- in the /Amazon S3 User Guide/.
newPutPublicAccessBlock ::
  -- | 'bucket'
  BucketName ->
  -- | 'publicAccessBlockConfiguration'
  PublicAccessBlockConfiguration ->
  PutPublicAccessBlock
newPutPublicAccessBlock :: BucketName
-> PublicAccessBlockConfiguration -> PutPublicAccessBlock
newPutPublicAccessBlock
  BucketName
pBucket_
  PublicAccessBlockConfiguration
pPublicAccessBlockConfiguration_ =
    PutPublicAccessBlock'
      { $sel:checksumAlgorithm:PutPublicAccessBlock' :: Maybe ChecksumAlgorithm
checksumAlgorithm =
          forall a. Maybe a
Prelude.Nothing,
        $sel:contentMD5:PutPublicAccessBlock' :: Maybe Text
contentMD5 = forall a. Maybe a
Prelude.Nothing,
        $sel:expectedBucketOwner:PutPublicAccessBlock' :: Maybe Text
expectedBucketOwner = forall a. Maybe a
Prelude.Nothing,
        $sel:bucket:PutPublicAccessBlock' :: BucketName
bucket = BucketName
pBucket_,
        $sel:publicAccessBlockConfiguration:PutPublicAccessBlock' :: PublicAccessBlockConfiguration
publicAccessBlockConfiguration =
          PublicAccessBlockConfiguration
pPublicAccessBlockConfiguration_
      }

-- | Indicates the algorithm used to create the checksum for the object when
-- using the SDK. This header will not provide any additional functionality
-- if not using the SDK. When sending this header, there must be a
-- corresponding @x-amz-checksum@ or @x-amz-trailer@ header sent.
-- Otherwise, Amazon S3 fails the request with the HTTP status code
-- @400 Bad Request@. For more information, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html Checking object integrity>
-- in the /Amazon S3 User Guide/.
--
-- If you provide an individual checksum, Amazon S3 ignores any provided
-- @ChecksumAlgorithm@ parameter.
putPublicAccessBlock_checksumAlgorithm :: Lens.Lens' PutPublicAccessBlock (Prelude.Maybe ChecksumAlgorithm)
putPublicAccessBlock_checksumAlgorithm :: Lens' PutPublicAccessBlock (Maybe ChecksumAlgorithm)
putPublicAccessBlock_checksumAlgorithm = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutPublicAccessBlock' {Maybe ChecksumAlgorithm
checksumAlgorithm :: Maybe ChecksumAlgorithm
$sel:checksumAlgorithm:PutPublicAccessBlock' :: PutPublicAccessBlock -> Maybe ChecksumAlgorithm
checksumAlgorithm} -> Maybe ChecksumAlgorithm
checksumAlgorithm) (\s :: PutPublicAccessBlock
s@PutPublicAccessBlock' {} Maybe ChecksumAlgorithm
a -> PutPublicAccessBlock
s {$sel:checksumAlgorithm:PutPublicAccessBlock' :: Maybe ChecksumAlgorithm
checksumAlgorithm = Maybe ChecksumAlgorithm
a} :: PutPublicAccessBlock)

-- | The MD5 hash of the @PutPublicAccessBlock@ request body.
--
-- For requests made using the Amazon Web Services Command Line Interface
-- (CLI) or Amazon Web Services SDKs, this field is calculated
-- automatically.
putPublicAccessBlock_contentMD5 :: Lens.Lens' PutPublicAccessBlock (Prelude.Maybe Prelude.Text)
putPublicAccessBlock_contentMD5 :: Lens' PutPublicAccessBlock (Maybe Text)
putPublicAccessBlock_contentMD5 = 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)

-- | The account ID of the expected bucket owner. If the bucket is owned by a
-- different account, the request fails with the HTTP status code
-- @403 Forbidden@ (access denied).
putPublicAccessBlock_expectedBucketOwner :: Lens.Lens' PutPublicAccessBlock (Prelude.Maybe Prelude.Text)
putPublicAccessBlock_expectedBucketOwner :: Lens' PutPublicAccessBlock (Maybe Text)
putPublicAccessBlock_expectedBucketOwner = 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)

-- | The name of the Amazon S3 bucket whose @PublicAccessBlock@ configuration
-- you want to set.
putPublicAccessBlock_bucket :: Lens.Lens' PutPublicAccessBlock BucketName
putPublicAccessBlock_bucket :: Lens' PutPublicAccessBlock BucketName
putPublicAccessBlock_bucket = 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)

-- | The @PublicAccessBlock@ configuration that you want to apply to this
-- Amazon S3 bucket. You can enable the configuration options in any
-- combination. For more information about when Amazon S3 considers a
-- bucket or object public, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html#access-control-block-public-access-policy-status The Meaning of \"Public\">
-- in the /Amazon S3 User Guide/.
putPublicAccessBlock_publicAccessBlockConfiguration :: Lens.Lens' PutPublicAccessBlock PublicAccessBlockConfiguration
putPublicAccessBlock_publicAccessBlockConfiguration :: Lens' PutPublicAccessBlock PublicAccessBlockConfiguration
putPublicAccessBlock_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 :: (Service -> Service)
-> PutPublicAccessBlock -> Request PutPublicAccessBlock
request Service -> Service
overrides =
    forall a. Request a -> Request a
Request.s3vhost
      forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a. (ToRequest a, ToElement a) => Service -> a -> Request a
Request.putXML (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy PutPublicAccessBlock
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse PutPublicAccessBlock)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull PutPublicAccessBlockResponse
PutPublicAccessBlockResponse'

instance Prelude.Hashable PutPublicAccessBlock where
  hashWithSalt :: Int -> PutPublicAccessBlock -> Int
hashWithSalt Int
_salt PutPublicAccessBlock' {Maybe Text
Maybe ChecksumAlgorithm
BucketName
PublicAccessBlockConfiguration
publicAccessBlockConfiguration :: PublicAccessBlockConfiguration
bucket :: BucketName
expectedBucketOwner :: Maybe Text
contentMD5 :: Maybe Text
checksumAlgorithm :: Maybe ChecksumAlgorithm
$sel:publicAccessBlockConfiguration:PutPublicAccessBlock' :: PutPublicAccessBlock -> PublicAccessBlockConfiguration
$sel:bucket:PutPublicAccessBlock' :: PutPublicAccessBlock -> BucketName
$sel:expectedBucketOwner:PutPublicAccessBlock' :: PutPublicAccessBlock -> Maybe Text
$sel:contentMD5:PutPublicAccessBlock' :: PutPublicAccessBlock -> Maybe Text
$sel:checksumAlgorithm:PutPublicAccessBlock' :: PutPublicAccessBlock -> Maybe ChecksumAlgorithm
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ChecksumAlgorithm
checksumAlgorithm
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
contentMD5
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
expectedBucketOwner
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` BucketName
bucket
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` PublicAccessBlockConfiguration
publicAccessBlockConfiguration

instance Prelude.NFData PutPublicAccessBlock where
  rnf :: PutPublicAccessBlock -> ()
rnf PutPublicAccessBlock' {Maybe Text
Maybe ChecksumAlgorithm
BucketName
PublicAccessBlockConfiguration
publicAccessBlockConfiguration :: PublicAccessBlockConfiguration
bucket :: BucketName
expectedBucketOwner :: Maybe Text
contentMD5 :: Maybe Text
checksumAlgorithm :: Maybe ChecksumAlgorithm
$sel:publicAccessBlockConfiguration:PutPublicAccessBlock' :: PutPublicAccessBlock -> PublicAccessBlockConfiguration
$sel:bucket:PutPublicAccessBlock' :: PutPublicAccessBlock -> BucketName
$sel:expectedBucketOwner:PutPublicAccessBlock' :: PutPublicAccessBlock -> Maybe Text
$sel:contentMD5:PutPublicAccessBlock' :: PutPublicAccessBlock -> Maybe Text
$sel:checksumAlgorithm:PutPublicAccessBlock' :: PutPublicAccessBlock -> Maybe ChecksumAlgorithm
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe ChecksumAlgorithm
checksumAlgorithm
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
contentMD5
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
expectedBucketOwner
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf BucketName
bucket
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf PublicAccessBlockConfiguration
publicAccessBlockConfiguration

instance Data.ToElement PutPublicAccessBlock where
  toElement :: PutPublicAccessBlock -> Element
toElement PutPublicAccessBlock' {Maybe Text
Maybe ChecksumAlgorithm
BucketName
PublicAccessBlockConfiguration
publicAccessBlockConfiguration :: PublicAccessBlockConfiguration
bucket :: BucketName
expectedBucketOwner :: Maybe Text
contentMD5 :: Maybe Text
checksumAlgorithm :: Maybe ChecksumAlgorithm
$sel:publicAccessBlockConfiguration:PutPublicAccessBlock' :: PutPublicAccessBlock -> PublicAccessBlockConfiguration
$sel:bucket:PutPublicAccessBlock' :: PutPublicAccessBlock -> BucketName
$sel:expectedBucketOwner:PutPublicAccessBlock' :: PutPublicAccessBlock -> Maybe Text
$sel:contentMD5:PutPublicAccessBlock' :: PutPublicAccessBlock -> Maybe Text
$sel:checksumAlgorithm:PutPublicAccessBlock' :: PutPublicAccessBlock -> Maybe ChecksumAlgorithm
..} =
    forall a. ToXML a => Name -> a -> Element
Data.mkElement
      Name
"{http://s3.amazonaws.com/doc/2006-03-01/}PublicAccessBlockConfiguration"
      PublicAccessBlockConfiguration
publicAccessBlockConfiguration

instance Data.ToHeaders PutPublicAccessBlock where
  toHeaders :: PutPublicAccessBlock -> [Header]
toHeaders PutPublicAccessBlock' {Maybe Text
Maybe ChecksumAlgorithm
BucketName
PublicAccessBlockConfiguration
publicAccessBlockConfiguration :: PublicAccessBlockConfiguration
bucket :: BucketName
expectedBucketOwner :: Maybe Text
contentMD5 :: Maybe Text
checksumAlgorithm :: Maybe ChecksumAlgorithm
$sel:publicAccessBlockConfiguration:PutPublicAccessBlock' :: PutPublicAccessBlock -> PublicAccessBlockConfiguration
$sel:bucket:PutPublicAccessBlock' :: PutPublicAccessBlock -> BucketName
$sel:expectedBucketOwner:PutPublicAccessBlock' :: PutPublicAccessBlock -> Maybe Text
$sel:contentMD5:PutPublicAccessBlock' :: PutPublicAccessBlock -> Maybe Text
$sel:checksumAlgorithm:PutPublicAccessBlock' :: PutPublicAccessBlock -> Maybe ChecksumAlgorithm
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ HeaderName
"x-amz-sdk-checksum-algorithm"
          forall a. ToHeader a => HeaderName -> a -> [Header]
Data.=# Maybe ChecksumAlgorithm
checksumAlgorithm,
        HeaderName
"Content-MD5" forall a. ToHeader a => HeaderName -> a -> [Header]
Data.=# Maybe Text
contentMD5,
        HeaderName
"x-amz-expected-bucket-owner"
          forall a. ToHeader a => HeaderName -> a -> [Header]
Data.=# Maybe Text
expectedBucketOwner
      ]

instance Data.ToPath PutPublicAccessBlock where
  toPath :: PutPublicAccessBlock -> ByteString
toPath PutPublicAccessBlock' {Maybe Text
Maybe ChecksumAlgorithm
BucketName
PublicAccessBlockConfiguration
publicAccessBlockConfiguration :: PublicAccessBlockConfiguration
bucket :: BucketName
expectedBucketOwner :: Maybe Text
contentMD5 :: Maybe Text
checksumAlgorithm :: Maybe ChecksumAlgorithm
$sel:publicAccessBlockConfiguration:PutPublicAccessBlock' :: PutPublicAccessBlock -> PublicAccessBlockConfiguration
$sel:bucket:PutPublicAccessBlock' :: PutPublicAccessBlock -> BucketName
$sel:expectedBucketOwner:PutPublicAccessBlock' :: PutPublicAccessBlock -> Maybe Text
$sel:contentMD5:PutPublicAccessBlock' :: PutPublicAccessBlock -> Maybe Text
$sel:checksumAlgorithm:PutPublicAccessBlock' :: PutPublicAccessBlock -> Maybe ChecksumAlgorithm
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"/", forall a. ToByteString a => a -> ByteString
Data.toBS BucketName
bucket]

instance Data.ToQuery PutPublicAccessBlock where
  toQuery :: PutPublicAccessBlock -> QueryString
toQuery =
    forall a b. a -> b -> a
Prelude.const
      (forall a. Monoid a => [a] -> a
Prelude.mconcat [QueryString
"publicAccessBlock"])

-- | /See:/ 'newPutPublicAccessBlockResponse' smart constructor.
data PutPublicAccessBlockResponse = PutPublicAccessBlockResponse'
  {
  }
  deriving (PutPublicAccessBlockResponse
-> PutPublicAccessBlockResponse -> Bool
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]
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
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.
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)

-- |
-- Create a value of 'PutPublicAccessBlockResponse' 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.
newPutPublicAccessBlockResponse ::
  PutPublicAccessBlockResponse
newPutPublicAccessBlockResponse :: PutPublicAccessBlockResponse
newPutPublicAccessBlockResponse =
  PutPublicAccessBlockResponse
PutPublicAccessBlockResponse'

instance Prelude.NFData PutPublicAccessBlockResponse where
  rnf :: PutPublicAccessBlockResponse -> ()
rnf PutPublicAccessBlockResponse
_ = ()