{-# 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.ListUpdates
(
ListUpdates (..),
newListUpdates,
listUpdates_addonName,
listUpdates_maxResults,
listUpdates_nextToken,
listUpdates_nodegroupName,
listUpdates_name,
ListUpdatesResponse (..),
newListUpdatesResponse,
listUpdatesResponse_nextToken,
listUpdatesResponse_updateIds,
listUpdatesResponse_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 ListUpdates = ListUpdates'
{
ListUpdates -> Maybe Text
addonName :: Prelude.Maybe Prelude.Text,
ListUpdates -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListUpdates -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListUpdates -> Maybe Text
nodegroupName :: Prelude.Maybe Prelude.Text,
ListUpdates -> Text
name :: Prelude.Text
}
deriving (ListUpdates -> ListUpdates -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListUpdates -> ListUpdates -> Bool
$c/= :: ListUpdates -> ListUpdates -> Bool
== :: ListUpdates -> ListUpdates -> Bool
$c== :: ListUpdates -> ListUpdates -> Bool
Prelude.Eq, ReadPrec [ListUpdates]
ReadPrec ListUpdates
Int -> ReadS ListUpdates
ReadS [ListUpdates]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListUpdates]
$creadListPrec :: ReadPrec [ListUpdates]
readPrec :: ReadPrec ListUpdates
$creadPrec :: ReadPrec ListUpdates
readList :: ReadS [ListUpdates]
$creadList :: ReadS [ListUpdates]
readsPrec :: Int -> ReadS ListUpdates
$creadsPrec :: Int -> ReadS ListUpdates
Prelude.Read, Int -> ListUpdates -> ShowS
[ListUpdates] -> ShowS
ListUpdates -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListUpdates] -> ShowS
$cshowList :: [ListUpdates] -> ShowS
show :: ListUpdates -> String
$cshow :: ListUpdates -> String
showsPrec :: Int -> ListUpdates -> ShowS
$cshowsPrec :: Int -> ListUpdates -> ShowS
Prelude.Show, forall x. Rep ListUpdates x -> ListUpdates
forall x. ListUpdates -> Rep ListUpdates x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListUpdates x -> ListUpdates
$cfrom :: forall x. ListUpdates -> Rep ListUpdates x
Prelude.Generic)
newListUpdates ::
Prelude.Text ->
ListUpdates
newListUpdates :: Text -> ListUpdates
newListUpdates Text
pName_ =
ListUpdates'
{ $sel:addonName:ListUpdates' :: Maybe Text
addonName = forall a. Maybe a
Prelude.Nothing,
$sel:maxResults:ListUpdates' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListUpdates' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:nodegroupName:ListUpdates' :: Maybe Text
nodegroupName = forall a. Maybe a
Prelude.Nothing,
$sel:name:ListUpdates' :: Text
name = Text
pName_
}
listUpdates_addonName :: Lens.Lens' ListUpdates (Prelude.Maybe Prelude.Text)
listUpdates_addonName :: Lens' ListUpdates (Maybe Text)
listUpdates_addonName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUpdates' {Maybe Text
addonName :: Maybe Text
$sel:addonName:ListUpdates' :: ListUpdates -> Maybe Text
addonName} -> Maybe Text
addonName) (\s :: ListUpdates
s@ListUpdates' {} Maybe Text
a -> ListUpdates
s {$sel:addonName:ListUpdates' :: Maybe Text
addonName = Maybe Text
a} :: ListUpdates)
listUpdates_maxResults :: Lens.Lens' ListUpdates (Prelude.Maybe Prelude.Natural)
listUpdates_maxResults :: Lens' ListUpdates (Maybe Natural)
listUpdates_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUpdates' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListUpdates' :: ListUpdates -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListUpdates
s@ListUpdates' {} Maybe Natural
a -> ListUpdates
s {$sel:maxResults:ListUpdates' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListUpdates)
listUpdates_nextToken :: Lens.Lens' ListUpdates (Prelude.Maybe Prelude.Text)
listUpdates_nextToken :: Lens' ListUpdates (Maybe Text)
listUpdates_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUpdates' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListUpdates' :: ListUpdates -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListUpdates
s@ListUpdates' {} Maybe Text
a -> ListUpdates
s {$sel:nextToken:ListUpdates' :: Maybe Text
nextToken = Maybe Text
a} :: ListUpdates)
listUpdates_nodegroupName :: Lens.Lens' ListUpdates (Prelude.Maybe Prelude.Text)
listUpdates_nodegroupName :: Lens' ListUpdates (Maybe Text)
listUpdates_nodegroupName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUpdates' {Maybe Text
nodegroupName :: Maybe Text
$sel:nodegroupName:ListUpdates' :: ListUpdates -> Maybe Text
nodegroupName} -> Maybe Text
nodegroupName) (\s :: ListUpdates
s@ListUpdates' {} Maybe Text
a -> ListUpdates
s {$sel:nodegroupName:ListUpdates' :: Maybe Text
nodegroupName = Maybe Text
a} :: ListUpdates)
listUpdates_name :: Lens.Lens' ListUpdates Prelude.Text
listUpdates_name :: Lens' ListUpdates Text
listUpdates_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUpdates' {Text
name :: Text
$sel:name:ListUpdates' :: ListUpdates -> Text
name} -> Text
name) (\s :: ListUpdates
s@ListUpdates' {} Text
a -> ListUpdates
s {$sel:name:ListUpdates' :: Text
name = Text
a} :: ListUpdates)
instance Core.AWSPager ListUpdates where
page :: ListUpdates -> AWSResponse ListUpdates -> Maybe ListUpdates
page ListUpdates
rq AWSResponse ListUpdates
rs
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListUpdates
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListUpdatesResponse (Maybe Text)
listUpdatesResponse_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 ListUpdates
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListUpdatesResponse (Maybe [Text])
listUpdatesResponse_updateIds
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.$ ListUpdates
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListUpdates (Maybe Text)
listUpdates_nextToken
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListUpdates
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListUpdatesResponse (Maybe Text)
listUpdatesResponse_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 ListUpdates where
type AWSResponse ListUpdates = ListUpdatesResponse
request :: (Service -> Service) -> ListUpdates -> Request ListUpdates
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 ListUpdates
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListUpdates)))
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 -> ListUpdatesResponse
ListUpdatesResponse'
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
"updateIds" 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 ListUpdates where
hashWithSalt :: Int -> ListUpdates -> Int
hashWithSalt Int
_salt ListUpdates' {Maybe Natural
Maybe Text
Text
name :: Text
nodegroupName :: Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
addonName :: Maybe Text
$sel:name:ListUpdates' :: ListUpdates -> Text
$sel:nodegroupName:ListUpdates' :: ListUpdates -> Maybe Text
$sel:nextToken:ListUpdates' :: ListUpdates -> Maybe Text
$sel:maxResults:ListUpdates' :: ListUpdates -> Maybe Natural
$sel:addonName:ListUpdates' :: ListUpdates -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
addonName
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` Maybe Text
nodegroupName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
instance Prelude.NFData ListUpdates where
rnf :: ListUpdates -> ()
rnf ListUpdates' {Maybe Natural
Maybe Text
Text
name :: Text
nodegroupName :: Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
addonName :: Maybe Text
$sel:name:ListUpdates' :: ListUpdates -> Text
$sel:nodegroupName:ListUpdates' :: ListUpdates -> Maybe Text
$sel:nextToken:ListUpdates' :: ListUpdates -> Maybe Text
$sel:maxResults:ListUpdates' :: ListUpdates -> Maybe Natural
$sel:addonName:ListUpdates' :: ListUpdates -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
addonName
seq :: forall a b. a -> b -> b
`Prelude.seq` 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 Maybe Text
nodegroupName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name
instance Data.ToHeaders ListUpdates where
toHeaders :: ListUpdates -> 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 ListUpdates where
toPath :: ListUpdates -> ByteString
toPath ListUpdates' {Maybe Natural
Maybe Text
Text
name :: Text
nodegroupName :: Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
addonName :: Maybe Text
$sel:name:ListUpdates' :: ListUpdates -> Text
$sel:nodegroupName:ListUpdates' :: ListUpdates -> Maybe Text
$sel:nextToken:ListUpdates' :: ListUpdates -> Maybe Text
$sel:maxResults:ListUpdates' :: ListUpdates -> Maybe Natural
$sel:addonName:ListUpdates' :: ListUpdates -> Maybe Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/clusters/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
name, ByteString
"/updates"]
instance Data.ToQuery ListUpdates where
toQuery :: ListUpdates -> QueryString
toQuery ListUpdates' {Maybe Natural
Maybe Text
Text
name :: Text
nodegroupName :: Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
addonName :: Maybe Text
$sel:name:ListUpdates' :: ListUpdates -> Text
$sel:nodegroupName:ListUpdates' :: ListUpdates -> Maybe Text
$sel:nextToken:ListUpdates' :: ListUpdates -> Maybe Text
$sel:maxResults:ListUpdates' :: ListUpdates -> Maybe Natural
$sel:addonName:ListUpdates' :: ListUpdates -> Maybe Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"addonName" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
addonName,
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,
ByteString
"nodegroupName" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
nodegroupName
]
data ListUpdatesResponse = ListUpdatesResponse'
{
ListUpdatesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListUpdatesResponse -> Maybe [Text]
updateIds :: Prelude.Maybe [Prelude.Text],
ListUpdatesResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListUpdatesResponse -> ListUpdatesResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListUpdatesResponse -> ListUpdatesResponse -> Bool
$c/= :: ListUpdatesResponse -> ListUpdatesResponse -> Bool
== :: ListUpdatesResponse -> ListUpdatesResponse -> Bool
$c== :: ListUpdatesResponse -> ListUpdatesResponse -> Bool
Prelude.Eq, ReadPrec [ListUpdatesResponse]
ReadPrec ListUpdatesResponse
Int -> ReadS ListUpdatesResponse
ReadS [ListUpdatesResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListUpdatesResponse]
$creadListPrec :: ReadPrec [ListUpdatesResponse]
readPrec :: ReadPrec ListUpdatesResponse
$creadPrec :: ReadPrec ListUpdatesResponse
readList :: ReadS [ListUpdatesResponse]
$creadList :: ReadS [ListUpdatesResponse]
readsPrec :: Int -> ReadS ListUpdatesResponse
$creadsPrec :: Int -> ReadS ListUpdatesResponse
Prelude.Read, Int -> ListUpdatesResponse -> ShowS
[ListUpdatesResponse] -> ShowS
ListUpdatesResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListUpdatesResponse] -> ShowS
$cshowList :: [ListUpdatesResponse] -> ShowS
show :: ListUpdatesResponse -> String
$cshow :: ListUpdatesResponse -> String
showsPrec :: Int -> ListUpdatesResponse -> ShowS
$cshowsPrec :: Int -> ListUpdatesResponse -> ShowS
Prelude.Show, forall x. Rep ListUpdatesResponse x -> ListUpdatesResponse
forall x. ListUpdatesResponse -> Rep ListUpdatesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListUpdatesResponse x -> ListUpdatesResponse
$cfrom :: forall x. ListUpdatesResponse -> Rep ListUpdatesResponse x
Prelude.Generic)
newListUpdatesResponse ::
Prelude.Int ->
ListUpdatesResponse
newListUpdatesResponse :: Int -> ListUpdatesResponse
newListUpdatesResponse Int
pHttpStatus_ =
ListUpdatesResponse'
{ $sel:nextToken:ListUpdatesResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:updateIds:ListUpdatesResponse' :: Maybe [Text]
updateIds = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListUpdatesResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listUpdatesResponse_nextToken :: Lens.Lens' ListUpdatesResponse (Prelude.Maybe Prelude.Text)
listUpdatesResponse_nextToken :: Lens' ListUpdatesResponse (Maybe Text)
listUpdatesResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUpdatesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListUpdatesResponse' :: ListUpdatesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListUpdatesResponse
s@ListUpdatesResponse' {} Maybe Text
a -> ListUpdatesResponse
s {$sel:nextToken:ListUpdatesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListUpdatesResponse)
listUpdatesResponse_updateIds :: Lens.Lens' ListUpdatesResponse (Prelude.Maybe [Prelude.Text])
listUpdatesResponse_updateIds :: Lens' ListUpdatesResponse (Maybe [Text])
listUpdatesResponse_updateIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUpdatesResponse' {Maybe [Text]
updateIds :: Maybe [Text]
$sel:updateIds:ListUpdatesResponse' :: ListUpdatesResponse -> Maybe [Text]
updateIds} -> Maybe [Text]
updateIds) (\s :: ListUpdatesResponse
s@ListUpdatesResponse' {} Maybe [Text]
a -> ListUpdatesResponse
s {$sel:updateIds:ListUpdatesResponse' :: Maybe [Text]
updateIds = Maybe [Text]
a} :: ListUpdatesResponse) 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
listUpdatesResponse_httpStatus :: Lens.Lens' ListUpdatesResponse Prelude.Int
listUpdatesResponse_httpStatus :: Lens' ListUpdatesResponse Int
listUpdatesResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUpdatesResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListUpdatesResponse' :: ListUpdatesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListUpdatesResponse
s@ListUpdatesResponse' {} Int
a -> ListUpdatesResponse
s {$sel:httpStatus:ListUpdatesResponse' :: Int
httpStatus = Int
a} :: ListUpdatesResponse)
instance Prelude.NFData ListUpdatesResponse where
rnf :: ListUpdatesResponse -> ()
rnf ListUpdatesResponse' {Int
Maybe [Text]
Maybe Text
httpStatus :: Int
updateIds :: Maybe [Text]
nextToken :: Maybe Text
$sel:httpStatus:ListUpdatesResponse' :: ListUpdatesResponse -> Int
$sel:updateIds:ListUpdatesResponse' :: ListUpdatesResponse -> Maybe [Text]
$sel:nextToken:ListUpdatesResponse' :: ListUpdatesResponse -> 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]
updateIds
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus