{-# 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.Route53RecoveryReadiness.ListCells
(
ListCells (..),
newListCells,
listCells_nextToken,
listCells_maxResults,
ListCellsResponse (..),
newListCellsResponse,
listCellsResponse_cells,
listCellsResponse_nextToken,
listCellsResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.Route53RecoveryReadiness.Types
data ListCells = ListCells'
{
ListCells -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListCells -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
}
deriving (ListCells -> ListCells -> Bool
(ListCells -> ListCells -> Bool)
-> (ListCells -> ListCells -> Bool) -> Eq ListCells
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListCells -> ListCells -> Bool
$c/= :: ListCells -> ListCells -> Bool
== :: ListCells -> ListCells -> Bool
$c== :: ListCells -> ListCells -> Bool
Prelude.Eq, ReadPrec [ListCells]
ReadPrec ListCells
Int -> ReadS ListCells
ReadS [ListCells]
(Int -> ReadS ListCells)
-> ReadS [ListCells]
-> ReadPrec ListCells
-> ReadPrec [ListCells]
-> Read ListCells
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListCells]
$creadListPrec :: ReadPrec [ListCells]
readPrec :: ReadPrec ListCells
$creadPrec :: ReadPrec ListCells
readList :: ReadS [ListCells]
$creadList :: ReadS [ListCells]
readsPrec :: Int -> ReadS ListCells
$creadsPrec :: Int -> ReadS ListCells
Prelude.Read, Int -> ListCells -> ShowS
[ListCells] -> ShowS
ListCells -> String
(Int -> ListCells -> ShowS)
-> (ListCells -> String)
-> ([ListCells] -> ShowS)
-> Show ListCells
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListCells] -> ShowS
$cshowList :: [ListCells] -> ShowS
show :: ListCells -> String
$cshow :: ListCells -> String
showsPrec :: Int -> ListCells -> ShowS
$cshowsPrec :: Int -> ListCells -> ShowS
Prelude.Show, (forall x. ListCells -> Rep ListCells x)
-> (forall x. Rep ListCells x -> ListCells) -> Generic ListCells
forall x. Rep ListCells x -> ListCells
forall x. ListCells -> Rep ListCells x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListCells x -> ListCells
$cfrom :: forall x. ListCells -> Rep ListCells x
Prelude.Generic)
newListCells ::
ListCells
newListCells :: ListCells
newListCells =
ListCells' :: Maybe Text -> Maybe Natural -> ListCells
ListCells'
{ $sel:nextToken:ListCells' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:maxResults:ListCells' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
}
listCells_nextToken :: Lens.Lens' ListCells (Prelude.Maybe Prelude.Text)
listCells_nextToken :: (Maybe Text -> f (Maybe Text)) -> ListCells -> f ListCells
listCells_nextToken = (ListCells -> Maybe Text)
-> (ListCells -> Maybe Text -> ListCells)
-> Lens ListCells ListCells (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCells' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListCells' :: ListCells -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListCells
s@ListCells' {} Maybe Text
a -> ListCells
s {$sel:nextToken:ListCells' :: Maybe Text
nextToken = Maybe Text
a} :: ListCells)
listCells_maxResults :: Lens.Lens' ListCells (Prelude.Maybe Prelude.Natural)
listCells_maxResults :: (Maybe Natural -> f (Maybe Natural)) -> ListCells -> f ListCells
listCells_maxResults = (ListCells -> Maybe Natural)
-> (ListCells -> Maybe Natural -> ListCells)
-> Lens ListCells ListCells (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCells' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListCells' :: ListCells -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListCells
s@ListCells' {} Maybe Natural
a -> ListCells
s {$sel:maxResults:ListCells' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListCells)
instance Core.AWSPager ListCells where
page :: ListCells -> AWSResponse ListCells -> Maybe ListCells
page ListCells
rq AWSResponse ListCells
rs
| Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListCells
ListCellsResponse
rs
ListCellsResponse
-> Getting (First Text) ListCellsResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListCellsResponse -> Const (First Text) ListCellsResponse
Lens' ListCellsResponse (Maybe Text)
listCellsResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
-> ListCellsResponse -> Const (First Text) ListCellsResponse)
-> ((Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListCellsResponse 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 ListCells
forall a. Maybe a
Prelude.Nothing
| Maybe [CellOutput] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListCells
ListCellsResponse
rs
ListCellsResponse
-> Getting (First [CellOutput]) ListCellsResponse [CellOutput]
-> Maybe [CellOutput]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [CellOutput]
-> Const (First [CellOutput]) (Maybe [CellOutput]))
-> ListCellsResponse
-> Const (First [CellOutput]) ListCellsResponse
Lens' ListCellsResponse (Maybe [CellOutput])
listCellsResponse_cells ((Maybe [CellOutput]
-> Const (First [CellOutput]) (Maybe [CellOutput]))
-> ListCellsResponse
-> Const (First [CellOutput]) ListCellsResponse)
-> (([CellOutput] -> Const (First [CellOutput]) [CellOutput])
-> Maybe [CellOutput]
-> Const (First [CellOutput]) (Maybe [CellOutput]))
-> Getting (First [CellOutput]) ListCellsResponse [CellOutput]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([CellOutput] -> Const (First [CellOutput]) [CellOutput])
-> Maybe [CellOutput]
-> Const (First [CellOutput]) (Maybe [CellOutput])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
Maybe ListCells
forall a. Maybe a
Prelude.Nothing
| Bool
Prelude.otherwise =
ListCells -> Maybe ListCells
forall a. a -> Maybe a
Prelude.Just (ListCells -> Maybe ListCells) -> ListCells -> Maybe ListCells
forall a b. (a -> b) -> a -> b
Prelude.$
ListCells
rq
ListCells -> (ListCells -> ListCells) -> ListCells
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListCells -> Identity ListCells
Lens ListCells ListCells (Maybe Text) (Maybe Text)
listCells_nextToken
((Maybe Text -> Identity (Maybe Text))
-> ListCells -> Identity ListCells)
-> Maybe Text -> ListCells -> ListCells
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListCells
ListCellsResponse
rs
ListCellsResponse
-> Getting (First Text) ListCellsResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListCellsResponse -> Const (First Text) ListCellsResponse
Lens' ListCellsResponse (Maybe Text)
listCellsResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
-> ListCellsResponse -> Const (First Text) ListCellsResponse)
-> ((Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListCellsResponse 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 ListCells where
type AWSResponse ListCells = ListCellsResponse
request :: ListCells -> Request ListCells
request = Service -> ListCells -> Request ListCells
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy ListCells
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListCells)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse ListCells))
-> Logger
-> Service
-> Proxy ListCells
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListCells)))
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 [CellOutput] -> Maybe Text -> Int -> ListCellsResponse
ListCellsResponse'
(Maybe [CellOutput] -> Maybe Text -> Int -> ListCellsResponse)
-> Either String (Maybe [CellOutput])
-> Either String (Maybe Text -> Int -> ListCellsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [CellOutput]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"cells" Either String (Maybe (Maybe [CellOutput]))
-> Maybe [CellOutput] -> Either String (Maybe [CellOutput])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [CellOutput]
forall a. Monoid a => a
Prelude.mempty)
Either String (Maybe Text -> Int -> ListCellsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ListCellsResponse)
forall (f :: * -> *) a b. Applicative f => 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 (Int -> ListCellsResponse)
-> Either String Int -> Either String ListCellsResponse
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 ListCells
instance Prelude.NFData ListCells
instance Core.ToHeaders ListCells where
toHeaders :: ListCells -> ResponseHeaders
toHeaders =
ResponseHeaders -> ListCells -> 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 ListCells where
toPath :: ListCells -> ByteString
toPath = ByteString -> ListCells -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/cells"
instance Core.ToQuery ListCells where
toQuery :: ListCells -> QueryString
toQuery ListCells' {Maybe Natural
Maybe Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:maxResults:ListCells' :: ListCells -> Maybe Natural
$sel:nextToken:ListCells' :: ListCells -> 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 ListCellsResponse = ListCellsResponse'
{
ListCellsResponse -> Maybe [CellOutput]
cells :: Prelude.Maybe [CellOutput],
ListCellsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListCellsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListCellsResponse -> ListCellsResponse -> Bool
(ListCellsResponse -> ListCellsResponse -> Bool)
-> (ListCellsResponse -> ListCellsResponse -> Bool)
-> Eq ListCellsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListCellsResponse -> ListCellsResponse -> Bool
$c/= :: ListCellsResponse -> ListCellsResponse -> Bool
== :: ListCellsResponse -> ListCellsResponse -> Bool
$c== :: ListCellsResponse -> ListCellsResponse -> Bool
Prelude.Eq, ReadPrec [ListCellsResponse]
ReadPrec ListCellsResponse
Int -> ReadS ListCellsResponse
ReadS [ListCellsResponse]
(Int -> ReadS ListCellsResponse)
-> ReadS [ListCellsResponse]
-> ReadPrec ListCellsResponse
-> ReadPrec [ListCellsResponse]
-> Read ListCellsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListCellsResponse]
$creadListPrec :: ReadPrec [ListCellsResponse]
readPrec :: ReadPrec ListCellsResponse
$creadPrec :: ReadPrec ListCellsResponse
readList :: ReadS [ListCellsResponse]
$creadList :: ReadS [ListCellsResponse]
readsPrec :: Int -> ReadS ListCellsResponse
$creadsPrec :: Int -> ReadS ListCellsResponse
Prelude.Read, Int -> ListCellsResponse -> ShowS
[ListCellsResponse] -> ShowS
ListCellsResponse -> String
(Int -> ListCellsResponse -> ShowS)
-> (ListCellsResponse -> String)
-> ([ListCellsResponse] -> ShowS)
-> Show ListCellsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListCellsResponse] -> ShowS
$cshowList :: [ListCellsResponse] -> ShowS
show :: ListCellsResponse -> String
$cshow :: ListCellsResponse -> String
showsPrec :: Int -> ListCellsResponse -> ShowS
$cshowsPrec :: Int -> ListCellsResponse -> ShowS
Prelude.Show, (forall x. ListCellsResponse -> Rep ListCellsResponse x)
-> (forall x. Rep ListCellsResponse x -> ListCellsResponse)
-> Generic ListCellsResponse
forall x. Rep ListCellsResponse x -> ListCellsResponse
forall x. ListCellsResponse -> Rep ListCellsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListCellsResponse x -> ListCellsResponse
$cfrom :: forall x. ListCellsResponse -> Rep ListCellsResponse x
Prelude.Generic)
newListCellsResponse ::
Prelude.Int ->
ListCellsResponse
newListCellsResponse :: Int -> ListCellsResponse
newListCellsResponse Int
pHttpStatus_ =
ListCellsResponse' :: Maybe [CellOutput] -> Maybe Text -> Int -> ListCellsResponse
ListCellsResponse'
{ $sel:cells:ListCellsResponse' :: Maybe [CellOutput]
cells = Maybe [CellOutput]
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListCellsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListCellsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listCellsResponse_cells :: Lens.Lens' ListCellsResponse (Prelude.Maybe [CellOutput])
listCellsResponse_cells :: (Maybe [CellOutput] -> f (Maybe [CellOutput]))
-> ListCellsResponse -> f ListCellsResponse
listCellsResponse_cells = (ListCellsResponse -> Maybe [CellOutput])
-> (ListCellsResponse -> Maybe [CellOutput] -> ListCellsResponse)
-> Lens' ListCellsResponse (Maybe [CellOutput])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCellsResponse' {Maybe [CellOutput]
cells :: Maybe [CellOutput]
$sel:cells:ListCellsResponse' :: ListCellsResponse -> Maybe [CellOutput]
cells} -> Maybe [CellOutput]
cells) (\s :: ListCellsResponse
s@ListCellsResponse' {} Maybe [CellOutput]
a -> ListCellsResponse
s {$sel:cells:ListCellsResponse' :: Maybe [CellOutput]
cells = Maybe [CellOutput]
a} :: ListCellsResponse) ((Maybe [CellOutput] -> f (Maybe [CellOutput]))
-> ListCellsResponse -> f ListCellsResponse)
-> ((Maybe [CellOutput] -> f (Maybe [CellOutput]))
-> Maybe [CellOutput] -> f (Maybe [CellOutput]))
-> (Maybe [CellOutput] -> f (Maybe [CellOutput]))
-> ListCellsResponse
-> f ListCellsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [CellOutput] [CellOutput] [CellOutput] [CellOutput]
-> Iso
(Maybe [CellOutput])
(Maybe [CellOutput])
(Maybe [CellOutput])
(Maybe [CellOutput])
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 [CellOutput] [CellOutput] [CellOutput] [CellOutput]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listCellsResponse_nextToken :: Lens.Lens' ListCellsResponse (Prelude.Maybe Prelude.Text)
listCellsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListCellsResponse -> f ListCellsResponse
listCellsResponse_nextToken = (ListCellsResponse -> Maybe Text)
-> (ListCellsResponse -> Maybe Text -> ListCellsResponse)
-> Lens' ListCellsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCellsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListCellsResponse' :: ListCellsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListCellsResponse
s@ListCellsResponse' {} Maybe Text
a -> ListCellsResponse
s {$sel:nextToken:ListCellsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListCellsResponse)
listCellsResponse_httpStatus :: Lens.Lens' ListCellsResponse Prelude.Int
listCellsResponse_httpStatus :: (Int -> f Int) -> ListCellsResponse -> f ListCellsResponse
listCellsResponse_httpStatus = (ListCellsResponse -> Int)
-> (ListCellsResponse -> Int -> ListCellsResponse)
-> Lens ListCellsResponse ListCellsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCellsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListCellsResponse' :: ListCellsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListCellsResponse
s@ListCellsResponse' {} Int
a -> ListCellsResponse
s {$sel:httpStatus:ListCellsResponse' :: Int
httpStatus = Int
a} :: ListCellsResponse)
instance Prelude.NFData ListCellsResponse