{-# 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.EMRContainers.ListManagedEndpoints
(
ListManagedEndpoints (..),
newListManagedEndpoints,
listManagedEndpoints_states,
listManagedEndpoints_createdAfter,
listManagedEndpoints_types,
listManagedEndpoints_nextToken,
listManagedEndpoints_maxResults,
listManagedEndpoints_createdBefore,
listManagedEndpoints_virtualClusterId,
ListManagedEndpointsResponse (..),
newListManagedEndpointsResponse,
listManagedEndpointsResponse_nextToken,
listManagedEndpointsResponse_endpoints,
listManagedEndpointsResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.EMRContainers.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
data ListManagedEndpoints = ListManagedEndpoints'
{
ListManagedEndpoints -> Maybe [EndpointState]
states :: Prelude.Maybe [EndpointState],
ListManagedEndpoints -> Maybe POSIX
createdAfter :: Prelude.Maybe Core.POSIX,
ListManagedEndpoints -> Maybe [Text]
types :: Prelude.Maybe [Prelude.Text],
ListManagedEndpoints -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListManagedEndpoints -> Maybe Int
maxResults :: Prelude.Maybe Prelude.Int,
ListManagedEndpoints -> Maybe POSIX
createdBefore :: Prelude.Maybe Core.POSIX,
ListManagedEndpoints -> Text
virtualClusterId :: Prelude.Text
}
deriving (ListManagedEndpoints -> ListManagedEndpoints -> Bool
(ListManagedEndpoints -> ListManagedEndpoints -> Bool)
-> (ListManagedEndpoints -> ListManagedEndpoints -> Bool)
-> Eq ListManagedEndpoints
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListManagedEndpoints -> ListManagedEndpoints -> Bool
$c/= :: ListManagedEndpoints -> ListManagedEndpoints -> Bool
== :: ListManagedEndpoints -> ListManagedEndpoints -> Bool
$c== :: ListManagedEndpoints -> ListManagedEndpoints -> Bool
Prelude.Eq, ReadPrec [ListManagedEndpoints]
ReadPrec ListManagedEndpoints
Int -> ReadS ListManagedEndpoints
ReadS [ListManagedEndpoints]
(Int -> ReadS ListManagedEndpoints)
-> ReadS [ListManagedEndpoints]
-> ReadPrec ListManagedEndpoints
-> ReadPrec [ListManagedEndpoints]
-> Read ListManagedEndpoints
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListManagedEndpoints]
$creadListPrec :: ReadPrec [ListManagedEndpoints]
readPrec :: ReadPrec ListManagedEndpoints
$creadPrec :: ReadPrec ListManagedEndpoints
readList :: ReadS [ListManagedEndpoints]
$creadList :: ReadS [ListManagedEndpoints]
readsPrec :: Int -> ReadS ListManagedEndpoints
$creadsPrec :: Int -> ReadS ListManagedEndpoints
Prelude.Read, Int -> ListManagedEndpoints -> ShowS
[ListManagedEndpoints] -> ShowS
ListManagedEndpoints -> String
(Int -> ListManagedEndpoints -> ShowS)
-> (ListManagedEndpoints -> String)
-> ([ListManagedEndpoints] -> ShowS)
-> Show ListManagedEndpoints
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListManagedEndpoints] -> ShowS
$cshowList :: [ListManagedEndpoints] -> ShowS
show :: ListManagedEndpoints -> String
$cshow :: ListManagedEndpoints -> String
showsPrec :: Int -> ListManagedEndpoints -> ShowS
$cshowsPrec :: Int -> ListManagedEndpoints -> ShowS
Prelude.Show, (forall x. ListManagedEndpoints -> Rep ListManagedEndpoints x)
-> (forall x. Rep ListManagedEndpoints x -> ListManagedEndpoints)
-> Generic ListManagedEndpoints
forall x. Rep ListManagedEndpoints x -> ListManagedEndpoints
forall x. ListManagedEndpoints -> Rep ListManagedEndpoints x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListManagedEndpoints x -> ListManagedEndpoints
$cfrom :: forall x. ListManagedEndpoints -> Rep ListManagedEndpoints x
Prelude.Generic)
newListManagedEndpoints ::
Prelude.Text ->
ListManagedEndpoints
newListManagedEndpoints :: Text -> ListManagedEndpoints
newListManagedEndpoints Text
pVirtualClusterId_ =
ListManagedEndpoints' :: Maybe [EndpointState]
-> Maybe POSIX
-> Maybe [Text]
-> Maybe Text
-> Maybe Int
-> Maybe POSIX
-> Text
-> ListManagedEndpoints
ListManagedEndpoints'
{ $sel:states:ListManagedEndpoints' :: Maybe [EndpointState]
states = Maybe [EndpointState]
forall a. Maybe a
Prelude.Nothing,
$sel:createdAfter:ListManagedEndpoints' :: Maybe POSIX
createdAfter = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:types:ListManagedEndpoints' :: Maybe [Text]
types = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListManagedEndpoints' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:maxResults:ListManagedEndpoints' :: Maybe Int
maxResults = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:createdBefore:ListManagedEndpoints' :: Maybe POSIX
createdBefore = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:virtualClusterId:ListManagedEndpoints' :: Text
virtualClusterId = Text
pVirtualClusterId_
}
listManagedEndpoints_states :: Lens.Lens' ListManagedEndpoints (Prelude.Maybe [EndpointState])
listManagedEndpoints_states :: (Maybe [EndpointState] -> f (Maybe [EndpointState]))
-> ListManagedEndpoints -> f ListManagedEndpoints
listManagedEndpoints_states = (ListManagedEndpoints -> Maybe [EndpointState])
-> (ListManagedEndpoints
-> Maybe [EndpointState] -> ListManagedEndpoints)
-> Lens
ListManagedEndpoints
ListManagedEndpoints
(Maybe [EndpointState])
(Maybe [EndpointState])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListManagedEndpoints' {Maybe [EndpointState]
states :: Maybe [EndpointState]
$sel:states:ListManagedEndpoints' :: ListManagedEndpoints -> Maybe [EndpointState]
states} -> Maybe [EndpointState]
states) (\s :: ListManagedEndpoints
s@ListManagedEndpoints' {} Maybe [EndpointState]
a -> ListManagedEndpoints
s {$sel:states:ListManagedEndpoints' :: Maybe [EndpointState]
states = Maybe [EndpointState]
a} :: ListManagedEndpoints) ((Maybe [EndpointState] -> f (Maybe [EndpointState]))
-> ListManagedEndpoints -> f ListManagedEndpoints)
-> ((Maybe [EndpointState] -> f (Maybe [EndpointState]))
-> Maybe [EndpointState] -> f (Maybe [EndpointState]))
-> (Maybe [EndpointState] -> f (Maybe [EndpointState]))
-> ListManagedEndpoints
-> f ListManagedEndpoints
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[EndpointState] [EndpointState] [EndpointState] [EndpointState]
-> Iso
(Maybe [EndpointState])
(Maybe [EndpointState])
(Maybe [EndpointState])
(Maybe [EndpointState])
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
[EndpointState] [EndpointState] [EndpointState] [EndpointState]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listManagedEndpoints_createdAfter :: Lens.Lens' ListManagedEndpoints (Prelude.Maybe Prelude.UTCTime)
listManagedEndpoints_createdAfter :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ListManagedEndpoints -> f ListManagedEndpoints
listManagedEndpoints_createdAfter = (ListManagedEndpoints -> Maybe POSIX)
-> (ListManagedEndpoints -> Maybe POSIX -> ListManagedEndpoints)
-> Lens
ListManagedEndpoints
ListManagedEndpoints
(Maybe POSIX)
(Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListManagedEndpoints' {Maybe POSIX
createdAfter :: Maybe POSIX
$sel:createdAfter:ListManagedEndpoints' :: ListManagedEndpoints -> Maybe POSIX
createdAfter} -> Maybe POSIX
createdAfter) (\s :: ListManagedEndpoints
s@ListManagedEndpoints' {} Maybe POSIX
a -> ListManagedEndpoints
s {$sel:createdAfter:ListManagedEndpoints' :: Maybe POSIX
createdAfter = Maybe POSIX
a} :: ListManagedEndpoints) ((Maybe POSIX -> f (Maybe POSIX))
-> ListManagedEndpoints -> f ListManagedEndpoints)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ListManagedEndpoints
-> f ListManagedEndpoints
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
listManagedEndpoints_types :: Lens.Lens' ListManagedEndpoints (Prelude.Maybe [Prelude.Text])
listManagedEndpoints_types :: (Maybe [Text] -> f (Maybe [Text]))
-> ListManagedEndpoints -> f ListManagedEndpoints
listManagedEndpoints_types = (ListManagedEndpoints -> Maybe [Text])
-> (ListManagedEndpoints -> Maybe [Text] -> ListManagedEndpoints)
-> Lens
ListManagedEndpoints
ListManagedEndpoints
(Maybe [Text])
(Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListManagedEndpoints' {Maybe [Text]
types :: Maybe [Text]
$sel:types:ListManagedEndpoints' :: ListManagedEndpoints -> Maybe [Text]
types} -> Maybe [Text]
types) (\s :: ListManagedEndpoints
s@ListManagedEndpoints' {} Maybe [Text]
a -> ListManagedEndpoints
s {$sel:types:ListManagedEndpoints' :: Maybe [Text]
types = Maybe [Text]
a} :: ListManagedEndpoints) ((Maybe [Text] -> f (Maybe [Text]))
-> ListManagedEndpoints -> f ListManagedEndpoints)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ListManagedEndpoints
-> f ListManagedEndpoints
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
listManagedEndpoints_nextToken :: Lens.Lens' ListManagedEndpoints (Prelude.Maybe Prelude.Text)
listManagedEndpoints_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListManagedEndpoints -> f ListManagedEndpoints
listManagedEndpoints_nextToken = (ListManagedEndpoints -> Maybe Text)
-> (ListManagedEndpoints -> Maybe Text -> ListManagedEndpoints)
-> Lens
ListManagedEndpoints ListManagedEndpoints (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListManagedEndpoints' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListManagedEndpoints' :: ListManagedEndpoints -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListManagedEndpoints
s@ListManagedEndpoints' {} Maybe Text
a -> ListManagedEndpoints
s {$sel:nextToken:ListManagedEndpoints' :: Maybe Text
nextToken = Maybe Text
a} :: ListManagedEndpoints)
listManagedEndpoints_maxResults :: Lens.Lens' ListManagedEndpoints (Prelude.Maybe Prelude.Int)
listManagedEndpoints_maxResults :: (Maybe Int -> f (Maybe Int))
-> ListManagedEndpoints -> f ListManagedEndpoints
listManagedEndpoints_maxResults = (ListManagedEndpoints -> Maybe Int)
-> (ListManagedEndpoints -> Maybe Int -> ListManagedEndpoints)
-> Lens
ListManagedEndpoints ListManagedEndpoints (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListManagedEndpoints' {Maybe Int
maxResults :: Maybe Int
$sel:maxResults:ListManagedEndpoints' :: ListManagedEndpoints -> Maybe Int
maxResults} -> Maybe Int
maxResults) (\s :: ListManagedEndpoints
s@ListManagedEndpoints' {} Maybe Int
a -> ListManagedEndpoints
s {$sel:maxResults:ListManagedEndpoints' :: Maybe Int
maxResults = Maybe Int
a} :: ListManagedEndpoints)
listManagedEndpoints_createdBefore :: Lens.Lens' ListManagedEndpoints (Prelude.Maybe Prelude.UTCTime)
listManagedEndpoints_createdBefore :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ListManagedEndpoints -> f ListManagedEndpoints
listManagedEndpoints_createdBefore = (ListManagedEndpoints -> Maybe POSIX)
-> (ListManagedEndpoints -> Maybe POSIX -> ListManagedEndpoints)
-> Lens
ListManagedEndpoints
ListManagedEndpoints
(Maybe POSIX)
(Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListManagedEndpoints' {Maybe POSIX
createdBefore :: Maybe POSIX
$sel:createdBefore:ListManagedEndpoints' :: ListManagedEndpoints -> Maybe POSIX
createdBefore} -> Maybe POSIX
createdBefore) (\s :: ListManagedEndpoints
s@ListManagedEndpoints' {} Maybe POSIX
a -> ListManagedEndpoints
s {$sel:createdBefore:ListManagedEndpoints' :: Maybe POSIX
createdBefore = Maybe POSIX
a} :: ListManagedEndpoints) ((Maybe POSIX -> f (Maybe POSIX))
-> ListManagedEndpoints -> f ListManagedEndpoints)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ListManagedEndpoints
-> f ListManagedEndpoints
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
listManagedEndpoints_virtualClusterId :: Lens.Lens' ListManagedEndpoints Prelude.Text
listManagedEndpoints_virtualClusterId :: (Text -> f Text) -> ListManagedEndpoints -> f ListManagedEndpoints
listManagedEndpoints_virtualClusterId = (ListManagedEndpoints -> Text)
-> (ListManagedEndpoints -> Text -> ListManagedEndpoints)
-> Lens ListManagedEndpoints ListManagedEndpoints Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListManagedEndpoints' {Text
virtualClusterId :: Text
$sel:virtualClusterId:ListManagedEndpoints' :: ListManagedEndpoints -> Text
virtualClusterId} -> Text
virtualClusterId) (\s :: ListManagedEndpoints
s@ListManagedEndpoints' {} Text
a -> ListManagedEndpoints
s {$sel:virtualClusterId:ListManagedEndpoints' :: Text
virtualClusterId = Text
a} :: ListManagedEndpoints)
instance Core.AWSPager ListManagedEndpoints where
page :: ListManagedEndpoints
-> AWSResponse ListManagedEndpoints -> Maybe ListManagedEndpoints
page ListManagedEndpoints
rq AWSResponse ListManagedEndpoints
rs
| Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListManagedEndpoints
ListManagedEndpointsResponse
rs
ListManagedEndpointsResponse
-> Getting (First Text) ListManagedEndpointsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListManagedEndpointsResponse
-> Const (First Text) ListManagedEndpointsResponse
Lens' ListManagedEndpointsResponse (Maybe Text)
listManagedEndpointsResponse_nextToken
((Maybe Text -> Const (First Text) (Maybe Text))
-> ListManagedEndpointsResponse
-> Const (First Text) ListManagedEndpointsResponse)
-> ((Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListManagedEndpointsResponse 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 ListManagedEndpoints
forall a. Maybe a
Prelude.Nothing
| Maybe [Endpoint] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListManagedEndpoints
ListManagedEndpointsResponse
rs
ListManagedEndpointsResponse
-> Getting
(First [Endpoint]) ListManagedEndpointsResponse [Endpoint]
-> Maybe [Endpoint]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [Endpoint] -> Const (First [Endpoint]) (Maybe [Endpoint]))
-> ListManagedEndpointsResponse
-> Const (First [Endpoint]) ListManagedEndpointsResponse
Lens' ListManagedEndpointsResponse (Maybe [Endpoint])
listManagedEndpointsResponse_endpoints
((Maybe [Endpoint] -> Const (First [Endpoint]) (Maybe [Endpoint]))
-> ListManagedEndpointsResponse
-> Const (First [Endpoint]) ListManagedEndpointsResponse)
-> (([Endpoint] -> Const (First [Endpoint]) [Endpoint])
-> Maybe [Endpoint] -> Const (First [Endpoint]) (Maybe [Endpoint]))
-> Getting
(First [Endpoint]) ListManagedEndpointsResponse [Endpoint]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Endpoint] -> Const (First [Endpoint]) [Endpoint])
-> Maybe [Endpoint] -> Const (First [Endpoint]) (Maybe [Endpoint])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
Maybe ListManagedEndpoints
forall a. Maybe a
Prelude.Nothing
| Bool
Prelude.otherwise =
ListManagedEndpoints -> Maybe ListManagedEndpoints
forall a. a -> Maybe a
Prelude.Just (ListManagedEndpoints -> Maybe ListManagedEndpoints)
-> ListManagedEndpoints -> Maybe ListManagedEndpoints
forall a b. (a -> b) -> a -> b
Prelude.$
ListManagedEndpoints
rq
ListManagedEndpoints
-> (ListManagedEndpoints -> ListManagedEndpoints)
-> ListManagedEndpoints
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListManagedEndpoints -> Identity ListManagedEndpoints
Lens
ListManagedEndpoints ListManagedEndpoints (Maybe Text) (Maybe Text)
listManagedEndpoints_nextToken
((Maybe Text -> Identity (Maybe Text))
-> ListManagedEndpoints -> Identity ListManagedEndpoints)
-> Maybe Text -> ListManagedEndpoints -> ListManagedEndpoints
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListManagedEndpoints
ListManagedEndpointsResponse
rs
ListManagedEndpointsResponse
-> Getting (First Text) ListManagedEndpointsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListManagedEndpointsResponse
-> Const (First Text) ListManagedEndpointsResponse
Lens' ListManagedEndpointsResponse (Maybe Text)
listManagedEndpointsResponse_nextToken
((Maybe Text -> Const (First Text) (Maybe Text))
-> ListManagedEndpointsResponse
-> Const (First Text) ListManagedEndpointsResponse)
-> ((Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListManagedEndpointsResponse 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 ListManagedEndpoints where
type
AWSResponse ListManagedEndpoints =
ListManagedEndpointsResponse
request :: ListManagedEndpoints -> Request ListManagedEndpoints
request = Service -> ListManagedEndpoints -> Request ListManagedEndpoints
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy ListManagedEndpoints
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListManagedEndpoints)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse ListManagedEndpoints))
-> Logger
-> Service
-> Proxy ListManagedEndpoints
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListManagedEndpoints)))
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 [Endpoint] -> Int -> ListManagedEndpointsResponse
ListManagedEndpointsResponse'
(Maybe Text
-> Maybe [Endpoint] -> Int -> ListManagedEndpointsResponse)
-> Either String (Maybe Text)
-> Either
String (Maybe [Endpoint] -> Int -> ListManagedEndpointsResponse)
forall (f :: * -> *) a b. Functor 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 (Maybe [Endpoint] -> Int -> ListManagedEndpointsResponse)
-> Either String (Maybe [Endpoint])
-> Either String (Int -> ListManagedEndpointsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [Endpoint]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"endpoints" Either String (Maybe (Maybe [Endpoint]))
-> Maybe [Endpoint] -> Either String (Maybe [Endpoint])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Endpoint]
forall a. Monoid a => a
Prelude.mempty)
Either String (Int -> ListManagedEndpointsResponse)
-> Either String Int -> Either String ListManagedEndpointsResponse
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 ListManagedEndpoints
instance Prelude.NFData ListManagedEndpoints
instance Core.ToHeaders ListManagedEndpoints where
toHeaders :: ListManagedEndpoints -> ResponseHeaders
toHeaders =
ResponseHeaders -> ListManagedEndpoints -> 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 ListManagedEndpoints where
toPath :: ListManagedEndpoints -> ByteString
toPath ListManagedEndpoints' {Maybe Int
Maybe [Text]
Maybe [EndpointState]
Maybe Text
Maybe POSIX
Text
virtualClusterId :: Text
createdBefore :: Maybe POSIX
maxResults :: Maybe Int
nextToken :: Maybe Text
types :: Maybe [Text]
createdAfter :: Maybe POSIX
states :: Maybe [EndpointState]
$sel:virtualClusterId:ListManagedEndpoints' :: ListManagedEndpoints -> Text
$sel:createdBefore:ListManagedEndpoints' :: ListManagedEndpoints -> Maybe POSIX
$sel:maxResults:ListManagedEndpoints' :: ListManagedEndpoints -> Maybe Int
$sel:nextToken:ListManagedEndpoints' :: ListManagedEndpoints -> Maybe Text
$sel:types:ListManagedEndpoints' :: ListManagedEndpoints -> Maybe [Text]
$sel:createdAfter:ListManagedEndpoints' :: ListManagedEndpoints -> Maybe POSIX
$sel:states:ListManagedEndpoints' :: ListManagedEndpoints -> Maybe [EndpointState]
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/virtualclusters/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
virtualClusterId,
ByteString
"/endpoints"
]
instance Core.ToQuery ListManagedEndpoints where
toQuery :: ListManagedEndpoints -> QueryString
toQuery ListManagedEndpoints' {Maybe Int
Maybe [Text]
Maybe [EndpointState]
Maybe Text
Maybe POSIX
Text
virtualClusterId :: Text
createdBefore :: Maybe POSIX
maxResults :: Maybe Int
nextToken :: Maybe Text
types :: Maybe [Text]
createdAfter :: Maybe POSIX
states :: Maybe [EndpointState]
$sel:virtualClusterId:ListManagedEndpoints' :: ListManagedEndpoints -> Text
$sel:createdBefore:ListManagedEndpoints' :: ListManagedEndpoints -> Maybe POSIX
$sel:maxResults:ListManagedEndpoints' :: ListManagedEndpoints -> Maybe Int
$sel:nextToken:ListManagedEndpoints' :: ListManagedEndpoints -> Maybe Text
$sel:types:ListManagedEndpoints' :: ListManagedEndpoints -> Maybe [Text]
$sel:createdAfter:ListManagedEndpoints' :: ListManagedEndpoints -> Maybe POSIX
$sel:states:ListManagedEndpoints' :: ListManagedEndpoints -> Maybe [EndpointState]
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"states"
ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
(ByteString -> [EndpointState] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member" ([EndpointState] -> QueryString)
-> Maybe [EndpointState] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [EndpointState]
states),
ByteString
"createdAfter" ByteString -> Maybe POSIX -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe POSIX
createdAfter,
ByteString
"types"
ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
(ByteString -> [Text] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member" ([Text] -> QueryString) -> Maybe [Text] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
types),
ByteString
"nextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
ByteString
"maxResults" ByteString -> Maybe Int -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Int
maxResults,
ByteString
"createdBefore" ByteString -> Maybe POSIX -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe POSIX
createdBefore
]
data ListManagedEndpointsResponse = ListManagedEndpointsResponse'
{
ListManagedEndpointsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListManagedEndpointsResponse -> Maybe [Endpoint]
endpoints :: Prelude.Maybe [Endpoint],
ListManagedEndpointsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListManagedEndpointsResponse
-> ListManagedEndpointsResponse -> Bool
(ListManagedEndpointsResponse
-> ListManagedEndpointsResponse -> Bool)
-> (ListManagedEndpointsResponse
-> ListManagedEndpointsResponse -> Bool)
-> Eq ListManagedEndpointsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListManagedEndpointsResponse
-> ListManagedEndpointsResponse -> Bool
$c/= :: ListManagedEndpointsResponse
-> ListManagedEndpointsResponse -> Bool
== :: ListManagedEndpointsResponse
-> ListManagedEndpointsResponse -> Bool
$c== :: ListManagedEndpointsResponse
-> ListManagedEndpointsResponse -> Bool
Prelude.Eq, Int -> ListManagedEndpointsResponse -> ShowS
[ListManagedEndpointsResponse] -> ShowS
ListManagedEndpointsResponse -> String
(Int -> ListManagedEndpointsResponse -> ShowS)
-> (ListManagedEndpointsResponse -> String)
-> ([ListManagedEndpointsResponse] -> ShowS)
-> Show ListManagedEndpointsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListManagedEndpointsResponse] -> ShowS
$cshowList :: [ListManagedEndpointsResponse] -> ShowS
show :: ListManagedEndpointsResponse -> String
$cshow :: ListManagedEndpointsResponse -> String
showsPrec :: Int -> ListManagedEndpointsResponse -> ShowS
$cshowsPrec :: Int -> ListManagedEndpointsResponse -> ShowS
Prelude.Show, (forall x.
ListManagedEndpointsResponse -> Rep ListManagedEndpointsResponse x)
-> (forall x.
Rep ListManagedEndpointsResponse x -> ListManagedEndpointsResponse)
-> Generic ListManagedEndpointsResponse
forall x.
Rep ListManagedEndpointsResponse x -> ListManagedEndpointsResponse
forall x.
ListManagedEndpointsResponse -> Rep ListManagedEndpointsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListManagedEndpointsResponse x -> ListManagedEndpointsResponse
$cfrom :: forall x.
ListManagedEndpointsResponse -> Rep ListManagedEndpointsResponse x
Prelude.Generic)
newListManagedEndpointsResponse ::
Prelude.Int ->
ListManagedEndpointsResponse
newListManagedEndpointsResponse :: Int -> ListManagedEndpointsResponse
newListManagedEndpointsResponse Int
pHttpStatus_ =
ListManagedEndpointsResponse' :: Maybe Text
-> Maybe [Endpoint] -> Int -> ListManagedEndpointsResponse
ListManagedEndpointsResponse'
{ $sel:nextToken:ListManagedEndpointsResponse' :: Maybe Text
nextToken =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:endpoints:ListManagedEndpointsResponse' :: Maybe [Endpoint]
endpoints = Maybe [Endpoint]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListManagedEndpointsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listManagedEndpointsResponse_nextToken :: Lens.Lens' ListManagedEndpointsResponse (Prelude.Maybe Prelude.Text)
listManagedEndpointsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListManagedEndpointsResponse -> f ListManagedEndpointsResponse
listManagedEndpointsResponse_nextToken = (ListManagedEndpointsResponse -> Maybe Text)
-> (ListManagedEndpointsResponse
-> Maybe Text -> ListManagedEndpointsResponse)
-> Lens' ListManagedEndpointsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListManagedEndpointsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListManagedEndpointsResponse' :: ListManagedEndpointsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListManagedEndpointsResponse
s@ListManagedEndpointsResponse' {} Maybe Text
a -> ListManagedEndpointsResponse
s {$sel:nextToken:ListManagedEndpointsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListManagedEndpointsResponse)
listManagedEndpointsResponse_endpoints :: Lens.Lens' ListManagedEndpointsResponse (Prelude.Maybe [Endpoint])
listManagedEndpointsResponse_endpoints :: (Maybe [Endpoint] -> f (Maybe [Endpoint]))
-> ListManagedEndpointsResponse -> f ListManagedEndpointsResponse
listManagedEndpointsResponse_endpoints = (ListManagedEndpointsResponse -> Maybe [Endpoint])
-> (ListManagedEndpointsResponse
-> Maybe [Endpoint] -> ListManagedEndpointsResponse)
-> Lens' ListManagedEndpointsResponse (Maybe [Endpoint])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListManagedEndpointsResponse' {Maybe [Endpoint]
endpoints :: Maybe [Endpoint]
$sel:endpoints:ListManagedEndpointsResponse' :: ListManagedEndpointsResponse -> Maybe [Endpoint]
endpoints} -> Maybe [Endpoint]
endpoints) (\s :: ListManagedEndpointsResponse
s@ListManagedEndpointsResponse' {} Maybe [Endpoint]
a -> ListManagedEndpointsResponse
s {$sel:endpoints:ListManagedEndpointsResponse' :: Maybe [Endpoint]
endpoints = Maybe [Endpoint]
a} :: ListManagedEndpointsResponse) ((Maybe [Endpoint] -> f (Maybe [Endpoint]))
-> ListManagedEndpointsResponse -> f ListManagedEndpointsResponse)
-> ((Maybe [Endpoint] -> f (Maybe [Endpoint]))
-> Maybe [Endpoint] -> f (Maybe [Endpoint]))
-> (Maybe [Endpoint] -> f (Maybe [Endpoint]))
-> ListManagedEndpointsResponse
-> f ListManagedEndpointsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Endpoint] [Endpoint] [Endpoint] [Endpoint]
-> Iso
(Maybe [Endpoint])
(Maybe [Endpoint])
(Maybe [Endpoint])
(Maybe [Endpoint])
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 [Endpoint] [Endpoint] [Endpoint] [Endpoint]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listManagedEndpointsResponse_httpStatus :: Lens.Lens' ListManagedEndpointsResponse Prelude.Int
listManagedEndpointsResponse_httpStatus :: (Int -> f Int)
-> ListManagedEndpointsResponse -> f ListManagedEndpointsResponse
listManagedEndpointsResponse_httpStatus = (ListManagedEndpointsResponse -> Int)
-> (ListManagedEndpointsResponse
-> Int -> ListManagedEndpointsResponse)
-> Lens
ListManagedEndpointsResponse ListManagedEndpointsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListManagedEndpointsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListManagedEndpointsResponse' :: ListManagedEndpointsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListManagedEndpointsResponse
s@ListManagedEndpointsResponse' {} Int
a -> ListManagedEndpointsResponse
s {$sel:httpStatus:ListManagedEndpointsResponse' :: Int
httpStatus = Int
a} :: ListManagedEndpointsResponse)
instance Prelude.NFData ListManagedEndpointsResponse