{-# 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 #-}
module Amazonka.EKS.ListNodegroups
(
ListNodegroups (..),
newListNodegroups,
listNodegroups_maxResults,
listNodegroups_nextToken,
listNodegroups_clusterName,
ListNodegroupsResponse (..),
newListNodegroupsResponse,
listNodegroupsResponse_nextToken,
listNodegroupsResponse_nodegroups,
listNodegroupsResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EKS.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ListNodegroups = ListNodegroups'
{
ListNodegroups -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListNodegroups -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListNodegroups -> Text
clusterName :: Prelude.Text
}
deriving (ListNodegroups -> ListNodegroups -> Bool
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]
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
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. 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)
newListNodegroups ::
Prelude.Text ->
ListNodegroups
newListNodegroups :: Text -> ListNodegroups
newListNodegroups Text
pClusterName_ =
ListNodegroups'
{ $sel:maxResults:ListNodegroups' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListNodegroups' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:clusterName:ListNodegroups' :: Text
clusterName = Text
pClusterName_
}
listNodegroups_maxResults :: Lens.Lens' ListNodegroups (Prelude.Maybe Prelude.Natural)
listNodegroups_maxResults :: Lens' ListNodegroups (Maybe Natural)
listNodegroups_maxResults = 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)
listNodegroups_nextToken :: Lens.Lens' ListNodegroups (Prelude.Maybe Prelude.Text)
listNodegroups_nextToken :: Lens' ListNodegroups (Maybe Text)
listNodegroups_nextToken = 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)
listNodegroups_clusterName :: Lens.Lens' ListNodegroups Prelude.Text
listNodegroups_clusterName :: Lens' ListNodegroups Text
listNodegroups_clusterName = 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
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListNodegroups
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListNodegroupsResponse (Maybe Text)
listNodegroupsResponse_nextToken
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 ListNodegroups
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListNodegroupsResponse (Maybe [Text])
listNodegroupsResponse_nodegroups
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.$ ListNodegroups
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListNodegroups (Maybe Text)
listNodegroups_nextToken
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListNodegroups
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListNodegroupsResponse (Maybe Text)
listNodegroupsResponse_nextToken
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 ListNodegroups where
type
AWSResponse ListNodegroups =
ListNodegroupsResponse
request :: (Service -> Service) -> ListNodegroups -> Request ListNodegroups
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListNodegroups
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListNodegroups)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> 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'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"nextToken")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"nodegroups" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
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 ListNodegroups where
hashWithSalt :: Int -> ListNodegroups -> Int
hashWithSalt Int
_salt ListNodegroups' {Maybe Natural
Maybe Text
Text
clusterName :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:clusterName:ListNodegroups' :: ListNodegroups -> Text
$sel:nextToken:ListNodegroups' :: ListNodegroups -> Maybe Text
$sel:maxResults:ListNodegroups' :: ListNodegroups -> Maybe Natural
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
clusterName
instance Prelude.NFData ListNodegroups where
rnf :: ListNodegroups -> ()
rnf ListNodegroups' {Maybe Natural
Maybe Text
Text
clusterName :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:clusterName:ListNodegroups' :: ListNodegroups -> Text
$sel:nextToken:ListNodegroups' :: ListNodegroups -> Maybe Text
$sel:maxResults:ListNodegroups' :: ListNodegroups -> Maybe Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
clusterName
instance Data.ToHeaders ListNodegroups where
toHeaders :: ListNodegroups -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToPath ListNodegroups where
toPath :: ListNodegroups -> ByteString
toPath ListNodegroups' {Maybe Natural
Maybe Text
Text
clusterName :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:clusterName:ListNodegroups' :: ListNodegroups -> Text
$sel:nextToken:ListNodegroups' :: ListNodegroups -> Maybe Text
$sel:maxResults:ListNodegroups' :: ListNodegroups -> Maybe Natural
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/clusters/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
clusterName, ByteString
"/node-groups"]
instance Data.ToQuery ListNodegroups where
toQuery :: ListNodegroups -> QueryString
toQuery ListNodegroups' {Maybe Natural
Maybe Text
Text
clusterName :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:clusterName:ListNodegroups' :: ListNodegroups -> Text
$sel:nextToken:ListNodegroups' :: ListNodegroups -> Maybe Text
$sel:maxResults:ListNodegroups' :: ListNodegroups -> Maybe Natural
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"maxResults" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
maxResults,
ByteString
"nextToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
nextToken
]
data ListNodegroupsResponse = ListNodegroupsResponse'
{
ListNodegroupsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListNodegroupsResponse -> Maybe [Text]
nodegroups :: Prelude.Maybe [Prelude.Text],
ListNodegroupsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListNodegroupsResponse -> ListNodegroupsResponse -> Bool
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]
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
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. 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)
newListNodegroupsResponse ::
Prelude.Int ->
ListNodegroupsResponse
newListNodegroupsResponse :: Int -> ListNodegroupsResponse
newListNodegroupsResponse Int
pHttpStatus_ =
ListNodegroupsResponse'
{ $sel:nextToken:ListNodegroupsResponse' :: Maybe Text
nextToken =
forall a. Maybe a
Prelude.Nothing,
$sel:nodegroups:ListNodegroupsResponse' :: Maybe [Text]
nodegroups = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListNodegroupsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listNodegroupsResponse_nextToken :: Lens.Lens' ListNodegroupsResponse (Prelude.Maybe Prelude.Text)
listNodegroupsResponse_nextToken :: Lens' ListNodegroupsResponse (Maybe Text)
listNodegroupsResponse_nextToken = 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)
listNodegroupsResponse_nodegroups :: Lens.Lens' ListNodegroupsResponse (Prelude.Maybe [Prelude.Text])
listNodegroupsResponse_nodegroups :: Lens' ListNodegroupsResponse (Maybe [Text])
listNodegroupsResponse_nodegroups = 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) 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
listNodegroupsResponse_httpStatus :: Lens.Lens' ListNodegroupsResponse Prelude.Int
listNodegroupsResponse_httpStatus :: Lens' ListNodegroupsResponse Int
listNodegroupsResponse_httpStatus = 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 where
rnf :: ListNodegroupsResponse -> ()
rnf ListNodegroupsResponse' {Int
Maybe [Text]
Maybe Text
httpStatus :: Int
nodegroups :: Maybe [Text]
nextToken :: Maybe Text
$sel:httpStatus:ListNodegroupsResponse' :: ListNodegroupsResponse -> Int
$sel:nodegroups:ListNodegroupsResponse' :: ListNodegroupsResponse -> Maybe [Text]
$sel:nextToken:ListNodegroupsResponse' :: ListNodegroupsResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
nodegroups
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus