{-# 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.EKS.ListNodegroups
-- 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)
--
-- Lists the Amazon EKS managed node groups associated with the specified
-- cluster in your Amazon Web Services account in the specified Region.
-- Self-managed node groups are not listed.
--
-- This operation returns paginated results.
module Amazonka.EKS.ListNodegroups
  ( -- * Creating a Request
    ListNodegroups (..),
    newListNodegroups,

    -- * Request Lenses
    listNodegroups_nextToken,
    listNodegroups_maxResults,
    listNodegroups_clusterName,

    -- * Destructuring the Response
    ListNodegroupsResponse (..),
    newListNodegroupsResponse,

    -- * Response Lenses
    listNodegroupsResponse_nodegroups,
    listNodegroupsResponse_nextToken,
    listNodegroupsResponse_httpStatus,
  )
where

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

-- | /See:/ 'newListNodegroups' smart constructor.
data ListNodegroups = ListNodegroups'
  { -- | The @nextToken@ value returned from a previous paginated
    -- @ListNodegroups@ request where @maxResults@ was used and the results
    -- exceeded the value of that parameter. Pagination continues from the end
    -- of the previous results that returned the @nextToken@ value.
    ListNodegroups -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of node group results returned by @ListNodegroups@ in
    -- paginated output. When you use this parameter, @ListNodegroups@ returns
    -- only @maxResults@ results in a single page along with a @nextToken@
    -- response element. You can see the remaining results of the initial
    -- request by sending another @ListNodegroups@ request with the returned
    -- @nextToken@ value. This value can be between 1 and 100. If you don\'t
    -- use this parameter, @ListNodegroups@ returns up to 100 results and a
    -- @nextToken@ value if applicable.
    ListNodegroups -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The name of the Amazon EKS cluster that you would like to list node
    -- groups in.
    ListNodegroups -> Text
clusterName :: Prelude.Text
  }
  deriving (ListNodegroups -> ListNodegroups -> Bool
(ListNodegroups -> ListNodegroups -> Bool)
-> (ListNodegroups -> ListNodegroups -> Bool) -> Eq ListNodegroups
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListNodegroups -> ListNodegroups -> Bool
$c/= :: ListNodegroups -> ListNodegroups -> Bool
== :: ListNodegroups -> ListNodegroups -> Bool
$c== :: ListNodegroups -> ListNodegroups -> Bool
Prelude.Eq, ReadPrec [ListNodegroups]
ReadPrec ListNodegroups
Int -> ReadS ListNodegroups
ReadS [ListNodegroups]
(Int -> ReadS ListNodegroups)
-> ReadS [ListNodegroups]
-> ReadPrec ListNodegroups
-> ReadPrec [ListNodegroups]
-> Read ListNodegroups
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListNodegroups]
$creadListPrec :: ReadPrec [ListNodegroups]
readPrec :: ReadPrec ListNodegroups
$creadPrec :: ReadPrec ListNodegroups
readList :: ReadS [ListNodegroups]
$creadList :: ReadS [ListNodegroups]
readsPrec :: Int -> ReadS ListNodegroups
$creadsPrec :: Int -> ReadS ListNodegroups
Prelude.Read, Int -> ListNodegroups -> ShowS
[ListNodegroups] -> ShowS
ListNodegroups -> String
(Int -> ListNodegroups -> ShowS)
-> (ListNodegroups -> String)
-> ([ListNodegroups] -> ShowS)
-> Show ListNodegroups
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListNodegroups] -> ShowS
$cshowList :: [ListNodegroups] -> ShowS
show :: ListNodegroups -> String
$cshow :: ListNodegroups -> String
showsPrec :: Int -> ListNodegroups -> ShowS
$cshowsPrec :: Int -> ListNodegroups -> ShowS
Prelude.Show, (forall x. ListNodegroups -> Rep ListNodegroups x)
-> (forall x. Rep ListNodegroups x -> ListNodegroups)
-> Generic ListNodegroups
forall x. Rep ListNodegroups x -> ListNodegroups
forall x. ListNodegroups -> Rep ListNodegroups x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListNodegroups x -> ListNodegroups
$cfrom :: forall x. ListNodegroups -> Rep ListNodegroups x
Prelude.Generic)

-- |
-- Create a value of 'ListNodegroups' 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', 'listNodegroups_nextToken' - The @nextToken@ value returned from a previous paginated
-- @ListNodegroups@ request where @maxResults@ was used and the results
-- exceeded the value of that parameter. Pagination continues from the end
-- of the previous results that returned the @nextToken@ value.
--
-- 'maxResults', 'listNodegroups_maxResults' - The maximum number of node group results returned by @ListNodegroups@ in
-- paginated output. When you use this parameter, @ListNodegroups@ returns
-- only @maxResults@ results in a single page along with a @nextToken@
-- response element. You can see the remaining results of the initial
-- request by sending another @ListNodegroups@ request with the returned
-- @nextToken@ value. This value can be between 1 and 100. If you don\'t
-- use this parameter, @ListNodegroups@ returns up to 100 results and a
-- @nextToken@ value if applicable.
--
-- 'clusterName', 'listNodegroups_clusterName' - The name of the Amazon EKS cluster that you would like to list node
-- groups in.
newListNodegroups ::
  -- | 'clusterName'
  Prelude.Text ->
  ListNodegroups
newListNodegroups :: Text -> ListNodegroups
newListNodegroups Text
pClusterName_ =
  ListNodegroups' :: Maybe Text -> Maybe Natural -> Text -> ListNodegroups
ListNodegroups'
    { $sel:nextToken:ListNodegroups' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListNodegroups' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:clusterName:ListNodegroups' :: Text
clusterName = Text
pClusterName_
    }

-- | The @nextToken@ value returned from a previous paginated
-- @ListNodegroups@ request where @maxResults@ was used and the results
-- exceeded the value of that parameter. Pagination continues from the end
-- of the previous results that returned the @nextToken@ value.
listNodegroups_nextToken :: Lens.Lens' ListNodegroups (Prelude.Maybe Prelude.Text)
listNodegroups_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListNodegroups -> f ListNodegroups
listNodegroups_nextToken = (ListNodegroups -> Maybe Text)
-> (ListNodegroups -> Maybe Text -> ListNodegroups)
-> Lens ListNodegroups ListNodegroups (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListNodegroups' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListNodegroups' :: ListNodegroups -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListNodegroups
s@ListNodegroups' {} Maybe Text
a -> ListNodegroups
s {$sel:nextToken:ListNodegroups' :: Maybe Text
nextToken = Maybe Text
a} :: ListNodegroups)

-- | The maximum number of node group results returned by @ListNodegroups@ in
-- paginated output. When you use this parameter, @ListNodegroups@ returns
-- only @maxResults@ results in a single page along with a @nextToken@
-- response element. You can see the remaining results of the initial
-- request by sending another @ListNodegroups@ request with the returned
-- @nextToken@ value. This value can be between 1 and 100. If you don\'t
-- use this parameter, @ListNodegroups@ returns up to 100 results and a
-- @nextToken@ value if applicable.
listNodegroups_maxResults :: Lens.Lens' ListNodegroups (Prelude.Maybe Prelude.Natural)
listNodegroups_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListNodegroups -> f ListNodegroups
listNodegroups_maxResults = (ListNodegroups -> Maybe Natural)
-> (ListNodegroups -> Maybe Natural -> ListNodegroups)
-> Lens
     ListNodegroups ListNodegroups (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListNodegroups' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListNodegroups' :: ListNodegroups -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListNodegroups
s@ListNodegroups' {} Maybe Natural
a -> ListNodegroups
s {$sel:maxResults:ListNodegroups' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListNodegroups)

-- | The name of the Amazon EKS cluster that you would like to list node
-- groups in.
listNodegroups_clusterName :: Lens.Lens' ListNodegroups Prelude.Text
listNodegroups_clusterName :: (Text -> f Text) -> ListNodegroups -> f ListNodegroups
listNodegroups_clusterName = (ListNodegroups -> Text)
-> (ListNodegroups -> Text -> ListNodegroups)
-> Lens ListNodegroups ListNodegroups Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListNodegroups' {Text
clusterName :: Text
$sel:clusterName:ListNodegroups' :: ListNodegroups -> Text
clusterName} -> Text
clusterName) (\s :: ListNodegroups
s@ListNodegroups' {} Text
a -> ListNodegroups
s {$sel:clusterName:ListNodegroups' :: Text
clusterName = Text
a} :: ListNodegroups)

instance Core.AWSPager ListNodegroups where
  page :: ListNodegroups
-> AWSResponse ListNodegroups -> Maybe ListNodegroups
page ListNodegroups
rq AWSResponse ListNodegroups
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListNodegroups
ListNodegroupsResponse
rs
            ListNodegroupsResponse
-> Getting (First Text) ListNodegroupsResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListNodegroupsResponse
-> Const (First Text) ListNodegroupsResponse
Lens' ListNodegroupsResponse (Maybe Text)
listNodegroupsResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListNodegroupsResponse
 -> Const (First Text) ListNodegroupsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListNodegroupsResponse 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 ListNodegroups
forall a. Maybe a
Prelude.Nothing
    | Maybe [Text] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListNodegroups
ListNodegroupsResponse
rs
            ListNodegroupsResponse
-> Getting (First [Text]) ListNodegroupsResponse [Text]
-> Maybe [Text]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [Text] -> Const (First [Text]) (Maybe [Text]))
-> ListNodegroupsResponse
-> Const (First [Text]) ListNodegroupsResponse
Lens' ListNodegroupsResponse (Maybe [Text])
listNodegroupsResponse_nodegroups
              ((Maybe [Text] -> Const (First [Text]) (Maybe [Text]))
 -> ListNodegroupsResponse
 -> Const (First [Text]) ListNodegroupsResponse)
-> (([Text] -> Const (First [Text]) [Text])
    -> Maybe [Text] -> Const (First [Text]) (Maybe [Text]))
-> Getting (First [Text]) ListNodegroupsResponse [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 ListNodegroups
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListNodegroups -> Maybe ListNodegroups
forall a. a -> Maybe a
Prelude.Just (ListNodegroups -> Maybe ListNodegroups)
-> ListNodegroups -> Maybe ListNodegroups
forall a b. (a -> b) -> a -> b
Prelude.$
        ListNodegroups
rq
          ListNodegroups
-> (ListNodegroups -> ListNodegroups) -> ListNodegroups
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListNodegroups -> Identity ListNodegroups
Lens ListNodegroups ListNodegroups (Maybe Text) (Maybe Text)
listNodegroups_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListNodegroups -> Identity ListNodegroups)
-> Maybe Text -> ListNodegroups -> ListNodegroups
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListNodegroups
ListNodegroupsResponse
rs
          ListNodegroupsResponse
-> Getting (First Text) ListNodegroupsResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListNodegroupsResponse
-> Const (First Text) ListNodegroupsResponse
Lens' ListNodegroupsResponse (Maybe Text)
listNodegroupsResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListNodegroupsResponse
 -> Const (First Text) ListNodegroupsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListNodegroupsResponse 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 ListNodegroups where
  type
    AWSResponse ListNodegroups =
      ListNodegroupsResponse
  request :: ListNodegroups -> Request ListNodegroups
request = Service -> ListNodegroups -> Request ListNodegroups
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListNodegroups
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListNodegroups)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListNodegroups))
-> Logger
-> Service
-> Proxy ListNodegroups
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListNodegroups)))
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 Text -> Int -> ListNodegroupsResponse
ListNodegroupsResponse'
            (Maybe [Text] -> Maybe Text -> Int -> ListNodegroupsResponse)
-> Either String (Maybe [Text])
-> Either String (Maybe Text -> Int -> ListNodegroupsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"nodegroups" Either String (Maybe (Maybe [Text]))
-> Maybe [Text] -> Either String (Maybe [Text])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Maybe Text -> Int -> ListNodegroupsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ListNodegroupsResponse)
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 -> ListNodegroupsResponse)
-> Either String Int -> Either String ListNodegroupsResponse
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 ListNodegroups

instance Prelude.NFData ListNodegroups

instance Core.ToHeaders ListNodegroups where
  toHeaders :: ListNodegroups -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListNodegroups -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ 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.ToPath ListNodegroups where
  toPath :: ListNodegroups -> ByteString
toPath ListNodegroups' {Maybe Natural
Maybe Text
Text
clusterName :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:clusterName:ListNodegroups' :: ListNodegroups -> Text
$sel:maxResults:ListNodegroups' :: ListNodegroups -> Maybe Natural
$sel:nextToken:ListNodegroups' :: ListNodegroups -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/clusters/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
clusterName, ByteString
"/node-groups"]

instance Core.ToQuery ListNodegroups where
  toQuery :: ListNodegroups -> QueryString
toQuery ListNodegroups' {Maybe Natural
Maybe Text
Text
clusterName :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:clusterName:ListNodegroups' :: ListNodegroups -> Text
$sel:maxResults:ListNodegroups' :: ListNodegroups -> Maybe Natural
$sel:nextToken:ListNodegroups' :: ListNodegroups -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"nextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"maxResults" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxResults
      ]

-- | /See:/ 'newListNodegroupsResponse' smart constructor.
data ListNodegroupsResponse = ListNodegroupsResponse'
  { -- | A list of all of the node groups associated with the specified cluster.
    ListNodegroupsResponse -> Maybe [Text]
nodegroups :: Prelude.Maybe [Prelude.Text],
    -- | The @nextToken@ value to include in a future @ListNodegroups@ request.
    -- When the results of a @ListNodegroups@ request exceed @maxResults@, you
    -- can use this value to retrieve the next page of results. This value is
    -- @null@ when there are no more results to return.
    ListNodegroupsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListNodegroupsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListNodegroupsResponse -> ListNodegroupsResponse -> Bool
(ListNodegroupsResponse -> ListNodegroupsResponse -> Bool)
-> (ListNodegroupsResponse -> ListNodegroupsResponse -> Bool)
-> Eq ListNodegroupsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListNodegroupsResponse -> ListNodegroupsResponse -> Bool
$c/= :: ListNodegroupsResponse -> ListNodegroupsResponse -> Bool
== :: ListNodegroupsResponse -> ListNodegroupsResponse -> Bool
$c== :: ListNodegroupsResponse -> ListNodegroupsResponse -> Bool
Prelude.Eq, ReadPrec [ListNodegroupsResponse]
ReadPrec ListNodegroupsResponse
Int -> ReadS ListNodegroupsResponse
ReadS [ListNodegroupsResponse]
(Int -> ReadS ListNodegroupsResponse)
-> ReadS [ListNodegroupsResponse]
-> ReadPrec ListNodegroupsResponse
-> ReadPrec [ListNodegroupsResponse]
-> Read ListNodegroupsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListNodegroupsResponse]
$creadListPrec :: ReadPrec [ListNodegroupsResponse]
readPrec :: ReadPrec ListNodegroupsResponse
$creadPrec :: ReadPrec ListNodegroupsResponse
readList :: ReadS [ListNodegroupsResponse]
$creadList :: ReadS [ListNodegroupsResponse]
readsPrec :: Int -> ReadS ListNodegroupsResponse
$creadsPrec :: Int -> ReadS ListNodegroupsResponse
Prelude.Read, Int -> ListNodegroupsResponse -> ShowS
[ListNodegroupsResponse] -> ShowS
ListNodegroupsResponse -> String
(Int -> ListNodegroupsResponse -> ShowS)
-> (ListNodegroupsResponse -> String)
-> ([ListNodegroupsResponse] -> ShowS)
-> Show ListNodegroupsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListNodegroupsResponse] -> ShowS
$cshowList :: [ListNodegroupsResponse] -> ShowS
show :: ListNodegroupsResponse -> String
$cshow :: ListNodegroupsResponse -> String
showsPrec :: Int -> ListNodegroupsResponse -> ShowS
$cshowsPrec :: Int -> ListNodegroupsResponse -> ShowS
Prelude.Show, (forall x. ListNodegroupsResponse -> Rep ListNodegroupsResponse x)
-> (forall x.
    Rep ListNodegroupsResponse x -> ListNodegroupsResponse)
-> Generic ListNodegroupsResponse
forall x. Rep ListNodegroupsResponse x -> ListNodegroupsResponse
forall x. ListNodegroupsResponse -> Rep ListNodegroupsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListNodegroupsResponse x -> ListNodegroupsResponse
$cfrom :: forall x. ListNodegroupsResponse -> Rep ListNodegroupsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListNodegroupsResponse' 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:
--
-- 'nodegroups', 'listNodegroupsResponse_nodegroups' - A list of all of the node groups associated with the specified cluster.
--
-- 'nextToken', 'listNodegroupsResponse_nextToken' - The @nextToken@ value to include in a future @ListNodegroups@ request.
-- When the results of a @ListNodegroups@ request exceed @maxResults@, you
-- can use this value to retrieve the next page of results. This value is
-- @null@ when there are no more results to return.
--
-- 'httpStatus', 'listNodegroupsResponse_httpStatus' - The response's http status code.
newListNodegroupsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListNodegroupsResponse
newListNodegroupsResponse :: Int -> ListNodegroupsResponse
newListNodegroupsResponse Int
pHttpStatus_ =
  ListNodegroupsResponse' :: Maybe [Text] -> Maybe Text -> Int -> ListNodegroupsResponse
ListNodegroupsResponse'
    { $sel:nodegroups:ListNodegroupsResponse' :: Maybe [Text]
nodegroups =
        Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListNodegroupsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListNodegroupsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A list of all of the node groups associated with the specified cluster.
listNodegroupsResponse_nodegroups :: Lens.Lens' ListNodegroupsResponse (Prelude.Maybe [Prelude.Text])
listNodegroupsResponse_nodegroups :: (Maybe [Text] -> f (Maybe [Text]))
-> ListNodegroupsResponse -> f ListNodegroupsResponse
listNodegroupsResponse_nodegroups = (ListNodegroupsResponse -> Maybe [Text])
-> (ListNodegroupsResponse
    -> Maybe [Text] -> ListNodegroupsResponse)
-> Lens' ListNodegroupsResponse (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListNodegroupsResponse' {Maybe [Text]
nodegroups :: Maybe [Text]
$sel:nodegroups:ListNodegroupsResponse' :: ListNodegroupsResponse -> Maybe [Text]
nodegroups} -> Maybe [Text]
nodegroups) (\s :: ListNodegroupsResponse
s@ListNodegroupsResponse' {} Maybe [Text]
a -> ListNodegroupsResponse
s {$sel:nodegroups:ListNodegroupsResponse' :: Maybe [Text]
nodegroups = Maybe [Text]
a} :: ListNodegroupsResponse) ((Maybe [Text] -> f (Maybe [Text]))
 -> ListNodegroupsResponse -> f ListNodegroupsResponse)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ListNodegroupsResponse
-> f ListNodegroupsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The @nextToken@ value to include in a future @ListNodegroups@ request.
-- When the results of a @ListNodegroups@ request exceed @maxResults@, you
-- can use this value to retrieve the next page of results. This value is
-- @null@ when there are no more results to return.
listNodegroupsResponse_nextToken :: Lens.Lens' ListNodegroupsResponse (Prelude.Maybe Prelude.Text)
listNodegroupsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListNodegroupsResponse -> f ListNodegroupsResponse
listNodegroupsResponse_nextToken = (ListNodegroupsResponse -> Maybe Text)
-> (ListNodegroupsResponse -> Maybe Text -> ListNodegroupsResponse)
-> Lens' ListNodegroupsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListNodegroupsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListNodegroupsResponse' :: ListNodegroupsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListNodegroupsResponse
s@ListNodegroupsResponse' {} Maybe Text
a -> ListNodegroupsResponse
s {$sel:nextToken:ListNodegroupsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListNodegroupsResponse)

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

instance Prelude.NFData ListNodegroupsResponse