{-# 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.FinSpace.ListEnvironments
(
ListEnvironments (..),
newListEnvironments,
listEnvironments_nextToken,
listEnvironments_maxResults,
ListEnvironmentsResponse (..),
newListEnvironmentsResponse,
listEnvironmentsResponse_nextToken,
listEnvironmentsResponse_environments,
listEnvironmentsResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.FinSpace.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 ListEnvironments = ListEnvironments'
{
ListEnvironments -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListEnvironments -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
}
deriving (ListEnvironments -> ListEnvironments -> Bool
(ListEnvironments -> ListEnvironments -> Bool)
-> (ListEnvironments -> ListEnvironments -> Bool)
-> Eq ListEnvironments
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListEnvironments -> ListEnvironments -> Bool
$c/= :: ListEnvironments -> ListEnvironments -> Bool
== :: ListEnvironments -> ListEnvironments -> Bool
$c== :: ListEnvironments -> ListEnvironments -> Bool
Prelude.Eq, ReadPrec [ListEnvironments]
ReadPrec ListEnvironments
Int -> ReadS ListEnvironments
ReadS [ListEnvironments]
(Int -> ReadS ListEnvironments)
-> ReadS [ListEnvironments]
-> ReadPrec ListEnvironments
-> ReadPrec [ListEnvironments]
-> Read ListEnvironments
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListEnvironments]
$creadListPrec :: ReadPrec [ListEnvironments]
readPrec :: ReadPrec ListEnvironments
$creadPrec :: ReadPrec ListEnvironments
readList :: ReadS [ListEnvironments]
$creadList :: ReadS [ListEnvironments]
readsPrec :: Int -> ReadS ListEnvironments
$creadsPrec :: Int -> ReadS ListEnvironments
Prelude.Read, Int -> ListEnvironments -> ShowS
[ListEnvironments] -> ShowS
ListEnvironments -> String
(Int -> ListEnvironments -> ShowS)
-> (ListEnvironments -> String)
-> ([ListEnvironments] -> ShowS)
-> Show ListEnvironments
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListEnvironments] -> ShowS
$cshowList :: [ListEnvironments] -> ShowS
show :: ListEnvironments -> String
$cshow :: ListEnvironments -> String
showsPrec :: Int -> ListEnvironments -> ShowS
$cshowsPrec :: Int -> ListEnvironments -> ShowS
Prelude.Show, (forall x. ListEnvironments -> Rep ListEnvironments x)
-> (forall x. Rep ListEnvironments x -> ListEnvironments)
-> Generic ListEnvironments
forall x. Rep ListEnvironments x -> ListEnvironments
forall x. ListEnvironments -> Rep ListEnvironments x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListEnvironments x -> ListEnvironments
$cfrom :: forall x. ListEnvironments -> Rep ListEnvironments x
Prelude.Generic)
newListEnvironments ::
ListEnvironments
newListEnvironments :: ListEnvironments
newListEnvironments =
ListEnvironments' :: Maybe Text -> Maybe Natural -> ListEnvironments
ListEnvironments'
{ $sel:nextToken:ListEnvironments' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:maxResults:ListEnvironments' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
}
listEnvironments_nextToken :: Lens.Lens' ListEnvironments (Prelude.Maybe Prelude.Text)
listEnvironments_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListEnvironments -> f ListEnvironments
listEnvironments_nextToken = (ListEnvironments -> Maybe Text)
-> (ListEnvironments -> Maybe Text -> ListEnvironments)
-> Lens ListEnvironments ListEnvironments (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListEnvironments' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListEnvironments' :: ListEnvironments -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListEnvironments
s@ListEnvironments' {} Maybe Text
a -> ListEnvironments
s {$sel:nextToken:ListEnvironments' :: Maybe Text
nextToken = Maybe Text
a} :: ListEnvironments)
listEnvironments_maxResults :: Lens.Lens' ListEnvironments (Prelude.Maybe Prelude.Natural)
listEnvironments_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListEnvironments -> f ListEnvironments
listEnvironments_maxResults = (ListEnvironments -> Maybe Natural)
-> (ListEnvironments -> Maybe Natural -> ListEnvironments)
-> Lens
ListEnvironments ListEnvironments (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListEnvironments' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListEnvironments' :: ListEnvironments -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListEnvironments
s@ListEnvironments' {} Maybe Natural
a -> ListEnvironments
s {$sel:maxResults:ListEnvironments' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListEnvironments)
instance Core.AWSRequest ListEnvironments where
type
AWSResponse ListEnvironments =
ListEnvironmentsResponse
request :: ListEnvironments -> Request ListEnvironments
request = Service -> ListEnvironments -> Request ListEnvironments
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy ListEnvironments
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListEnvironments)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse ListEnvironments))
-> Logger
-> Service
-> Proxy ListEnvironments
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListEnvironments)))
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 [Environment] -> Int -> ListEnvironmentsResponse
ListEnvironmentsResponse'
(Maybe Text
-> Maybe [Environment] -> Int -> ListEnvironmentsResponse)
-> Either String (Maybe Text)
-> Either
String (Maybe [Environment] -> Int -> ListEnvironmentsResponse)
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 [Environment] -> Int -> ListEnvironmentsResponse)
-> Either String (Maybe [Environment])
-> Either String (Int -> ListEnvironmentsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [Environment]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"environments" Either String (Maybe (Maybe [Environment]))
-> Maybe [Environment] -> Either String (Maybe [Environment])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Environment]
forall a. Monoid a => a
Prelude.mempty)
Either String (Int -> ListEnvironmentsResponse)
-> Either String Int -> Either String ListEnvironmentsResponse
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 ListEnvironments
instance Prelude.NFData ListEnvironments
instance Core.ToHeaders ListEnvironments where
toHeaders :: ListEnvironments -> ResponseHeaders
toHeaders =
ResponseHeaders -> ListEnvironments -> 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 ListEnvironments where
toPath :: ListEnvironments -> ByteString
toPath = ByteString -> ListEnvironments -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/environment"
instance Core.ToQuery ListEnvironments where
toQuery :: ListEnvironments -> QueryString
toQuery ListEnvironments' {Maybe Natural
Maybe Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:maxResults:ListEnvironments' :: ListEnvironments -> Maybe Natural
$sel:nextToken:ListEnvironments' :: ListEnvironments -> 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
]
data ListEnvironmentsResponse = ListEnvironmentsResponse'
{
ListEnvironmentsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListEnvironmentsResponse -> Maybe [Environment]
environments :: Prelude.Maybe [Environment],
ListEnvironmentsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListEnvironmentsResponse -> ListEnvironmentsResponse -> Bool
(ListEnvironmentsResponse -> ListEnvironmentsResponse -> Bool)
-> (ListEnvironmentsResponse -> ListEnvironmentsResponse -> Bool)
-> Eq ListEnvironmentsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListEnvironmentsResponse -> ListEnvironmentsResponse -> Bool
$c/= :: ListEnvironmentsResponse -> ListEnvironmentsResponse -> Bool
== :: ListEnvironmentsResponse -> ListEnvironmentsResponse -> Bool
$c== :: ListEnvironmentsResponse -> ListEnvironmentsResponse -> Bool
Prelude.Eq, ReadPrec [ListEnvironmentsResponse]
ReadPrec ListEnvironmentsResponse
Int -> ReadS ListEnvironmentsResponse
ReadS [ListEnvironmentsResponse]
(Int -> ReadS ListEnvironmentsResponse)
-> ReadS [ListEnvironmentsResponse]
-> ReadPrec ListEnvironmentsResponse
-> ReadPrec [ListEnvironmentsResponse]
-> Read ListEnvironmentsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListEnvironmentsResponse]
$creadListPrec :: ReadPrec [ListEnvironmentsResponse]
readPrec :: ReadPrec ListEnvironmentsResponse
$creadPrec :: ReadPrec ListEnvironmentsResponse
readList :: ReadS [ListEnvironmentsResponse]
$creadList :: ReadS [ListEnvironmentsResponse]
readsPrec :: Int -> ReadS ListEnvironmentsResponse
$creadsPrec :: Int -> ReadS ListEnvironmentsResponse
Prelude.Read, Int -> ListEnvironmentsResponse -> ShowS
[ListEnvironmentsResponse] -> ShowS
ListEnvironmentsResponse -> String
(Int -> ListEnvironmentsResponse -> ShowS)
-> (ListEnvironmentsResponse -> String)
-> ([ListEnvironmentsResponse] -> ShowS)
-> Show ListEnvironmentsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListEnvironmentsResponse] -> ShowS
$cshowList :: [ListEnvironmentsResponse] -> ShowS
show :: ListEnvironmentsResponse -> String
$cshow :: ListEnvironmentsResponse -> String
showsPrec :: Int -> ListEnvironmentsResponse -> ShowS
$cshowsPrec :: Int -> ListEnvironmentsResponse -> ShowS
Prelude.Show, (forall x.
ListEnvironmentsResponse -> Rep ListEnvironmentsResponse x)
-> (forall x.
Rep ListEnvironmentsResponse x -> ListEnvironmentsResponse)
-> Generic ListEnvironmentsResponse
forall x.
Rep ListEnvironmentsResponse x -> ListEnvironmentsResponse
forall x.
ListEnvironmentsResponse -> Rep ListEnvironmentsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListEnvironmentsResponse x -> ListEnvironmentsResponse
$cfrom :: forall x.
ListEnvironmentsResponse -> Rep ListEnvironmentsResponse x
Prelude.Generic)
newListEnvironmentsResponse ::
Prelude.Int ->
ListEnvironmentsResponse
newListEnvironmentsResponse :: Int -> ListEnvironmentsResponse
newListEnvironmentsResponse Int
pHttpStatus_ =
ListEnvironmentsResponse' :: Maybe Text
-> Maybe [Environment] -> Int -> ListEnvironmentsResponse
ListEnvironmentsResponse'
{ $sel:nextToken:ListEnvironmentsResponse' :: Maybe Text
nextToken =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:environments:ListEnvironmentsResponse' :: Maybe [Environment]
environments = Maybe [Environment]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListEnvironmentsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listEnvironmentsResponse_nextToken :: Lens.Lens' ListEnvironmentsResponse (Prelude.Maybe Prelude.Text)
listEnvironmentsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListEnvironmentsResponse -> f ListEnvironmentsResponse
listEnvironmentsResponse_nextToken = (ListEnvironmentsResponse -> Maybe Text)
-> (ListEnvironmentsResponse
-> Maybe Text -> ListEnvironmentsResponse)
-> Lens
ListEnvironmentsResponse
ListEnvironmentsResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListEnvironmentsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListEnvironmentsResponse' :: ListEnvironmentsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListEnvironmentsResponse
s@ListEnvironmentsResponse' {} Maybe Text
a -> ListEnvironmentsResponse
s {$sel:nextToken:ListEnvironmentsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListEnvironmentsResponse)
listEnvironmentsResponse_environments :: Lens.Lens' ListEnvironmentsResponse (Prelude.Maybe [Environment])
listEnvironmentsResponse_environments :: (Maybe [Environment] -> f (Maybe [Environment]))
-> ListEnvironmentsResponse -> f ListEnvironmentsResponse
listEnvironmentsResponse_environments = (ListEnvironmentsResponse -> Maybe [Environment])
-> (ListEnvironmentsResponse
-> Maybe [Environment] -> ListEnvironmentsResponse)
-> Lens
ListEnvironmentsResponse
ListEnvironmentsResponse
(Maybe [Environment])
(Maybe [Environment])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListEnvironmentsResponse' {Maybe [Environment]
environments :: Maybe [Environment]
$sel:environments:ListEnvironmentsResponse' :: ListEnvironmentsResponse -> Maybe [Environment]
environments} -> Maybe [Environment]
environments) (\s :: ListEnvironmentsResponse
s@ListEnvironmentsResponse' {} Maybe [Environment]
a -> ListEnvironmentsResponse
s {$sel:environments:ListEnvironmentsResponse' :: Maybe [Environment]
environments = Maybe [Environment]
a} :: ListEnvironmentsResponse) ((Maybe [Environment] -> f (Maybe [Environment]))
-> ListEnvironmentsResponse -> f ListEnvironmentsResponse)
-> ((Maybe [Environment] -> f (Maybe [Environment]))
-> Maybe [Environment] -> f (Maybe [Environment]))
-> (Maybe [Environment] -> f (Maybe [Environment]))
-> ListEnvironmentsResponse
-> f ListEnvironmentsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Environment] [Environment] [Environment] [Environment]
-> Iso
(Maybe [Environment])
(Maybe [Environment])
(Maybe [Environment])
(Maybe [Environment])
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 [Environment] [Environment] [Environment] [Environment]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listEnvironmentsResponse_httpStatus :: Lens.Lens' ListEnvironmentsResponse Prelude.Int
listEnvironmentsResponse_httpStatus :: (Int -> f Int)
-> ListEnvironmentsResponse -> f ListEnvironmentsResponse
listEnvironmentsResponse_httpStatus = (ListEnvironmentsResponse -> Int)
-> (ListEnvironmentsResponse -> Int -> ListEnvironmentsResponse)
-> Lens ListEnvironmentsResponse ListEnvironmentsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListEnvironmentsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListEnvironmentsResponse' :: ListEnvironmentsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListEnvironmentsResponse
s@ListEnvironmentsResponse' {} Int
a -> ListEnvironmentsResponse
s {$sel:httpStatus:ListEnvironmentsResponse' :: Int
httpStatus = Int
a} :: ListEnvironmentsResponse)
instance Prelude.NFData ListEnvironmentsResponse