{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- 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_isTruncated,
    listBucketAnalyticsConfigurationsResponse_nextContinuationToken,
    listBucketAnalyticsConfigurationsResponse_httpStatus,
  )
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:/ '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 fails with the HTTP status code
    -- @403 Forbidden@ (access denied).
    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
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]
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
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.
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 fails with the HTTP status code
-- @403 Forbidden@ (access denied).
--
-- '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'
    { $sel:continuationToken:ListBucketAnalyticsConfigurations' :: Maybe Text
continuationToken =
        forall a. Maybe a
Prelude.Nothing,
      $sel:expectedBucketOwner:ListBucketAnalyticsConfigurations' :: Maybe Text
expectedBucketOwner = 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 :: Lens' ListBucketAnalyticsConfigurations (Maybe Text)
listBucketAnalyticsConfigurations_continuationToken = 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 fails with the HTTP status code
-- @403 Forbidden@ (access denied).
listBucketAnalyticsConfigurations_expectedBucketOwner :: Lens.Lens' ListBucketAnalyticsConfigurations (Prelude.Maybe Prelude.Text)
listBucketAnalyticsConfigurations_expectedBucketOwner :: Lens' ListBucketAnalyticsConfigurations (Maybe Text)
listBucketAnalyticsConfigurations_expectedBucketOwner = 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 :: Lens' ListBucketAnalyticsConfigurations BucketName
listBucketAnalyticsConfigurations_bucket = 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 :: (Service -> Service)
-> ListBucketAnalyticsConfigurations
-> Request ListBucketAnalyticsConfigurations
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 => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListBucketAnalyticsConfigurations
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse ListBucketAnalyticsConfigurations)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXML
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe [AnalyticsConfiguration]
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Int
-> ListBucketAnalyticsConfigurationsResponse
ListBucketAnalyticsConfigurationsResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may
                            (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"AnalyticsConfiguration")
                            [Node]
x
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"ContinuationToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"IsTruncated")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"NextContinuationToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance
  Prelude.Hashable
    ListBucketAnalyticsConfigurations
  where
  hashWithSalt :: Int -> ListBucketAnalyticsConfigurations -> Int
hashWithSalt
    Int
_salt
    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
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
continuationToken
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
expectedBucketOwner
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` BucketName
bucket

instance
  Prelude.NFData
    ListBucketAnalyticsConfigurations
  where
  rnf :: ListBucketAnalyticsConfigurations -> ()
rnf 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
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
continuationToken
      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

instance
  Data.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
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ HeaderName
"x-amz-expected-bucket-owner"
          forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# Maybe Text
expectedBucketOwner
      ]

instance
  Data.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
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"/", forall a. ToByteString a => a -> ByteString
Data.toBS BucketName
bucket]

instance
  Data.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
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"continuation-token" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: 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,
    -- | 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,
    -- | @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,
    -- | The response's http status code.
    ListBucketAnalyticsConfigurationsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListBucketAnalyticsConfigurationsResponse
-> ListBucketAnalyticsConfigurationsResponse -> Bool
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]
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
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.
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.
--
-- '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.
--
-- '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.
--
-- 'httpStatus', 'listBucketAnalyticsConfigurationsResponse_httpStatus' - The response's http status code.
newListBucketAnalyticsConfigurationsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListBucketAnalyticsConfigurationsResponse
newListBucketAnalyticsConfigurationsResponse :: Int -> ListBucketAnalyticsConfigurationsResponse
newListBucketAnalyticsConfigurationsResponse
  Int
pHttpStatus_ =
    ListBucketAnalyticsConfigurationsResponse'
      { $sel:analyticsConfigurationList:ListBucketAnalyticsConfigurationsResponse' :: Maybe [AnalyticsConfiguration]
analyticsConfigurationList =
          forall a. Maybe a
Prelude.Nothing,
        $sel:continuationToken:ListBucketAnalyticsConfigurationsResponse' :: Maybe Text
continuationToken =
          forall a. Maybe a
Prelude.Nothing,
        $sel:isTruncated:ListBucketAnalyticsConfigurationsResponse' :: Maybe Bool
isTruncated = forall a. Maybe a
Prelude.Nothing,
        $sel:nextContinuationToken:ListBucketAnalyticsConfigurationsResponse' :: Maybe Text
nextContinuationToken =
          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 :: Lens'
  ListBucketAnalyticsConfigurationsResponse
  (Maybe [AnalyticsConfiguration])
listBucketAnalyticsConfigurationsResponse_analyticsConfigurationList = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 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 :: Lens' ListBucketAnalyticsConfigurationsResponse (Maybe Text)
listBucketAnalyticsConfigurationsResponse_continuationToken = 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)

-- | 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 :: Lens' ListBucketAnalyticsConfigurationsResponse (Maybe Bool)
listBucketAnalyticsConfigurationsResponse_isTruncated = 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)

-- | @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 :: Lens' ListBucketAnalyticsConfigurationsResponse (Maybe Text)
listBucketAnalyticsConfigurationsResponse_nextContinuationToken = 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)

-- | The response's http status code.
listBucketAnalyticsConfigurationsResponse_httpStatus :: Lens.Lens' ListBucketAnalyticsConfigurationsResponse Prelude.Int
listBucketAnalyticsConfigurationsResponse_httpStatus :: Lens' ListBucketAnalyticsConfigurationsResponse Int
listBucketAnalyticsConfigurationsResponse_httpStatus = 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
  where
  rnf :: ListBucketAnalyticsConfigurationsResponse -> ()
rnf ListBucketAnalyticsConfigurationsResponse' {Int
Maybe Bool
Maybe [AnalyticsConfiguration]
Maybe Text
httpStatus :: Int
nextContinuationToken :: Maybe Text
isTruncated :: Maybe Bool
continuationToken :: Maybe Text
analyticsConfigurationList :: Maybe [AnalyticsConfiguration]
$sel:httpStatus:ListBucketAnalyticsConfigurationsResponse' :: ListBucketAnalyticsConfigurationsResponse -> Int
$sel:nextContinuationToken:ListBucketAnalyticsConfigurationsResponse' :: ListBucketAnalyticsConfigurationsResponse -> Maybe Text
$sel:isTruncated:ListBucketAnalyticsConfigurationsResponse' :: ListBucketAnalyticsConfigurationsResponse -> Maybe Bool
$sel:continuationToken:ListBucketAnalyticsConfigurationsResponse' :: ListBucketAnalyticsConfigurationsResponse -> Maybe Text
$sel:analyticsConfigurationList:ListBucketAnalyticsConfigurationsResponse' :: ListBucketAnalyticsConfigurationsResponse
-> Maybe [AnalyticsConfiguration]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [AnalyticsConfiguration]
analyticsConfigurationList
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
continuationToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
isTruncated
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextContinuationToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus