{-# 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.ListBucketAnalyticsConfigurations
-- 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)
--
-- Lists the analytics configurations for the bucket. You can have up to
-- 1,000 analytics configurations per bucket.
--
-- This action supports list pagination and does not return more than 100
-- configurations at a time. You should always check the @IsTruncated@
-- element in the response. If there are no more configurations to list,
-- @IsTruncated@ is set to false. If there are more configurations to list,
-- @IsTruncated@ is set to true, and there will be a value in
-- @NextContinuationToken@. You use the @NextContinuationToken@ value to
-- continue the pagination of the list by passing the value in
-- continuation-token in the request to @GET@ the next page.
--
-- To use this operation, you must have permissions to perform the
-- @s3:GetAnalyticsConfiguration@ 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>.
--
-- For information about Amazon S3 analytics feature, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/analytics-storage-class.html Amazon S3 Analytics – Storage Class Analysis>.
--
-- The following operations are related to
-- @ListBucketAnalyticsConfigurations@:
--
-- -   <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_PutBucketAnalyticsConfiguration.html PutBucketAnalyticsConfiguration>
module Amazonka.S3.ListBucketAnalyticsConfigurations
  ( -- * Creating a Request
    ListBucketAnalyticsConfigurations (..),
    newListBucketAnalyticsConfigurations,

    -- * Request Lenses
    listBucketAnalyticsConfigurations_continuationToken,
    listBucketAnalyticsConfigurations_expectedBucketOwner,
    listBucketAnalyticsConfigurations_bucket,

    -- * Destructuring the Response
    ListBucketAnalyticsConfigurationsResponse (..),
    newListBucketAnalyticsConfigurationsResponse,

    -- * Response Lenses
    listBucketAnalyticsConfigurationsResponse_analyticsConfigurationList,
    listBucketAnalyticsConfigurationsResponse_continuationToken,
    listBucketAnalyticsConfigurationsResponse_nextContinuationToken,
    listBucketAnalyticsConfigurationsResponse_isTruncated,
    listBucketAnalyticsConfigurationsResponse_httpStatus,
  )
where

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

-- | /See:/ 'newListBucketAnalyticsConfigurations' smart constructor.
data ListBucketAnalyticsConfigurations = ListBucketAnalyticsConfigurations'
  { -- | The ContinuationToken that represents a placeholder from where this
    -- request should begin.
    ListBucketAnalyticsConfigurations -> Maybe Text
continuationToken :: Prelude.Maybe Prelude.Text,
    -- | 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.
    ListBucketAnalyticsConfigurations -> Maybe Text
expectedBucketOwner :: Prelude.Maybe Prelude.Text,
    -- | The name of the bucket from which analytics configurations are
    -- retrieved.
    ListBucketAnalyticsConfigurations -> BucketName
bucket :: BucketName
  }
  deriving (ListBucketAnalyticsConfigurations
-> ListBucketAnalyticsConfigurations -> Bool
(ListBucketAnalyticsConfigurations
 -> ListBucketAnalyticsConfigurations -> Bool)
-> (ListBucketAnalyticsConfigurations
    -> ListBucketAnalyticsConfigurations -> Bool)
-> Eq ListBucketAnalyticsConfigurations
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListBucketAnalyticsConfigurations
-> ListBucketAnalyticsConfigurations -> Bool
$c/= :: ListBucketAnalyticsConfigurations
-> ListBucketAnalyticsConfigurations -> Bool
== :: ListBucketAnalyticsConfigurations
-> ListBucketAnalyticsConfigurations -> Bool
$c== :: ListBucketAnalyticsConfigurations
-> ListBucketAnalyticsConfigurations -> Bool
Prelude.Eq, ReadPrec [ListBucketAnalyticsConfigurations]
ReadPrec ListBucketAnalyticsConfigurations
Int -> ReadS ListBucketAnalyticsConfigurations
ReadS [ListBucketAnalyticsConfigurations]
(Int -> ReadS ListBucketAnalyticsConfigurations)
-> ReadS [ListBucketAnalyticsConfigurations]
-> ReadPrec ListBucketAnalyticsConfigurations
-> ReadPrec [ListBucketAnalyticsConfigurations]
-> Read ListBucketAnalyticsConfigurations
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListBucketAnalyticsConfigurations]
$creadListPrec :: ReadPrec [ListBucketAnalyticsConfigurations]
readPrec :: ReadPrec ListBucketAnalyticsConfigurations
$creadPrec :: ReadPrec ListBucketAnalyticsConfigurations
readList :: ReadS [ListBucketAnalyticsConfigurations]
$creadList :: ReadS [ListBucketAnalyticsConfigurations]
readsPrec :: Int -> ReadS ListBucketAnalyticsConfigurations
$creadsPrec :: Int -> ReadS ListBucketAnalyticsConfigurations
Prelude.Read, Int -> ListBucketAnalyticsConfigurations -> ShowS
[ListBucketAnalyticsConfigurations] -> ShowS
ListBucketAnalyticsConfigurations -> String
(Int -> ListBucketAnalyticsConfigurations -> ShowS)
-> (ListBucketAnalyticsConfigurations -> String)
-> ([ListBucketAnalyticsConfigurations] -> ShowS)
-> Show ListBucketAnalyticsConfigurations
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListBucketAnalyticsConfigurations] -> ShowS
$cshowList :: [ListBucketAnalyticsConfigurations] -> ShowS
show :: ListBucketAnalyticsConfigurations -> String
$cshow :: ListBucketAnalyticsConfigurations -> String
showsPrec :: Int -> ListBucketAnalyticsConfigurations -> ShowS
$cshowsPrec :: Int -> ListBucketAnalyticsConfigurations -> ShowS
Prelude.Show, (forall x.
 ListBucketAnalyticsConfigurations
 -> Rep ListBucketAnalyticsConfigurations x)
-> (forall x.
    Rep ListBucketAnalyticsConfigurations x
    -> ListBucketAnalyticsConfigurations)
-> Generic ListBucketAnalyticsConfigurations
forall x.
Rep ListBucketAnalyticsConfigurations x
-> ListBucketAnalyticsConfigurations
forall x.
ListBucketAnalyticsConfigurations
-> Rep ListBucketAnalyticsConfigurations x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListBucketAnalyticsConfigurations x
-> ListBucketAnalyticsConfigurations
$cfrom :: forall x.
ListBucketAnalyticsConfigurations
-> Rep ListBucketAnalyticsConfigurations x
Prelude.Generic)

-- |
-- Create a value of 'ListBucketAnalyticsConfigurations' 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:
--
-- 'continuationToken', 'listBucketAnalyticsConfigurations_continuationToken' - The ContinuationToken that represents a placeholder from where this
-- request should begin.
--
-- 'expectedBucketOwner', 'listBucketAnalyticsConfigurations_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', 'listBucketAnalyticsConfigurations_bucket' - The name of the bucket from which analytics configurations are
-- retrieved.
newListBucketAnalyticsConfigurations ::
  -- | 'bucket'
  BucketName ->
  ListBucketAnalyticsConfigurations
newListBucketAnalyticsConfigurations :: BucketName -> ListBucketAnalyticsConfigurations
newListBucketAnalyticsConfigurations BucketName
pBucket_ =
  ListBucketAnalyticsConfigurations' :: Maybe Text
-> Maybe Text -> BucketName -> ListBucketAnalyticsConfigurations
ListBucketAnalyticsConfigurations'
    { $sel:continuationToken:ListBucketAnalyticsConfigurations' :: Maybe Text
continuationToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:expectedBucketOwner:ListBucketAnalyticsConfigurations' :: Maybe Text
expectedBucketOwner = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:bucket:ListBucketAnalyticsConfigurations' :: BucketName
bucket = BucketName
pBucket_
    }

-- | The ContinuationToken that represents a placeholder from where this
-- request should begin.
listBucketAnalyticsConfigurations_continuationToken :: Lens.Lens' ListBucketAnalyticsConfigurations (Prelude.Maybe Prelude.Text)
listBucketAnalyticsConfigurations_continuationToken :: (Maybe Text -> f (Maybe Text))
-> ListBucketAnalyticsConfigurations
-> f ListBucketAnalyticsConfigurations
listBucketAnalyticsConfigurations_continuationToken = (ListBucketAnalyticsConfigurations -> Maybe Text)
-> (ListBucketAnalyticsConfigurations
    -> Maybe Text -> ListBucketAnalyticsConfigurations)
-> Lens
     ListBucketAnalyticsConfigurations
     ListBucketAnalyticsConfigurations
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListBucketAnalyticsConfigurations' {Maybe Text
continuationToken :: Maybe Text
$sel:continuationToken:ListBucketAnalyticsConfigurations' :: ListBucketAnalyticsConfigurations -> Maybe Text
continuationToken} -> Maybe Text
continuationToken) (\s :: ListBucketAnalyticsConfigurations
s@ListBucketAnalyticsConfigurations' {} Maybe Text
a -> ListBucketAnalyticsConfigurations
s {$sel:continuationToken:ListBucketAnalyticsConfigurations' :: Maybe Text
continuationToken = Maybe Text
a} :: ListBucketAnalyticsConfigurations)

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

-- | The name of the bucket from which analytics configurations are
-- retrieved.
listBucketAnalyticsConfigurations_bucket :: Lens.Lens' ListBucketAnalyticsConfigurations BucketName
listBucketAnalyticsConfigurations_bucket :: (BucketName -> f BucketName)
-> ListBucketAnalyticsConfigurations
-> f ListBucketAnalyticsConfigurations
listBucketAnalyticsConfigurations_bucket = (ListBucketAnalyticsConfigurations -> BucketName)
-> (ListBucketAnalyticsConfigurations
    -> BucketName -> ListBucketAnalyticsConfigurations)
-> Lens
     ListBucketAnalyticsConfigurations
     ListBucketAnalyticsConfigurations
     BucketName
     BucketName
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListBucketAnalyticsConfigurations' {BucketName
bucket :: BucketName
$sel:bucket:ListBucketAnalyticsConfigurations' :: ListBucketAnalyticsConfigurations -> BucketName
bucket} -> BucketName
bucket) (\s :: ListBucketAnalyticsConfigurations
s@ListBucketAnalyticsConfigurations' {} BucketName
a -> ListBucketAnalyticsConfigurations
s {$sel:bucket:ListBucketAnalyticsConfigurations' :: BucketName
bucket = BucketName
a} :: ListBucketAnalyticsConfigurations)

instance
  Core.AWSRequest
    ListBucketAnalyticsConfigurations
  where
  type
    AWSResponse ListBucketAnalyticsConfigurations =
      ListBucketAnalyticsConfigurationsResponse
  request :: ListBucketAnalyticsConfigurations
-> Request ListBucketAnalyticsConfigurations
request =
    Request ListBucketAnalyticsConfigurations
-> Request ListBucketAnalyticsConfigurations
forall a. Request a -> Request a
Request.s3vhost
      (Request ListBucketAnalyticsConfigurations
 -> Request ListBucketAnalyticsConfigurations)
-> (ListBucketAnalyticsConfigurations
    -> Request ListBucketAnalyticsConfigurations)
-> ListBucketAnalyticsConfigurations
-> Request ListBucketAnalyticsConfigurations
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Service
-> ListBucketAnalyticsConfigurations
-> Request ListBucketAnalyticsConfigurations
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListBucketAnalyticsConfigurations
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse ListBucketAnalyticsConfigurations)))
response =
    (Int
 -> ResponseHeaders
 -> [Node]
 -> Either String (AWSResponse ListBucketAnalyticsConfigurations))
-> Logger
-> Service
-> Proxy ListBucketAnalyticsConfigurations
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse ListBucketAnalyticsConfigurations)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXML
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe [AnalyticsConfiguration]
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Int
-> ListBucketAnalyticsConfigurationsResponse
ListBucketAnalyticsConfigurationsResponse'
            (Maybe [AnalyticsConfiguration]
 -> Maybe Text
 -> Maybe Text
 -> Maybe Bool
 -> Int
 -> ListBucketAnalyticsConfigurationsResponse)
-> Either String (Maybe [AnalyticsConfiguration])
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Int
      -> ListBucketAnalyticsConfigurationsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( ([Node] -> Either String [AnalyticsConfiguration])
-> [Node] -> Either String (Maybe [AnalyticsConfiguration])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may
                            (Text -> [Node] -> Either String [AnalyticsConfiguration]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"AnalyticsConfiguration")
                            [Node]
x
                        )
              Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Int
   -> ListBucketAnalyticsConfigurationsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Bool -> Int -> ListBucketAnalyticsConfigurationsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ContinuationToken")
              Either
  String
  (Maybe Text
   -> Maybe Bool -> Int -> ListBucketAnalyticsConfigurationsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Bool -> Int -> ListBucketAnalyticsConfigurationsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"NextContinuationToken")
              Either
  String
  (Maybe Bool -> Int -> ListBucketAnalyticsConfigurationsResponse)
-> Either String (Maybe Bool)
-> Either String (Int -> ListBucketAnalyticsConfigurationsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Bool)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"IsTruncated")
              Either String (Int -> ListBucketAnalyticsConfigurationsResponse)
-> Either String Int
-> Either String ListBucketAnalyticsConfigurationsResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance
  Prelude.Hashable
    ListBucketAnalyticsConfigurations

instance
  Prelude.NFData
    ListBucketAnalyticsConfigurations

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

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

-- | /See:/ 'newListBucketAnalyticsConfigurationsResponse' smart constructor.
data ListBucketAnalyticsConfigurationsResponse = ListBucketAnalyticsConfigurationsResponse'
  { -- | The list of analytics configurations for a bucket.
    ListBucketAnalyticsConfigurationsResponse
-> Maybe [AnalyticsConfiguration]
analyticsConfigurationList :: Prelude.Maybe [AnalyticsConfiguration],
    -- | The marker that is used as a starting point for this analytics
    -- configuration list response. This value is present if it was sent in the
    -- request.
    ListBucketAnalyticsConfigurationsResponse -> Maybe Text
continuationToken :: Prelude.Maybe Prelude.Text,
    -- | @NextContinuationToken@ is sent when @isTruncated@ is true, which
    -- indicates that there are more analytics configurations to list. The next
    -- request must include this @NextContinuationToken@. The token is
    -- obfuscated and is not a usable value.
    ListBucketAnalyticsConfigurationsResponse -> Maybe Text
nextContinuationToken :: Prelude.Maybe Prelude.Text,
    -- | Indicates whether the returned list of analytics configurations is
    -- complete. A value of true indicates that the list is not complete and
    -- the NextContinuationToken will be provided for a subsequent request.
    ListBucketAnalyticsConfigurationsResponse -> Maybe Bool
isTruncated :: Prelude.Maybe Prelude.Bool,
    -- | The response's http status code.
    ListBucketAnalyticsConfigurationsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListBucketAnalyticsConfigurationsResponse
-> ListBucketAnalyticsConfigurationsResponse -> Bool
(ListBucketAnalyticsConfigurationsResponse
 -> ListBucketAnalyticsConfigurationsResponse -> Bool)
-> (ListBucketAnalyticsConfigurationsResponse
    -> ListBucketAnalyticsConfigurationsResponse -> Bool)
-> Eq ListBucketAnalyticsConfigurationsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListBucketAnalyticsConfigurationsResponse
-> ListBucketAnalyticsConfigurationsResponse -> Bool
$c/= :: ListBucketAnalyticsConfigurationsResponse
-> ListBucketAnalyticsConfigurationsResponse -> Bool
== :: ListBucketAnalyticsConfigurationsResponse
-> ListBucketAnalyticsConfigurationsResponse -> Bool
$c== :: ListBucketAnalyticsConfigurationsResponse
-> ListBucketAnalyticsConfigurationsResponse -> Bool
Prelude.Eq, ReadPrec [ListBucketAnalyticsConfigurationsResponse]
ReadPrec ListBucketAnalyticsConfigurationsResponse
Int -> ReadS ListBucketAnalyticsConfigurationsResponse
ReadS [ListBucketAnalyticsConfigurationsResponse]
(Int -> ReadS ListBucketAnalyticsConfigurationsResponse)
-> ReadS [ListBucketAnalyticsConfigurationsResponse]
-> ReadPrec ListBucketAnalyticsConfigurationsResponse
-> ReadPrec [ListBucketAnalyticsConfigurationsResponse]
-> Read ListBucketAnalyticsConfigurationsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListBucketAnalyticsConfigurationsResponse]
$creadListPrec :: ReadPrec [ListBucketAnalyticsConfigurationsResponse]
readPrec :: ReadPrec ListBucketAnalyticsConfigurationsResponse
$creadPrec :: ReadPrec ListBucketAnalyticsConfigurationsResponse
readList :: ReadS [ListBucketAnalyticsConfigurationsResponse]
$creadList :: ReadS [ListBucketAnalyticsConfigurationsResponse]
readsPrec :: Int -> ReadS ListBucketAnalyticsConfigurationsResponse
$creadsPrec :: Int -> ReadS ListBucketAnalyticsConfigurationsResponse
Prelude.Read, Int -> ListBucketAnalyticsConfigurationsResponse -> ShowS
[ListBucketAnalyticsConfigurationsResponse] -> ShowS
ListBucketAnalyticsConfigurationsResponse -> String
(Int -> ListBucketAnalyticsConfigurationsResponse -> ShowS)
-> (ListBucketAnalyticsConfigurationsResponse -> String)
-> ([ListBucketAnalyticsConfigurationsResponse] -> ShowS)
-> Show ListBucketAnalyticsConfigurationsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListBucketAnalyticsConfigurationsResponse] -> ShowS
$cshowList :: [ListBucketAnalyticsConfigurationsResponse] -> ShowS
show :: ListBucketAnalyticsConfigurationsResponse -> String
$cshow :: ListBucketAnalyticsConfigurationsResponse -> String
showsPrec :: Int -> ListBucketAnalyticsConfigurationsResponse -> ShowS
$cshowsPrec :: Int -> ListBucketAnalyticsConfigurationsResponse -> ShowS
Prelude.Show, (forall x.
 ListBucketAnalyticsConfigurationsResponse
 -> Rep ListBucketAnalyticsConfigurationsResponse x)
-> (forall x.
    Rep ListBucketAnalyticsConfigurationsResponse x
    -> ListBucketAnalyticsConfigurationsResponse)
-> Generic ListBucketAnalyticsConfigurationsResponse
forall x.
Rep ListBucketAnalyticsConfigurationsResponse x
-> ListBucketAnalyticsConfigurationsResponse
forall x.
ListBucketAnalyticsConfigurationsResponse
-> Rep ListBucketAnalyticsConfigurationsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListBucketAnalyticsConfigurationsResponse x
-> ListBucketAnalyticsConfigurationsResponse
$cfrom :: forall x.
ListBucketAnalyticsConfigurationsResponse
-> Rep ListBucketAnalyticsConfigurationsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListBucketAnalyticsConfigurationsResponse' 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:
--
-- 'analyticsConfigurationList', 'listBucketAnalyticsConfigurationsResponse_analyticsConfigurationList' - The list of analytics configurations for a bucket.
--
-- 'continuationToken', 'listBucketAnalyticsConfigurationsResponse_continuationToken' - The marker that is used as a starting point for this analytics
-- configuration list response. This value is present if it was sent in the
-- request.
--
-- 'nextContinuationToken', 'listBucketAnalyticsConfigurationsResponse_nextContinuationToken' - @NextContinuationToken@ is sent when @isTruncated@ is true, which
-- indicates that there are more analytics configurations to list. The next
-- request must include this @NextContinuationToken@. The token is
-- obfuscated and is not a usable value.
--
-- 'isTruncated', 'listBucketAnalyticsConfigurationsResponse_isTruncated' - Indicates whether the returned list of analytics configurations is
-- complete. A value of true indicates that the list is not complete and
-- the NextContinuationToken will be provided for a subsequent request.
--
-- 'httpStatus', 'listBucketAnalyticsConfigurationsResponse_httpStatus' - The response's http status code.
newListBucketAnalyticsConfigurationsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListBucketAnalyticsConfigurationsResponse
newListBucketAnalyticsConfigurationsResponse :: Int -> ListBucketAnalyticsConfigurationsResponse
newListBucketAnalyticsConfigurationsResponse
  Int
pHttpStatus_ =
    ListBucketAnalyticsConfigurationsResponse' :: Maybe [AnalyticsConfiguration]
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Int
-> ListBucketAnalyticsConfigurationsResponse
ListBucketAnalyticsConfigurationsResponse'
      { $sel:analyticsConfigurationList:ListBucketAnalyticsConfigurationsResponse' :: Maybe [AnalyticsConfiguration]
analyticsConfigurationList =
          Maybe [AnalyticsConfiguration]
forall a. Maybe a
Prelude.Nothing,
        $sel:continuationToken:ListBucketAnalyticsConfigurationsResponse' :: Maybe Text
continuationToken =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:nextContinuationToken:ListBucketAnalyticsConfigurationsResponse' :: Maybe Text
nextContinuationToken =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:isTruncated:ListBucketAnalyticsConfigurationsResponse' :: Maybe Bool
isTruncated = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:ListBucketAnalyticsConfigurationsResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | The list of analytics configurations for a bucket.
listBucketAnalyticsConfigurationsResponse_analyticsConfigurationList :: Lens.Lens' ListBucketAnalyticsConfigurationsResponse (Prelude.Maybe [AnalyticsConfiguration])
listBucketAnalyticsConfigurationsResponse_analyticsConfigurationList :: (Maybe [AnalyticsConfiguration]
 -> f (Maybe [AnalyticsConfiguration]))
-> ListBucketAnalyticsConfigurationsResponse
-> f ListBucketAnalyticsConfigurationsResponse
listBucketAnalyticsConfigurationsResponse_analyticsConfigurationList = (ListBucketAnalyticsConfigurationsResponse
 -> Maybe [AnalyticsConfiguration])
-> (ListBucketAnalyticsConfigurationsResponse
    -> Maybe [AnalyticsConfiguration]
    -> ListBucketAnalyticsConfigurationsResponse)
-> Lens
     ListBucketAnalyticsConfigurationsResponse
     ListBucketAnalyticsConfigurationsResponse
     (Maybe [AnalyticsConfiguration])
     (Maybe [AnalyticsConfiguration])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListBucketAnalyticsConfigurationsResponse' {Maybe [AnalyticsConfiguration]
analyticsConfigurationList :: Maybe [AnalyticsConfiguration]
$sel:analyticsConfigurationList:ListBucketAnalyticsConfigurationsResponse' :: ListBucketAnalyticsConfigurationsResponse
-> Maybe [AnalyticsConfiguration]
analyticsConfigurationList} -> Maybe [AnalyticsConfiguration]
analyticsConfigurationList) (\s :: ListBucketAnalyticsConfigurationsResponse
s@ListBucketAnalyticsConfigurationsResponse' {} Maybe [AnalyticsConfiguration]
a -> ListBucketAnalyticsConfigurationsResponse
s {$sel:analyticsConfigurationList:ListBucketAnalyticsConfigurationsResponse' :: Maybe [AnalyticsConfiguration]
analyticsConfigurationList = Maybe [AnalyticsConfiguration]
a} :: ListBucketAnalyticsConfigurationsResponse) ((Maybe [AnalyticsConfiguration]
  -> f (Maybe [AnalyticsConfiguration]))
 -> ListBucketAnalyticsConfigurationsResponse
 -> f ListBucketAnalyticsConfigurationsResponse)
-> ((Maybe [AnalyticsConfiguration]
     -> f (Maybe [AnalyticsConfiguration]))
    -> Maybe [AnalyticsConfiguration]
    -> f (Maybe [AnalyticsConfiguration]))
-> (Maybe [AnalyticsConfiguration]
    -> f (Maybe [AnalyticsConfiguration]))
-> ListBucketAnalyticsConfigurationsResponse
-> f ListBucketAnalyticsConfigurationsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [AnalyticsConfiguration]
  [AnalyticsConfiguration]
  [AnalyticsConfiguration]
  [AnalyticsConfiguration]
-> Iso
     (Maybe [AnalyticsConfiguration])
     (Maybe [AnalyticsConfiguration])
     (Maybe [AnalyticsConfiguration])
     (Maybe [AnalyticsConfiguration])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  [AnalyticsConfiguration]
  [AnalyticsConfiguration]
  [AnalyticsConfiguration]
  [AnalyticsConfiguration]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The marker that is used as a starting point for this analytics
-- configuration list response. This value is present if it was sent in the
-- request.
listBucketAnalyticsConfigurationsResponse_continuationToken :: Lens.Lens' ListBucketAnalyticsConfigurationsResponse (Prelude.Maybe Prelude.Text)
listBucketAnalyticsConfigurationsResponse_continuationToken :: (Maybe Text -> f (Maybe Text))
-> ListBucketAnalyticsConfigurationsResponse
-> f ListBucketAnalyticsConfigurationsResponse
listBucketAnalyticsConfigurationsResponse_continuationToken = (ListBucketAnalyticsConfigurationsResponse -> Maybe Text)
-> (ListBucketAnalyticsConfigurationsResponse
    -> Maybe Text -> ListBucketAnalyticsConfigurationsResponse)
-> Lens
     ListBucketAnalyticsConfigurationsResponse
     ListBucketAnalyticsConfigurationsResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListBucketAnalyticsConfigurationsResponse' {Maybe Text
continuationToken :: Maybe Text
$sel:continuationToken:ListBucketAnalyticsConfigurationsResponse' :: ListBucketAnalyticsConfigurationsResponse -> Maybe Text
continuationToken} -> Maybe Text
continuationToken) (\s :: ListBucketAnalyticsConfigurationsResponse
s@ListBucketAnalyticsConfigurationsResponse' {} Maybe Text
a -> ListBucketAnalyticsConfigurationsResponse
s {$sel:continuationToken:ListBucketAnalyticsConfigurationsResponse' :: Maybe Text
continuationToken = Maybe Text
a} :: ListBucketAnalyticsConfigurationsResponse)

-- | @NextContinuationToken@ is sent when @isTruncated@ is true, which
-- indicates that there are more analytics configurations to list. The next
-- request must include this @NextContinuationToken@. The token is
-- obfuscated and is not a usable value.
listBucketAnalyticsConfigurationsResponse_nextContinuationToken :: Lens.Lens' ListBucketAnalyticsConfigurationsResponse (Prelude.Maybe Prelude.Text)
listBucketAnalyticsConfigurationsResponse_nextContinuationToken :: (Maybe Text -> f (Maybe Text))
-> ListBucketAnalyticsConfigurationsResponse
-> f ListBucketAnalyticsConfigurationsResponse
listBucketAnalyticsConfigurationsResponse_nextContinuationToken = (ListBucketAnalyticsConfigurationsResponse -> Maybe Text)
-> (ListBucketAnalyticsConfigurationsResponse
    -> Maybe Text -> ListBucketAnalyticsConfigurationsResponse)
-> Lens
     ListBucketAnalyticsConfigurationsResponse
     ListBucketAnalyticsConfigurationsResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListBucketAnalyticsConfigurationsResponse' {Maybe Text
nextContinuationToken :: Maybe Text
$sel:nextContinuationToken:ListBucketAnalyticsConfigurationsResponse' :: ListBucketAnalyticsConfigurationsResponse -> Maybe Text
nextContinuationToken} -> Maybe Text
nextContinuationToken) (\s :: ListBucketAnalyticsConfigurationsResponse
s@ListBucketAnalyticsConfigurationsResponse' {} Maybe Text
a -> ListBucketAnalyticsConfigurationsResponse
s {$sel:nextContinuationToken:ListBucketAnalyticsConfigurationsResponse' :: Maybe Text
nextContinuationToken = Maybe Text
a} :: ListBucketAnalyticsConfigurationsResponse)

-- | Indicates whether the returned list of analytics configurations is
-- complete. A value of true indicates that the list is not complete and
-- the NextContinuationToken will be provided for a subsequent request.
listBucketAnalyticsConfigurationsResponse_isTruncated :: Lens.Lens' ListBucketAnalyticsConfigurationsResponse (Prelude.Maybe Prelude.Bool)
listBucketAnalyticsConfigurationsResponse_isTruncated :: (Maybe Bool -> f (Maybe Bool))
-> ListBucketAnalyticsConfigurationsResponse
-> f ListBucketAnalyticsConfigurationsResponse
listBucketAnalyticsConfigurationsResponse_isTruncated = (ListBucketAnalyticsConfigurationsResponse -> Maybe Bool)
-> (ListBucketAnalyticsConfigurationsResponse
    -> Maybe Bool -> ListBucketAnalyticsConfigurationsResponse)
-> Lens
     ListBucketAnalyticsConfigurationsResponse
     ListBucketAnalyticsConfigurationsResponse
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListBucketAnalyticsConfigurationsResponse' {Maybe Bool
isTruncated :: Maybe Bool
$sel:isTruncated:ListBucketAnalyticsConfigurationsResponse' :: ListBucketAnalyticsConfigurationsResponse -> Maybe Bool
isTruncated} -> Maybe Bool
isTruncated) (\s :: ListBucketAnalyticsConfigurationsResponse
s@ListBucketAnalyticsConfigurationsResponse' {} Maybe Bool
a -> ListBucketAnalyticsConfigurationsResponse
s {$sel:isTruncated:ListBucketAnalyticsConfigurationsResponse' :: Maybe Bool
isTruncated = Maybe Bool
a} :: ListBucketAnalyticsConfigurationsResponse)

-- | The response's http status code.
listBucketAnalyticsConfigurationsResponse_httpStatus :: Lens.Lens' ListBucketAnalyticsConfigurationsResponse Prelude.Int
listBucketAnalyticsConfigurationsResponse_httpStatus :: (Int -> f Int)
-> ListBucketAnalyticsConfigurationsResponse
-> f ListBucketAnalyticsConfigurationsResponse
listBucketAnalyticsConfigurationsResponse_httpStatus = (ListBucketAnalyticsConfigurationsResponse -> Int)
-> (ListBucketAnalyticsConfigurationsResponse
    -> Int -> ListBucketAnalyticsConfigurationsResponse)
-> Lens
     ListBucketAnalyticsConfigurationsResponse
     ListBucketAnalyticsConfigurationsResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListBucketAnalyticsConfigurationsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListBucketAnalyticsConfigurationsResponse' :: ListBucketAnalyticsConfigurationsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListBucketAnalyticsConfigurationsResponse
s@ListBucketAnalyticsConfigurationsResponse' {} Int
a -> ListBucketAnalyticsConfigurationsResponse
s {$sel:httpStatus:ListBucketAnalyticsConfigurationsResponse' :: Int
httpStatus = Int
a} :: ListBucketAnalyticsConfigurationsResponse)

instance
  Prelude.NFData
    ListBucketAnalyticsConfigurationsResponse