{-# 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.ListBucketMetricsConfigurations
-- 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 metrics configurations for the bucket. The metrics
-- configurations are only for the request metrics of the bucket and do not
-- provide information on daily storage metrics. You can have up to 1,000
-- configurations per bucket.
--
-- This action supports list pagination and does not return more than 100
-- configurations at a time. 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 is 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:GetMetricsConfiguration@ 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 more information about metrics configurations and CloudWatch request
-- metrics, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/cloudwatch-monitoring.html Monitoring Metrics with Amazon CloudWatch>.
--
-- The following operations are related to
-- @ListBucketMetricsConfigurations@:
--
-- -   <https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketMetricsConfiguration.html PutBucketMetricsConfiguration>
--
-- -   <https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketMetricsConfiguration.html GetBucketMetricsConfiguration>
--
-- -   <https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketMetricsConfiguration.html DeleteBucketMetricsConfiguration>
module Amazonka.S3.ListBucketMetricsConfigurations
  ( -- * Creating a Request
    ListBucketMetricsConfigurations (..),
    newListBucketMetricsConfigurations,

    -- * Request Lenses
    listBucketMetricsConfigurations_continuationToken,
    listBucketMetricsConfigurations_expectedBucketOwner,
    listBucketMetricsConfigurations_bucket,

    -- * Destructuring the Response
    ListBucketMetricsConfigurationsResponse (..),
    newListBucketMetricsConfigurationsResponse,

    -- * Response Lenses
    listBucketMetricsConfigurationsResponse_continuationToken,
    listBucketMetricsConfigurationsResponse_metricsConfigurationList,
    listBucketMetricsConfigurationsResponse_nextContinuationToken,
    listBucketMetricsConfigurationsResponse_isTruncated,
    listBucketMetricsConfigurationsResponse_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:/ 'newListBucketMetricsConfigurations' smart constructor.
data ListBucketMetricsConfigurations = ListBucketMetricsConfigurations'
  { -- | The marker that is used to continue a metrics configuration listing that
    -- has been truncated. Use the NextContinuationToken from a previously
    -- truncated list response to continue the listing. The continuation token
    -- is an opaque value that Amazon S3 understands.
    ListBucketMetricsConfigurations -> 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.
    ListBucketMetricsConfigurations -> Maybe Text
expectedBucketOwner :: Prelude.Maybe Prelude.Text,
    -- | The name of the bucket containing the metrics configurations to
    -- retrieve.
    ListBucketMetricsConfigurations -> BucketName
bucket :: BucketName
  }
  deriving (ListBucketMetricsConfigurations
-> ListBucketMetricsConfigurations -> Bool
(ListBucketMetricsConfigurations
 -> ListBucketMetricsConfigurations -> Bool)
-> (ListBucketMetricsConfigurations
    -> ListBucketMetricsConfigurations -> Bool)
-> Eq ListBucketMetricsConfigurations
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListBucketMetricsConfigurations
-> ListBucketMetricsConfigurations -> Bool
$c/= :: ListBucketMetricsConfigurations
-> ListBucketMetricsConfigurations -> Bool
== :: ListBucketMetricsConfigurations
-> ListBucketMetricsConfigurations -> Bool
$c== :: ListBucketMetricsConfigurations
-> ListBucketMetricsConfigurations -> Bool
Prelude.Eq, ReadPrec [ListBucketMetricsConfigurations]
ReadPrec ListBucketMetricsConfigurations
Int -> ReadS ListBucketMetricsConfigurations
ReadS [ListBucketMetricsConfigurations]
(Int -> ReadS ListBucketMetricsConfigurations)
-> ReadS [ListBucketMetricsConfigurations]
-> ReadPrec ListBucketMetricsConfigurations
-> ReadPrec [ListBucketMetricsConfigurations]
-> Read ListBucketMetricsConfigurations
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListBucketMetricsConfigurations]
$creadListPrec :: ReadPrec [ListBucketMetricsConfigurations]
readPrec :: ReadPrec ListBucketMetricsConfigurations
$creadPrec :: ReadPrec ListBucketMetricsConfigurations
readList :: ReadS [ListBucketMetricsConfigurations]
$creadList :: ReadS [ListBucketMetricsConfigurations]
readsPrec :: Int -> ReadS ListBucketMetricsConfigurations
$creadsPrec :: Int -> ReadS ListBucketMetricsConfigurations
Prelude.Read, Int -> ListBucketMetricsConfigurations -> ShowS
[ListBucketMetricsConfigurations] -> ShowS
ListBucketMetricsConfigurations -> String
(Int -> ListBucketMetricsConfigurations -> ShowS)
-> (ListBucketMetricsConfigurations -> String)
-> ([ListBucketMetricsConfigurations] -> ShowS)
-> Show ListBucketMetricsConfigurations
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListBucketMetricsConfigurations] -> ShowS
$cshowList :: [ListBucketMetricsConfigurations] -> ShowS
show :: ListBucketMetricsConfigurations -> String
$cshow :: ListBucketMetricsConfigurations -> String
showsPrec :: Int -> ListBucketMetricsConfigurations -> ShowS
$cshowsPrec :: Int -> ListBucketMetricsConfigurations -> ShowS
Prelude.Show, (forall x.
 ListBucketMetricsConfigurations
 -> Rep ListBucketMetricsConfigurations x)
-> (forall x.
    Rep ListBucketMetricsConfigurations x
    -> ListBucketMetricsConfigurations)
-> Generic ListBucketMetricsConfigurations
forall x.
Rep ListBucketMetricsConfigurations x
-> ListBucketMetricsConfigurations
forall x.
ListBucketMetricsConfigurations
-> Rep ListBucketMetricsConfigurations x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListBucketMetricsConfigurations x
-> ListBucketMetricsConfigurations
$cfrom :: forall x.
ListBucketMetricsConfigurations
-> Rep ListBucketMetricsConfigurations x
Prelude.Generic)

-- |
-- Create a value of 'ListBucketMetricsConfigurations' 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', 'listBucketMetricsConfigurations_continuationToken' - The marker that is used to continue a metrics configuration listing that
-- has been truncated. Use the NextContinuationToken from a previously
-- truncated list response to continue the listing. The continuation token
-- is an opaque value that Amazon S3 understands.
--
-- 'expectedBucketOwner', 'listBucketMetricsConfigurations_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', 'listBucketMetricsConfigurations_bucket' - The name of the bucket containing the metrics configurations to
-- retrieve.
newListBucketMetricsConfigurations ::
  -- | 'bucket'
  BucketName ->
  ListBucketMetricsConfigurations
newListBucketMetricsConfigurations :: BucketName -> ListBucketMetricsConfigurations
newListBucketMetricsConfigurations BucketName
pBucket_ =
  ListBucketMetricsConfigurations' :: Maybe Text
-> Maybe Text -> BucketName -> ListBucketMetricsConfigurations
ListBucketMetricsConfigurations'
    { $sel:continuationToken:ListBucketMetricsConfigurations' :: Maybe Text
continuationToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:expectedBucketOwner:ListBucketMetricsConfigurations' :: Maybe Text
expectedBucketOwner = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:bucket:ListBucketMetricsConfigurations' :: BucketName
bucket = BucketName
pBucket_
    }

-- | The marker that is used to continue a metrics configuration listing that
-- has been truncated. Use the NextContinuationToken from a previously
-- truncated list response to continue the listing. The continuation token
-- is an opaque value that Amazon S3 understands.
listBucketMetricsConfigurations_continuationToken :: Lens.Lens' ListBucketMetricsConfigurations (Prelude.Maybe Prelude.Text)
listBucketMetricsConfigurations_continuationToken :: (Maybe Text -> f (Maybe Text))
-> ListBucketMetricsConfigurations
-> f ListBucketMetricsConfigurations
listBucketMetricsConfigurations_continuationToken = (ListBucketMetricsConfigurations -> Maybe Text)
-> (ListBucketMetricsConfigurations
    -> Maybe Text -> ListBucketMetricsConfigurations)
-> Lens
     ListBucketMetricsConfigurations
     ListBucketMetricsConfigurations
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListBucketMetricsConfigurations' {Maybe Text
continuationToken :: Maybe Text
$sel:continuationToken:ListBucketMetricsConfigurations' :: ListBucketMetricsConfigurations -> Maybe Text
continuationToken} -> Maybe Text
continuationToken) (\s :: ListBucketMetricsConfigurations
s@ListBucketMetricsConfigurations' {} Maybe Text
a -> ListBucketMetricsConfigurations
s {$sel:continuationToken:ListBucketMetricsConfigurations' :: Maybe Text
continuationToken = Maybe Text
a} :: ListBucketMetricsConfigurations)

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

-- | The name of the bucket containing the metrics configurations to
-- retrieve.
listBucketMetricsConfigurations_bucket :: Lens.Lens' ListBucketMetricsConfigurations BucketName
listBucketMetricsConfigurations_bucket :: (BucketName -> f BucketName)
-> ListBucketMetricsConfigurations
-> f ListBucketMetricsConfigurations
listBucketMetricsConfigurations_bucket = (ListBucketMetricsConfigurations -> BucketName)
-> (ListBucketMetricsConfigurations
    -> BucketName -> ListBucketMetricsConfigurations)
-> Lens
     ListBucketMetricsConfigurations
     ListBucketMetricsConfigurations
     BucketName
     BucketName
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListBucketMetricsConfigurations' {BucketName
bucket :: BucketName
$sel:bucket:ListBucketMetricsConfigurations' :: ListBucketMetricsConfigurations -> BucketName
bucket} -> BucketName
bucket) (\s :: ListBucketMetricsConfigurations
s@ListBucketMetricsConfigurations' {} BucketName
a -> ListBucketMetricsConfigurations
s {$sel:bucket:ListBucketMetricsConfigurations' :: BucketName
bucket = BucketName
a} :: ListBucketMetricsConfigurations)

instance
  Core.AWSRequest
    ListBucketMetricsConfigurations
  where
  type
    AWSResponse ListBucketMetricsConfigurations =
      ListBucketMetricsConfigurationsResponse
  request :: ListBucketMetricsConfigurations
-> Request ListBucketMetricsConfigurations
request =
    Request ListBucketMetricsConfigurations
-> Request ListBucketMetricsConfigurations
forall a. Request a -> Request a
Request.s3vhost
      (Request ListBucketMetricsConfigurations
 -> Request ListBucketMetricsConfigurations)
-> (ListBucketMetricsConfigurations
    -> Request ListBucketMetricsConfigurations)
-> ListBucketMetricsConfigurations
-> Request ListBucketMetricsConfigurations
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Service
-> ListBucketMetricsConfigurations
-> Request ListBucketMetricsConfigurations
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListBucketMetricsConfigurations
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse ListBucketMetricsConfigurations)))
response =
    (Int
 -> ResponseHeaders
 -> [Node]
 -> Either String (AWSResponse ListBucketMetricsConfigurations))
-> Logger
-> Service
-> Proxy ListBucketMetricsConfigurations
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse ListBucketMetricsConfigurations)))
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 Text
-> Maybe [MetricsConfiguration]
-> Maybe Text
-> Maybe Bool
-> Int
-> ListBucketMetricsConfigurationsResponse
ListBucketMetricsConfigurationsResponse'
            (Maybe Text
 -> Maybe [MetricsConfiguration]
 -> Maybe Text
 -> Maybe Bool
 -> Int
 -> ListBucketMetricsConfigurationsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [MetricsConfiguration]
      -> Maybe Text
      -> Maybe Bool
      -> Int
      -> ListBucketMetricsConfigurationsResponse)
forall (f :: * -> *) a b. Functor 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 [MetricsConfiguration]
   -> Maybe Text
   -> Maybe Bool
   -> Int
   -> ListBucketMetricsConfigurationsResponse)
-> Either String (Maybe [MetricsConfiguration])
-> Either
     String
     (Maybe Text
      -> Maybe Bool -> Int -> ListBucketMetricsConfigurationsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( ([Node] -> Either String [MetricsConfiguration])
-> [Node] -> Either String (Maybe [MetricsConfiguration])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may
                            (Text -> [Node] -> Either String [MetricsConfiguration]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"MetricsConfiguration")
                            [Node]
x
                        )
            Either
  String
  (Maybe Text
   -> Maybe Bool -> Int -> ListBucketMetricsConfigurationsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Bool -> Int -> ListBucketMetricsConfigurationsResponse)
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 -> ListBucketMetricsConfigurationsResponse)
-> Either String (Maybe Bool)
-> Either String (Int -> ListBucketMetricsConfigurationsResponse)
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 -> ListBucketMetricsConfigurationsResponse)
-> Either String Int
-> Either String ListBucketMetricsConfigurationsResponse
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
    ListBucketMetricsConfigurations

instance
  Prelude.NFData
    ListBucketMetricsConfigurations

instance
  Core.ToHeaders
    ListBucketMetricsConfigurations
  where
  toHeaders :: ListBucketMetricsConfigurations -> ResponseHeaders
toHeaders ListBucketMetricsConfigurations' {Maybe Text
BucketName
bucket :: BucketName
expectedBucketOwner :: Maybe Text
continuationToken :: Maybe Text
$sel:bucket:ListBucketMetricsConfigurations' :: ListBucketMetricsConfigurations -> BucketName
$sel:expectedBucketOwner:ListBucketMetricsConfigurations' :: ListBucketMetricsConfigurations -> Maybe Text
$sel:continuationToken:ListBucketMetricsConfigurations' :: ListBucketMetricsConfigurations -> 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 ListBucketMetricsConfigurations where
  toPath :: ListBucketMetricsConfigurations -> ByteString
toPath ListBucketMetricsConfigurations' {Maybe Text
BucketName
bucket :: BucketName
expectedBucketOwner :: Maybe Text
continuationToken :: Maybe Text
$sel:bucket:ListBucketMetricsConfigurations' :: ListBucketMetricsConfigurations -> BucketName
$sel:expectedBucketOwner:ListBucketMetricsConfigurations' :: ListBucketMetricsConfigurations -> Maybe Text
$sel:continuationToken:ListBucketMetricsConfigurations' :: ListBucketMetricsConfigurations -> 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 ListBucketMetricsConfigurations where
  toQuery :: ListBucketMetricsConfigurations -> QueryString
toQuery ListBucketMetricsConfigurations' {Maybe Text
BucketName
bucket :: BucketName
expectedBucketOwner :: Maybe Text
continuationToken :: Maybe Text
$sel:bucket:ListBucketMetricsConfigurations' :: ListBucketMetricsConfigurations -> BucketName
$sel:expectedBucketOwner:ListBucketMetricsConfigurations' :: ListBucketMetricsConfigurations -> Maybe Text
$sel:continuationToken:ListBucketMetricsConfigurations' :: ListBucketMetricsConfigurations -> 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
"metrics"
      ]

-- | /See:/ 'newListBucketMetricsConfigurationsResponse' smart constructor.
data ListBucketMetricsConfigurationsResponse = ListBucketMetricsConfigurationsResponse'
  { -- | The marker that is used as a starting point for this metrics
    -- configuration list response. This value is present if it was sent in the
    -- request.
    ListBucketMetricsConfigurationsResponse -> Maybe Text
continuationToken :: Prelude.Maybe Prelude.Text,
    -- | The list of metrics configurations for a bucket.
    ListBucketMetricsConfigurationsResponse
-> Maybe [MetricsConfiguration]
metricsConfigurationList :: Prelude.Maybe [MetricsConfiguration],
    -- | The marker used to continue a metrics configuration listing that has
    -- been truncated. Use the @NextContinuationToken@ from a previously
    -- truncated list response to continue the listing. The continuation token
    -- is an opaque value that Amazon S3 understands.
    ListBucketMetricsConfigurationsResponse -> Maybe Text
nextContinuationToken :: Prelude.Maybe Prelude.Text,
    -- | Indicates whether the returned list of metrics configurations is
    -- complete. A value of true indicates that the list is not complete and
    -- the NextContinuationToken will be provided for a subsequent request.
    ListBucketMetricsConfigurationsResponse -> Maybe Bool
isTruncated :: Prelude.Maybe Prelude.Bool,
    -- | The response's http status code.
    ListBucketMetricsConfigurationsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListBucketMetricsConfigurationsResponse
-> ListBucketMetricsConfigurationsResponse -> Bool
(ListBucketMetricsConfigurationsResponse
 -> ListBucketMetricsConfigurationsResponse -> Bool)
-> (ListBucketMetricsConfigurationsResponse
    -> ListBucketMetricsConfigurationsResponse -> Bool)
-> Eq ListBucketMetricsConfigurationsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListBucketMetricsConfigurationsResponse
-> ListBucketMetricsConfigurationsResponse -> Bool
$c/= :: ListBucketMetricsConfigurationsResponse
-> ListBucketMetricsConfigurationsResponse -> Bool
== :: ListBucketMetricsConfigurationsResponse
-> ListBucketMetricsConfigurationsResponse -> Bool
$c== :: ListBucketMetricsConfigurationsResponse
-> ListBucketMetricsConfigurationsResponse -> Bool
Prelude.Eq, ReadPrec [ListBucketMetricsConfigurationsResponse]
ReadPrec ListBucketMetricsConfigurationsResponse
Int -> ReadS ListBucketMetricsConfigurationsResponse
ReadS [ListBucketMetricsConfigurationsResponse]
(Int -> ReadS ListBucketMetricsConfigurationsResponse)
-> ReadS [ListBucketMetricsConfigurationsResponse]
-> ReadPrec ListBucketMetricsConfigurationsResponse
-> ReadPrec [ListBucketMetricsConfigurationsResponse]
-> Read ListBucketMetricsConfigurationsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListBucketMetricsConfigurationsResponse]
$creadListPrec :: ReadPrec [ListBucketMetricsConfigurationsResponse]
readPrec :: ReadPrec ListBucketMetricsConfigurationsResponse
$creadPrec :: ReadPrec ListBucketMetricsConfigurationsResponse
readList :: ReadS [ListBucketMetricsConfigurationsResponse]
$creadList :: ReadS [ListBucketMetricsConfigurationsResponse]
readsPrec :: Int -> ReadS ListBucketMetricsConfigurationsResponse
$creadsPrec :: Int -> ReadS ListBucketMetricsConfigurationsResponse
Prelude.Read, Int -> ListBucketMetricsConfigurationsResponse -> ShowS
[ListBucketMetricsConfigurationsResponse] -> ShowS
ListBucketMetricsConfigurationsResponse -> String
(Int -> ListBucketMetricsConfigurationsResponse -> ShowS)
-> (ListBucketMetricsConfigurationsResponse -> String)
-> ([ListBucketMetricsConfigurationsResponse] -> ShowS)
-> Show ListBucketMetricsConfigurationsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListBucketMetricsConfigurationsResponse] -> ShowS
$cshowList :: [ListBucketMetricsConfigurationsResponse] -> ShowS
show :: ListBucketMetricsConfigurationsResponse -> String
$cshow :: ListBucketMetricsConfigurationsResponse -> String
showsPrec :: Int -> ListBucketMetricsConfigurationsResponse -> ShowS
$cshowsPrec :: Int -> ListBucketMetricsConfigurationsResponse -> ShowS
Prelude.Show, (forall x.
 ListBucketMetricsConfigurationsResponse
 -> Rep ListBucketMetricsConfigurationsResponse x)
-> (forall x.
    Rep ListBucketMetricsConfigurationsResponse x
    -> ListBucketMetricsConfigurationsResponse)
-> Generic ListBucketMetricsConfigurationsResponse
forall x.
Rep ListBucketMetricsConfigurationsResponse x
-> ListBucketMetricsConfigurationsResponse
forall x.
ListBucketMetricsConfigurationsResponse
-> Rep ListBucketMetricsConfigurationsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListBucketMetricsConfigurationsResponse x
-> ListBucketMetricsConfigurationsResponse
$cfrom :: forall x.
ListBucketMetricsConfigurationsResponse
-> Rep ListBucketMetricsConfigurationsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListBucketMetricsConfigurationsResponse' 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', 'listBucketMetricsConfigurationsResponse_continuationToken' - The marker that is used as a starting point for this metrics
-- configuration list response. This value is present if it was sent in the
-- request.
--
-- 'metricsConfigurationList', 'listBucketMetricsConfigurationsResponse_metricsConfigurationList' - The list of metrics configurations for a bucket.
--
-- 'nextContinuationToken', 'listBucketMetricsConfigurationsResponse_nextContinuationToken' - The marker used to continue a metrics configuration listing that has
-- been truncated. Use the @NextContinuationToken@ from a previously
-- truncated list response to continue the listing. The continuation token
-- is an opaque value that Amazon S3 understands.
--
-- 'isTruncated', 'listBucketMetricsConfigurationsResponse_isTruncated' - Indicates whether the returned list of metrics 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', 'listBucketMetricsConfigurationsResponse_httpStatus' - The response's http status code.
newListBucketMetricsConfigurationsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListBucketMetricsConfigurationsResponse
newListBucketMetricsConfigurationsResponse :: Int -> ListBucketMetricsConfigurationsResponse
newListBucketMetricsConfigurationsResponse
  Int
pHttpStatus_ =
    ListBucketMetricsConfigurationsResponse' :: Maybe Text
-> Maybe [MetricsConfiguration]
-> Maybe Text
-> Maybe Bool
-> Int
-> ListBucketMetricsConfigurationsResponse
ListBucketMetricsConfigurationsResponse'
      { $sel:continuationToken:ListBucketMetricsConfigurationsResponse' :: Maybe Text
continuationToken =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:metricsConfigurationList:ListBucketMetricsConfigurationsResponse' :: Maybe [MetricsConfiguration]
metricsConfigurationList =
          Maybe [MetricsConfiguration]
forall a. Maybe a
Prelude.Nothing,
        $sel:nextContinuationToken:ListBucketMetricsConfigurationsResponse' :: Maybe Text
nextContinuationToken =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:isTruncated:ListBucketMetricsConfigurationsResponse' :: Maybe Bool
isTruncated = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:ListBucketMetricsConfigurationsResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

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

-- | The list of metrics configurations for a bucket.
listBucketMetricsConfigurationsResponse_metricsConfigurationList :: Lens.Lens' ListBucketMetricsConfigurationsResponse (Prelude.Maybe [MetricsConfiguration])
listBucketMetricsConfigurationsResponse_metricsConfigurationList :: (Maybe [MetricsConfiguration] -> f (Maybe [MetricsConfiguration]))
-> ListBucketMetricsConfigurationsResponse
-> f ListBucketMetricsConfigurationsResponse
listBucketMetricsConfigurationsResponse_metricsConfigurationList = (ListBucketMetricsConfigurationsResponse
 -> Maybe [MetricsConfiguration])
-> (ListBucketMetricsConfigurationsResponse
    -> Maybe [MetricsConfiguration]
    -> ListBucketMetricsConfigurationsResponse)
-> Lens
     ListBucketMetricsConfigurationsResponse
     ListBucketMetricsConfigurationsResponse
     (Maybe [MetricsConfiguration])
     (Maybe [MetricsConfiguration])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListBucketMetricsConfigurationsResponse' {Maybe [MetricsConfiguration]
metricsConfigurationList :: Maybe [MetricsConfiguration]
$sel:metricsConfigurationList:ListBucketMetricsConfigurationsResponse' :: ListBucketMetricsConfigurationsResponse
-> Maybe [MetricsConfiguration]
metricsConfigurationList} -> Maybe [MetricsConfiguration]
metricsConfigurationList) (\s :: ListBucketMetricsConfigurationsResponse
s@ListBucketMetricsConfigurationsResponse' {} Maybe [MetricsConfiguration]
a -> ListBucketMetricsConfigurationsResponse
s {$sel:metricsConfigurationList:ListBucketMetricsConfigurationsResponse' :: Maybe [MetricsConfiguration]
metricsConfigurationList = Maybe [MetricsConfiguration]
a} :: ListBucketMetricsConfigurationsResponse) ((Maybe [MetricsConfiguration] -> f (Maybe [MetricsConfiguration]))
 -> ListBucketMetricsConfigurationsResponse
 -> f ListBucketMetricsConfigurationsResponse)
-> ((Maybe [MetricsConfiguration]
     -> f (Maybe [MetricsConfiguration]))
    -> Maybe [MetricsConfiguration]
    -> f (Maybe [MetricsConfiguration]))
-> (Maybe [MetricsConfiguration]
    -> f (Maybe [MetricsConfiguration]))
-> ListBucketMetricsConfigurationsResponse
-> f ListBucketMetricsConfigurationsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [MetricsConfiguration]
  [MetricsConfiguration]
  [MetricsConfiguration]
  [MetricsConfiguration]
-> Iso
     (Maybe [MetricsConfiguration])
     (Maybe [MetricsConfiguration])
     (Maybe [MetricsConfiguration])
     (Maybe [MetricsConfiguration])
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
  [MetricsConfiguration]
  [MetricsConfiguration]
  [MetricsConfiguration]
  [MetricsConfiguration]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The marker used to continue a metrics configuration listing that has
-- been truncated. Use the @NextContinuationToken@ from a previously
-- truncated list response to continue the listing. The continuation token
-- is an opaque value that Amazon S3 understands.
listBucketMetricsConfigurationsResponse_nextContinuationToken :: Lens.Lens' ListBucketMetricsConfigurationsResponse (Prelude.Maybe Prelude.Text)
listBucketMetricsConfigurationsResponse_nextContinuationToken :: (Maybe Text -> f (Maybe Text))
-> ListBucketMetricsConfigurationsResponse
-> f ListBucketMetricsConfigurationsResponse
listBucketMetricsConfigurationsResponse_nextContinuationToken = (ListBucketMetricsConfigurationsResponse -> Maybe Text)
-> (ListBucketMetricsConfigurationsResponse
    -> Maybe Text -> ListBucketMetricsConfigurationsResponse)
-> Lens
     ListBucketMetricsConfigurationsResponse
     ListBucketMetricsConfigurationsResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListBucketMetricsConfigurationsResponse' {Maybe Text
nextContinuationToken :: Maybe Text
$sel:nextContinuationToken:ListBucketMetricsConfigurationsResponse' :: ListBucketMetricsConfigurationsResponse -> Maybe Text
nextContinuationToken} -> Maybe Text
nextContinuationToken) (\s :: ListBucketMetricsConfigurationsResponse
s@ListBucketMetricsConfigurationsResponse' {} Maybe Text
a -> ListBucketMetricsConfigurationsResponse
s {$sel:nextContinuationToken:ListBucketMetricsConfigurationsResponse' :: Maybe Text
nextContinuationToken = Maybe Text
a} :: ListBucketMetricsConfigurationsResponse)

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

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

instance
  Prelude.NFData
    ListBucketMetricsConfigurationsResponse