{-# 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.MemoryDb.DescribeClusters
-- 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)
--
-- Returns information about all provisioned clusters if no cluster
-- identifier is specified, or about a specific cluster if a cluster name
-- is supplied.
module Amazonka.MemoryDb.DescribeClusters
  ( -- * Creating a Request
    DescribeClusters (..),
    newDescribeClusters,

    -- * Request Lenses
    describeClusters_showShardDetails,
    describeClusters_nextToken,
    describeClusters_clusterName,
    describeClusters_maxResults,

    -- * Destructuring the Response
    DescribeClustersResponse (..),
    newDescribeClustersResponse,

    -- * Response Lenses
    describeClustersResponse_nextToken,
    describeClustersResponse_clusters,
    describeClustersResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MemoryDb.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newDescribeClusters' smart constructor.
data DescribeClusters = DescribeClusters'
  { -- | An optional flag that can be included in the request to retrieve
    -- information about the individual shard(s).
    DescribeClusters -> Maybe Bool
showShardDetails :: Prelude.Maybe Prelude.Bool,
    -- | An optional argument to pass in case the total number of records exceeds
    -- the value of MaxResults. If nextToken is returned, there are more
    -- results available. The value of nextToken is a unique pagination token
    -- for each page. Make the call again using the returned token to retrieve
    -- the next page. Keep all other arguments unchanged.
    DescribeClusters -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The name of the cluster
    DescribeClusters -> Maybe Text
clusterName :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of records to include in the response. If more
    -- records exist than the specified MaxResults value, a token is included
    -- in the response so that the remaining results can be retrieved.
    DescribeClusters -> Maybe Int
maxResults :: Prelude.Maybe Prelude.Int
  }
  deriving (DescribeClusters -> DescribeClusters -> Bool
(DescribeClusters -> DescribeClusters -> Bool)
-> (DescribeClusters -> DescribeClusters -> Bool)
-> Eq DescribeClusters
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeClusters -> DescribeClusters -> Bool
$c/= :: DescribeClusters -> DescribeClusters -> Bool
== :: DescribeClusters -> DescribeClusters -> Bool
$c== :: DescribeClusters -> DescribeClusters -> Bool
Prelude.Eq, ReadPrec [DescribeClusters]
ReadPrec DescribeClusters
Int -> ReadS DescribeClusters
ReadS [DescribeClusters]
(Int -> ReadS DescribeClusters)
-> ReadS [DescribeClusters]
-> ReadPrec DescribeClusters
-> ReadPrec [DescribeClusters]
-> Read DescribeClusters
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeClusters]
$creadListPrec :: ReadPrec [DescribeClusters]
readPrec :: ReadPrec DescribeClusters
$creadPrec :: ReadPrec DescribeClusters
readList :: ReadS [DescribeClusters]
$creadList :: ReadS [DescribeClusters]
readsPrec :: Int -> ReadS DescribeClusters
$creadsPrec :: Int -> ReadS DescribeClusters
Prelude.Read, Int -> DescribeClusters -> ShowS
[DescribeClusters] -> ShowS
DescribeClusters -> String
(Int -> DescribeClusters -> ShowS)
-> (DescribeClusters -> String)
-> ([DescribeClusters] -> ShowS)
-> Show DescribeClusters
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeClusters] -> ShowS
$cshowList :: [DescribeClusters] -> ShowS
show :: DescribeClusters -> String
$cshow :: DescribeClusters -> String
showsPrec :: Int -> DescribeClusters -> ShowS
$cshowsPrec :: Int -> DescribeClusters -> ShowS
Prelude.Show, (forall x. DescribeClusters -> Rep DescribeClusters x)
-> (forall x. Rep DescribeClusters x -> DescribeClusters)
-> Generic DescribeClusters
forall x. Rep DescribeClusters x -> DescribeClusters
forall x. DescribeClusters -> Rep DescribeClusters x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeClusters x -> DescribeClusters
$cfrom :: forall x. DescribeClusters -> Rep DescribeClusters x
Prelude.Generic)

-- |
-- Create a value of 'DescribeClusters' 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:
--
-- 'showShardDetails', 'describeClusters_showShardDetails' - An optional flag that can be included in the request to retrieve
-- information about the individual shard(s).
--
-- 'nextToken', 'describeClusters_nextToken' - An optional argument to pass in case the total number of records exceeds
-- the value of MaxResults. If nextToken is returned, there are more
-- results available. The value of nextToken is a unique pagination token
-- for each page. Make the call again using the returned token to retrieve
-- the next page. Keep all other arguments unchanged.
--
-- 'clusterName', 'describeClusters_clusterName' - The name of the cluster
--
-- 'maxResults', 'describeClusters_maxResults' - The maximum number of records to include in the response. If more
-- records exist than the specified MaxResults value, a token is included
-- in the response so that the remaining results can be retrieved.
newDescribeClusters ::
  DescribeClusters
newDescribeClusters :: DescribeClusters
newDescribeClusters =
  DescribeClusters' :: Maybe Bool
-> Maybe Text -> Maybe Text -> Maybe Int -> DescribeClusters
DescribeClusters'
    { $sel:showShardDetails:DescribeClusters' :: Maybe Bool
showShardDetails =
        Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeClusters' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:clusterName:DescribeClusters' :: Maybe Text
clusterName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:DescribeClusters' :: Maybe Int
maxResults = Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

-- | An optional flag that can be included in the request to retrieve
-- information about the individual shard(s).
describeClusters_showShardDetails :: Lens.Lens' DescribeClusters (Prelude.Maybe Prelude.Bool)
describeClusters_showShardDetails :: (Maybe Bool -> f (Maybe Bool))
-> DescribeClusters -> f DescribeClusters
describeClusters_showShardDetails = (DescribeClusters -> Maybe Bool)
-> (DescribeClusters -> Maybe Bool -> DescribeClusters)
-> Lens DescribeClusters DescribeClusters (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeClusters' {Maybe Bool
showShardDetails :: Maybe Bool
$sel:showShardDetails:DescribeClusters' :: DescribeClusters -> Maybe Bool
showShardDetails} -> Maybe Bool
showShardDetails) (\s :: DescribeClusters
s@DescribeClusters' {} Maybe Bool
a -> DescribeClusters
s {$sel:showShardDetails:DescribeClusters' :: Maybe Bool
showShardDetails = Maybe Bool
a} :: DescribeClusters)

-- | An optional argument to pass in case the total number of records exceeds
-- the value of MaxResults. If nextToken is returned, there are more
-- results available. The value of nextToken is a unique pagination token
-- for each page. Make the call again using the returned token to retrieve
-- the next page. Keep all other arguments unchanged.
describeClusters_nextToken :: Lens.Lens' DescribeClusters (Prelude.Maybe Prelude.Text)
describeClusters_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeClusters -> f DescribeClusters
describeClusters_nextToken = (DescribeClusters -> Maybe Text)
-> (DescribeClusters -> Maybe Text -> DescribeClusters)
-> Lens DescribeClusters DescribeClusters (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeClusters' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeClusters' :: DescribeClusters -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeClusters
s@DescribeClusters' {} Maybe Text
a -> DescribeClusters
s {$sel:nextToken:DescribeClusters' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeClusters)

-- | The name of the cluster
describeClusters_clusterName :: Lens.Lens' DescribeClusters (Prelude.Maybe Prelude.Text)
describeClusters_clusterName :: (Maybe Text -> f (Maybe Text))
-> DescribeClusters -> f DescribeClusters
describeClusters_clusterName = (DescribeClusters -> Maybe Text)
-> (DescribeClusters -> Maybe Text -> DescribeClusters)
-> Lens DescribeClusters DescribeClusters (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeClusters' {Maybe Text
clusterName :: Maybe Text
$sel:clusterName:DescribeClusters' :: DescribeClusters -> Maybe Text
clusterName} -> Maybe Text
clusterName) (\s :: DescribeClusters
s@DescribeClusters' {} Maybe Text
a -> DescribeClusters
s {$sel:clusterName:DescribeClusters' :: Maybe Text
clusterName = Maybe Text
a} :: DescribeClusters)

-- | The maximum number of records to include in the response. If more
-- records exist than the specified MaxResults value, a token is included
-- in the response so that the remaining results can be retrieved.
describeClusters_maxResults :: Lens.Lens' DescribeClusters (Prelude.Maybe Prelude.Int)
describeClusters_maxResults :: (Maybe Int -> f (Maybe Int))
-> DescribeClusters -> f DescribeClusters
describeClusters_maxResults = (DescribeClusters -> Maybe Int)
-> (DescribeClusters -> Maybe Int -> DescribeClusters)
-> Lens DescribeClusters DescribeClusters (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeClusters' {Maybe Int
maxResults :: Maybe Int
$sel:maxResults:DescribeClusters' :: DescribeClusters -> Maybe Int
maxResults} -> Maybe Int
maxResults) (\s :: DescribeClusters
s@DescribeClusters' {} Maybe Int
a -> DescribeClusters
s {$sel:maxResults:DescribeClusters' :: Maybe Int
maxResults = Maybe Int
a} :: DescribeClusters)

instance Core.AWSRequest DescribeClusters where
  type
    AWSResponse DescribeClusters =
      DescribeClustersResponse
  request :: DescribeClusters -> Request DescribeClusters
request = Service -> DescribeClusters -> Request DescribeClusters
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeClusters
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeClusters)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DescribeClusters))
-> Logger
-> Service
-> Proxy DescribeClusters
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeClusters)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text -> Maybe [Cluster] -> Int -> DescribeClustersResponse
DescribeClustersResponse'
            (Maybe Text -> Maybe [Cluster] -> Int -> DescribeClustersResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe [Cluster] -> Int -> DescribeClustersResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"NextToken")
            Either String (Maybe [Cluster] -> Int -> DescribeClustersResponse)
-> Either String (Maybe [Cluster])
-> Either String (Int -> DescribeClustersResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [Cluster]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Clusters" Either String (Maybe (Maybe [Cluster]))
-> Maybe [Cluster] -> Either String (Maybe [Cluster])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Cluster]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Int -> DescribeClustersResponse)
-> Either String Int -> Either String DescribeClustersResponse
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 DescribeClusters

instance Prelude.NFData DescribeClusters

instance Core.ToHeaders DescribeClusters where
  toHeaders :: DescribeClusters -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DescribeClusters -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AmazonMemoryDB.DescribeClusters" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON DescribeClusters where
  toJSON :: DescribeClusters -> Value
toJSON DescribeClusters' {Maybe Bool
Maybe Int
Maybe Text
maxResults :: Maybe Int
clusterName :: Maybe Text
nextToken :: Maybe Text
showShardDetails :: Maybe Bool
$sel:maxResults:DescribeClusters' :: DescribeClusters -> Maybe Int
$sel:clusterName:DescribeClusters' :: DescribeClusters -> Maybe Text
$sel:nextToken:DescribeClusters' :: DescribeClusters -> Maybe Text
$sel:showShardDetails:DescribeClusters' :: DescribeClusters -> Maybe Bool
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"ShowShardDetails" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
showShardDetails,
            (Text
"NextToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            (Text
"ClusterName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
clusterName,
            (Text
"MaxResults" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
maxResults
          ]
      )

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

instance Core.ToQuery DescribeClusters where
  toQuery :: DescribeClusters -> QueryString
toQuery = QueryString -> DescribeClusters -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newDescribeClustersResponse' smart constructor.
data DescribeClustersResponse = DescribeClustersResponse'
  { -- | An optional argument to pass in case the total number of records exceeds
    -- the value of MaxResults. If nextToken is returned, there are more
    -- results available. The value of nextToken is a unique pagination token
    -- for each page. Make the call again using the returned token to retrieve
    -- the next page. Keep all other arguments unchanged.
    DescribeClustersResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A list of clusters
    DescribeClustersResponse -> Maybe [Cluster]
clusters :: Prelude.Maybe [Cluster],
    -- | The response's http status code.
    DescribeClustersResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeClustersResponse -> DescribeClustersResponse -> Bool
(DescribeClustersResponse -> DescribeClustersResponse -> Bool)
-> (DescribeClustersResponse -> DescribeClustersResponse -> Bool)
-> Eq DescribeClustersResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeClustersResponse -> DescribeClustersResponse -> Bool
$c/= :: DescribeClustersResponse -> DescribeClustersResponse -> Bool
== :: DescribeClustersResponse -> DescribeClustersResponse -> Bool
$c== :: DescribeClustersResponse -> DescribeClustersResponse -> Bool
Prelude.Eq, ReadPrec [DescribeClustersResponse]
ReadPrec DescribeClustersResponse
Int -> ReadS DescribeClustersResponse
ReadS [DescribeClustersResponse]
(Int -> ReadS DescribeClustersResponse)
-> ReadS [DescribeClustersResponse]
-> ReadPrec DescribeClustersResponse
-> ReadPrec [DescribeClustersResponse]
-> Read DescribeClustersResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeClustersResponse]
$creadListPrec :: ReadPrec [DescribeClustersResponse]
readPrec :: ReadPrec DescribeClustersResponse
$creadPrec :: ReadPrec DescribeClustersResponse
readList :: ReadS [DescribeClustersResponse]
$creadList :: ReadS [DescribeClustersResponse]
readsPrec :: Int -> ReadS DescribeClustersResponse
$creadsPrec :: Int -> ReadS DescribeClustersResponse
Prelude.Read, Int -> DescribeClustersResponse -> ShowS
[DescribeClustersResponse] -> ShowS
DescribeClustersResponse -> String
(Int -> DescribeClustersResponse -> ShowS)
-> (DescribeClustersResponse -> String)
-> ([DescribeClustersResponse] -> ShowS)
-> Show DescribeClustersResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeClustersResponse] -> ShowS
$cshowList :: [DescribeClustersResponse] -> ShowS
show :: DescribeClustersResponse -> String
$cshow :: DescribeClustersResponse -> String
showsPrec :: Int -> DescribeClustersResponse -> ShowS
$cshowsPrec :: Int -> DescribeClustersResponse -> ShowS
Prelude.Show, (forall x.
 DescribeClustersResponse -> Rep DescribeClustersResponse x)
-> (forall x.
    Rep DescribeClustersResponse x -> DescribeClustersResponse)
-> Generic DescribeClustersResponse
forall x.
Rep DescribeClustersResponse x -> DescribeClustersResponse
forall x.
DescribeClustersResponse -> Rep DescribeClustersResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeClustersResponse x -> DescribeClustersResponse
$cfrom :: forall x.
DescribeClustersResponse -> Rep DescribeClustersResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeClustersResponse' 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:
--
-- 'nextToken', 'describeClustersResponse_nextToken' - An optional argument to pass in case the total number of records exceeds
-- the value of MaxResults. If nextToken is returned, there are more
-- results available. The value of nextToken is a unique pagination token
-- for each page. Make the call again using the returned token to retrieve
-- the next page. Keep all other arguments unchanged.
--
-- 'clusters', 'describeClustersResponse_clusters' - A list of clusters
--
-- 'httpStatus', 'describeClustersResponse_httpStatus' - The response's http status code.
newDescribeClustersResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeClustersResponse
newDescribeClustersResponse :: Int -> DescribeClustersResponse
newDescribeClustersResponse Int
pHttpStatus_ =
  DescribeClustersResponse' :: Maybe Text -> Maybe [Cluster] -> Int -> DescribeClustersResponse
DescribeClustersResponse'
    { $sel:nextToken:DescribeClustersResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:clusters:DescribeClustersResponse' :: Maybe [Cluster]
clusters = Maybe [Cluster]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeClustersResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | An optional argument to pass in case the total number of records exceeds
-- the value of MaxResults. If nextToken is returned, there are more
-- results available. The value of nextToken is a unique pagination token
-- for each page. Make the call again using the returned token to retrieve
-- the next page. Keep all other arguments unchanged.
describeClustersResponse_nextToken :: Lens.Lens' DescribeClustersResponse (Prelude.Maybe Prelude.Text)
describeClustersResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeClustersResponse -> f DescribeClustersResponse
describeClustersResponse_nextToken = (DescribeClustersResponse -> Maybe Text)
-> (DescribeClustersResponse
    -> Maybe Text -> DescribeClustersResponse)
-> Lens
     DescribeClustersResponse
     DescribeClustersResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeClustersResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeClustersResponse' :: DescribeClustersResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeClustersResponse
s@DescribeClustersResponse' {} Maybe Text
a -> DescribeClustersResponse
s {$sel:nextToken:DescribeClustersResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeClustersResponse)

-- | A list of clusters
describeClustersResponse_clusters :: Lens.Lens' DescribeClustersResponse (Prelude.Maybe [Cluster])
describeClustersResponse_clusters :: (Maybe [Cluster] -> f (Maybe [Cluster]))
-> DescribeClustersResponse -> f DescribeClustersResponse
describeClustersResponse_clusters = (DescribeClustersResponse -> Maybe [Cluster])
-> (DescribeClustersResponse
    -> Maybe [Cluster] -> DescribeClustersResponse)
-> Lens
     DescribeClustersResponse
     DescribeClustersResponse
     (Maybe [Cluster])
     (Maybe [Cluster])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeClustersResponse' {Maybe [Cluster]
clusters :: Maybe [Cluster]
$sel:clusters:DescribeClustersResponse' :: DescribeClustersResponse -> Maybe [Cluster]
clusters} -> Maybe [Cluster]
clusters) (\s :: DescribeClustersResponse
s@DescribeClustersResponse' {} Maybe [Cluster]
a -> DescribeClustersResponse
s {$sel:clusters:DescribeClustersResponse' :: Maybe [Cluster]
clusters = Maybe [Cluster]
a} :: DescribeClustersResponse) ((Maybe [Cluster] -> f (Maybe [Cluster]))
 -> DescribeClustersResponse -> f DescribeClustersResponse)
-> ((Maybe [Cluster] -> f (Maybe [Cluster]))
    -> Maybe [Cluster] -> f (Maybe [Cluster]))
-> (Maybe [Cluster] -> f (Maybe [Cluster]))
-> DescribeClustersResponse
-> f DescribeClustersResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Cluster] [Cluster] [Cluster] [Cluster]
-> Iso
     (Maybe [Cluster])
     (Maybe [Cluster])
     (Maybe [Cluster])
     (Maybe [Cluster])
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 [Cluster] [Cluster] [Cluster] [Cluster]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData DescribeClustersResponse