{-# 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.Route53RecoveryControlConfig.DescribeRoutingControl
(
DescribeRoutingControl (..),
newDescribeRoutingControl,
describeRoutingControl_routingControlArn,
DescribeRoutingControlResponse (..),
newDescribeRoutingControlResponse,
describeRoutingControlResponse_routingControl,
describeRoutingControlResponse_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.Route53RecoveryControlConfig.Types
data DescribeRoutingControl = DescribeRoutingControl'
{
DescribeRoutingControl -> Text
routingControlArn :: Prelude.Text
}
deriving (DescribeRoutingControl -> DescribeRoutingControl -> Bool
(DescribeRoutingControl -> DescribeRoutingControl -> Bool)
-> (DescribeRoutingControl -> DescribeRoutingControl -> Bool)
-> Eq DescribeRoutingControl
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeRoutingControl -> DescribeRoutingControl -> Bool
$c/= :: DescribeRoutingControl -> DescribeRoutingControl -> Bool
== :: DescribeRoutingControl -> DescribeRoutingControl -> Bool
$c== :: DescribeRoutingControl -> DescribeRoutingControl -> Bool
Prelude.Eq, ReadPrec [DescribeRoutingControl]
ReadPrec DescribeRoutingControl
Int -> ReadS DescribeRoutingControl
ReadS [DescribeRoutingControl]
(Int -> ReadS DescribeRoutingControl)
-> ReadS [DescribeRoutingControl]
-> ReadPrec DescribeRoutingControl
-> ReadPrec [DescribeRoutingControl]
-> Read DescribeRoutingControl
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeRoutingControl]
$creadListPrec :: ReadPrec [DescribeRoutingControl]
readPrec :: ReadPrec DescribeRoutingControl
$creadPrec :: ReadPrec DescribeRoutingControl
readList :: ReadS [DescribeRoutingControl]
$creadList :: ReadS [DescribeRoutingControl]
readsPrec :: Int -> ReadS DescribeRoutingControl
$creadsPrec :: Int -> ReadS DescribeRoutingControl
Prelude.Read, Int -> DescribeRoutingControl -> ShowS
[DescribeRoutingControl] -> ShowS
DescribeRoutingControl -> String
(Int -> DescribeRoutingControl -> ShowS)
-> (DescribeRoutingControl -> String)
-> ([DescribeRoutingControl] -> ShowS)
-> Show DescribeRoutingControl
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeRoutingControl] -> ShowS
$cshowList :: [DescribeRoutingControl] -> ShowS
show :: DescribeRoutingControl -> String
$cshow :: DescribeRoutingControl -> String
showsPrec :: Int -> DescribeRoutingControl -> ShowS
$cshowsPrec :: Int -> DescribeRoutingControl -> ShowS
Prelude.Show, (forall x. DescribeRoutingControl -> Rep DescribeRoutingControl x)
-> (forall x.
Rep DescribeRoutingControl x -> DescribeRoutingControl)
-> Generic DescribeRoutingControl
forall x. Rep DescribeRoutingControl x -> DescribeRoutingControl
forall x. DescribeRoutingControl -> Rep DescribeRoutingControl x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeRoutingControl x -> DescribeRoutingControl
$cfrom :: forall x. DescribeRoutingControl -> Rep DescribeRoutingControl x
Prelude.Generic)
newDescribeRoutingControl ::
Prelude.Text ->
DescribeRoutingControl
newDescribeRoutingControl :: Text -> DescribeRoutingControl
newDescribeRoutingControl Text
pRoutingControlArn_ =
DescribeRoutingControl' :: Text -> DescribeRoutingControl
DescribeRoutingControl'
{ $sel:routingControlArn:DescribeRoutingControl' :: Text
routingControlArn =
Text
pRoutingControlArn_
}
describeRoutingControl_routingControlArn :: Lens.Lens' DescribeRoutingControl Prelude.Text
describeRoutingControl_routingControlArn :: (Text -> f Text)
-> DescribeRoutingControl -> f DescribeRoutingControl
describeRoutingControl_routingControlArn = (DescribeRoutingControl -> Text)
-> (DescribeRoutingControl -> Text -> DescribeRoutingControl)
-> Lens DescribeRoutingControl DescribeRoutingControl Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRoutingControl' {Text
routingControlArn :: Text
$sel:routingControlArn:DescribeRoutingControl' :: DescribeRoutingControl -> Text
routingControlArn} -> Text
routingControlArn) (\s :: DescribeRoutingControl
s@DescribeRoutingControl' {} Text
a -> DescribeRoutingControl
s {$sel:routingControlArn:DescribeRoutingControl' :: Text
routingControlArn = Text
a} :: DescribeRoutingControl)
instance Core.AWSRequest DescribeRoutingControl where
type
AWSResponse DescribeRoutingControl =
DescribeRoutingControlResponse
request :: DescribeRoutingControl -> Request DescribeRoutingControl
request = Service -> DescribeRoutingControl -> Request DescribeRoutingControl
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeRoutingControl
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeRoutingControl)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeRoutingControl))
-> Logger
-> Service
-> Proxy DescribeRoutingControl
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeRoutingControl)))
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 RoutingControl -> Int -> DescribeRoutingControlResponse
DescribeRoutingControlResponse'
(Maybe RoutingControl -> Int -> DescribeRoutingControlResponse)
-> Either String (Maybe RoutingControl)
-> Either String (Int -> DescribeRoutingControlResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe RoutingControl)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"RoutingControl")
Either String (Int -> DescribeRoutingControlResponse)
-> Either String Int
-> Either String DescribeRoutingControlResponse
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 DescribeRoutingControl
instance Prelude.NFData DescribeRoutingControl
instance Core.ToHeaders DescribeRoutingControl where
toHeaders :: DescribeRoutingControl -> ResponseHeaders
toHeaders =
ResponseHeaders -> DescribeRoutingControl -> 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 DescribeRoutingControl where
toPath :: DescribeRoutingControl -> ByteString
toPath DescribeRoutingControl' {Text
routingControlArn :: Text
$sel:routingControlArn:DescribeRoutingControl' :: DescribeRoutingControl -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/routingcontrol/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
routingControlArn]
instance Core.ToQuery DescribeRoutingControl where
toQuery :: DescribeRoutingControl -> QueryString
toQuery = QueryString -> DescribeRoutingControl -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeRoutingControlResponse = DescribeRoutingControlResponse'
{
DescribeRoutingControlResponse -> Maybe RoutingControl
routingControl :: Prelude.Maybe RoutingControl,
DescribeRoutingControlResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeRoutingControlResponse
-> DescribeRoutingControlResponse -> Bool
(DescribeRoutingControlResponse
-> DescribeRoutingControlResponse -> Bool)
-> (DescribeRoutingControlResponse
-> DescribeRoutingControlResponse -> Bool)
-> Eq DescribeRoutingControlResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeRoutingControlResponse
-> DescribeRoutingControlResponse -> Bool
$c/= :: DescribeRoutingControlResponse
-> DescribeRoutingControlResponse -> Bool
== :: DescribeRoutingControlResponse
-> DescribeRoutingControlResponse -> Bool
$c== :: DescribeRoutingControlResponse
-> DescribeRoutingControlResponse -> Bool
Prelude.Eq, ReadPrec [DescribeRoutingControlResponse]
ReadPrec DescribeRoutingControlResponse
Int -> ReadS DescribeRoutingControlResponse
ReadS [DescribeRoutingControlResponse]
(Int -> ReadS DescribeRoutingControlResponse)
-> ReadS [DescribeRoutingControlResponse]
-> ReadPrec DescribeRoutingControlResponse
-> ReadPrec [DescribeRoutingControlResponse]
-> Read DescribeRoutingControlResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeRoutingControlResponse]
$creadListPrec :: ReadPrec [DescribeRoutingControlResponse]
readPrec :: ReadPrec DescribeRoutingControlResponse
$creadPrec :: ReadPrec DescribeRoutingControlResponse
readList :: ReadS [DescribeRoutingControlResponse]
$creadList :: ReadS [DescribeRoutingControlResponse]
readsPrec :: Int -> ReadS DescribeRoutingControlResponse
$creadsPrec :: Int -> ReadS DescribeRoutingControlResponse
Prelude.Read, Int -> DescribeRoutingControlResponse -> ShowS
[DescribeRoutingControlResponse] -> ShowS
DescribeRoutingControlResponse -> String
(Int -> DescribeRoutingControlResponse -> ShowS)
-> (DescribeRoutingControlResponse -> String)
-> ([DescribeRoutingControlResponse] -> ShowS)
-> Show DescribeRoutingControlResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeRoutingControlResponse] -> ShowS
$cshowList :: [DescribeRoutingControlResponse] -> ShowS
show :: DescribeRoutingControlResponse -> String
$cshow :: DescribeRoutingControlResponse -> String
showsPrec :: Int -> DescribeRoutingControlResponse -> ShowS
$cshowsPrec :: Int -> DescribeRoutingControlResponse -> ShowS
Prelude.Show, (forall x.
DescribeRoutingControlResponse
-> Rep DescribeRoutingControlResponse x)
-> (forall x.
Rep DescribeRoutingControlResponse x
-> DescribeRoutingControlResponse)
-> Generic DescribeRoutingControlResponse
forall x.
Rep DescribeRoutingControlResponse x
-> DescribeRoutingControlResponse
forall x.
DescribeRoutingControlResponse
-> Rep DescribeRoutingControlResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeRoutingControlResponse x
-> DescribeRoutingControlResponse
$cfrom :: forall x.
DescribeRoutingControlResponse
-> Rep DescribeRoutingControlResponse x
Prelude.Generic)
newDescribeRoutingControlResponse ::
Prelude.Int ->
DescribeRoutingControlResponse
newDescribeRoutingControlResponse :: Int -> DescribeRoutingControlResponse
newDescribeRoutingControlResponse Int
pHttpStatus_ =
DescribeRoutingControlResponse' :: Maybe RoutingControl -> Int -> DescribeRoutingControlResponse
DescribeRoutingControlResponse'
{ $sel:routingControl:DescribeRoutingControlResponse' :: Maybe RoutingControl
routingControl =
Maybe RoutingControl
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeRoutingControlResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeRoutingControlResponse_routingControl :: Lens.Lens' DescribeRoutingControlResponse (Prelude.Maybe RoutingControl)
describeRoutingControlResponse_routingControl :: (Maybe RoutingControl -> f (Maybe RoutingControl))
-> DescribeRoutingControlResponse
-> f DescribeRoutingControlResponse
describeRoutingControlResponse_routingControl = (DescribeRoutingControlResponse -> Maybe RoutingControl)
-> (DescribeRoutingControlResponse
-> Maybe RoutingControl -> DescribeRoutingControlResponse)
-> Lens
DescribeRoutingControlResponse
DescribeRoutingControlResponse
(Maybe RoutingControl)
(Maybe RoutingControl)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRoutingControlResponse' {Maybe RoutingControl
routingControl :: Maybe RoutingControl
$sel:routingControl:DescribeRoutingControlResponse' :: DescribeRoutingControlResponse -> Maybe RoutingControl
routingControl} -> Maybe RoutingControl
routingControl) (\s :: DescribeRoutingControlResponse
s@DescribeRoutingControlResponse' {} Maybe RoutingControl
a -> DescribeRoutingControlResponse
s {$sel:routingControl:DescribeRoutingControlResponse' :: Maybe RoutingControl
routingControl = Maybe RoutingControl
a} :: DescribeRoutingControlResponse)
describeRoutingControlResponse_httpStatus :: Lens.Lens' DescribeRoutingControlResponse Prelude.Int
describeRoutingControlResponse_httpStatus :: (Int -> f Int)
-> DescribeRoutingControlResponse
-> f DescribeRoutingControlResponse
describeRoutingControlResponse_httpStatus = (DescribeRoutingControlResponse -> Int)
-> (DescribeRoutingControlResponse
-> Int -> DescribeRoutingControlResponse)
-> Lens
DescribeRoutingControlResponse
DescribeRoutingControlResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRoutingControlResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeRoutingControlResponse' :: DescribeRoutingControlResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeRoutingControlResponse
s@DescribeRoutingControlResponse' {} Int
a -> DescribeRoutingControlResponse
s {$sel:httpStatus:DescribeRoutingControlResponse' :: Int
httpStatus = Int
a} :: DescribeRoutingControlResponse)
instance
Prelude.NFData
DescribeRoutingControlResponse