{-# 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.ElastiCache.DescribeCacheSubnetGroups
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Returns a list of cache subnet group descriptions. If a subnet group
-- name is specified, the list contains only the description of that group.
-- This is applicable only when you have ElastiCache in VPC setup. All
-- ElastiCache clusters now launch in VPC by default.
--
-- This operation returns paginated results.
module Amazonka.ElastiCache.DescribeCacheSubnetGroups
  ( -- * Creating a Request
    DescribeCacheSubnetGroups (..),
    newDescribeCacheSubnetGroups,

    -- * Request Lenses
    describeCacheSubnetGroups_cacheSubnetGroupName,
    describeCacheSubnetGroups_marker,
    describeCacheSubnetGroups_maxRecords,

    -- * Destructuring the Response
    DescribeCacheSubnetGroupsResponse (..),
    newDescribeCacheSubnetGroupsResponse,

    -- * Response Lenses
    describeCacheSubnetGroupsResponse_cacheSubnetGroups,
    describeCacheSubnetGroupsResponse_marker,
    describeCacheSubnetGroupsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.ElastiCache.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | Represents the input of a @DescribeCacheSubnetGroups@ operation.
--
-- /See:/ 'newDescribeCacheSubnetGroups' smart constructor.
data DescribeCacheSubnetGroups = DescribeCacheSubnetGroups'
  { -- | The name of the cache subnet group to return details for.
    DescribeCacheSubnetGroups -> Maybe Text
cacheSubnetGroupName :: Prelude.Maybe Prelude.Text,
    -- | An optional marker returned from a prior request. Use this marker for
    -- pagination of results from this operation. If this parameter is
    -- specified, the response includes only records beyond the marker, up to
    -- the value specified by @MaxRecords@.
    DescribeCacheSubnetGroups -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of records to include in the response. If more
    -- records exist than the specified @MaxRecords@ value, a marker is
    -- included in the response so that the remaining results can be retrieved.
    --
    -- Default: 100
    --
    -- Constraints: minimum 20; maximum 100.
    DescribeCacheSubnetGroups -> Maybe Int
maxRecords :: Prelude.Maybe Prelude.Int
  }
  deriving (DescribeCacheSubnetGroups -> DescribeCacheSubnetGroups -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeCacheSubnetGroups -> DescribeCacheSubnetGroups -> Bool
$c/= :: DescribeCacheSubnetGroups -> DescribeCacheSubnetGroups -> Bool
== :: DescribeCacheSubnetGroups -> DescribeCacheSubnetGroups -> Bool
$c== :: DescribeCacheSubnetGroups -> DescribeCacheSubnetGroups -> Bool
Prelude.Eq, ReadPrec [DescribeCacheSubnetGroups]
ReadPrec DescribeCacheSubnetGroups
Int -> ReadS DescribeCacheSubnetGroups
ReadS [DescribeCacheSubnetGroups]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeCacheSubnetGroups]
$creadListPrec :: ReadPrec [DescribeCacheSubnetGroups]
readPrec :: ReadPrec DescribeCacheSubnetGroups
$creadPrec :: ReadPrec DescribeCacheSubnetGroups
readList :: ReadS [DescribeCacheSubnetGroups]
$creadList :: ReadS [DescribeCacheSubnetGroups]
readsPrec :: Int -> ReadS DescribeCacheSubnetGroups
$creadsPrec :: Int -> ReadS DescribeCacheSubnetGroups
Prelude.Read, Int -> DescribeCacheSubnetGroups -> ShowS
[DescribeCacheSubnetGroups] -> ShowS
DescribeCacheSubnetGroups -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeCacheSubnetGroups] -> ShowS
$cshowList :: [DescribeCacheSubnetGroups] -> ShowS
show :: DescribeCacheSubnetGroups -> String
$cshow :: DescribeCacheSubnetGroups -> String
showsPrec :: Int -> DescribeCacheSubnetGroups -> ShowS
$cshowsPrec :: Int -> DescribeCacheSubnetGroups -> ShowS
Prelude.Show, forall x.
Rep DescribeCacheSubnetGroups x -> DescribeCacheSubnetGroups
forall x.
DescribeCacheSubnetGroups -> Rep DescribeCacheSubnetGroups x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeCacheSubnetGroups x -> DescribeCacheSubnetGroups
$cfrom :: forall x.
DescribeCacheSubnetGroups -> Rep DescribeCacheSubnetGroups x
Prelude.Generic)

-- |
-- Create a value of 'DescribeCacheSubnetGroups' 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:
--
-- 'cacheSubnetGroupName', 'describeCacheSubnetGroups_cacheSubnetGroupName' - The name of the cache subnet group to return details for.
--
-- 'marker', 'describeCacheSubnetGroups_marker' - An optional marker returned from a prior request. Use this marker for
-- pagination of results from this operation. If this parameter is
-- specified, the response includes only records beyond the marker, up to
-- the value specified by @MaxRecords@.
--
-- 'maxRecords', 'describeCacheSubnetGroups_maxRecords' - The maximum number of records to include in the response. If more
-- records exist than the specified @MaxRecords@ value, a marker is
-- included in the response so that the remaining results can be retrieved.
--
-- Default: 100
--
-- Constraints: minimum 20; maximum 100.
newDescribeCacheSubnetGroups ::
  DescribeCacheSubnetGroups
newDescribeCacheSubnetGroups :: DescribeCacheSubnetGroups
newDescribeCacheSubnetGroups =
  DescribeCacheSubnetGroups'
    { $sel:cacheSubnetGroupName:DescribeCacheSubnetGroups' :: Maybe Text
cacheSubnetGroupName =
        forall a. Maybe a
Prelude.Nothing,
      $sel:marker:DescribeCacheSubnetGroups' :: Maybe Text
marker = forall a. Maybe a
Prelude.Nothing,
      $sel:maxRecords:DescribeCacheSubnetGroups' :: Maybe Int
maxRecords = forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the cache subnet group to return details for.
describeCacheSubnetGroups_cacheSubnetGroupName :: Lens.Lens' DescribeCacheSubnetGroups (Prelude.Maybe Prelude.Text)
describeCacheSubnetGroups_cacheSubnetGroupName :: Lens' DescribeCacheSubnetGroups (Maybe Text)
describeCacheSubnetGroups_cacheSubnetGroupName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCacheSubnetGroups' {Maybe Text
cacheSubnetGroupName :: Maybe Text
$sel:cacheSubnetGroupName:DescribeCacheSubnetGroups' :: DescribeCacheSubnetGroups -> Maybe Text
cacheSubnetGroupName} -> Maybe Text
cacheSubnetGroupName) (\s :: DescribeCacheSubnetGroups
s@DescribeCacheSubnetGroups' {} Maybe Text
a -> DescribeCacheSubnetGroups
s {$sel:cacheSubnetGroupName:DescribeCacheSubnetGroups' :: Maybe Text
cacheSubnetGroupName = Maybe Text
a} :: DescribeCacheSubnetGroups)

-- | An optional marker returned from a prior request. Use this marker for
-- pagination of results from this operation. If this parameter is
-- specified, the response includes only records beyond the marker, up to
-- the value specified by @MaxRecords@.
describeCacheSubnetGroups_marker :: Lens.Lens' DescribeCacheSubnetGroups (Prelude.Maybe Prelude.Text)
describeCacheSubnetGroups_marker :: Lens' DescribeCacheSubnetGroups (Maybe Text)
describeCacheSubnetGroups_marker = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCacheSubnetGroups' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeCacheSubnetGroups' :: DescribeCacheSubnetGroups -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeCacheSubnetGroups
s@DescribeCacheSubnetGroups' {} Maybe Text
a -> DescribeCacheSubnetGroups
s {$sel:marker:DescribeCacheSubnetGroups' :: Maybe Text
marker = Maybe Text
a} :: DescribeCacheSubnetGroups)

-- | The maximum number of records to include in the response. If more
-- records exist than the specified @MaxRecords@ value, a marker is
-- included in the response so that the remaining results can be retrieved.
--
-- Default: 100
--
-- Constraints: minimum 20; maximum 100.
describeCacheSubnetGroups_maxRecords :: Lens.Lens' DescribeCacheSubnetGroups (Prelude.Maybe Prelude.Int)
describeCacheSubnetGroups_maxRecords :: Lens' DescribeCacheSubnetGroups (Maybe Int)
describeCacheSubnetGroups_maxRecords = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCacheSubnetGroups' {Maybe Int
maxRecords :: Maybe Int
$sel:maxRecords:DescribeCacheSubnetGroups' :: DescribeCacheSubnetGroups -> Maybe Int
maxRecords} -> Maybe Int
maxRecords) (\s :: DescribeCacheSubnetGroups
s@DescribeCacheSubnetGroups' {} Maybe Int
a -> DescribeCacheSubnetGroups
s {$sel:maxRecords:DescribeCacheSubnetGroups' :: Maybe Int
maxRecords = Maybe Int
a} :: DescribeCacheSubnetGroups)

instance Core.AWSPager DescribeCacheSubnetGroups where
  page :: DescribeCacheSubnetGroups
-> AWSResponse DescribeCacheSubnetGroups
-> Maybe DescribeCacheSubnetGroups
page DescribeCacheSubnetGroups
rq AWSResponse DescribeCacheSubnetGroups
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeCacheSubnetGroups
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeCacheSubnetGroupsResponse (Maybe Text)
describeCacheSubnetGroupsResponse_marker
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeCacheSubnetGroups
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeCacheSubnetGroupsResponse (Maybe [CacheSubnetGroup])
describeCacheSubnetGroupsResponse_cacheSubnetGroups
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ DescribeCacheSubnetGroups
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' DescribeCacheSubnetGroups (Maybe Text)
describeCacheSubnetGroups_marker
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeCacheSubnetGroups
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeCacheSubnetGroupsResponse (Maybe Text)
describeCacheSubnetGroupsResponse_marker
          forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest DescribeCacheSubnetGroups where
  type
    AWSResponse DescribeCacheSubnetGroups =
      DescribeCacheSubnetGroupsResponse
  request :: (Service -> Service)
-> DescribeCacheSubnetGroups -> Request DescribeCacheSubnetGroups
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DescribeCacheSubnetGroups
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeCacheSubnetGroups)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
      Text
"DescribeCacheSubnetGroupsResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe [CacheSubnetGroup]
-> Maybe Text -> Int -> DescribeCacheSubnetGroupsResponse
DescribeCacheSubnetGroupsResponse'
            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
"CacheSubnetGroups"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                            forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m 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
"CacheSubnetGroup")
                        )
            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
"Marker")
            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 DescribeCacheSubnetGroups where
  hashWithSalt :: Int -> DescribeCacheSubnetGroups -> Int
hashWithSalt Int
_salt DescribeCacheSubnetGroups' {Maybe Int
Maybe Text
maxRecords :: Maybe Int
marker :: Maybe Text
cacheSubnetGroupName :: Maybe Text
$sel:maxRecords:DescribeCacheSubnetGroups' :: DescribeCacheSubnetGroups -> Maybe Int
$sel:marker:DescribeCacheSubnetGroups' :: DescribeCacheSubnetGroups -> Maybe Text
$sel:cacheSubnetGroupName:DescribeCacheSubnetGroups' :: DescribeCacheSubnetGroups -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
cacheSubnetGroupName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
marker
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
maxRecords

instance Prelude.NFData DescribeCacheSubnetGroups where
  rnf :: DescribeCacheSubnetGroups -> ()
rnf DescribeCacheSubnetGroups' {Maybe Int
Maybe Text
maxRecords :: Maybe Int
marker :: Maybe Text
cacheSubnetGroupName :: Maybe Text
$sel:maxRecords:DescribeCacheSubnetGroups' :: DescribeCacheSubnetGroups -> Maybe Int
$sel:marker:DescribeCacheSubnetGroups' :: DescribeCacheSubnetGroups -> Maybe Text
$sel:cacheSubnetGroupName:DescribeCacheSubnetGroups' :: DescribeCacheSubnetGroups -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
cacheSubnetGroupName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
marker
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
maxRecords

instance Data.ToHeaders DescribeCacheSubnetGroups where
  toHeaders :: DescribeCacheSubnetGroups -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

instance Data.ToPath DescribeCacheSubnetGroups where
  toPath :: DescribeCacheSubnetGroups -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Data.ToQuery DescribeCacheSubnetGroups where
  toQuery :: DescribeCacheSubnetGroups -> QueryString
toQuery DescribeCacheSubnetGroups' {Maybe Int
Maybe Text
maxRecords :: Maybe Int
marker :: Maybe Text
cacheSubnetGroupName :: Maybe Text
$sel:maxRecords:DescribeCacheSubnetGroups' :: DescribeCacheSubnetGroups -> Maybe Int
$sel:marker:DescribeCacheSubnetGroups' :: DescribeCacheSubnetGroups -> Maybe Text
$sel:cacheSubnetGroupName:DescribeCacheSubnetGroups' :: DescribeCacheSubnetGroups -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"DescribeCacheSubnetGroups" :: Prelude.ByteString),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2015-02-02" :: Prelude.ByteString),
        ByteString
"CacheSubnetGroupName" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
cacheSubnetGroupName,
        ByteString
"Marker" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
marker,
        ByteString
"MaxRecords" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Int
maxRecords
      ]

-- | Represents the output of a @DescribeCacheSubnetGroups@ operation.
--
-- /See:/ 'newDescribeCacheSubnetGroupsResponse' smart constructor.
data DescribeCacheSubnetGroupsResponse = DescribeCacheSubnetGroupsResponse'
  { -- | A list of cache subnet groups. Each element in the list contains
    -- detailed information about one group.
    DescribeCacheSubnetGroupsResponse -> Maybe [CacheSubnetGroup]
cacheSubnetGroups :: Prelude.Maybe [CacheSubnetGroup],
    -- | Provides an identifier to allow retrieval of paginated results.
    DescribeCacheSubnetGroupsResponse -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeCacheSubnetGroupsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeCacheSubnetGroupsResponse
-> DescribeCacheSubnetGroupsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeCacheSubnetGroupsResponse
-> DescribeCacheSubnetGroupsResponse -> Bool
$c/= :: DescribeCacheSubnetGroupsResponse
-> DescribeCacheSubnetGroupsResponse -> Bool
== :: DescribeCacheSubnetGroupsResponse
-> DescribeCacheSubnetGroupsResponse -> Bool
$c== :: DescribeCacheSubnetGroupsResponse
-> DescribeCacheSubnetGroupsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeCacheSubnetGroupsResponse]
ReadPrec DescribeCacheSubnetGroupsResponse
Int -> ReadS DescribeCacheSubnetGroupsResponse
ReadS [DescribeCacheSubnetGroupsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeCacheSubnetGroupsResponse]
$creadListPrec :: ReadPrec [DescribeCacheSubnetGroupsResponse]
readPrec :: ReadPrec DescribeCacheSubnetGroupsResponse
$creadPrec :: ReadPrec DescribeCacheSubnetGroupsResponse
readList :: ReadS [DescribeCacheSubnetGroupsResponse]
$creadList :: ReadS [DescribeCacheSubnetGroupsResponse]
readsPrec :: Int -> ReadS DescribeCacheSubnetGroupsResponse
$creadsPrec :: Int -> ReadS DescribeCacheSubnetGroupsResponse
Prelude.Read, Int -> DescribeCacheSubnetGroupsResponse -> ShowS
[DescribeCacheSubnetGroupsResponse] -> ShowS
DescribeCacheSubnetGroupsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeCacheSubnetGroupsResponse] -> ShowS
$cshowList :: [DescribeCacheSubnetGroupsResponse] -> ShowS
show :: DescribeCacheSubnetGroupsResponse -> String
$cshow :: DescribeCacheSubnetGroupsResponse -> String
showsPrec :: Int -> DescribeCacheSubnetGroupsResponse -> ShowS
$cshowsPrec :: Int -> DescribeCacheSubnetGroupsResponse -> ShowS
Prelude.Show, forall x.
Rep DescribeCacheSubnetGroupsResponse x
-> DescribeCacheSubnetGroupsResponse
forall x.
DescribeCacheSubnetGroupsResponse
-> Rep DescribeCacheSubnetGroupsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeCacheSubnetGroupsResponse x
-> DescribeCacheSubnetGroupsResponse
$cfrom :: forall x.
DescribeCacheSubnetGroupsResponse
-> Rep DescribeCacheSubnetGroupsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeCacheSubnetGroupsResponse' 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:
--
-- 'cacheSubnetGroups', 'describeCacheSubnetGroupsResponse_cacheSubnetGroups' - A list of cache subnet groups. Each element in the list contains
-- detailed information about one group.
--
-- 'marker', 'describeCacheSubnetGroupsResponse_marker' - Provides an identifier to allow retrieval of paginated results.
--
-- 'httpStatus', 'describeCacheSubnetGroupsResponse_httpStatus' - The response's http status code.
newDescribeCacheSubnetGroupsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeCacheSubnetGroupsResponse
newDescribeCacheSubnetGroupsResponse :: Int -> DescribeCacheSubnetGroupsResponse
newDescribeCacheSubnetGroupsResponse Int
pHttpStatus_ =
  DescribeCacheSubnetGroupsResponse'
    { $sel:cacheSubnetGroups:DescribeCacheSubnetGroupsResponse' :: Maybe [CacheSubnetGroup]
cacheSubnetGroups =
        forall a. Maybe a
Prelude.Nothing,
      $sel:marker:DescribeCacheSubnetGroupsResponse' :: Maybe Text
marker = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeCacheSubnetGroupsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A list of cache subnet groups. Each element in the list contains
-- detailed information about one group.
describeCacheSubnetGroupsResponse_cacheSubnetGroups :: Lens.Lens' DescribeCacheSubnetGroupsResponse (Prelude.Maybe [CacheSubnetGroup])
describeCacheSubnetGroupsResponse_cacheSubnetGroups :: Lens' DescribeCacheSubnetGroupsResponse (Maybe [CacheSubnetGroup])
describeCacheSubnetGroupsResponse_cacheSubnetGroups = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCacheSubnetGroupsResponse' {Maybe [CacheSubnetGroup]
cacheSubnetGroups :: Maybe [CacheSubnetGroup]
$sel:cacheSubnetGroups:DescribeCacheSubnetGroupsResponse' :: DescribeCacheSubnetGroupsResponse -> Maybe [CacheSubnetGroup]
cacheSubnetGroups} -> Maybe [CacheSubnetGroup]
cacheSubnetGroups) (\s :: DescribeCacheSubnetGroupsResponse
s@DescribeCacheSubnetGroupsResponse' {} Maybe [CacheSubnetGroup]
a -> DescribeCacheSubnetGroupsResponse
s {$sel:cacheSubnetGroups:DescribeCacheSubnetGroupsResponse' :: Maybe [CacheSubnetGroup]
cacheSubnetGroups = Maybe [CacheSubnetGroup]
a} :: DescribeCacheSubnetGroupsResponse) 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

-- | Provides an identifier to allow retrieval of paginated results.
describeCacheSubnetGroupsResponse_marker :: Lens.Lens' DescribeCacheSubnetGroupsResponse (Prelude.Maybe Prelude.Text)
describeCacheSubnetGroupsResponse_marker :: Lens' DescribeCacheSubnetGroupsResponse (Maybe Text)
describeCacheSubnetGroupsResponse_marker = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCacheSubnetGroupsResponse' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeCacheSubnetGroupsResponse' :: DescribeCacheSubnetGroupsResponse -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeCacheSubnetGroupsResponse
s@DescribeCacheSubnetGroupsResponse' {} Maybe Text
a -> DescribeCacheSubnetGroupsResponse
s {$sel:marker:DescribeCacheSubnetGroupsResponse' :: Maybe Text
marker = Maybe Text
a} :: DescribeCacheSubnetGroupsResponse)

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

instance
  Prelude.NFData
    DescribeCacheSubnetGroupsResponse
  where
  rnf :: DescribeCacheSubnetGroupsResponse -> ()
rnf DescribeCacheSubnetGroupsResponse' {Int
Maybe [CacheSubnetGroup]
Maybe Text
httpStatus :: Int
marker :: Maybe Text
cacheSubnetGroups :: Maybe [CacheSubnetGroup]
$sel:httpStatus:DescribeCacheSubnetGroupsResponse' :: DescribeCacheSubnetGroupsResponse -> Int
$sel:marker:DescribeCacheSubnetGroupsResponse' :: DescribeCacheSubnetGroupsResponse -> Maybe Text
$sel:cacheSubnetGroups:DescribeCacheSubnetGroupsResponse' :: DescribeCacheSubnetGroupsResponse -> Maybe [CacheSubnetGroup]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [CacheSubnetGroup]
cacheSubnetGroups
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
marker
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus