{-# 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.DescribeCacheClusters
-- 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 information about all provisioned clusters if no cluster
-- identifier is specified, or about a specific cache cluster if a cluster
-- identifier is supplied.
--
-- By default, abbreviated information about the clusters is returned. You
-- can use the optional /ShowCacheNodeInfo/ flag to retrieve detailed
-- information about the cache nodes associated with the clusters. These
-- details include the DNS address and port for the cache node endpoint.
--
-- If the cluster is in the /creating/ state, only cluster-level
-- information is displayed until all of the nodes are successfully
-- provisioned.
--
-- If the cluster is in the /deleting/ state, only cluster-level
-- information is displayed.
--
-- If cache nodes are currently being added to the cluster, node endpoint
-- information and creation time for the additional nodes are not displayed
-- until they are completely provisioned. When the cluster state is
-- /available/, the cluster is ready for use.
--
-- If cache nodes are currently being removed from the cluster, no endpoint
-- information for the removed nodes is displayed.
--
-- This operation returns paginated results.
module Amazonka.ElastiCache.DescribeCacheClusters
  ( -- * Creating a Request
    DescribeCacheClusters (..),
    newDescribeCacheClusters,

    -- * Request Lenses
    describeCacheClusters_cacheClusterId,
    describeCacheClusters_marker,
    describeCacheClusters_maxRecords,
    describeCacheClusters_showCacheClustersNotInReplicationGroups,
    describeCacheClusters_showCacheNodeInfo,

    -- * Destructuring the Response
    DescribeCacheClustersResponse (..),
    newDescribeCacheClustersResponse,

    -- * Response Lenses
    describeCacheClustersResponse_cacheClusters,
    describeCacheClustersResponse_marker,
    describeCacheClustersResponse_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 @DescribeCacheClusters@ operation.
--
-- /See:/ 'newDescribeCacheClusters' smart constructor.
data DescribeCacheClusters = DescribeCacheClusters'
  { -- | The user-supplied cluster identifier. If this parameter is specified,
    -- only information about that specific cluster is returned. This parameter
    -- isn\'t case sensitive.
    DescribeCacheClusters -> Maybe Text
cacheClusterId :: 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@.
    DescribeCacheClusters -> 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.
    DescribeCacheClusters -> Maybe Int
maxRecords :: Prelude.Maybe Prelude.Int,
    -- | An optional flag that can be included in the @DescribeCacheCluster@
    -- request to show only nodes (API\/CLI: clusters) that are not members of
    -- a replication group. In practice, this mean Memcached and single node
    -- Redis clusters.
    DescribeCacheClusters -> Maybe Bool
showCacheClustersNotInReplicationGroups :: Prelude.Maybe Prelude.Bool,
    -- | An optional flag that can be included in the @DescribeCacheCluster@
    -- request to retrieve information about the individual cache nodes.
    DescribeCacheClusters -> Maybe Bool
showCacheNodeInfo :: Prelude.Maybe Prelude.Bool
  }
  deriving (DescribeCacheClusters -> DescribeCacheClusters -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeCacheClusters -> DescribeCacheClusters -> Bool
$c/= :: DescribeCacheClusters -> DescribeCacheClusters -> Bool
== :: DescribeCacheClusters -> DescribeCacheClusters -> Bool
$c== :: DescribeCacheClusters -> DescribeCacheClusters -> Bool
Prelude.Eq, ReadPrec [DescribeCacheClusters]
ReadPrec DescribeCacheClusters
Int -> ReadS DescribeCacheClusters
ReadS [DescribeCacheClusters]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeCacheClusters]
$creadListPrec :: ReadPrec [DescribeCacheClusters]
readPrec :: ReadPrec DescribeCacheClusters
$creadPrec :: ReadPrec DescribeCacheClusters
readList :: ReadS [DescribeCacheClusters]
$creadList :: ReadS [DescribeCacheClusters]
readsPrec :: Int -> ReadS DescribeCacheClusters
$creadsPrec :: Int -> ReadS DescribeCacheClusters
Prelude.Read, Int -> DescribeCacheClusters -> ShowS
[DescribeCacheClusters] -> ShowS
DescribeCacheClusters -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeCacheClusters] -> ShowS
$cshowList :: [DescribeCacheClusters] -> ShowS
show :: DescribeCacheClusters -> String
$cshow :: DescribeCacheClusters -> String
showsPrec :: Int -> DescribeCacheClusters -> ShowS
$cshowsPrec :: Int -> DescribeCacheClusters -> ShowS
Prelude.Show, forall x. Rep DescribeCacheClusters x -> DescribeCacheClusters
forall x. DescribeCacheClusters -> Rep DescribeCacheClusters x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeCacheClusters x -> DescribeCacheClusters
$cfrom :: forall x. DescribeCacheClusters -> Rep DescribeCacheClusters x
Prelude.Generic)

-- |
-- Create a value of 'DescribeCacheClusters' 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:
--
-- 'cacheClusterId', 'describeCacheClusters_cacheClusterId' - The user-supplied cluster identifier. If this parameter is specified,
-- only information about that specific cluster is returned. This parameter
-- isn\'t case sensitive.
--
-- 'marker', 'describeCacheClusters_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', 'describeCacheClusters_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.
--
-- 'showCacheClustersNotInReplicationGroups', 'describeCacheClusters_showCacheClustersNotInReplicationGroups' - An optional flag that can be included in the @DescribeCacheCluster@
-- request to show only nodes (API\/CLI: clusters) that are not members of
-- a replication group. In practice, this mean Memcached and single node
-- Redis clusters.
--
-- 'showCacheNodeInfo', 'describeCacheClusters_showCacheNodeInfo' - An optional flag that can be included in the @DescribeCacheCluster@
-- request to retrieve information about the individual cache nodes.
newDescribeCacheClusters ::
  DescribeCacheClusters
newDescribeCacheClusters :: DescribeCacheClusters
newDescribeCacheClusters =
  DescribeCacheClusters'
    { $sel:cacheClusterId:DescribeCacheClusters' :: Maybe Text
cacheClusterId =
        forall a. Maybe a
Prelude.Nothing,
      $sel:marker:DescribeCacheClusters' :: Maybe Text
marker = forall a. Maybe a
Prelude.Nothing,
      $sel:maxRecords:DescribeCacheClusters' :: Maybe Int
maxRecords = forall a. Maybe a
Prelude.Nothing,
      $sel:showCacheClustersNotInReplicationGroups:DescribeCacheClusters' :: Maybe Bool
showCacheClustersNotInReplicationGroups =
        forall a. Maybe a
Prelude.Nothing,
      $sel:showCacheNodeInfo:DescribeCacheClusters' :: Maybe Bool
showCacheNodeInfo = forall a. Maybe a
Prelude.Nothing
    }

-- | The user-supplied cluster identifier. If this parameter is specified,
-- only information about that specific cluster is returned. This parameter
-- isn\'t case sensitive.
describeCacheClusters_cacheClusterId :: Lens.Lens' DescribeCacheClusters (Prelude.Maybe Prelude.Text)
describeCacheClusters_cacheClusterId :: Lens' DescribeCacheClusters (Maybe Text)
describeCacheClusters_cacheClusterId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCacheClusters' {Maybe Text
cacheClusterId :: Maybe Text
$sel:cacheClusterId:DescribeCacheClusters' :: DescribeCacheClusters -> Maybe Text
cacheClusterId} -> Maybe Text
cacheClusterId) (\s :: DescribeCacheClusters
s@DescribeCacheClusters' {} Maybe Text
a -> DescribeCacheClusters
s {$sel:cacheClusterId:DescribeCacheClusters' :: Maybe Text
cacheClusterId = Maybe Text
a} :: DescribeCacheClusters)

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

-- | 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.
describeCacheClusters_maxRecords :: Lens.Lens' DescribeCacheClusters (Prelude.Maybe Prelude.Int)
describeCacheClusters_maxRecords :: Lens' DescribeCacheClusters (Maybe Int)
describeCacheClusters_maxRecords = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCacheClusters' {Maybe Int
maxRecords :: Maybe Int
$sel:maxRecords:DescribeCacheClusters' :: DescribeCacheClusters -> Maybe Int
maxRecords} -> Maybe Int
maxRecords) (\s :: DescribeCacheClusters
s@DescribeCacheClusters' {} Maybe Int
a -> DescribeCacheClusters
s {$sel:maxRecords:DescribeCacheClusters' :: Maybe Int
maxRecords = Maybe Int
a} :: DescribeCacheClusters)

-- | An optional flag that can be included in the @DescribeCacheCluster@
-- request to show only nodes (API\/CLI: clusters) that are not members of
-- a replication group. In practice, this mean Memcached and single node
-- Redis clusters.
describeCacheClusters_showCacheClustersNotInReplicationGroups :: Lens.Lens' DescribeCacheClusters (Prelude.Maybe Prelude.Bool)
describeCacheClusters_showCacheClustersNotInReplicationGroups :: Lens' DescribeCacheClusters (Maybe Bool)
describeCacheClusters_showCacheClustersNotInReplicationGroups = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCacheClusters' {Maybe Bool
showCacheClustersNotInReplicationGroups :: Maybe Bool
$sel:showCacheClustersNotInReplicationGroups:DescribeCacheClusters' :: DescribeCacheClusters -> Maybe Bool
showCacheClustersNotInReplicationGroups} -> Maybe Bool
showCacheClustersNotInReplicationGroups) (\s :: DescribeCacheClusters
s@DescribeCacheClusters' {} Maybe Bool
a -> DescribeCacheClusters
s {$sel:showCacheClustersNotInReplicationGroups:DescribeCacheClusters' :: Maybe Bool
showCacheClustersNotInReplicationGroups = Maybe Bool
a} :: DescribeCacheClusters)

-- | An optional flag that can be included in the @DescribeCacheCluster@
-- request to retrieve information about the individual cache nodes.
describeCacheClusters_showCacheNodeInfo :: Lens.Lens' DescribeCacheClusters (Prelude.Maybe Prelude.Bool)
describeCacheClusters_showCacheNodeInfo :: Lens' DescribeCacheClusters (Maybe Bool)
describeCacheClusters_showCacheNodeInfo = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCacheClusters' {Maybe Bool
showCacheNodeInfo :: Maybe Bool
$sel:showCacheNodeInfo:DescribeCacheClusters' :: DescribeCacheClusters -> Maybe Bool
showCacheNodeInfo} -> Maybe Bool
showCacheNodeInfo) (\s :: DescribeCacheClusters
s@DescribeCacheClusters' {} Maybe Bool
a -> DescribeCacheClusters
s {$sel:showCacheNodeInfo:DescribeCacheClusters' :: Maybe Bool
showCacheNodeInfo = Maybe Bool
a} :: DescribeCacheClusters)

instance Core.AWSPager DescribeCacheClusters where
  page :: DescribeCacheClusters
-> AWSResponse DescribeCacheClusters -> Maybe DescribeCacheClusters
page DescribeCacheClusters
rq AWSResponse DescribeCacheClusters
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeCacheClusters
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeCacheClustersResponse (Maybe Text)
describeCacheClustersResponse_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 DescribeCacheClusters
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeCacheClustersResponse (Maybe [CacheCluster])
describeCacheClustersResponse_cacheClusters
            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.$ DescribeCacheClusters
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' DescribeCacheClusters (Maybe Text)
describeCacheClusters_marker
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeCacheClusters
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeCacheClustersResponse (Maybe Text)
describeCacheClustersResponse_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 DescribeCacheClusters where
  type
    AWSResponse DescribeCacheClusters =
      DescribeCacheClustersResponse
  request :: (Service -> Service)
-> DescribeCacheClusters -> Request DescribeCacheClusters
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 DescribeCacheClusters
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeCacheClusters)))
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
"DescribeCacheClustersResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe [CacheCluster]
-> Maybe Text -> Int -> DescribeCacheClustersResponse
DescribeCacheClustersResponse'
            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
"CacheClusters"
                            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
"CacheCluster")
                        )
            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 DescribeCacheClusters where
  hashWithSalt :: Int -> DescribeCacheClusters -> Int
hashWithSalt Int
_salt DescribeCacheClusters' {Maybe Bool
Maybe Int
Maybe Text
showCacheNodeInfo :: Maybe Bool
showCacheClustersNotInReplicationGroups :: Maybe Bool
maxRecords :: Maybe Int
marker :: Maybe Text
cacheClusterId :: Maybe Text
$sel:showCacheNodeInfo:DescribeCacheClusters' :: DescribeCacheClusters -> Maybe Bool
$sel:showCacheClustersNotInReplicationGroups:DescribeCacheClusters' :: DescribeCacheClusters -> Maybe Bool
$sel:maxRecords:DescribeCacheClusters' :: DescribeCacheClusters -> Maybe Int
$sel:marker:DescribeCacheClusters' :: DescribeCacheClusters -> Maybe Text
$sel:cacheClusterId:DescribeCacheClusters' :: DescribeCacheClusters -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
cacheClusterId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
marker
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
maxRecords
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
showCacheClustersNotInReplicationGroups
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
showCacheNodeInfo

instance Prelude.NFData DescribeCacheClusters where
  rnf :: DescribeCacheClusters -> ()
rnf DescribeCacheClusters' {Maybe Bool
Maybe Int
Maybe Text
showCacheNodeInfo :: Maybe Bool
showCacheClustersNotInReplicationGroups :: Maybe Bool
maxRecords :: Maybe Int
marker :: Maybe Text
cacheClusterId :: Maybe Text
$sel:showCacheNodeInfo:DescribeCacheClusters' :: DescribeCacheClusters -> Maybe Bool
$sel:showCacheClustersNotInReplicationGroups:DescribeCacheClusters' :: DescribeCacheClusters -> Maybe Bool
$sel:maxRecords:DescribeCacheClusters' :: DescribeCacheClusters -> Maybe Int
$sel:marker:DescribeCacheClusters' :: DescribeCacheClusters -> Maybe Text
$sel:cacheClusterId:DescribeCacheClusters' :: DescribeCacheClusters -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
cacheClusterId
      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
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
showCacheClustersNotInReplicationGroups
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
showCacheNodeInfo

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

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

instance Data.ToQuery DescribeCacheClusters where
  toQuery :: DescribeCacheClusters -> QueryString
toQuery DescribeCacheClusters' {Maybe Bool
Maybe Int
Maybe Text
showCacheNodeInfo :: Maybe Bool
showCacheClustersNotInReplicationGroups :: Maybe Bool
maxRecords :: Maybe Int
marker :: Maybe Text
cacheClusterId :: Maybe Text
$sel:showCacheNodeInfo:DescribeCacheClusters' :: DescribeCacheClusters -> Maybe Bool
$sel:showCacheClustersNotInReplicationGroups:DescribeCacheClusters' :: DescribeCacheClusters -> Maybe Bool
$sel:maxRecords:DescribeCacheClusters' :: DescribeCacheClusters -> Maybe Int
$sel:marker:DescribeCacheClusters' :: DescribeCacheClusters -> Maybe Text
$sel:cacheClusterId:DescribeCacheClusters' :: DescribeCacheClusters -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"DescribeCacheClusters" :: Prelude.ByteString),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2015-02-02" :: Prelude.ByteString),
        ByteString
"CacheClusterId" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
cacheClusterId,
        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,
        ByteString
"ShowCacheClustersNotInReplicationGroups"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
showCacheClustersNotInReplicationGroups,
        ByteString
"ShowCacheNodeInfo" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
showCacheNodeInfo
      ]

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

-- |
-- Create a value of 'DescribeCacheClustersResponse' 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:
--
-- 'cacheClusters', 'describeCacheClustersResponse_cacheClusters' - A list of clusters. Each item in the list contains detailed information
-- about one cluster.
--
-- 'marker', 'describeCacheClustersResponse_marker' - Provides an identifier to allow retrieval of paginated results.
--
-- 'httpStatus', 'describeCacheClustersResponse_httpStatus' - The response's http status code.
newDescribeCacheClustersResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeCacheClustersResponse
newDescribeCacheClustersResponse :: Int -> DescribeCacheClustersResponse
newDescribeCacheClustersResponse Int
pHttpStatus_ =
  DescribeCacheClustersResponse'
    { $sel:cacheClusters:DescribeCacheClustersResponse' :: Maybe [CacheCluster]
cacheClusters =
        forall a. Maybe a
Prelude.Nothing,
      $sel:marker:DescribeCacheClustersResponse' :: Maybe Text
marker = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeCacheClustersResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A list of clusters. Each item in the list contains detailed information
-- about one cluster.
describeCacheClustersResponse_cacheClusters :: Lens.Lens' DescribeCacheClustersResponse (Prelude.Maybe [CacheCluster])
describeCacheClustersResponse_cacheClusters :: Lens' DescribeCacheClustersResponse (Maybe [CacheCluster])
describeCacheClustersResponse_cacheClusters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCacheClustersResponse' {Maybe [CacheCluster]
cacheClusters :: Maybe [CacheCluster]
$sel:cacheClusters:DescribeCacheClustersResponse' :: DescribeCacheClustersResponse -> Maybe [CacheCluster]
cacheClusters} -> Maybe [CacheCluster]
cacheClusters) (\s :: DescribeCacheClustersResponse
s@DescribeCacheClustersResponse' {} Maybe [CacheCluster]
a -> DescribeCacheClustersResponse
s {$sel:cacheClusters:DescribeCacheClustersResponse' :: Maybe [CacheCluster]
cacheClusters = Maybe [CacheCluster]
a} :: DescribeCacheClustersResponse) 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.
describeCacheClustersResponse_marker :: Lens.Lens' DescribeCacheClustersResponse (Prelude.Maybe Prelude.Text)
describeCacheClustersResponse_marker :: Lens' DescribeCacheClustersResponse (Maybe Text)
describeCacheClustersResponse_marker = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCacheClustersResponse' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeCacheClustersResponse' :: DescribeCacheClustersResponse -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeCacheClustersResponse
s@DescribeCacheClustersResponse' {} Maybe Text
a -> DescribeCacheClustersResponse
s {$sel:marker:DescribeCacheClustersResponse' :: Maybe Text
marker = Maybe Text
a} :: DescribeCacheClustersResponse)

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

instance Prelude.NFData DescribeCacheClustersResponse where
  rnf :: DescribeCacheClustersResponse -> ()
rnf DescribeCacheClustersResponse' {Int
Maybe [CacheCluster]
Maybe Text
httpStatus :: Int
marker :: Maybe Text
cacheClusters :: Maybe [CacheCluster]
$sel:httpStatus:DescribeCacheClustersResponse' :: DescribeCacheClustersResponse -> Int
$sel:marker:DescribeCacheClustersResponse' :: DescribeCacheClustersResponse -> Maybe Text
$sel:cacheClusters:DescribeCacheClustersResponse' :: DescribeCacheClustersResponse -> Maybe [CacheCluster]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [CacheCluster]
cacheClusters
      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