{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- 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_isTruncated,
    listBucketMetricsConfigurationsResponse_metricsConfigurationList,
    listBucketMetricsConfigurationsResponse_nextContinuationToken,
    listBucketMetricsConfigurationsResponse_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:/ '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 fails with the HTTP status code
    -- @403 Forbidden@ (access denied).
    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
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]
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
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.
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 fails with the HTTP status code
-- @403 Forbidden@ (access denied).
--
-- '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'
    { $sel:continuationToken:ListBucketMetricsConfigurations' :: Maybe Text
continuationToken =
        forall a. Maybe a
Prelude.Nothing,
      $sel:expectedBucketOwner:ListBucketMetricsConfigurations' :: Maybe Text
expectedBucketOwner = 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 :: Lens' ListBucketMetricsConfigurations (Maybe Text)
listBucketMetricsConfigurations_continuationToken = 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 fails with the HTTP status code
-- @403 Forbidden@ (access denied).
listBucketMetricsConfigurations_expectedBucketOwner :: Lens.Lens' ListBucketMetricsConfigurations (Prelude.Maybe Prelude.Text)
listBucketMetricsConfigurations_expectedBucketOwner :: Lens' ListBucketMetricsConfigurations (Maybe Text)
listBucketMetricsConfigurations_expectedBucketOwner = 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 :: Lens' ListBucketMetricsConfigurations BucketName
listBucketMetricsConfigurations_bucket = 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 :: (Service -> Service)
-> ListBucketMetricsConfigurations
-> Request ListBucketMetricsConfigurations
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 ListBucketMetricsConfigurations
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse ListBucketMetricsConfigurations)))
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 Text
-> Maybe Bool
-> Maybe [MetricsConfiguration]
-> Maybe Text
-> Int
-> ListBucketMetricsConfigurationsResponse
ListBucketMetricsConfigurationsResponse'
            forall (f :: * -> *) a b. Functor 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.<*> ( 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
"MetricsConfiguration")
                            [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
"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
    ListBucketMetricsConfigurations
  where
  hashWithSalt :: Int -> ListBucketMetricsConfigurations -> Int
hashWithSalt
    Int
_salt
    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
..} =
      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
    ListBucketMetricsConfigurations
  where
  rnf :: ListBucketMetricsConfigurations -> ()
rnf 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
..} =
    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
    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
..} =
    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 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
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"/", forall a. ToByteString a => a -> ByteString
Data.toBS BucketName
bucket]

instance Data.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
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"continuation-token" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: 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,
    -- | 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 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,
    -- | The response's http status code.
    ListBucketMetricsConfigurationsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListBucketMetricsConfigurationsResponse
-> ListBucketMetricsConfigurationsResponse -> Bool
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]
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
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.
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.
--
-- '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.
--
-- '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.
--
-- 'httpStatus', 'listBucketMetricsConfigurationsResponse_httpStatus' - The response's http status code.
newListBucketMetricsConfigurationsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListBucketMetricsConfigurationsResponse
newListBucketMetricsConfigurationsResponse :: Int -> ListBucketMetricsConfigurationsResponse
newListBucketMetricsConfigurationsResponse
  Int
pHttpStatus_ =
    ListBucketMetricsConfigurationsResponse'
      { $sel:continuationToken:ListBucketMetricsConfigurationsResponse' :: Maybe Text
continuationToken =
          forall a. Maybe a
Prelude.Nothing,
        $sel:isTruncated:ListBucketMetricsConfigurationsResponse' :: Maybe Bool
isTruncated = forall a. Maybe a
Prelude.Nothing,
        $sel:metricsConfigurationList:ListBucketMetricsConfigurationsResponse' :: Maybe [MetricsConfiguration]
metricsConfigurationList =
          forall a. Maybe a
Prelude.Nothing,
        $sel:nextContinuationToken:ListBucketMetricsConfigurationsResponse' :: Maybe Text
nextContinuationToken =
          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 :: Lens' ListBucketMetricsConfigurationsResponse (Maybe Text)
listBucketMetricsConfigurationsResponse_continuationToken = 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)

-- | 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 :: Lens' ListBucketMetricsConfigurationsResponse (Maybe Bool)
listBucketMetricsConfigurationsResponse_isTruncated = 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 list of metrics configurations for a bucket.
listBucketMetricsConfigurationsResponse_metricsConfigurationList :: Lens.Lens' ListBucketMetricsConfigurationsResponse (Prelude.Maybe [MetricsConfiguration])
listBucketMetricsConfigurationsResponse_metricsConfigurationList :: Lens'
  ListBucketMetricsConfigurationsResponse
  (Maybe [MetricsConfiguration])
listBucketMetricsConfigurationsResponse_metricsConfigurationList = 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) 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 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 :: Lens' ListBucketMetricsConfigurationsResponse (Maybe Text)
listBucketMetricsConfigurationsResponse_nextContinuationToken = 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)

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