{-# 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.Snowball.ListClusters
-- 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 an array of @ClusterListEntry@ objects of the specified length.
-- Each @ClusterListEntry@ object contains a cluster\'s state, a cluster\'s
-- ID, and other important status information.
--
-- This operation returns paginated results.
module Amazonka.Snowball.ListClusters
  ( -- * Creating a Request
    ListClusters (..),
    newListClusters,

    -- * Request Lenses
    listClusters_nextToken,
    listClusters_maxResults,

    -- * Destructuring the Response
    ListClustersResponse (..),
    newListClustersResponse,

    -- * Response Lenses
    listClustersResponse_clusterListEntries,
    listClustersResponse_nextToken,
    listClustersResponse_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.Snowball.Types

-- | /See:/ 'newListClusters' smart constructor.
data ListClusters = ListClusters'
  { -- | HTTP requests are stateless. To identify what object comes \"next\" in
    -- the list of @ClusterListEntry@ objects, you have the option of
    -- specifying @NextToken@ as the starting point for your returned list.
    ListClusters -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The number of @ClusterListEntry@ objects to return.
    ListClusters -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListClusters -> ListClusters -> Bool
(ListClusters -> ListClusters -> Bool)
-> (ListClusters -> ListClusters -> Bool) -> Eq ListClusters
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListClusters -> ListClusters -> Bool
$c/= :: ListClusters -> ListClusters -> Bool
== :: ListClusters -> ListClusters -> Bool
$c== :: ListClusters -> ListClusters -> Bool
Prelude.Eq, ReadPrec [ListClusters]
ReadPrec ListClusters
Int -> ReadS ListClusters
ReadS [ListClusters]
(Int -> ReadS ListClusters)
-> ReadS [ListClusters]
-> ReadPrec ListClusters
-> ReadPrec [ListClusters]
-> Read ListClusters
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListClusters]
$creadListPrec :: ReadPrec [ListClusters]
readPrec :: ReadPrec ListClusters
$creadPrec :: ReadPrec ListClusters
readList :: ReadS [ListClusters]
$creadList :: ReadS [ListClusters]
readsPrec :: Int -> ReadS ListClusters
$creadsPrec :: Int -> ReadS ListClusters
Prelude.Read, Int -> ListClusters -> ShowS
[ListClusters] -> ShowS
ListClusters -> String
(Int -> ListClusters -> ShowS)
-> (ListClusters -> String)
-> ([ListClusters] -> ShowS)
-> Show ListClusters
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListClusters] -> ShowS
$cshowList :: [ListClusters] -> ShowS
show :: ListClusters -> String
$cshow :: ListClusters -> String
showsPrec :: Int -> ListClusters -> ShowS
$cshowsPrec :: Int -> ListClusters -> ShowS
Prelude.Show, (forall x. ListClusters -> Rep ListClusters x)
-> (forall x. Rep ListClusters x -> ListClusters)
-> Generic ListClusters
forall x. Rep ListClusters x -> ListClusters
forall x. ListClusters -> Rep ListClusters x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListClusters x -> ListClusters
$cfrom :: forall x. ListClusters -> Rep ListClusters x
Prelude.Generic)

-- |
-- Create a value of 'ListClusters' 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', 'listClusters_nextToken' - HTTP requests are stateless. To identify what object comes \"next\" in
-- the list of @ClusterListEntry@ objects, you have the option of
-- specifying @NextToken@ as the starting point for your returned list.
--
-- 'maxResults', 'listClusters_maxResults' - The number of @ClusterListEntry@ objects to return.
newListClusters ::
  ListClusters
newListClusters :: ListClusters
newListClusters =
  ListClusters' :: Maybe Text -> Maybe Natural -> ListClusters
ListClusters'
    { $sel:nextToken:ListClusters' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListClusters' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | HTTP requests are stateless. To identify what object comes \"next\" in
-- the list of @ClusterListEntry@ objects, you have the option of
-- specifying @NextToken@ as the starting point for your returned list.
listClusters_nextToken :: Lens.Lens' ListClusters (Prelude.Maybe Prelude.Text)
listClusters_nextToken :: (Maybe Text -> f (Maybe Text)) -> ListClusters -> f ListClusters
listClusters_nextToken = (ListClusters -> Maybe Text)
-> (ListClusters -> Maybe Text -> ListClusters)
-> Lens ListClusters ListClusters (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListClusters' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListClusters' :: ListClusters -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListClusters
s@ListClusters' {} Maybe Text
a -> ListClusters
s {$sel:nextToken:ListClusters' :: Maybe Text
nextToken = Maybe Text
a} :: ListClusters)

-- | The number of @ClusterListEntry@ objects to return.
listClusters_maxResults :: Lens.Lens' ListClusters (Prelude.Maybe Prelude.Natural)
listClusters_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListClusters -> f ListClusters
listClusters_maxResults = (ListClusters -> Maybe Natural)
-> (ListClusters -> Maybe Natural -> ListClusters)
-> Lens ListClusters ListClusters (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListClusters' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListClusters' :: ListClusters -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListClusters
s@ListClusters' {} Maybe Natural
a -> ListClusters
s {$sel:maxResults:ListClusters' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListClusters)

instance Core.AWSPager ListClusters where
  page :: ListClusters -> AWSResponse ListClusters -> Maybe ListClusters
page ListClusters
rq AWSResponse ListClusters
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListClusters
ListClustersResponse
rs
            ListClustersResponse
-> Getting (First Text) ListClustersResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListClustersResponse -> Const (First Text) ListClustersResponse
Lens' ListClustersResponse (Maybe Text)
listClustersResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListClustersResponse -> Const (First Text) ListClustersResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListClustersResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListClusters
forall a. Maybe a
Prelude.Nothing
    | Maybe [ClusterListEntry] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListClusters
ListClustersResponse
rs
            ListClustersResponse
-> Getting
     (First [ClusterListEntry]) ListClustersResponse [ClusterListEntry]
-> Maybe [ClusterListEntry]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [ClusterListEntry]
 -> Const (First [ClusterListEntry]) (Maybe [ClusterListEntry]))
-> ListClustersResponse
-> Const (First [ClusterListEntry]) ListClustersResponse
Lens' ListClustersResponse (Maybe [ClusterListEntry])
listClustersResponse_clusterListEntries
              ((Maybe [ClusterListEntry]
  -> Const (First [ClusterListEntry]) (Maybe [ClusterListEntry]))
 -> ListClustersResponse
 -> Const (First [ClusterListEntry]) ListClustersResponse)
-> (([ClusterListEntry]
     -> Const (First [ClusterListEntry]) [ClusterListEntry])
    -> Maybe [ClusterListEntry]
    -> Const (First [ClusterListEntry]) (Maybe [ClusterListEntry]))
-> Getting
     (First [ClusterListEntry]) ListClustersResponse [ClusterListEntry]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([ClusterListEntry]
 -> Const (First [ClusterListEntry]) [ClusterListEntry])
-> Maybe [ClusterListEntry]
-> Const (First [ClusterListEntry]) (Maybe [ClusterListEntry])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListClusters
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListClusters -> Maybe ListClusters
forall a. a -> Maybe a
Prelude.Just (ListClusters -> Maybe ListClusters)
-> ListClusters -> Maybe ListClusters
forall a b. (a -> b) -> a -> b
Prelude.$
        ListClusters
rq
          ListClusters -> (ListClusters -> ListClusters) -> ListClusters
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListClusters -> Identity ListClusters
Lens ListClusters ListClusters (Maybe Text) (Maybe Text)
listClusters_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListClusters -> Identity ListClusters)
-> Maybe Text -> ListClusters -> ListClusters
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListClusters
ListClustersResponse
rs
          ListClustersResponse
-> Getting (First Text) ListClustersResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListClustersResponse -> Const (First Text) ListClustersResponse
Lens' ListClustersResponse (Maybe Text)
listClustersResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListClustersResponse -> Const (First Text) ListClustersResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListClustersResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

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

instance Prelude.NFData ListClusters

instance Core.ToHeaders ListClusters where
  toHeaders :: ListClusters -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListClusters -> 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
"AWSIESnowballJobManagementService.ListClusters" ::
                          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 ListClusters where
  toJSON :: ListClusters -> Value
toJSON ListClusters' {Maybe Natural
Maybe Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:maxResults:ListClusters' :: ListClusters -> Maybe Natural
$sel:nextToken:ListClusters' :: ListClusters -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (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
"MaxResults" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults
          ]
      )

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

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

-- | /See:/ 'newListClustersResponse' smart constructor.
data ListClustersResponse = ListClustersResponse'
  { -- | Each @ClusterListEntry@ object contains a cluster\'s state, a cluster\'s
    -- ID, and other important status information.
    ListClustersResponse -> Maybe [ClusterListEntry]
clusterListEntries :: Prelude.Maybe [ClusterListEntry],
    -- | HTTP requests are stateless. If you use the automatically generated
    -- @NextToken@ value in your next @ClusterListEntry@ call, your list of
    -- returned clusters will start from this point in the array.
    ListClustersResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListClustersResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListClustersResponse -> ListClustersResponse -> Bool
(ListClustersResponse -> ListClustersResponse -> Bool)
-> (ListClustersResponse -> ListClustersResponse -> Bool)
-> Eq ListClustersResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListClustersResponse -> ListClustersResponse -> Bool
$c/= :: ListClustersResponse -> ListClustersResponse -> Bool
== :: ListClustersResponse -> ListClustersResponse -> Bool
$c== :: ListClustersResponse -> ListClustersResponse -> Bool
Prelude.Eq, ReadPrec [ListClustersResponse]
ReadPrec ListClustersResponse
Int -> ReadS ListClustersResponse
ReadS [ListClustersResponse]
(Int -> ReadS ListClustersResponse)
-> ReadS [ListClustersResponse]
-> ReadPrec ListClustersResponse
-> ReadPrec [ListClustersResponse]
-> Read ListClustersResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListClustersResponse]
$creadListPrec :: ReadPrec [ListClustersResponse]
readPrec :: ReadPrec ListClustersResponse
$creadPrec :: ReadPrec ListClustersResponse
readList :: ReadS [ListClustersResponse]
$creadList :: ReadS [ListClustersResponse]
readsPrec :: Int -> ReadS ListClustersResponse
$creadsPrec :: Int -> ReadS ListClustersResponse
Prelude.Read, Int -> ListClustersResponse -> ShowS
[ListClustersResponse] -> ShowS
ListClustersResponse -> String
(Int -> ListClustersResponse -> ShowS)
-> (ListClustersResponse -> String)
-> ([ListClustersResponse] -> ShowS)
-> Show ListClustersResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListClustersResponse] -> ShowS
$cshowList :: [ListClustersResponse] -> ShowS
show :: ListClustersResponse -> String
$cshow :: ListClustersResponse -> String
showsPrec :: Int -> ListClustersResponse -> ShowS
$cshowsPrec :: Int -> ListClustersResponse -> ShowS
Prelude.Show, (forall x. ListClustersResponse -> Rep ListClustersResponse x)
-> (forall x. Rep ListClustersResponse x -> ListClustersResponse)
-> Generic ListClustersResponse
forall x. Rep ListClustersResponse x -> ListClustersResponse
forall x. ListClustersResponse -> Rep ListClustersResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListClustersResponse x -> ListClustersResponse
$cfrom :: forall x. ListClustersResponse -> Rep ListClustersResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListClustersResponse' 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:
--
-- 'clusterListEntries', 'listClustersResponse_clusterListEntries' - Each @ClusterListEntry@ object contains a cluster\'s state, a cluster\'s
-- ID, and other important status information.
--
-- 'nextToken', 'listClustersResponse_nextToken' - HTTP requests are stateless. If you use the automatically generated
-- @NextToken@ value in your next @ClusterListEntry@ call, your list of
-- returned clusters will start from this point in the array.
--
-- 'httpStatus', 'listClustersResponse_httpStatus' - The response's http status code.
newListClustersResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListClustersResponse
newListClustersResponse :: Int -> ListClustersResponse
newListClustersResponse Int
pHttpStatus_ =
  ListClustersResponse' :: Maybe [ClusterListEntry]
-> Maybe Text -> Int -> ListClustersResponse
ListClustersResponse'
    { $sel:clusterListEntries:ListClustersResponse' :: Maybe [ClusterListEntry]
clusterListEntries =
        Maybe [ClusterListEntry]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListClustersResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListClustersResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Each @ClusterListEntry@ object contains a cluster\'s state, a cluster\'s
-- ID, and other important status information.
listClustersResponse_clusterListEntries :: Lens.Lens' ListClustersResponse (Prelude.Maybe [ClusterListEntry])
listClustersResponse_clusterListEntries :: (Maybe [ClusterListEntry] -> f (Maybe [ClusterListEntry]))
-> ListClustersResponse -> f ListClustersResponse
listClustersResponse_clusterListEntries = (ListClustersResponse -> Maybe [ClusterListEntry])
-> (ListClustersResponse
    -> Maybe [ClusterListEntry] -> ListClustersResponse)
-> Lens' ListClustersResponse (Maybe [ClusterListEntry])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListClustersResponse' {Maybe [ClusterListEntry]
clusterListEntries :: Maybe [ClusterListEntry]
$sel:clusterListEntries:ListClustersResponse' :: ListClustersResponse -> Maybe [ClusterListEntry]
clusterListEntries} -> Maybe [ClusterListEntry]
clusterListEntries) (\s :: ListClustersResponse
s@ListClustersResponse' {} Maybe [ClusterListEntry]
a -> ListClustersResponse
s {$sel:clusterListEntries:ListClustersResponse' :: Maybe [ClusterListEntry]
clusterListEntries = Maybe [ClusterListEntry]
a} :: ListClustersResponse) ((Maybe [ClusterListEntry] -> f (Maybe [ClusterListEntry]))
 -> ListClustersResponse -> f ListClustersResponse)
-> ((Maybe [ClusterListEntry] -> f (Maybe [ClusterListEntry]))
    -> Maybe [ClusterListEntry] -> f (Maybe [ClusterListEntry]))
-> (Maybe [ClusterListEntry] -> f (Maybe [ClusterListEntry]))
-> ListClustersResponse
-> f ListClustersResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ClusterListEntry]
  [ClusterListEntry]
  [ClusterListEntry]
  [ClusterListEntry]
-> Iso
     (Maybe [ClusterListEntry])
     (Maybe [ClusterListEntry])
     (Maybe [ClusterListEntry])
     (Maybe [ClusterListEntry])
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
  [ClusterListEntry]
  [ClusterListEntry]
  [ClusterListEntry]
  [ClusterListEntry]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | HTTP requests are stateless. If you use the automatically generated
-- @NextToken@ value in your next @ClusterListEntry@ call, your list of
-- returned clusters will start from this point in the array.
listClustersResponse_nextToken :: Lens.Lens' ListClustersResponse (Prelude.Maybe Prelude.Text)
listClustersResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListClustersResponse -> f ListClustersResponse
listClustersResponse_nextToken = (ListClustersResponse -> Maybe Text)
-> (ListClustersResponse -> Maybe Text -> ListClustersResponse)
-> Lens' ListClustersResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListClustersResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListClustersResponse' :: ListClustersResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListClustersResponse
s@ListClustersResponse' {} Maybe Text
a -> ListClustersResponse
s {$sel:nextToken:ListClustersResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListClustersResponse)

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

instance Prelude.NFData ListClustersResponse