{-# 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.PutBucketAnalyticsConfiguration
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Sets an analytics configuration for the bucket (specified by the
-- analytics configuration ID). You can have up to 1,000 analytics
-- configurations per bucket.
--
-- You can choose to have storage class analysis export analysis reports
-- sent to a comma-separated values (CSV) flat file. See the @DataExport@
-- request element. Reports are updated daily and are based on the object
-- filters that you configure. When selecting data export, you specify a
-- destination bucket and an optional destination prefix where the file is
-- written. You can export the data to a destination bucket in a different
-- account. However, the destination bucket must be in the same Region as
-- the bucket that you are making the PUT analytics configuration to. For
-- more information, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/analytics-storage-class.html Amazon S3 Analytics – Storage Class Analysis>.
--
-- You must create a bucket policy on the destination bucket where the
-- exported file is written to grant permissions to Amazon S3 to write
-- objects to the bucket. For an example policy, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/example-bucket-policies.html#example-bucket-policies-use-case-9 Granting Permissions for Amazon S3 Inventory and Storage Class Analysis>.
--
-- To use this operation, you must have permissions to perform the
-- @s3:PutAnalyticsConfiguration@ action. The bucket owner has this
-- permission by default. The bucket owner can grant this permission to
-- others. For more information about permissions, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources Permissions Related to Bucket Subresource Operations>
-- and
-- <https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html Managing Access Permissions to Your Amazon S3 Resources>.
--
-- __Special Errors__
--
-- -   -   /HTTP Error: HTTP 400 Bad Request/
--
--     -   /Code: InvalidArgument/
--
--     -   /Cause: Invalid argument./
--
-- -   -   /HTTP Error: HTTP 400 Bad Request/
--
--     -   /Code: TooManyConfigurations/
--
--     -   /Cause: You are attempting to create a new configuration but
--         have already reached the 1,000-configuration limit./
--
-- -   -   /HTTP Error: HTTP 403 Forbidden/
--
--     -   /Code: AccessDenied/
--
--     -   /Cause: You are not the owner of the specified bucket, or you do
--         not have the s3:PutAnalyticsConfiguration bucket permission to
--         set the configuration on the bucket./
--
-- __Related Resources__
--
-- -   <https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketAnalyticsConfiguration.html GetBucketAnalyticsConfiguration>
--
-- -   <https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketAnalyticsConfiguration.html DeleteBucketAnalyticsConfiguration>
--
-- -   <https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketAnalyticsConfigurations.html ListBucketAnalyticsConfigurations>
module Amazonka.S3.PutBucketAnalyticsConfiguration
  ( -- * Creating a Request
    PutBucketAnalyticsConfiguration (..),
    newPutBucketAnalyticsConfiguration,

    -- * Request Lenses
    putBucketAnalyticsConfiguration_expectedBucketOwner,
    putBucketAnalyticsConfiguration_bucket,
    putBucketAnalyticsConfiguration_id,
    putBucketAnalyticsConfiguration_analyticsConfiguration,

    -- * Destructuring the Response
    PutBucketAnalyticsConfigurationResponse (..),
    newPutBucketAnalyticsConfigurationResponse,
  )
where

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

-- | /See:/ 'newPutBucketAnalyticsConfiguration' smart constructor.
data PutBucketAnalyticsConfiguration = PutBucketAnalyticsConfiguration'
  { -- | The account ID of the expected bucket owner. If the bucket is owned by a
    -- different account, the request will fail with an HTTP
    -- @403 (Access Denied)@ error.
    PutBucketAnalyticsConfiguration -> Maybe Text
expectedBucketOwner :: Prelude.Maybe Prelude.Text,
    -- | The name of the bucket to which an analytics configuration is stored.
    PutBucketAnalyticsConfiguration -> BucketName
bucket :: BucketName,
    -- | The ID that identifies the analytics configuration.
    PutBucketAnalyticsConfiguration -> Text
id :: Prelude.Text,
    -- | The configuration and any analyses for the analytics filter.
    PutBucketAnalyticsConfiguration -> AnalyticsConfiguration
analyticsConfiguration :: AnalyticsConfiguration
  }
  deriving (PutBucketAnalyticsConfiguration
-> PutBucketAnalyticsConfiguration -> Bool
(PutBucketAnalyticsConfiguration
 -> PutBucketAnalyticsConfiguration -> Bool)
-> (PutBucketAnalyticsConfiguration
    -> PutBucketAnalyticsConfiguration -> Bool)
-> Eq PutBucketAnalyticsConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutBucketAnalyticsConfiguration
-> PutBucketAnalyticsConfiguration -> Bool
$c/= :: PutBucketAnalyticsConfiguration
-> PutBucketAnalyticsConfiguration -> Bool
== :: PutBucketAnalyticsConfiguration
-> PutBucketAnalyticsConfiguration -> Bool
$c== :: PutBucketAnalyticsConfiguration
-> PutBucketAnalyticsConfiguration -> Bool
Prelude.Eq, ReadPrec [PutBucketAnalyticsConfiguration]
ReadPrec PutBucketAnalyticsConfiguration
Int -> ReadS PutBucketAnalyticsConfiguration
ReadS [PutBucketAnalyticsConfiguration]
(Int -> ReadS PutBucketAnalyticsConfiguration)
-> ReadS [PutBucketAnalyticsConfiguration]
-> ReadPrec PutBucketAnalyticsConfiguration
-> ReadPrec [PutBucketAnalyticsConfiguration]
-> Read PutBucketAnalyticsConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutBucketAnalyticsConfiguration]
$creadListPrec :: ReadPrec [PutBucketAnalyticsConfiguration]
readPrec :: ReadPrec PutBucketAnalyticsConfiguration
$creadPrec :: ReadPrec PutBucketAnalyticsConfiguration
readList :: ReadS [PutBucketAnalyticsConfiguration]
$creadList :: ReadS [PutBucketAnalyticsConfiguration]
readsPrec :: Int -> ReadS PutBucketAnalyticsConfiguration
$creadsPrec :: Int -> ReadS PutBucketAnalyticsConfiguration
Prelude.Read, Int -> PutBucketAnalyticsConfiguration -> ShowS
[PutBucketAnalyticsConfiguration] -> ShowS
PutBucketAnalyticsConfiguration -> String
(Int -> PutBucketAnalyticsConfiguration -> ShowS)
-> (PutBucketAnalyticsConfiguration -> String)
-> ([PutBucketAnalyticsConfiguration] -> ShowS)
-> Show PutBucketAnalyticsConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutBucketAnalyticsConfiguration] -> ShowS
$cshowList :: [PutBucketAnalyticsConfiguration] -> ShowS
show :: PutBucketAnalyticsConfiguration -> String
$cshow :: PutBucketAnalyticsConfiguration -> String
showsPrec :: Int -> PutBucketAnalyticsConfiguration -> ShowS
$cshowsPrec :: Int -> PutBucketAnalyticsConfiguration -> ShowS
Prelude.Show, (forall x.
 PutBucketAnalyticsConfiguration
 -> Rep PutBucketAnalyticsConfiguration x)
-> (forall x.
    Rep PutBucketAnalyticsConfiguration x
    -> PutBucketAnalyticsConfiguration)
-> Generic PutBucketAnalyticsConfiguration
forall x.
Rep PutBucketAnalyticsConfiguration x
-> PutBucketAnalyticsConfiguration
forall x.
PutBucketAnalyticsConfiguration
-> Rep PutBucketAnalyticsConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutBucketAnalyticsConfiguration x
-> PutBucketAnalyticsConfiguration
$cfrom :: forall x.
PutBucketAnalyticsConfiguration
-> Rep PutBucketAnalyticsConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'PutBucketAnalyticsConfiguration' 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:
--
-- 'expectedBucketOwner', 'putBucketAnalyticsConfiguration_expectedBucketOwner' - The account ID of the expected bucket owner. If the bucket is owned by a
-- different account, the request will fail with an HTTP
-- @403 (Access Denied)@ error.
--
-- 'bucket', 'putBucketAnalyticsConfiguration_bucket' - The name of the bucket to which an analytics configuration is stored.
--
-- 'id', 'putBucketAnalyticsConfiguration_id' - The ID that identifies the analytics configuration.
--
-- 'analyticsConfiguration', 'putBucketAnalyticsConfiguration_analyticsConfiguration' - The configuration and any analyses for the analytics filter.
newPutBucketAnalyticsConfiguration ::
  -- | 'bucket'
  BucketName ->
  -- | 'id'
  Prelude.Text ->
  -- | 'analyticsConfiguration'
  AnalyticsConfiguration ->
  PutBucketAnalyticsConfiguration
newPutBucketAnalyticsConfiguration :: BucketName
-> Text
-> AnalyticsConfiguration
-> PutBucketAnalyticsConfiguration
newPutBucketAnalyticsConfiguration
  BucketName
pBucket_
  Text
pId_
  AnalyticsConfiguration
pAnalyticsConfiguration_ =
    PutBucketAnalyticsConfiguration' :: Maybe Text
-> BucketName
-> Text
-> AnalyticsConfiguration
-> PutBucketAnalyticsConfiguration
PutBucketAnalyticsConfiguration'
      { $sel:expectedBucketOwner:PutBucketAnalyticsConfiguration' :: Maybe Text
expectedBucketOwner =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:bucket:PutBucketAnalyticsConfiguration' :: BucketName
bucket = BucketName
pBucket_,
        $sel:id:PutBucketAnalyticsConfiguration' :: Text
id = Text
pId_,
        $sel:analyticsConfiguration:PutBucketAnalyticsConfiguration' :: AnalyticsConfiguration
analyticsConfiguration =
          AnalyticsConfiguration
pAnalyticsConfiguration_
      }

-- | The account ID of the expected bucket owner. If the bucket is owned by a
-- different account, the request will fail with an HTTP
-- @403 (Access Denied)@ error.
putBucketAnalyticsConfiguration_expectedBucketOwner :: Lens.Lens' PutBucketAnalyticsConfiguration (Prelude.Maybe Prelude.Text)
putBucketAnalyticsConfiguration_expectedBucketOwner :: (Maybe Text -> f (Maybe Text))
-> PutBucketAnalyticsConfiguration
-> f PutBucketAnalyticsConfiguration
putBucketAnalyticsConfiguration_expectedBucketOwner = (PutBucketAnalyticsConfiguration -> Maybe Text)
-> (PutBucketAnalyticsConfiguration
    -> Maybe Text -> PutBucketAnalyticsConfiguration)
-> Lens
     PutBucketAnalyticsConfiguration
     PutBucketAnalyticsConfiguration
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutBucketAnalyticsConfiguration' {Maybe Text
expectedBucketOwner :: Maybe Text
$sel:expectedBucketOwner:PutBucketAnalyticsConfiguration' :: PutBucketAnalyticsConfiguration -> Maybe Text
expectedBucketOwner} -> Maybe Text
expectedBucketOwner) (\s :: PutBucketAnalyticsConfiguration
s@PutBucketAnalyticsConfiguration' {} Maybe Text
a -> PutBucketAnalyticsConfiguration
s {$sel:expectedBucketOwner:PutBucketAnalyticsConfiguration' :: Maybe Text
expectedBucketOwner = Maybe Text
a} :: PutBucketAnalyticsConfiguration)

-- | The name of the bucket to which an analytics configuration is stored.
putBucketAnalyticsConfiguration_bucket :: Lens.Lens' PutBucketAnalyticsConfiguration BucketName
putBucketAnalyticsConfiguration_bucket :: (BucketName -> f BucketName)
-> PutBucketAnalyticsConfiguration
-> f PutBucketAnalyticsConfiguration
putBucketAnalyticsConfiguration_bucket = (PutBucketAnalyticsConfiguration -> BucketName)
-> (PutBucketAnalyticsConfiguration
    -> BucketName -> PutBucketAnalyticsConfiguration)
-> Lens
     PutBucketAnalyticsConfiguration
     PutBucketAnalyticsConfiguration
     BucketName
     BucketName
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutBucketAnalyticsConfiguration' {BucketName
bucket :: BucketName
$sel:bucket:PutBucketAnalyticsConfiguration' :: PutBucketAnalyticsConfiguration -> BucketName
bucket} -> BucketName
bucket) (\s :: PutBucketAnalyticsConfiguration
s@PutBucketAnalyticsConfiguration' {} BucketName
a -> PutBucketAnalyticsConfiguration
s {$sel:bucket:PutBucketAnalyticsConfiguration' :: BucketName
bucket = BucketName
a} :: PutBucketAnalyticsConfiguration)

-- | The ID that identifies the analytics configuration.
putBucketAnalyticsConfiguration_id :: Lens.Lens' PutBucketAnalyticsConfiguration Prelude.Text
putBucketAnalyticsConfiguration_id :: (Text -> f Text)
-> PutBucketAnalyticsConfiguration
-> f PutBucketAnalyticsConfiguration
putBucketAnalyticsConfiguration_id = (PutBucketAnalyticsConfiguration -> Text)
-> (PutBucketAnalyticsConfiguration
    -> Text -> PutBucketAnalyticsConfiguration)
-> Lens
     PutBucketAnalyticsConfiguration
     PutBucketAnalyticsConfiguration
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutBucketAnalyticsConfiguration' {Text
id :: Text
$sel:id:PutBucketAnalyticsConfiguration' :: PutBucketAnalyticsConfiguration -> Text
id} -> Text
id) (\s :: PutBucketAnalyticsConfiguration
s@PutBucketAnalyticsConfiguration' {} Text
a -> PutBucketAnalyticsConfiguration
s {$sel:id:PutBucketAnalyticsConfiguration' :: Text
id = Text
a} :: PutBucketAnalyticsConfiguration)

-- | The configuration and any analyses for the analytics filter.
putBucketAnalyticsConfiguration_analyticsConfiguration :: Lens.Lens' PutBucketAnalyticsConfiguration AnalyticsConfiguration
putBucketAnalyticsConfiguration_analyticsConfiguration :: (AnalyticsConfiguration -> f AnalyticsConfiguration)
-> PutBucketAnalyticsConfiguration
-> f PutBucketAnalyticsConfiguration
putBucketAnalyticsConfiguration_analyticsConfiguration = (PutBucketAnalyticsConfiguration -> AnalyticsConfiguration)
-> (PutBucketAnalyticsConfiguration
    -> AnalyticsConfiguration -> PutBucketAnalyticsConfiguration)
-> Lens
     PutBucketAnalyticsConfiguration
     PutBucketAnalyticsConfiguration
     AnalyticsConfiguration
     AnalyticsConfiguration
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutBucketAnalyticsConfiguration' {AnalyticsConfiguration
analyticsConfiguration :: AnalyticsConfiguration
$sel:analyticsConfiguration:PutBucketAnalyticsConfiguration' :: PutBucketAnalyticsConfiguration -> AnalyticsConfiguration
analyticsConfiguration} -> AnalyticsConfiguration
analyticsConfiguration) (\s :: PutBucketAnalyticsConfiguration
s@PutBucketAnalyticsConfiguration' {} AnalyticsConfiguration
a -> PutBucketAnalyticsConfiguration
s {$sel:analyticsConfiguration:PutBucketAnalyticsConfiguration' :: AnalyticsConfiguration
analyticsConfiguration = AnalyticsConfiguration
a} :: PutBucketAnalyticsConfiguration)

instance
  Core.AWSRequest
    PutBucketAnalyticsConfiguration
  where
  type
    AWSResponse PutBucketAnalyticsConfiguration =
      PutBucketAnalyticsConfigurationResponse
  request :: PutBucketAnalyticsConfiguration
-> Request PutBucketAnalyticsConfiguration
request =
    Request PutBucketAnalyticsConfiguration
-> Request PutBucketAnalyticsConfiguration
forall a. Request a -> Request a
Request.s3vhost
      (Request PutBucketAnalyticsConfiguration
 -> Request PutBucketAnalyticsConfiguration)
-> (PutBucketAnalyticsConfiguration
    -> Request PutBucketAnalyticsConfiguration)
-> PutBucketAnalyticsConfiguration
-> Request PutBucketAnalyticsConfiguration
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Service
-> PutBucketAnalyticsConfiguration
-> Request PutBucketAnalyticsConfiguration
forall a. (ToRequest a, ToElement a) => Service -> a -> Request a
Request.putXML Service
defaultService
  response :: Logger
-> Service
-> Proxy PutBucketAnalyticsConfiguration
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse PutBucketAnalyticsConfiguration)))
response =
    AWSResponse PutBucketAnalyticsConfiguration
-> Logger
-> Service
-> Proxy PutBucketAnalyticsConfiguration
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse PutBucketAnalyticsConfiguration)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
      AWSResponse PutBucketAnalyticsConfiguration
PutBucketAnalyticsConfigurationResponse
PutBucketAnalyticsConfigurationResponse'

instance
  Prelude.Hashable
    PutBucketAnalyticsConfiguration

instance
  Prelude.NFData
    PutBucketAnalyticsConfiguration

instance
  Core.ToElement
    PutBucketAnalyticsConfiguration
  where
  toElement :: PutBucketAnalyticsConfiguration -> Element
toElement PutBucketAnalyticsConfiguration' {Maybe Text
Text
BucketName
AnalyticsConfiguration
analyticsConfiguration :: AnalyticsConfiguration
id :: Text
bucket :: BucketName
expectedBucketOwner :: Maybe Text
$sel:analyticsConfiguration:PutBucketAnalyticsConfiguration' :: PutBucketAnalyticsConfiguration -> AnalyticsConfiguration
$sel:id:PutBucketAnalyticsConfiguration' :: PutBucketAnalyticsConfiguration -> Text
$sel:bucket:PutBucketAnalyticsConfiguration' :: PutBucketAnalyticsConfiguration -> BucketName
$sel:expectedBucketOwner:PutBucketAnalyticsConfiguration' :: PutBucketAnalyticsConfiguration -> Maybe Text
..} =
    Name -> AnalyticsConfiguration -> Element
forall a. ToXML a => Name -> a -> Element
Core.mkElement
      Name
"{http://s3.amazonaws.com/doc/2006-03-01/}AnalyticsConfiguration"
      AnalyticsConfiguration
analyticsConfiguration

instance
  Core.ToHeaders
    PutBucketAnalyticsConfiguration
  where
  toHeaders :: PutBucketAnalyticsConfiguration -> [Header]
toHeaders PutBucketAnalyticsConfiguration' {Maybe Text
Text
BucketName
AnalyticsConfiguration
analyticsConfiguration :: AnalyticsConfiguration
id :: Text
bucket :: BucketName
expectedBucketOwner :: Maybe Text
$sel:analyticsConfiguration:PutBucketAnalyticsConfiguration' :: PutBucketAnalyticsConfiguration -> AnalyticsConfiguration
$sel:id:PutBucketAnalyticsConfiguration' :: PutBucketAnalyticsConfiguration -> Text
$sel:bucket:PutBucketAnalyticsConfiguration' :: PutBucketAnalyticsConfiguration -> BucketName
$sel:expectedBucketOwner:PutBucketAnalyticsConfiguration' :: PutBucketAnalyticsConfiguration -> Maybe Text
..} =
    [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ HeaderName
"x-amz-expected-bucket-owner"
          HeaderName -> Maybe Text -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# Maybe Text
expectedBucketOwner
      ]

instance Core.ToPath PutBucketAnalyticsConfiguration where
  toPath :: PutBucketAnalyticsConfiguration -> ByteString
toPath PutBucketAnalyticsConfiguration' {Maybe Text
Text
BucketName
AnalyticsConfiguration
analyticsConfiguration :: AnalyticsConfiguration
id :: Text
bucket :: BucketName
expectedBucketOwner :: Maybe Text
$sel:analyticsConfiguration:PutBucketAnalyticsConfiguration' :: PutBucketAnalyticsConfiguration -> AnalyticsConfiguration
$sel:id:PutBucketAnalyticsConfiguration' :: PutBucketAnalyticsConfiguration -> Text
$sel:bucket:PutBucketAnalyticsConfiguration' :: PutBucketAnalyticsConfiguration -> BucketName
$sel:expectedBucketOwner:PutBucketAnalyticsConfiguration' :: PutBucketAnalyticsConfiguration -> 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 PutBucketAnalyticsConfiguration where
  toQuery :: PutBucketAnalyticsConfiguration -> QueryString
toQuery PutBucketAnalyticsConfiguration' {Maybe Text
Text
BucketName
AnalyticsConfiguration
analyticsConfiguration :: AnalyticsConfiguration
id :: Text
bucket :: BucketName
expectedBucketOwner :: Maybe Text
$sel:analyticsConfiguration:PutBucketAnalyticsConfiguration' :: PutBucketAnalyticsConfiguration -> AnalyticsConfiguration
$sel:id:PutBucketAnalyticsConfiguration' :: PutBucketAnalyticsConfiguration -> Text
$sel:bucket:PutBucketAnalyticsConfiguration' :: PutBucketAnalyticsConfiguration -> BucketName
$sel:expectedBucketOwner:PutBucketAnalyticsConfiguration' :: PutBucketAnalyticsConfiguration -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"id" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
id, QueryString
"analytics"]

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

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

instance
  Prelude.NFData
    PutBucketAnalyticsConfigurationResponse