{-# 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.Route53RecoveryCluster.ListRoutingControls
(
ListRoutingControls (..),
newListRoutingControls,
listRoutingControls_controlPanelArn,
listRoutingControls_maxResults,
listRoutingControls_nextToken,
ListRoutingControlsResponse (..),
newListRoutingControlsResponse,
listRoutingControlsResponse_nextToken,
listRoutingControlsResponse_httpStatus,
listRoutingControlsResponse_routingControls,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.Route53RecoveryCluster.Types
data ListRoutingControls = ListRoutingControls'
{
ListRoutingControls -> Maybe Text
controlPanelArn :: Prelude.Maybe Prelude.Text,
ListRoutingControls -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListRoutingControls -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
}
deriving (ListRoutingControls -> ListRoutingControls -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListRoutingControls -> ListRoutingControls -> Bool
$c/= :: ListRoutingControls -> ListRoutingControls -> Bool
== :: ListRoutingControls -> ListRoutingControls -> Bool
$c== :: ListRoutingControls -> ListRoutingControls -> Bool
Prelude.Eq, ReadPrec [ListRoutingControls]
ReadPrec ListRoutingControls
Int -> ReadS ListRoutingControls
ReadS [ListRoutingControls]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListRoutingControls]
$creadListPrec :: ReadPrec [ListRoutingControls]
readPrec :: ReadPrec ListRoutingControls
$creadPrec :: ReadPrec ListRoutingControls
readList :: ReadS [ListRoutingControls]
$creadList :: ReadS [ListRoutingControls]
readsPrec :: Int -> ReadS ListRoutingControls
$creadsPrec :: Int -> ReadS ListRoutingControls
Prelude.Read, Int -> ListRoutingControls -> ShowS
[ListRoutingControls] -> ShowS
ListRoutingControls -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListRoutingControls] -> ShowS
$cshowList :: [ListRoutingControls] -> ShowS
show :: ListRoutingControls -> String
$cshow :: ListRoutingControls -> String
showsPrec :: Int -> ListRoutingControls -> ShowS
$cshowsPrec :: Int -> ListRoutingControls -> ShowS
Prelude.Show, forall x. Rep ListRoutingControls x -> ListRoutingControls
forall x. ListRoutingControls -> Rep ListRoutingControls x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListRoutingControls x -> ListRoutingControls
$cfrom :: forall x. ListRoutingControls -> Rep ListRoutingControls x
Prelude.Generic)
newListRoutingControls ::
ListRoutingControls
newListRoutingControls :: ListRoutingControls
newListRoutingControls =
ListRoutingControls'
{ $sel:controlPanelArn:ListRoutingControls' :: Maybe Text
controlPanelArn =
forall a. Maybe a
Prelude.Nothing,
$sel:maxResults:ListRoutingControls' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListRoutingControls' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing
}
listRoutingControls_controlPanelArn :: Lens.Lens' ListRoutingControls (Prelude.Maybe Prelude.Text)
listRoutingControls_controlPanelArn :: Lens' ListRoutingControls (Maybe Text)
listRoutingControls_controlPanelArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRoutingControls' {Maybe Text
controlPanelArn :: Maybe Text
$sel:controlPanelArn:ListRoutingControls' :: ListRoutingControls -> Maybe Text
controlPanelArn} -> Maybe Text
controlPanelArn) (\s :: ListRoutingControls
s@ListRoutingControls' {} Maybe Text
a -> ListRoutingControls
s {$sel:controlPanelArn:ListRoutingControls' :: Maybe Text
controlPanelArn = Maybe Text
a} :: ListRoutingControls)
listRoutingControls_maxResults :: Lens.Lens' ListRoutingControls (Prelude.Maybe Prelude.Natural)
listRoutingControls_maxResults :: Lens' ListRoutingControls (Maybe Natural)
listRoutingControls_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRoutingControls' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListRoutingControls' :: ListRoutingControls -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListRoutingControls
s@ListRoutingControls' {} Maybe Natural
a -> ListRoutingControls
s {$sel:maxResults:ListRoutingControls' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListRoutingControls)
listRoutingControls_nextToken :: Lens.Lens' ListRoutingControls (Prelude.Maybe Prelude.Text)
listRoutingControls_nextToken :: Lens' ListRoutingControls (Maybe Text)
listRoutingControls_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRoutingControls' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListRoutingControls' :: ListRoutingControls -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListRoutingControls
s@ListRoutingControls' {} Maybe Text
a -> ListRoutingControls
s {$sel:nextToken:ListRoutingControls' :: Maybe Text
nextToken = Maybe Text
a} :: ListRoutingControls)
instance Core.AWSPager ListRoutingControls where
page :: ListRoutingControls
-> AWSResponse ListRoutingControls -> Maybe ListRoutingControls
page ListRoutingControls
rq AWSResponse ListRoutingControls
rs
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListRoutingControls
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListRoutingControlsResponse (Maybe Text)
listRoutingControlsResponse_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 ListRoutingControls
rs
forall s a. s -> Getting a s a -> a
Lens.^. Lens' ListRoutingControlsResponse [RoutingControl]
listRoutingControlsResponse_routingControls
) =
forall a. Maybe a
Prelude.Nothing
| Bool
Prelude.otherwise =
forall a. a -> Maybe a
Prelude.Just
forall a b. (a -> b) -> a -> b
Prelude.$ ListRoutingControls
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListRoutingControls (Maybe Text)
listRoutingControls_nextToken
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListRoutingControls
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListRoutingControlsResponse (Maybe Text)
listRoutingControlsResponse_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 ListRoutingControls where
type
AWSResponse ListRoutingControls =
ListRoutingControlsResponse
request :: (Service -> Service)
-> ListRoutingControls -> Request ListRoutingControls
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListRoutingControls
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListRoutingControls)))
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
-> Int -> [RoutingControl] -> ListRoutingControlsResponse
ListRoutingControlsResponse'
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.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
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
"RoutingControls"
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
)
)
instance Prelude.Hashable ListRoutingControls where
hashWithSalt :: Int -> ListRoutingControls -> Int
hashWithSalt Int
_salt ListRoutingControls' {Maybe Natural
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
controlPanelArn :: Maybe Text
$sel:nextToken:ListRoutingControls' :: ListRoutingControls -> Maybe Text
$sel:maxResults:ListRoutingControls' :: ListRoutingControls -> Maybe Natural
$sel:controlPanelArn:ListRoutingControls' :: ListRoutingControls -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
controlPanelArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
instance Prelude.NFData ListRoutingControls where
rnf :: ListRoutingControls -> ()
rnf ListRoutingControls' {Maybe Natural
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
controlPanelArn :: Maybe Text
$sel:nextToken:ListRoutingControls' :: ListRoutingControls -> Maybe Text
$sel:maxResults:ListRoutingControls' :: ListRoutingControls -> Maybe Natural
$sel:controlPanelArn:ListRoutingControls' :: ListRoutingControls -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
controlPanelArn
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
instance Data.ToHeaders ListRoutingControls where
toHeaders :: ListRoutingControls -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"ToggleCustomerAPI.ListRoutingControls" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.0" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON ListRoutingControls where
toJSON :: ListRoutingControls -> Value
toJSON ListRoutingControls' {Maybe Natural
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
controlPanelArn :: Maybe Text
$sel:nextToken:ListRoutingControls' :: ListRoutingControls -> Maybe Text
$sel:maxResults:ListRoutingControls' :: ListRoutingControls -> Maybe Natural
$sel:controlPanelArn:ListRoutingControls' :: ListRoutingControls -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"ControlPanelArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
controlPanelArn,
(Key
"MaxResults" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
(Key
"NextToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken
]
)
instance Data.ToPath ListRoutingControls where
toPath :: ListRoutingControls -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery ListRoutingControls where
toQuery :: ListRoutingControls -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data ListRoutingControlsResponse = ListRoutingControlsResponse'
{
ListRoutingControlsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListRoutingControlsResponse -> Int
httpStatus :: Prelude.Int,
ListRoutingControlsResponse -> [RoutingControl]
routingControls :: [RoutingControl]
}
deriving (ListRoutingControlsResponse -> ListRoutingControlsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListRoutingControlsResponse -> ListRoutingControlsResponse -> Bool
$c/= :: ListRoutingControlsResponse -> ListRoutingControlsResponse -> Bool
== :: ListRoutingControlsResponse -> ListRoutingControlsResponse -> Bool
$c== :: ListRoutingControlsResponse -> ListRoutingControlsResponse -> Bool
Prelude.Eq, ReadPrec [ListRoutingControlsResponse]
ReadPrec ListRoutingControlsResponse
Int -> ReadS ListRoutingControlsResponse
ReadS [ListRoutingControlsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListRoutingControlsResponse]
$creadListPrec :: ReadPrec [ListRoutingControlsResponse]
readPrec :: ReadPrec ListRoutingControlsResponse
$creadPrec :: ReadPrec ListRoutingControlsResponse
readList :: ReadS [ListRoutingControlsResponse]
$creadList :: ReadS [ListRoutingControlsResponse]
readsPrec :: Int -> ReadS ListRoutingControlsResponse
$creadsPrec :: Int -> ReadS ListRoutingControlsResponse
Prelude.Read, Int -> ListRoutingControlsResponse -> ShowS
[ListRoutingControlsResponse] -> ShowS
ListRoutingControlsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListRoutingControlsResponse] -> ShowS
$cshowList :: [ListRoutingControlsResponse] -> ShowS
show :: ListRoutingControlsResponse -> String
$cshow :: ListRoutingControlsResponse -> String
showsPrec :: Int -> ListRoutingControlsResponse -> ShowS
$cshowsPrec :: Int -> ListRoutingControlsResponse -> ShowS
Prelude.Show, forall x.
Rep ListRoutingControlsResponse x -> ListRoutingControlsResponse
forall x.
ListRoutingControlsResponse -> Rep ListRoutingControlsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListRoutingControlsResponse x -> ListRoutingControlsResponse
$cfrom :: forall x.
ListRoutingControlsResponse -> Rep ListRoutingControlsResponse x
Prelude.Generic)
newListRoutingControlsResponse ::
Prelude.Int ->
ListRoutingControlsResponse
newListRoutingControlsResponse :: Int -> ListRoutingControlsResponse
newListRoutingControlsResponse Int
pHttpStatus_ =
ListRoutingControlsResponse'
{ $sel:nextToken:ListRoutingControlsResponse' :: Maybe Text
nextToken =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListRoutingControlsResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:routingControls:ListRoutingControlsResponse' :: [RoutingControl]
routingControls = forall a. Monoid a => a
Prelude.mempty
}
listRoutingControlsResponse_nextToken :: Lens.Lens' ListRoutingControlsResponse (Prelude.Maybe Prelude.Text)
listRoutingControlsResponse_nextToken :: Lens' ListRoutingControlsResponse (Maybe Text)
listRoutingControlsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRoutingControlsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListRoutingControlsResponse' :: ListRoutingControlsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListRoutingControlsResponse
s@ListRoutingControlsResponse' {} Maybe Text
a -> ListRoutingControlsResponse
s {$sel:nextToken:ListRoutingControlsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListRoutingControlsResponse)
listRoutingControlsResponse_httpStatus :: Lens.Lens' ListRoutingControlsResponse Prelude.Int
listRoutingControlsResponse_httpStatus :: Lens' ListRoutingControlsResponse Int
listRoutingControlsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRoutingControlsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListRoutingControlsResponse' :: ListRoutingControlsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListRoutingControlsResponse
s@ListRoutingControlsResponse' {} Int
a -> ListRoutingControlsResponse
s {$sel:httpStatus:ListRoutingControlsResponse' :: Int
httpStatus = Int
a} :: ListRoutingControlsResponse)
listRoutingControlsResponse_routingControls :: Lens.Lens' ListRoutingControlsResponse [RoutingControl]
listRoutingControlsResponse_routingControls :: Lens' ListRoutingControlsResponse [RoutingControl]
listRoutingControlsResponse_routingControls = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRoutingControlsResponse' {[RoutingControl]
routingControls :: [RoutingControl]
$sel:routingControls:ListRoutingControlsResponse' :: ListRoutingControlsResponse -> [RoutingControl]
routingControls} -> [RoutingControl]
routingControls) (\s :: ListRoutingControlsResponse
s@ListRoutingControlsResponse' {} [RoutingControl]
a -> ListRoutingControlsResponse
s {$sel:routingControls:ListRoutingControlsResponse' :: [RoutingControl]
routingControls = [RoutingControl]
a} :: ListRoutingControlsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Prelude.NFData ListRoutingControlsResponse where
rnf :: ListRoutingControlsResponse -> ()
rnf ListRoutingControlsResponse' {Int
[RoutingControl]
Maybe Text
routingControls :: [RoutingControl]
httpStatus :: Int
nextToken :: Maybe Text
$sel:routingControls:ListRoutingControlsResponse' :: ListRoutingControlsResponse -> [RoutingControl]
$sel:httpStatus:ListRoutingControlsResponse' :: ListRoutingControlsResponse -> Int
$sel:nextToken:ListRoutingControlsResponse' :: ListRoutingControlsResponse -> 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 Int
httpStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [RoutingControl]
routingControls