{-# 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.GetBucketLifecycleConfiguration
-- 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)
--
-- Bucket lifecycle configuration now supports specifying a lifecycle rule
-- using an object key name prefix, one or more object tags, or a
-- combination of both. Accordingly, this section describes the latest API.
-- The response describes the new filter element that you can use to
-- specify a filter to select a subset of objects to which the rule
-- applies. If you are using a previous version of the lifecycle
-- configuration, it still works. For the earlier action, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLifecycle.html GetBucketLifecycle>.
--
-- Returns the lifecycle configuration information set on the bucket. For
-- information about lifecycle configuration, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html Object Lifecycle Management>.
--
-- To use this operation, you must have permission to perform the
-- @s3:GetLifecycleConfiguration@ 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>.
--
-- @GetBucketLifecycleConfiguration@ has the following special error:
--
-- -   Error code: @NoSuchLifecycleConfiguration@
--
--     -   Description: The lifecycle configuration does not exist.
--
--     -   HTTP Status Code: 404 Not Found
--
--     -   SOAP Fault Code Prefix: Client
--
-- The following operations are related to
-- @GetBucketLifecycleConfiguration@:
--
-- -   <https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLifecycle.html GetBucketLifecycle>
--
-- -   <https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycle.html PutBucketLifecycle>
--
-- -   <https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketLifecycle.html DeleteBucketLifecycle>
module Amazonka.S3.GetBucketLifecycleConfiguration
  ( -- * Creating a Request
    GetBucketLifecycleConfiguration (..),
    newGetBucketLifecycleConfiguration,

    -- * Request Lenses
    getBucketLifecycleConfiguration_expectedBucketOwner,
    getBucketLifecycleConfiguration_bucket,

    -- * Destructuring the Response
    GetBucketLifecycleConfigurationResponse (..),
    newGetBucketLifecycleConfigurationResponse,

    -- * Response Lenses
    getBucketLifecycleConfigurationResponse_rules,
    getBucketLifecycleConfigurationResponse_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:/ 'newGetBucketLifecycleConfiguration' smart constructor.
data GetBucketLifecycleConfiguration = GetBucketLifecycleConfiguration'
  { -- | 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.
    GetBucketLifecycleConfiguration -> Maybe Text
expectedBucketOwner :: Prelude.Maybe Prelude.Text,
    -- | The name of the bucket for which to get the lifecycle information.
    GetBucketLifecycleConfiguration -> BucketName
bucket :: BucketName
  }
  deriving (GetBucketLifecycleConfiguration
-> GetBucketLifecycleConfiguration -> Bool
(GetBucketLifecycleConfiguration
 -> GetBucketLifecycleConfiguration -> Bool)
-> (GetBucketLifecycleConfiguration
    -> GetBucketLifecycleConfiguration -> Bool)
-> Eq GetBucketLifecycleConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetBucketLifecycleConfiguration
-> GetBucketLifecycleConfiguration -> Bool
$c/= :: GetBucketLifecycleConfiguration
-> GetBucketLifecycleConfiguration -> Bool
== :: GetBucketLifecycleConfiguration
-> GetBucketLifecycleConfiguration -> Bool
$c== :: GetBucketLifecycleConfiguration
-> GetBucketLifecycleConfiguration -> Bool
Prelude.Eq, ReadPrec [GetBucketLifecycleConfiguration]
ReadPrec GetBucketLifecycleConfiguration
Int -> ReadS GetBucketLifecycleConfiguration
ReadS [GetBucketLifecycleConfiguration]
(Int -> ReadS GetBucketLifecycleConfiguration)
-> ReadS [GetBucketLifecycleConfiguration]
-> ReadPrec GetBucketLifecycleConfiguration
-> ReadPrec [GetBucketLifecycleConfiguration]
-> Read GetBucketLifecycleConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetBucketLifecycleConfiguration]
$creadListPrec :: ReadPrec [GetBucketLifecycleConfiguration]
readPrec :: ReadPrec GetBucketLifecycleConfiguration
$creadPrec :: ReadPrec GetBucketLifecycleConfiguration
readList :: ReadS [GetBucketLifecycleConfiguration]
$creadList :: ReadS [GetBucketLifecycleConfiguration]
readsPrec :: Int -> ReadS GetBucketLifecycleConfiguration
$creadsPrec :: Int -> ReadS GetBucketLifecycleConfiguration
Prelude.Read, Int -> GetBucketLifecycleConfiguration -> ShowS
[GetBucketLifecycleConfiguration] -> ShowS
GetBucketLifecycleConfiguration -> String
(Int -> GetBucketLifecycleConfiguration -> ShowS)
-> (GetBucketLifecycleConfiguration -> String)
-> ([GetBucketLifecycleConfiguration] -> ShowS)
-> Show GetBucketLifecycleConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetBucketLifecycleConfiguration] -> ShowS
$cshowList :: [GetBucketLifecycleConfiguration] -> ShowS
show :: GetBucketLifecycleConfiguration -> String
$cshow :: GetBucketLifecycleConfiguration -> String
showsPrec :: Int -> GetBucketLifecycleConfiguration -> ShowS
$cshowsPrec :: Int -> GetBucketLifecycleConfiguration -> ShowS
Prelude.Show, (forall x.
 GetBucketLifecycleConfiguration
 -> Rep GetBucketLifecycleConfiguration x)
-> (forall x.
    Rep GetBucketLifecycleConfiguration x
    -> GetBucketLifecycleConfiguration)
-> Generic GetBucketLifecycleConfiguration
forall x.
Rep GetBucketLifecycleConfiguration x
-> GetBucketLifecycleConfiguration
forall x.
GetBucketLifecycleConfiguration
-> Rep GetBucketLifecycleConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetBucketLifecycleConfiguration x
-> GetBucketLifecycleConfiguration
$cfrom :: forall x.
GetBucketLifecycleConfiguration
-> Rep GetBucketLifecycleConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'GetBucketLifecycleConfiguration' 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', 'getBucketLifecycleConfiguration_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', 'getBucketLifecycleConfiguration_bucket' - The name of the bucket for which to get the lifecycle information.
newGetBucketLifecycleConfiguration ::
  -- | 'bucket'
  BucketName ->
  GetBucketLifecycleConfiguration
newGetBucketLifecycleConfiguration :: BucketName -> GetBucketLifecycleConfiguration
newGetBucketLifecycleConfiguration BucketName
pBucket_ =
  GetBucketLifecycleConfiguration' :: Maybe Text -> BucketName -> GetBucketLifecycleConfiguration
GetBucketLifecycleConfiguration'
    { $sel:expectedBucketOwner:GetBucketLifecycleConfiguration' :: Maybe Text
expectedBucketOwner =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:bucket:GetBucketLifecycleConfiguration' :: BucketName
bucket = BucketName
pBucket_
    }

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

-- | The name of the bucket for which to get the lifecycle information.
getBucketLifecycleConfiguration_bucket :: Lens.Lens' GetBucketLifecycleConfiguration BucketName
getBucketLifecycleConfiguration_bucket :: (BucketName -> f BucketName)
-> GetBucketLifecycleConfiguration
-> f GetBucketLifecycleConfiguration
getBucketLifecycleConfiguration_bucket = (GetBucketLifecycleConfiguration -> BucketName)
-> (GetBucketLifecycleConfiguration
    -> BucketName -> GetBucketLifecycleConfiguration)
-> Lens
     GetBucketLifecycleConfiguration
     GetBucketLifecycleConfiguration
     BucketName
     BucketName
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBucketLifecycleConfiguration' {BucketName
bucket :: BucketName
$sel:bucket:GetBucketLifecycleConfiguration' :: GetBucketLifecycleConfiguration -> BucketName
bucket} -> BucketName
bucket) (\s :: GetBucketLifecycleConfiguration
s@GetBucketLifecycleConfiguration' {} BucketName
a -> GetBucketLifecycleConfiguration
s {$sel:bucket:GetBucketLifecycleConfiguration' :: BucketName
bucket = BucketName
a} :: GetBucketLifecycleConfiguration)

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

instance
  Prelude.NFData
    GetBucketLifecycleConfiguration

instance
  Core.ToHeaders
    GetBucketLifecycleConfiguration
  where
  toHeaders :: GetBucketLifecycleConfiguration -> ResponseHeaders
toHeaders GetBucketLifecycleConfiguration' {Maybe Text
BucketName
bucket :: BucketName
expectedBucketOwner :: Maybe Text
$sel:bucket:GetBucketLifecycleConfiguration' :: GetBucketLifecycleConfiguration -> BucketName
$sel:expectedBucketOwner:GetBucketLifecycleConfiguration' :: GetBucketLifecycleConfiguration -> 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 GetBucketLifecycleConfiguration where
  toPath :: GetBucketLifecycleConfiguration -> ByteString
toPath GetBucketLifecycleConfiguration' {Maybe Text
BucketName
bucket :: BucketName
expectedBucketOwner :: Maybe Text
$sel:bucket:GetBucketLifecycleConfiguration' :: GetBucketLifecycleConfiguration -> BucketName
$sel:expectedBucketOwner:GetBucketLifecycleConfiguration' :: GetBucketLifecycleConfiguration -> 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 GetBucketLifecycleConfiguration where
  toQuery :: GetBucketLifecycleConfiguration -> QueryString
toQuery =
    QueryString -> GetBucketLifecycleConfiguration -> QueryString
forall a b. a -> b -> a
Prelude.const ([QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat [QueryString
"lifecycle"])

-- | /See:/ 'newGetBucketLifecycleConfigurationResponse' smart constructor.
data GetBucketLifecycleConfigurationResponse = GetBucketLifecycleConfigurationResponse'
  { -- | Container for a lifecycle rule.
    GetBucketLifecycleConfigurationResponse -> Maybe [LifecycleRule]
rules :: Prelude.Maybe [LifecycleRule],
    -- | The response's http status code.
    GetBucketLifecycleConfigurationResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetBucketLifecycleConfigurationResponse
-> GetBucketLifecycleConfigurationResponse -> Bool
(GetBucketLifecycleConfigurationResponse
 -> GetBucketLifecycleConfigurationResponse -> Bool)
-> (GetBucketLifecycleConfigurationResponse
    -> GetBucketLifecycleConfigurationResponse -> Bool)
-> Eq GetBucketLifecycleConfigurationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetBucketLifecycleConfigurationResponse
-> GetBucketLifecycleConfigurationResponse -> Bool
$c/= :: GetBucketLifecycleConfigurationResponse
-> GetBucketLifecycleConfigurationResponse -> Bool
== :: GetBucketLifecycleConfigurationResponse
-> GetBucketLifecycleConfigurationResponse -> Bool
$c== :: GetBucketLifecycleConfigurationResponse
-> GetBucketLifecycleConfigurationResponse -> Bool
Prelude.Eq, ReadPrec [GetBucketLifecycleConfigurationResponse]
ReadPrec GetBucketLifecycleConfigurationResponse
Int -> ReadS GetBucketLifecycleConfigurationResponse
ReadS [GetBucketLifecycleConfigurationResponse]
(Int -> ReadS GetBucketLifecycleConfigurationResponse)
-> ReadS [GetBucketLifecycleConfigurationResponse]
-> ReadPrec GetBucketLifecycleConfigurationResponse
-> ReadPrec [GetBucketLifecycleConfigurationResponse]
-> Read GetBucketLifecycleConfigurationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetBucketLifecycleConfigurationResponse]
$creadListPrec :: ReadPrec [GetBucketLifecycleConfigurationResponse]
readPrec :: ReadPrec GetBucketLifecycleConfigurationResponse
$creadPrec :: ReadPrec GetBucketLifecycleConfigurationResponse
readList :: ReadS [GetBucketLifecycleConfigurationResponse]
$creadList :: ReadS [GetBucketLifecycleConfigurationResponse]
readsPrec :: Int -> ReadS GetBucketLifecycleConfigurationResponse
$creadsPrec :: Int -> ReadS GetBucketLifecycleConfigurationResponse
Prelude.Read, Int -> GetBucketLifecycleConfigurationResponse -> ShowS
[GetBucketLifecycleConfigurationResponse] -> ShowS
GetBucketLifecycleConfigurationResponse -> String
(Int -> GetBucketLifecycleConfigurationResponse -> ShowS)
-> (GetBucketLifecycleConfigurationResponse -> String)
-> ([GetBucketLifecycleConfigurationResponse] -> ShowS)
-> Show GetBucketLifecycleConfigurationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetBucketLifecycleConfigurationResponse] -> ShowS
$cshowList :: [GetBucketLifecycleConfigurationResponse] -> ShowS
show :: GetBucketLifecycleConfigurationResponse -> String
$cshow :: GetBucketLifecycleConfigurationResponse -> String
showsPrec :: Int -> GetBucketLifecycleConfigurationResponse -> ShowS
$cshowsPrec :: Int -> GetBucketLifecycleConfigurationResponse -> ShowS
Prelude.Show, (forall x.
 GetBucketLifecycleConfigurationResponse
 -> Rep GetBucketLifecycleConfigurationResponse x)
-> (forall x.
    Rep GetBucketLifecycleConfigurationResponse x
    -> GetBucketLifecycleConfigurationResponse)
-> Generic GetBucketLifecycleConfigurationResponse
forall x.
Rep GetBucketLifecycleConfigurationResponse x
-> GetBucketLifecycleConfigurationResponse
forall x.
GetBucketLifecycleConfigurationResponse
-> Rep GetBucketLifecycleConfigurationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetBucketLifecycleConfigurationResponse x
-> GetBucketLifecycleConfigurationResponse
$cfrom :: forall x.
GetBucketLifecycleConfigurationResponse
-> Rep GetBucketLifecycleConfigurationResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetBucketLifecycleConfigurationResponse' 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:
--
-- 'rules', 'getBucketLifecycleConfigurationResponse_rules' - Container for a lifecycle rule.
--
-- 'httpStatus', 'getBucketLifecycleConfigurationResponse_httpStatus' - The response's http status code.
newGetBucketLifecycleConfigurationResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetBucketLifecycleConfigurationResponse
newGetBucketLifecycleConfigurationResponse :: Int -> GetBucketLifecycleConfigurationResponse
newGetBucketLifecycleConfigurationResponse
  Int
pHttpStatus_ =
    GetBucketLifecycleConfigurationResponse' :: Maybe [LifecycleRule]
-> Int -> GetBucketLifecycleConfigurationResponse
GetBucketLifecycleConfigurationResponse'
      { $sel:rules:GetBucketLifecycleConfigurationResponse' :: Maybe [LifecycleRule]
rules =
          Maybe [LifecycleRule]
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:GetBucketLifecycleConfigurationResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | Container for a lifecycle rule.
getBucketLifecycleConfigurationResponse_rules :: Lens.Lens' GetBucketLifecycleConfigurationResponse (Prelude.Maybe [LifecycleRule])
getBucketLifecycleConfigurationResponse_rules :: (Maybe [LifecycleRule] -> f (Maybe [LifecycleRule]))
-> GetBucketLifecycleConfigurationResponse
-> f GetBucketLifecycleConfigurationResponse
getBucketLifecycleConfigurationResponse_rules = (GetBucketLifecycleConfigurationResponse -> Maybe [LifecycleRule])
-> (GetBucketLifecycleConfigurationResponse
    -> Maybe [LifecycleRule]
    -> GetBucketLifecycleConfigurationResponse)
-> Lens
     GetBucketLifecycleConfigurationResponse
     GetBucketLifecycleConfigurationResponse
     (Maybe [LifecycleRule])
     (Maybe [LifecycleRule])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBucketLifecycleConfigurationResponse' {Maybe [LifecycleRule]
rules :: Maybe [LifecycleRule]
$sel:rules:GetBucketLifecycleConfigurationResponse' :: GetBucketLifecycleConfigurationResponse -> Maybe [LifecycleRule]
rules} -> Maybe [LifecycleRule]
rules) (\s :: GetBucketLifecycleConfigurationResponse
s@GetBucketLifecycleConfigurationResponse' {} Maybe [LifecycleRule]
a -> GetBucketLifecycleConfigurationResponse
s {$sel:rules:GetBucketLifecycleConfigurationResponse' :: Maybe [LifecycleRule]
rules = Maybe [LifecycleRule]
a} :: GetBucketLifecycleConfigurationResponse) ((Maybe [LifecycleRule] -> f (Maybe [LifecycleRule]))
 -> GetBucketLifecycleConfigurationResponse
 -> f GetBucketLifecycleConfigurationResponse)
-> ((Maybe [LifecycleRule] -> f (Maybe [LifecycleRule]))
    -> Maybe [LifecycleRule] -> f (Maybe [LifecycleRule]))
-> (Maybe [LifecycleRule] -> f (Maybe [LifecycleRule]))
-> GetBucketLifecycleConfigurationResponse
-> f GetBucketLifecycleConfigurationResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [LifecycleRule] [LifecycleRule] [LifecycleRule] [LifecycleRule]
-> Iso
     (Maybe [LifecycleRule])
     (Maybe [LifecycleRule])
     (Maybe [LifecycleRule])
     (Maybe [LifecycleRule])
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
  [LifecycleRule] [LifecycleRule] [LifecycleRule] [LifecycleRule]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    GetBucketLifecycleConfigurationResponse