{-# 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.PutBucketLogging
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Set the logging parameters for a bucket and to specify permissions for
-- who can view and modify the logging parameters. All logs are saved to
-- buckets in the same Amazon Web Services Region as the source bucket. To
-- set the logging status of a bucket, you must be the bucket owner.
--
-- The bucket owner is automatically granted FULL_CONTROL to all logs. You
-- use the @Grantee@ request element to grant access to other people. The
-- @Permissions@ request element specifies the kind of access the grantee
-- has to the logs.
--
-- If the target bucket for log delivery uses the bucket owner enforced
-- setting for S3 Object Ownership, you can\'t use the @Grantee@ request
-- element to grant access to others. Permissions can only be granted using
-- policies. For more information, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/userguide/enable-server-access-logging.html#grant-log-delivery-permissions-general Permissions for server access log delivery>
-- in the /Amazon S3 User Guide/.
--
-- __Grantee Values__
--
-- You can specify the person (grantee) to whom you\'re assigning access
-- rights (using request elements) in the following ways:
--
-- -   By the person\'s ID:
--
--     @\<Grantee xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\" xsi:type=\"CanonicalUser\">\<ID>\<>ID\<>\<\/ID>\<DisplayName>\<>GranteesEmail\<>\<\/DisplayName> \<\/Grantee>@
--
--     DisplayName is optional and ignored in the request.
--
-- -   By Email address:
--
--     @ \<Grantee xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\" xsi:type=\"AmazonCustomerByEmail\">\<EmailAddress>\<>Grantees\@email.com\<>\<\/EmailAddress>\<\/Grantee>@
--
--     The grantee is resolved to the CanonicalUser and, in a response to a
--     GET Object acl request, appears as the CanonicalUser.
--
-- -   By URI:
--
--     @\<Grantee xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\" xsi:type=\"Group\">\<URI>\<>http:\/\/acs.amazonaws.com\/groups\/global\/AuthenticatedUsers\<>\<\/URI>\<\/Grantee>@
--
-- To enable logging, you use LoggingEnabled and its children request
-- elements. To disable logging, you use an empty BucketLoggingStatus
-- request element:
--
-- @\<BucketLoggingStatus xmlns=\"http:\/\/doc.s3.amazonaws.com\/2006-03-01\" \/>@
--
-- For more information about server access logging, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/userguide/ServerLogs.html Server Access Logging>
-- in the /Amazon S3 User Guide/.
--
-- For more information about creating a bucket, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html CreateBucket>.
-- For more information about returning the logging status of a bucket, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLogging.html GetBucketLogging>.
--
-- The following operations are related to @PutBucketLogging@:
--
-- -   <https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html PutObject>
--
-- -   <https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucket.html DeleteBucket>
--
-- -   <https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html CreateBucket>
--
-- -   <https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLogging.html GetBucketLogging>
module Amazonka.S3.PutBucketLogging
  ( -- * Creating a Request
    PutBucketLogging (..),
    newPutBucketLogging,

    -- * Request Lenses
    putBucketLogging_checksumAlgorithm,
    putBucketLogging_contentMD5,
    putBucketLogging_expectedBucketOwner,
    putBucketLogging_bucket,
    putBucketLogging_bucketLoggingStatus,

    -- * Destructuring the Response
    PutBucketLoggingResponse (..),
    newPutBucketLoggingResponse,
  )
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:/ 'newPutBucketLogging' smart constructor.
data PutBucketLogging = PutBucketLogging'
  { -- | 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.
    PutBucketLogging -> Maybe ChecksumAlgorithm
checksumAlgorithm :: Prelude.Maybe ChecksumAlgorithm,
    -- | The MD5 hash of the @PutBucketLogging@ request body.
    --
    -- For requests made using the Amazon Web Services Command Line Interface
    -- (CLI) or Amazon Web Services SDKs, this field is calculated
    -- automatically.
    PutBucketLogging -> 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).
    PutBucketLogging -> Maybe Text
expectedBucketOwner :: Prelude.Maybe Prelude.Text,
    -- | The name of the bucket for which to set the logging parameters.
    PutBucketLogging -> BucketName
bucket :: BucketName,
    -- | Container for logging status information.
    PutBucketLogging -> BucketLoggingStatus
bucketLoggingStatus :: BucketLoggingStatus
  }
  deriving (PutBucketLogging -> PutBucketLogging -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutBucketLogging -> PutBucketLogging -> Bool
$c/= :: PutBucketLogging -> PutBucketLogging -> Bool
== :: PutBucketLogging -> PutBucketLogging -> Bool
$c== :: PutBucketLogging -> PutBucketLogging -> Bool
Prelude.Eq, ReadPrec [PutBucketLogging]
ReadPrec PutBucketLogging
Int -> ReadS PutBucketLogging
ReadS [PutBucketLogging]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutBucketLogging]
$creadListPrec :: ReadPrec [PutBucketLogging]
readPrec :: ReadPrec PutBucketLogging
$creadPrec :: ReadPrec PutBucketLogging
readList :: ReadS [PutBucketLogging]
$creadList :: ReadS [PutBucketLogging]
readsPrec :: Int -> ReadS PutBucketLogging
$creadsPrec :: Int -> ReadS PutBucketLogging
Prelude.Read, Int -> PutBucketLogging -> ShowS
[PutBucketLogging] -> ShowS
PutBucketLogging -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutBucketLogging] -> ShowS
$cshowList :: [PutBucketLogging] -> ShowS
show :: PutBucketLogging -> String
$cshow :: PutBucketLogging -> String
showsPrec :: Int -> PutBucketLogging -> ShowS
$cshowsPrec :: Int -> PutBucketLogging -> ShowS
Prelude.Show, forall x. Rep PutBucketLogging x -> PutBucketLogging
forall x. PutBucketLogging -> Rep PutBucketLogging x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutBucketLogging x -> PutBucketLogging
$cfrom :: forall x. PutBucketLogging -> Rep PutBucketLogging x
Prelude.Generic)

-- |
-- Create a value of 'PutBucketLogging' 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', 'putBucketLogging_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', 'putBucketLogging_contentMD5' - The MD5 hash of the @PutBucketLogging@ 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', 'putBucketLogging_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', 'putBucketLogging_bucket' - The name of the bucket for which to set the logging parameters.
--
-- 'bucketLoggingStatus', 'putBucketLogging_bucketLoggingStatus' - Container for logging status information.
newPutBucketLogging ::
  -- | 'bucket'
  BucketName ->
  -- | 'bucketLoggingStatus'
  BucketLoggingStatus ->
  PutBucketLogging
newPutBucketLogging :: BucketName -> BucketLoggingStatus -> PutBucketLogging
newPutBucketLogging BucketName
pBucket_ BucketLoggingStatus
pBucketLoggingStatus_ =
  PutBucketLogging'
    { $sel:checksumAlgorithm:PutBucketLogging' :: Maybe ChecksumAlgorithm
checksumAlgorithm =
        forall a. Maybe a
Prelude.Nothing,
      $sel:contentMD5:PutBucketLogging' :: Maybe Text
contentMD5 = forall a. Maybe a
Prelude.Nothing,
      $sel:expectedBucketOwner:PutBucketLogging' :: Maybe Text
expectedBucketOwner = forall a. Maybe a
Prelude.Nothing,
      $sel:bucket:PutBucketLogging' :: BucketName
bucket = BucketName
pBucket_,
      $sel:bucketLoggingStatus:PutBucketLogging' :: BucketLoggingStatus
bucketLoggingStatus = BucketLoggingStatus
pBucketLoggingStatus_
    }

-- | 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.
putBucketLogging_checksumAlgorithm :: Lens.Lens' PutBucketLogging (Prelude.Maybe ChecksumAlgorithm)
putBucketLogging_checksumAlgorithm :: Lens' PutBucketLogging (Maybe ChecksumAlgorithm)
putBucketLogging_checksumAlgorithm = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutBucketLogging' {Maybe ChecksumAlgorithm
checksumAlgorithm :: Maybe ChecksumAlgorithm
$sel:checksumAlgorithm:PutBucketLogging' :: PutBucketLogging -> Maybe ChecksumAlgorithm
checksumAlgorithm} -> Maybe ChecksumAlgorithm
checksumAlgorithm) (\s :: PutBucketLogging
s@PutBucketLogging' {} Maybe ChecksumAlgorithm
a -> PutBucketLogging
s {$sel:checksumAlgorithm:PutBucketLogging' :: Maybe ChecksumAlgorithm
checksumAlgorithm = Maybe ChecksumAlgorithm
a} :: PutBucketLogging)

-- | The MD5 hash of the @PutBucketLogging@ request body.
--
-- For requests made using the Amazon Web Services Command Line Interface
-- (CLI) or Amazon Web Services SDKs, this field is calculated
-- automatically.
putBucketLogging_contentMD5 :: Lens.Lens' PutBucketLogging (Prelude.Maybe Prelude.Text)
putBucketLogging_contentMD5 :: Lens' PutBucketLogging (Maybe Text)
putBucketLogging_contentMD5 = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutBucketLogging' {Maybe Text
contentMD5 :: Maybe Text
$sel:contentMD5:PutBucketLogging' :: PutBucketLogging -> Maybe Text
contentMD5} -> Maybe Text
contentMD5) (\s :: PutBucketLogging
s@PutBucketLogging' {} Maybe Text
a -> PutBucketLogging
s {$sel:contentMD5:PutBucketLogging' :: Maybe Text
contentMD5 = Maybe Text
a} :: PutBucketLogging)

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

-- | The name of the bucket for which to set the logging parameters.
putBucketLogging_bucket :: Lens.Lens' PutBucketLogging BucketName
putBucketLogging_bucket :: Lens' PutBucketLogging BucketName
putBucketLogging_bucket = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutBucketLogging' {BucketName
bucket :: BucketName
$sel:bucket:PutBucketLogging' :: PutBucketLogging -> BucketName
bucket} -> BucketName
bucket) (\s :: PutBucketLogging
s@PutBucketLogging' {} BucketName
a -> PutBucketLogging
s {$sel:bucket:PutBucketLogging' :: BucketName
bucket = BucketName
a} :: PutBucketLogging)

-- | Container for logging status information.
putBucketLogging_bucketLoggingStatus :: Lens.Lens' PutBucketLogging BucketLoggingStatus
putBucketLogging_bucketLoggingStatus :: Lens' PutBucketLogging BucketLoggingStatus
putBucketLogging_bucketLoggingStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutBucketLogging' {BucketLoggingStatus
bucketLoggingStatus :: BucketLoggingStatus
$sel:bucketLoggingStatus:PutBucketLogging' :: PutBucketLogging -> BucketLoggingStatus
bucketLoggingStatus} -> BucketLoggingStatus
bucketLoggingStatus) (\s :: PutBucketLogging
s@PutBucketLogging' {} BucketLoggingStatus
a -> PutBucketLogging
s {$sel:bucketLoggingStatus:PutBucketLogging' :: BucketLoggingStatus
bucketLoggingStatus = BucketLoggingStatus
a} :: PutBucketLogging)

instance Core.AWSRequest PutBucketLogging where
  type
    AWSResponse PutBucketLogging =
      PutBucketLoggingResponse
  request :: (Service -> Service)
-> PutBucketLogging -> Request PutBucketLogging
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 PutBucketLogging
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse PutBucketLogging)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull PutBucketLoggingResponse
PutBucketLoggingResponse'

instance Prelude.Hashable PutBucketLogging where
  hashWithSalt :: Int -> PutBucketLogging -> Int
hashWithSalt Int
_salt PutBucketLogging' {Maybe Text
Maybe ChecksumAlgorithm
BucketName
BucketLoggingStatus
bucketLoggingStatus :: BucketLoggingStatus
bucket :: BucketName
expectedBucketOwner :: Maybe Text
contentMD5 :: Maybe Text
checksumAlgorithm :: Maybe ChecksumAlgorithm
$sel:bucketLoggingStatus:PutBucketLogging' :: PutBucketLogging -> BucketLoggingStatus
$sel:bucket:PutBucketLogging' :: PutBucketLogging -> BucketName
$sel:expectedBucketOwner:PutBucketLogging' :: PutBucketLogging -> Maybe Text
$sel:contentMD5:PutBucketLogging' :: PutBucketLogging -> Maybe Text
$sel:checksumAlgorithm:PutBucketLogging' :: PutBucketLogging -> 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` BucketLoggingStatus
bucketLoggingStatus

instance Prelude.NFData PutBucketLogging where
  rnf :: PutBucketLogging -> ()
rnf PutBucketLogging' {Maybe Text
Maybe ChecksumAlgorithm
BucketName
BucketLoggingStatus
bucketLoggingStatus :: BucketLoggingStatus
bucket :: BucketName
expectedBucketOwner :: Maybe Text
contentMD5 :: Maybe Text
checksumAlgorithm :: Maybe ChecksumAlgorithm
$sel:bucketLoggingStatus:PutBucketLogging' :: PutBucketLogging -> BucketLoggingStatus
$sel:bucket:PutBucketLogging' :: PutBucketLogging -> BucketName
$sel:expectedBucketOwner:PutBucketLogging' :: PutBucketLogging -> Maybe Text
$sel:contentMD5:PutBucketLogging' :: PutBucketLogging -> Maybe Text
$sel:checksumAlgorithm:PutBucketLogging' :: PutBucketLogging -> 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 BucketLoggingStatus
bucketLoggingStatus

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

instance Data.ToHeaders PutBucketLogging where
  toHeaders :: PutBucketLogging -> [Header]
toHeaders PutBucketLogging' {Maybe Text
Maybe ChecksumAlgorithm
BucketName
BucketLoggingStatus
bucketLoggingStatus :: BucketLoggingStatus
bucket :: BucketName
expectedBucketOwner :: Maybe Text
contentMD5 :: Maybe Text
checksumAlgorithm :: Maybe ChecksumAlgorithm
$sel:bucketLoggingStatus:PutBucketLogging' :: PutBucketLogging -> BucketLoggingStatus
$sel:bucket:PutBucketLogging' :: PutBucketLogging -> BucketName
$sel:expectedBucketOwner:PutBucketLogging' :: PutBucketLogging -> Maybe Text
$sel:contentMD5:PutBucketLogging' :: PutBucketLogging -> Maybe Text
$sel:checksumAlgorithm:PutBucketLogging' :: PutBucketLogging -> 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 PutBucketLogging where
  toPath :: PutBucketLogging -> ByteString
toPath PutBucketLogging' {Maybe Text
Maybe ChecksumAlgorithm
BucketName
BucketLoggingStatus
bucketLoggingStatus :: BucketLoggingStatus
bucket :: BucketName
expectedBucketOwner :: Maybe Text
contentMD5 :: Maybe Text
checksumAlgorithm :: Maybe ChecksumAlgorithm
$sel:bucketLoggingStatus:PutBucketLogging' :: PutBucketLogging -> BucketLoggingStatus
$sel:bucket:PutBucketLogging' :: PutBucketLogging -> BucketName
$sel:expectedBucketOwner:PutBucketLogging' :: PutBucketLogging -> Maybe Text
$sel:contentMD5:PutBucketLogging' :: PutBucketLogging -> Maybe Text
$sel:checksumAlgorithm:PutBucketLogging' :: PutBucketLogging -> Maybe ChecksumAlgorithm
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"/", forall a. ToByteString a => a -> ByteString
Data.toBS BucketName
bucket]

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

-- | /See:/ 'newPutBucketLoggingResponse' smart constructor.
data PutBucketLoggingResponse = PutBucketLoggingResponse'
  {
  }
  deriving (PutBucketLoggingResponse -> PutBucketLoggingResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutBucketLoggingResponse -> PutBucketLoggingResponse -> Bool
$c/= :: PutBucketLoggingResponse -> PutBucketLoggingResponse -> Bool
== :: PutBucketLoggingResponse -> PutBucketLoggingResponse -> Bool
$c== :: PutBucketLoggingResponse -> PutBucketLoggingResponse -> Bool
Prelude.Eq, ReadPrec [PutBucketLoggingResponse]
ReadPrec PutBucketLoggingResponse
Int -> ReadS PutBucketLoggingResponse
ReadS [PutBucketLoggingResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutBucketLoggingResponse]
$creadListPrec :: ReadPrec [PutBucketLoggingResponse]
readPrec :: ReadPrec PutBucketLoggingResponse
$creadPrec :: ReadPrec PutBucketLoggingResponse
readList :: ReadS [PutBucketLoggingResponse]
$creadList :: ReadS [PutBucketLoggingResponse]
readsPrec :: Int -> ReadS PutBucketLoggingResponse
$creadsPrec :: Int -> ReadS PutBucketLoggingResponse
Prelude.Read, Int -> PutBucketLoggingResponse -> ShowS
[PutBucketLoggingResponse] -> ShowS
PutBucketLoggingResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutBucketLoggingResponse] -> ShowS
$cshowList :: [PutBucketLoggingResponse] -> ShowS
show :: PutBucketLoggingResponse -> String
$cshow :: PutBucketLoggingResponse -> String
showsPrec :: Int -> PutBucketLoggingResponse -> ShowS
$cshowsPrec :: Int -> PutBucketLoggingResponse -> ShowS
Prelude.Show, forall x.
Rep PutBucketLoggingResponse x -> PutBucketLoggingResponse
forall x.
PutBucketLoggingResponse -> Rep PutBucketLoggingResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutBucketLoggingResponse x -> PutBucketLoggingResponse
$cfrom :: forall x.
PutBucketLoggingResponse -> Rep PutBucketLoggingResponse x
Prelude.Generic)

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

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