{-# 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.ListAddons
(
ListAddons (..),
newListAddons,
listAddons_maxResults,
listAddons_nextToken,
listAddons_clusterName,
ListAddonsResponse (..),
newListAddonsResponse,
listAddonsResponse_addons,
listAddonsResponse_nextToken,
listAddonsResponse_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 ListAddons = ListAddons'
{
ListAddons -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListAddons -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListAddons -> Text
clusterName :: Prelude.Text
}
deriving (ListAddons -> ListAddons -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAddons -> ListAddons -> Bool
$c/= :: ListAddons -> ListAddons -> Bool
== :: ListAddons -> ListAddons -> Bool
$c== :: ListAddons -> ListAddons -> Bool
Prelude.Eq, ReadPrec [ListAddons]
ReadPrec ListAddons
Int -> ReadS ListAddons
ReadS [ListAddons]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAddons]
$creadListPrec :: ReadPrec [ListAddons]
readPrec :: ReadPrec ListAddons
$creadPrec :: ReadPrec ListAddons
readList :: ReadS [ListAddons]
$creadList :: ReadS [ListAddons]
readsPrec :: Int -> ReadS ListAddons
$creadsPrec :: Int -> ReadS ListAddons
Prelude.Read, Int -> ListAddons -> ShowS
[ListAddons] -> ShowS
ListAddons -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAddons] -> ShowS
$cshowList :: [ListAddons] -> ShowS
show :: ListAddons -> String
$cshow :: ListAddons -> String
showsPrec :: Int -> ListAddons -> ShowS
$cshowsPrec :: Int -> ListAddons -> ShowS
Prelude.Show, forall x. Rep ListAddons x -> ListAddons
forall x. ListAddons -> Rep ListAddons x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListAddons x -> ListAddons
$cfrom :: forall x. ListAddons -> Rep ListAddons x
Prelude.Generic)
newListAddons ::
Prelude.Text ->
ListAddons
newListAddons :: Text -> ListAddons
newListAddons Text
pClusterName_ =
ListAddons'
{ $sel:maxResults:ListAddons' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListAddons' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:clusterName:ListAddons' :: Text
clusterName = Text
pClusterName_
}
listAddons_maxResults :: Lens.Lens' ListAddons (Prelude.Maybe Prelude.Natural)
listAddons_maxResults :: Lens' ListAddons (Maybe Natural)
listAddons_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAddons' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListAddons' :: ListAddons -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListAddons
s@ListAddons' {} Maybe Natural
a -> ListAddons
s {$sel:maxResults:ListAddons' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListAddons)
listAddons_nextToken :: Lens.Lens' ListAddons (Prelude.Maybe Prelude.Text)
listAddons_nextToken :: Lens' ListAddons (Maybe Text)
listAddons_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAddons' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListAddons' :: ListAddons -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListAddons
s@ListAddons' {} Maybe Text
a -> ListAddons
s {$sel:nextToken:ListAddons' :: Maybe Text
nextToken = Maybe Text
a} :: ListAddons)
listAddons_clusterName :: Lens.Lens' ListAddons Prelude.Text
listAddons_clusterName :: Lens' ListAddons Text
listAddons_clusterName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAddons' {Text
clusterName :: Text
$sel:clusterName:ListAddons' :: ListAddons -> Text
clusterName} -> Text
clusterName) (\s :: ListAddons
s@ListAddons' {} Text
a -> ListAddons
s {$sel:clusterName:ListAddons' :: Text
clusterName = Text
a} :: ListAddons)
instance Core.AWSPager ListAddons where
page :: ListAddons -> AWSResponse ListAddons -> Maybe ListAddons
page ListAddons
rq AWSResponse ListAddons
rs
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListAddons
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListAddonsResponse (Maybe Text)
listAddonsResponse_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 ListAddons
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListAddonsResponse (Maybe [Text])
listAddonsResponse_addons
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.$ ListAddons
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListAddons (Maybe Text)
listAddons_nextToken
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListAddons
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListAddonsResponse (Maybe Text)
listAddonsResponse_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 ListAddons where
type AWSResponse ListAddons = ListAddonsResponse
request :: (Service -> Service) -> ListAddons -> Request ListAddons
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 ListAddons
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListAddons)))
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 -> ListAddonsResponse
ListAddonsResponse'
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
"addons" 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.<*> (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.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable ListAddons where
hashWithSalt :: Int -> ListAddons -> Int
hashWithSalt Int
_salt ListAddons' {Maybe Natural
Maybe Text
Text
clusterName :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:clusterName:ListAddons' :: ListAddons -> Text
$sel:nextToken:ListAddons' :: ListAddons -> Maybe Text
$sel:maxResults:ListAddons' :: ListAddons -> 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 ListAddons where
rnf :: ListAddons -> ()
rnf ListAddons' {Maybe Natural
Maybe Text
Text
clusterName :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:clusterName:ListAddons' :: ListAddons -> Text
$sel:nextToken:ListAddons' :: ListAddons -> Maybe Text
$sel:maxResults:ListAddons' :: ListAddons -> 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 ListAddons where
toHeaders :: ListAddons -> 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 ListAddons where
toPath :: ListAddons -> ByteString
toPath ListAddons' {Maybe Natural
Maybe Text
Text
clusterName :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:clusterName:ListAddons' :: ListAddons -> Text
$sel:nextToken:ListAddons' :: ListAddons -> Maybe Text
$sel:maxResults:ListAddons' :: ListAddons -> Maybe Natural
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/clusters/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
clusterName, ByteString
"/addons"]
instance Data.ToQuery ListAddons where
toQuery :: ListAddons -> QueryString
toQuery ListAddons' {Maybe Natural
Maybe Text
Text
clusterName :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:clusterName:ListAddons' :: ListAddons -> Text
$sel:nextToken:ListAddons' :: ListAddons -> Maybe Text
$sel:maxResults:ListAddons' :: ListAddons -> 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 ListAddonsResponse = ListAddonsResponse'
{
ListAddonsResponse -> Maybe [Text]
addons :: Prelude.Maybe [Prelude.Text],
ListAddonsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListAddonsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListAddonsResponse -> ListAddonsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAddonsResponse -> ListAddonsResponse -> Bool
$c/= :: ListAddonsResponse -> ListAddonsResponse -> Bool
== :: ListAddonsResponse -> ListAddonsResponse -> Bool
$c== :: ListAddonsResponse -> ListAddonsResponse -> Bool
Prelude.Eq, ReadPrec [ListAddonsResponse]
ReadPrec ListAddonsResponse
Int -> ReadS ListAddonsResponse
ReadS [ListAddonsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAddonsResponse]
$creadListPrec :: ReadPrec [ListAddonsResponse]
readPrec :: ReadPrec ListAddonsResponse
$creadPrec :: ReadPrec ListAddonsResponse
readList :: ReadS [ListAddonsResponse]
$creadList :: ReadS [ListAddonsResponse]
readsPrec :: Int -> ReadS ListAddonsResponse
$creadsPrec :: Int -> ReadS ListAddonsResponse
Prelude.Read, Int -> ListAddonsResponse -> ShowS
[ListAddonsResponse] -> ShowS
ListAddonsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAddonsResponse] -> ShowS
$cshowList :: [ListAddonsResponse] -> ShowS
show :: ListAddonsResponse -> String
$cshow :: ListAddonsResponse -> String
showsPrec :: Int -> ListAddonsResponse -> ShowS
$cshowsPrec :: Int -> ListAddonsResponse -> ShowS
Prelude.Show, forall x. Rep ListAddonsResponse x -> ListAddonsResponse
forall x. ListAddonsResponse -> Rep ListAddonsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListAddonsResponse x -> ListAddonsResponse
$cfrom :: forall x. ListAddonsResponse -> Rep ListAddonsResponse x
Prelude.Generic)
newListAddonsResponse ::
Prelude.Int ->
ListAddonsResponse
newListAddonsResponse :: Int -> ListAddonsResponse
newListAddonsResponse Int
pHttpStatus_ =
ListAddonsResponse'
{ $sel:addons:ListAddonsResponse' :: Maybe [Text]
addons = forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListAddonsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListAddonsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listAddonsResponse_addons :: Lens.Lens' ListAddonsResponse (Prelude.Maybe [Prelude.Text])
listAddonsResponse_addons :: Lens' ListAddonsResponse (Maybe [Text])
listAddonsResponse_addons = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAddonsResponse' {Maybe [Text]
addons :: Maybe [Text]
$sel:addons:ListAddonsResponse' :: ListAddonsResponse -> Maybe [Text]
addons} -> Maybe [Text]
addons) (\s :: ListAddonsResponse
s@ListAddonsResponse' {} Maybe [Text]
a -> ListAddonsResponse
s {$sel:addons:ListAddonsResponse' :: Maybe [Text]
addons = Maybe [Text]
a} :: ListAddonsResponse) 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
listAddonsResponse_nextToken :: Lens.Lens' ListAddonsResponse (Prelude.Maybe Prelude.Text)
listAddonsResponse_nextToken :: Lens' ListAddonsResponse (Maybe Text)
listAddonsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAddonsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListAddonsResponse' :: ListAddonsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListAddonsResponse
s@ListAddonsResponse' {} Maybe Text
a -> ListAddonsResponse
s {$sel:nextToken:ListAddonsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListAddonsResponse)
listAddonsResponse_httpStatus :: Lens.Lens' ListAddonsResponse Prelude.Int
listAddonsResponse_httpStatus :: Lens' ListAddonsResponse Int
listAddonsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAddonsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListAddonsResponse' :: ListAddonsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListAddonsResponse
s@ListAddonsResponse' {} Int
a -> ListAddonsResponse
s {$sel:httpStatus:ListAddonsResponse' :: Int
httpStatus = Int
a} :: ListAddonsResponse)
instance Prelude.NFData ListAddonsResponse where
rnf :: ListAddonsResponse -> ()
rnf ListAddonsResponse' {Int
Maybe [Text]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
addons :: Maybe [Text]
$sel:httpStatus:ListAddonsResponse' :: ListAddonsResponse -> Int
$sel:nextToken:ListAddonsResponse' :: ListAddonsResponse -> Maybe Text
$sel:addons:ListAddonsResponse' :: ListAddonsResponse -> Maybe [Text]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
addons
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 Int
httpStatus