{-# 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.GetBucketMetricsConfiguration
-- 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)
--
-- Gets a metrics configuration (specified by the metrics configuration ID)
-- from the bucket. Note that this doesn\'t include the daily storage
-- metrics.
--
-- 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 information about CloudWatch request metrics for Amazon S3, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/cloudwatch-monitoring.html Monitoring Metrics with Amazon CloudWatch>.
--
-- The following operations are related to @GetBucketMetricsConfiguration@:
--
-- -   <https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketMetricsConfiguration.html PutBucketMetricsConfiguration>
--
-- -   <https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketMetricsConfiguration.html DeleteBucketMetricsConfiguration>
--
-- -   <https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketMetricsConfigurations.html ListBucketMetricsConfigurations>
--
-- -   <https://docs.aws.amazon.com/AmazonS3/latest/dev/cloudwatch-monitoring.html Monitoring Metrics with Amazon CloudWatch>
module Amazonka.S3.GetBucketMetricsConfiguration
  ( -- * Creating a Request
    GetBucketMetricsConfiguration (..),
    newGetBucketMetricsConfiguration,

    -- * Request Lenses
    getBucketMetricsConfiguration_expectedBucketOwner,
    getBucketMetricsConfiguration_bucket,
    getBucketMetricsConfiguration_id,

    -- * Destructuring the Response
    GetBucketMetricsConfigurationResponse (..),
    newGetBucketMetricsConfigurationResponse,

    -- * Response Lenses
    getBucketMetricsConfigurationResponse_metricsConfiguration,
    getBucketMetricsConfigurationResponse_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:/ 'newGetBucketMetricsConfiguration' smart constructor.
data GetBucketMetricsConfiguration = GetBucketMetricsConfiguration'
  { -- | 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.
    GetBucketMetricsConfiguration -> Maybe Text
expectedBucketOwner :: Prelude.Maybe Prelude.Text,
    -- | The name of the bucket containing the metrics configuration to retrieve.
    GetBucketMetricsConfiguration -> BucketName
bucket :: BucketName,
    -- | The ID used to identify the metrics configuration.
    GetBucketMetricsConfiguration -> Text
id :: Prelude.Text
  }
  deriving (GetBucketMetricsConfiguration
-> GetBucketMetricsConfiguration -> Bool
(GetBucketMetricsConfiguration
 -> GetBucketMetricsConfiguration -> Bool)
-> (GetBucketMetricsConfiguration
    -> GetBucketMetricsConfiguration -> Bool)
-> Eq GetBucketMetricsConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetBucketMetricsConfiguration
-> GetBucketMetricsConfiguration -> Bool
$c/= :: GetBucketMetricsConfiguration
-> GetBucketMetricsConfiguration -> Bool
== :: GetBucketMetricsConfiguration
-> GetBucketMetricsConfiguration -> Bool
$c== :: GetBucketMetricsConfiguration
-> GetBucketMetricsConfiguration -> Bool
Prelude.Eq, ReadPrec [GetBucketMetricsConfiguration]
ReadPrec GetBucketMetricsConfiguration
Int -> ReadS GetBucketMetricsConfiguration
ReadS [GetBucketMetricsConfiguration]
(Int -> ReadS GetBucketMetricsConfiguration)
-> ReadS [GetBucketMetricsConfiguration]
-> ReadPrec GetBucketMetricsConfiguration
-> ReadPrec [GetBucketMetricsConfiguration]
-> Read GetBucketMetricsConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetBucketMetricsConfiguration]
$creadListPrec :: ReadPrec [GetBucketMetricsConfiguration]
readPrec :: ReadPrec GetBucketMetricsConfiguration
$creadPrec :: ReadPrec GetBucketMetricsConfiguration
readList :: ReadS [GetBucketMetricsConfiguration]
$creadList :: ReadS [GetBucketMetricsConfiguration]
readsPrec :: Int -> ReadS GetBucketMetricsConfiguration
$creadsPrec :: Int -> ReadS GetBucketMetricsConfiguration
Prelude.Read, Int -> GetBucketMetricsConfiguration -> ShowS
[GetBucketMetricsConfiguration] -> ShowS
GetBucketMetricsConfiguration -> String
(Int -> GetBucketMetricsConfiguration -> ShowS)
-> (GetBucketMetricsConfiguration -> String)
-> ([GetBucketMetricsConfiguration] -> ShowS)
-> Show GetBucketMetricsConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetBucketMetricsConfiguration] -> ShowS
$cshowList :: [GetBucketMetricsConfiguration] -> ShowS
show :: GetBucketMetricsConfiguration -> String
$cshow :: GetBucketMetricsConfiguration -> String
showsPrec :: Int -> GetBucketMetricsConfiguration -> ShowS
$cshowsPrec :: Int -> GetBucketMetricsConfiguration -> ShowS
Prelude.Show, (forall x.
 GetBucketMetricsConfiguration
 -> Rep GetBucketMetricsConfiguration x)
-> (forall x.
    Rep GetBucketMetricsConfiguration x
    -> GetBucketMetricsConfiguration)
-> Generic GetBucketMetricsConfiguration
forall x.
Rep GetBucketMetricsConfiguration x
-> GetBucketMetricsConfiguration
forall x.
GetBucketMetricsConfiguration
-> Rep GetBucketMetricsConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetBucketMetricsConfiguration x
-> GetBucketMetricsConfiguration
$cfrom :: forall x.
GetBucketMetricsConfiguration
-> Rep GetBucketMetricsConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'GetBucketMetricsConfiguration' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'expectedBucketOwner', 'getBucketMetricsConfiguration_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', 'getBucketMetricsConfiguration_bucket' - The name of the bucket containing the metrics configuration to retrieve.
--
-- 'id', 'getBucketMetricsConfiguration_id' - The ID used to identify the metrics configuration.
newGetBucketMetricsConfiguration ::
  -- | 'bucket'
  BucketName ->
  -- | 'id'
  Prelude.Text ->
  GetBucketMetricsConfiguration
newGetBucketMetricsConfiguration :: BucketName -> Text -> GetBucketMetricsConfiguration
newGetBucketMetricsConfiguration BucketName
pBucket_ Text
pId_ =
  GetBucketMetricsConfiguration' :: Maybe Text -> BucketName -> Text -> GetBucketMetricsConfiguration
GetBucketMetricsConfiguration'
    { $sel:expectedBucketOwner:GetBucketMetricsConfiguration' :: Maybe Text
expectedBucketOwner =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:bucket:GetBucketMetricsConfiguration' :: BucketName
bucket = BucketName
pBucket_,
      $sel:id:GetBucketMetricsConfiguration' :: Text
id = Text
pId_
    }

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

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

-- | The ID used to identify the metrics configuration.
getBucketMetricsConfiguration_id :: Lens.Lens' GetBucketMetricsConfiguration Prelude.Text
getBucketMetricsConfiguration_id :: (Text -> f Text)
-> GetBucketMetricsConfiguration -> f GetBucketMetricsConfiguration
getBucketMetricsConfiguration_id = (GetBucketMetricsConfiguration -> Text)
-> (GetBucketMetricsConfiguration
    -> Text -> GetBucketMetricsConfiguration)
-> Lens
     GetBucketMetricsConfiguration
     GetBucketMetricsConfiguration
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBucketMetricsConfiguration' {Text
id :: Text
$sel:id:GetBucketMetricsConfiguration' :: GetBucketMetricsConfiguration -> Text
id} -> Text
id) (\s :: GetBucketMetricsConfiguration
s@GetBucketMetricsConfiguration' {} Text
a -> GetBucketMetricsConfiguration
s {$sel:id:GetBucketMetricsConfiguration' :: Text
id = Text
a} :: GetBucketMetricsConfiguration)

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

instance Prelude.NFData GetBucketMetricsConfiguration

instance Core.ToHeaders GetBucketMetricsConfiguration where
  toHeaders :: GetBucketMetricsConfiguration -> ResponseHeaders
toHeaders GetBucketMetricsConfiguration' {Maybe Text
Text
BucketName
id :: Text
bucket :: BucketName
expectedBucketOwner :: Maybe Text
$sel:id:GetBucketMetricsConfiguration' :: GetBucketMetricsConfiguration -> Text
$sel:bucket:GetBucketMetricsConfiguration' :: GetBucketMetricsConfiguration -> BucketName
$sel:expectedBucketOwner:GetBucketMetricsConfiguration' :: GetBucketMetricsConfiguration -> 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 GetBucketMetricsConfiguration where
  toPath :: GetBucketMetricsConfiguration -> ByteString
toPath GetBucketMetricsConfiguration' {Maybe Text
Text
BucketName
id :: Text
bucket :: BucketName
expectedBucketOwner :: Maybe Text
$sel:id:GetBucketMetricsConfiguration' :: GetBucketMetricsConfiguration -> Text
$sel:bucket:GetBucketMetricsConfiguration' :: GetBucketMetricsConfiguration -> BucketName
$sel:expectedBucketOwner:GetBucketMetricsConfiguration' :: GetBucketMetricsConfiguration -> 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 GetBucketMetricsConfiguration where
  toQuery :: GetBucketMetricsConfiguration -> QueryString
toQuery GetBucketMetricsConfiguration' {Maybe Text
Text
BucketName
id :: Text
bucket :: BucketName
expectedBucketOwner :: Maybe Text
$sel:id:GetBucketMetricsConfiguration' :: GetBucketMetricsConfiguration -> Text
$sel:bucket:GetBucketMetricsConfiguration' :: GetBucketMetricsConfiguration -> BucketName
$sel:expectedBucketOwner:GetBucketMetricsConfiguration' :: GetBucketMetricsConfiguration -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"id" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
id, QueryString
"metrics"]

-- | /See:/ 'newGetBucketMetricsConfigurationResponse' smart constructor.
data GetBucketMetricsConfigurationResponse = GetBucketMetricsConfigurationResponse'
  { -- | Specifies the metrics configuration.
    GetBucketMetricsConfigurationResponse -> Maybe MetricsConfiguration
metricsConfiguration :: Prelude.Maybe MetricsConfiguration,
    -- | The response's http status code.
    GetBucketMetricsConfigurationResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetBucketMetricsConfigurationResponse
-> GetBucketMetricsConfigurationResponse -> Bool
(GetBucketMetricsConfigurationResponse
 -> GetBucketMetricsConfigurationResponse -> Bool)
-> (GetBucketMetricsConfigurationResponse
    -> GetBucketMetricsConfigurationResponse -> Bool)
-> Eq GetBucketMetricsConfigurationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetBucketMetricsConfigurationResponse
-> GetBucketMetricsConfigurationResponse -> Bool
$c/= :: GetBucketMetricsConfigurationResponse
-> GetBucketMetricsConfigurationResponse -> Bool
== :: GetBucketMetricsConfigurationResponse
-> GetBucketMetricsConfigurationResponse -> Bool
$c== :: GetBucketMetricsConfigurationResponse
-> GetBucketMetricsConfigurationResponse -> Bool
Prelude.Eq, ReadPrec [GetBucketMetricsConfigurationResponse]
ReadPrec GetBucketMetricsConfigurationResponse
Int -> ReadS GetBucketMetricsConfigurationResponse
ReadS [GetBucketMetricsConfigurationResponse]
(Int -> ReadS GetBucketMetricsConfigurationResponse)
-> ReadS [GetBucketMetricsConfigurationResponse]
-> ReadPrec GetBucketMetricsConfigurationResponse
-> ReadPrec [GetBucketMetricsConfigurationResponse]
-> Read GetBucketMetricsConfigurationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetBucketMetricsConfigurationResponse]
$creadListPrec :: ReadPrec [GetBucketMetricsConfigurationResponse]
readPrec :: ReadPrec GetBucketMetricsConfigurationResponse
$creadPrec :: ReadPrec GetBucketMetricsConfigurationResponse
readList :: ReadS [GetBucketMetricsConfigurationResponse]
$creadList :: ReadS [GetBucketMetricsConfigurationResponse]
readsPrec :: Int -> ReadS GetBucketMetricsConfigurationResponse
$creadsPrec :: Int -> ReadS GetBucketMetricsConfigurationResponse
Prelude.Read, Int -> GetBucketMetricsConfigurationResponse -> ShowS
[GetBucketMetricsConfigurationResponse] -> ShowS
GetBucketMetricsConfigurationResponse -> String
(Int -> GetBucketMetricsConfigurationResponse -> ShowS)
-> (GetBucketMetricsConfigurationResponse -> String)
-> ([GetBucketMetricsConfigurationResponse] -> ShowS)
-> Show GetBucketMetricsConfigurationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetBucketMetricsConfigurationResponse] -> ShowS
$cshowList :: [GetBucketMetricsConfigurationResponse] -> ShowS
show :: GetBucketMetricsConfigurationResponse -> String
$cshow :: GetBucketMetricsConfigurationResponse -> String
showsPrec :: Int -> GetBucketMetricsConfigurationResponse -> ShowS
$cshowsPrec :: Int -> GetBucketMetricsConfigurationResponse -> ShowS
Prelude.Show, (forall x.
 GetBucketMetricsConfigurationResponse
 -> Rep GetBucketMetricsConfigurationResponse x)
-> (forall x.
    Rep GetBucketMetricsConfigurationResponse x
    -> GetBucketMetricsConfigurationResponse)
-> Generic GetBucketMetricsConfigurationResponse
forall x.
Rep GetBucketMetricsConfigurationResponse x
-> GetBucketMetricsConfigurationResponse
forall x.
GetBucketMetricsConfigurationResponse
-> Rep GetBucketMetricsConfigurationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetBucketMetricsConfigurationResponse x
-> GetBucketMetricsConfigurationResponse
$cfrom :: forall x.
GetBucketMetricsConfigurationResponse
-> Rep GetBucketMetricsConfigurationResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetBucketMetricsConfigurationResponse' 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:
--
-- 'metricsConfiguration', 'getBucketMetricsConfigurationResponse_metricsConfiguration' - Specifies the metrics configuration.
--
-- 'httpStatus', 'getBucketMetricsConfigurationResponse_httpStatus' - The response's http status code.
newGetBucketMetricsConfigurationResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetBucketMetricsConfigurationResponse
newGetBucketMetricsConfigurationResponse :: Int -> GetBucketMetricsConfigurationResponse
newGetBucketMetricsConfigurationResponse Int
pHttpStatus_ =
  GetBucketMetricsConfigurationResponse' :: Maybe MetricsConfiguration
-> Int -> GetBucketMetricsConfigurationResponse
GetBucketMetricsConfigurationResponse'
    { $sel:metricsConfiguration:GetBucketMetricsConfigurationResponse' :: Maybe MetricsConfiguration
metricsConfiguration =
        Maybe MetricsConfiguration
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetBucketMetricsConfigurationResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Specifies the metrics configuration.
getBucketMetricsConfigurationResponse_metricsConfiguration :: Lens.Lens' GetBucketMetricsConfigurationResponse (Prelude.Maybe MetricsConfiguration)
getBucketMetricsConfigurationResponse_metricsConfiguration :: (Maybe MetricsConfiguration -> f (Maybe MetricsConfiguration))
-> GetBucketMetricsConfigurationResponse
-> f GetBucketMetricsConfigurationResponse
getBucketMetricsConfigurationResponse_metricsConfiguration = (GetBucketMetricsConfigurationResponse
 -> Maybe MetricsConfiguration)
-> (GetBucketMetricsConfigurationResponse
    -> Maybe MetricsConfiguration
    -> GetBucketMetricsConfigurationResponse)
-> Lens
     GetBucketMetricsConfigurationResponse
     GetBucketMetricsConfigurationResponse
     (Maybe MetricsConfiguration)
     (Maybe MetricsConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBucketMetricsConfigurationResponse' {Maybe MetricsConfiguration
metricsConfiguration :: Maybe MetricsConfiguration
$sel:metricsConfiguration:GetBucketMetricsConfigurationResponse' :: GetBucketMetricsConfigurationResponse -> Maybe MetricsConfiguration
metricsConfiguration} -> Maybe MetricsConfiguration
metricsConfiguration) (\s :: GetBucketMetricsConfigurationResponse
s@GetBucketMetricsConfigurationResponse' {} Maybe MetricsConfiguration
a -> GetBucketMetricsConfigurationResponse
s {$sel:metricsConfiguration:GetBucketMetricsConfigurationResponse' :: Maybe MetricsConfiguration
metricsConfiguration = Maybe MetricsConfiguration
a} :: GetBucketMetricsConfigurationResponse)

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

instance
  Prelude.NFData
    GetBucketMetricsConfigurationResponse