{-# 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.UpdateRoutingControlState
(
UpdateRoutingControlState (..),
newUpdateRoutingControlState,
updateRoutingControlState_routingControlArn,
updateRoutingControlState_routingControlState,
UpdateRoutingControlStateResponse (..),
newUpdateRoutingControlStateResponse,
updateRoutingControlStateResponse_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.Route53RecoveryCluster.Types
data UpdateRoutingControlState = UpdateRoutingControlState'
{
UpdateRoutingControlState -> Text
routingControlArn :: Prelude.Text,
UpdateRoutingControlState -> RoutingControlState
routingControlState :: RoutingControlState
}
deriving (UpdateRoutingControlState -> UpdateRoutingControlState -> Bool
(UpdateRoutingControlState -> UpdateRoutingControlState -> Bool)
-> (UpdateRoutingControlState -> UpdateRoutingControlState -> Bool)
-> Eq UpdateRoutingControlState
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateRoutingControlState -> UpdateRoutingControlState -> Bool
$c/= :: UpdateRoutingControlState -> UpdateRoutingControlState -> Bool
== :: UpdateRoutingControlState -> UpdateRoutingControlState -> Bool
$c== :: UpdateRoutingControlState -> UpdateRoutingControlState -> Bool
Prelude.Eq, ReadPrec [UpdateRoutingControlState]
ReadPrec UpdateRoutingControlState
Int -> ReadS UpdateRoutingControlState
ReadS [UpdateRoutingControlState]
(Int -> ReadS UpdateRoutingControlState)
-> ReadS [UpdateRoutingControlState]
-> ReadPrec UpdateRoutingControlState
-> ReadPrec [UpdateRoutingControlState]
-> Read UpdateRoutingControlState
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateRoutingControlState]
$creadListPrec :: ReadPrec [UpdateRoutingControlState]
readPrec :: ReadPrec UpdateRoutingControlState
$creadPrec :: ReadPrec UpdateRoutingControlState
readList :: ReadS [UpdateRoutingControlState]
$creadList :: ReadS [UpdateRoutingControlState]
readsPrec :: Int -> ReadS UpdateRoutingControlState
$creadsPrec :: Int -> ReadS UpdateRoutingControlState
Prelude.Read, Int -> UpdateRoutingControlState -> ShowS
[UpdateRoutingControlState] -> ShowS
UpdateRoutingControlState -> String
(Int -> UpdateRoutingControlState -> ShowS)
-> (UpdateRoutingControlState -> String)
-> ([UpdateRoutingControlState] -> ShowS)
-> Show UpdateRoutingControlState
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateRoutingControlState] -> ShowS
$cshowList :: [UpdateRoutingControlState] -> ShowS
show :: UpdateRoutingControlState -> String
$cshow :: UpdateRoutingControlState -> String
showsPrec :: Int -> UpdateRoutingControlState -> ShowS
$cshowsPrec :: Int -> UpdateRoutingControlState -> ShowS
Prelude.Show, (forall x.
UpdateRoutingControlState -> Rep UpdateRoutingControlState x)
-> (forall x.
Rep UpdateRoutingControlState x -> UpdateRoutingControlState)
-> Generic UpdateRoutingControlState
forall x.
Rep UpdateRoutingControlState x -> UpdateRoutingControlState
forall x.
UpdateRoutingControlState -> Rep UpdateRoutingControlState x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateRoutingControlState x -> UpdateRoutingControlState
$cfrom :: forall x.
UpdateRoutingControlState -> Rep UpdateRoutingControlState x
Prelude.Generic)
newUpdateRoutingControlState ::
Prelude.Text ->
RoutingControlState ->
UpdateRoutingControlState
newUpdateRoutingControlState :: Text -> RoutingControlState -> UpdateRoutingControlState
newUpdateRoutingControlState
Text
pRoutingControlArn_
RoutingControlState
pRoutingControlState_ =
UpdateRoutingControlState' :: Text -> RoutingControlState -> UpdateRoutingControlState
UpdateRoutingControlState'
{ $sel:routingControlArn:UpdateRoutingControlState' :: Text
routingControlArn =
Text
pRoutingControlArn_,
$sel:routingControlState:UpdateRoutingControlState' :: RoutingControlState
routingControlState = RoutingControlState
pRoutingControlState_
}
updateRoutingControlState_routingControlArn :: Lens.Lens' UpdateRoutingControlState Prelude.Text
updateRoutingControlState_routingControlArn :: (Text -> f Text)
-> UpdateRoutingControlState -> f UpdateRoutingControlState
updateRoutingControlState_routingControlArn = (UpdateRoutingControlState -> Text)
-> (UpdateRoutingControlState -> Text -> UpdateRoutingControlState)
-> Lens
UpdateRoutingControlState UpdateRoutingControlState Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRoutingControlState' {Text
routingControlArn :: Text
$sel:routingControlArn:UpdateRoutingControlState' :: UpdateRoutingControlState -> Text
routingControlArn} -> Text
routingControlArn) (\s :: UpdateRoutingControlState
s@UpdateRoutingControlState' {} Text
a -> UpdateRoutingControlState
s {$sel:routingControlArn:UpdateRoutingControlState' :: Text
routingControlArn = Text
a} :: UpdateRoutingControlState)
updateRoutingControlState_routingControlState :: Lens.Lens' UpdateRoutingControlState RoutingControlState
updateRoutingControlState_routingControlState :: (RoutingControlState -> f RoutingControlState)
-> UpdateRoutingControlState -> f UpdateRoutingControlState
updateRoutingControlState_routingControlState = (UpdateRoutingControlState -> RoutingControlState)
-> (UpdateRoutingControlState
-> RoutingControlState -> UpdateRoutingControlState)
-> Lens
UpdateRoutingControlState
UpdateRoutingControlState
RoutingControlState
RoutingControlState
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRoutingControlState' {RoutingControlState
routingControlState :: RoutingControlState
$sel:routingControlState:UpdateRoutingControlState' :: UpdateRoutingControlState -> RoutingControlState
routingControlState} -> RoutingControlState
routingControlState) (\s :: UpdateRoutingControlState
s@UpdateRoutingControlState' {} RoutingControlState
a -> UpdateRoutingControlState
s {$sel:routingControlState:UpdateRoutingControlState' :: RoutingControlState
routingControlState = RoutingControlState
a} :: UpdateRoutingControlState)
instance Core.AWSRequest UpdateRoutingControlState where
type
AWSResponse UpdateRoutingControlState =
UpdateRoutingControlStateResponse
request :: UpdateRoutingControlState -> Request UpdateRoutingControlState
request = Service
-> UpdateRoutingControlState -> Request UpdateRoutingControlState
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateRoutingControlState
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateRoutingControlState)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse UpdateRoutingControlState))
-> Logger
-> Service
-> Proxy UpdateRoutingControlState
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateRoutingControlState)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> UpdateRoutingControlStateResponse
UpdateRoutingControlStateResponse'
(Int -> UpdateRoutingControlStateResponse)
-> Either String Int
-> Either String UpdateRoutingControlStateResponse
forall (f :: * -> *) a b. Functor 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 UpdateRoutingControlState
instance Prelude.NFData UpdateRoutingControlState
instance Core.ToHeaders UpdateRoutingControlState where
toHeaders :: UpdateRoutingControlState -> ResponseHeaders
toHeaders =
ResponseHeaders -> UpdateRoutingControlState -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"ToggleCustomerAPI.UpdateRoutingControlState" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.0" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON UpdateRoutingControlState where
toJSON :: UpdateRoutingControlState -> Value
toJSON UpdateRoutingControlState' {Text
RoutingControlState
routingControlState :: RoutingControlState
routingControlArn :: Text
$sel:routingControlState:UpdateRoutingControlState' :: UpdateRoutingControlState -> RoutingControlState
$sel:routingControlArn:UpdateRoutingControlState' :: UpdateRoutingControlState -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"RoutingControlArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
routingControlArn),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"RoutingControlState" Text -> RoutingControlState -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= RoutingControlState
routingControlState)
]
)
instance Core.ToPath UpdateRoutingControlState where
toPath :: UpdateRoutingControlState -> ByteString
toPath = ByteString -> UpdateRoutingControlState -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery UpdateRoutingControlState where
toQuery :: UpdateRoutingControlState -> QueryString
toQuery = QueryString -> UpdateRoutingControlState -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateRoutingControlStateResponse = UpdateRoutingControlStateResponse'
{
UpdateRoutingControlStateResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateRoutingControlStateResponse
-> UpdateRoutingControlStateResponse -> Bool
(UpdateRoutingControlStateResponse
-> UpdateRoutingControlStateResponse -> Bool)
-> (UpdateRoutingControlStateResponse
-> UpdateRoutingControlStateResponse -> Bool)
-> Eq UpdateRoutingControlStateResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateRoutingControlStateResponse
-> UpdateRoutingControlStateResponse -> Bool
$c/= :: UpdateRoutingControlStateResponse
-> UpdateRoutingControlStateResponse -> Bool
== :: UpdateRoutingControlStateResponse
-> UpdateRoutingControlStateResponse -> Bool
$c== :: UpdateRoutingControlStateResponse
-> UpdateRoutingControlStateResponse -> Bool
Prelude.Eq, ReadPrec [UpdateRoutingControlStateResponse]
ReadPrec UpdateRoutingControlStateResponse
Int -> ReadS UpdateRoutingControlStateResponse
ReadS [UpdateRoutingControlStateResponse]
(Int -> ReadS UpdateRoutingControlStateResponse)
-> ReadS [UpdateRoutingControlStateResponse]
-> ReadPrec UpdateRoutingControlStateResponse
-> ReadPrec [UpdateRoutingControlStateResponse]
-> Read UpdateRoutingControlStateResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateRoutingControlStateResponse]
$creadListPrec :: ReadPrec [UpdateRoutingControlStateResponse]
readPrec :: ReadPrec UpdateRoutingControlStateResponse
$creadPrec :: ReadPrec UpdateRoutingControlStateResponse
readList :: ReadS [UpdateRoutingControlStateResponse]
$creadList :: ReadS [UpdateRoutingControlStateResponse]
readsPrec :: Int -> ReadS UpdateRoutingControlStateResponse
$creadsPrec :: Int -> ReadS UpdateRoutingControlStateResponse
Prelude.Read, Int -> UpdateRoutingControlStateResponse -> ShowS
[UpdateRoutingControlStateResponse] -> ShowS
UpdateRoutingControlStateResponse -> String
(Int -> UpdateRoutingControlStateResponse -> ShowS)
-> (UpdateRoutingControlStateResponse -> String)
-> ([UpdateRoutingControlStateResponse] -> ShowS)
-> Show UpdateRoutingControlStateResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateRoutingControlStateResponse] -> ShowS
$cshowList :: [UpdateRoutingControlStateResponse] -> ShowS
show :: UpdateRoutingControlStateResponse -> String
$cshow :: UpdateRoutingControlStateResponse -> String
showsPrec :: Int -> UpdateRoutingControlStateResponse -> ShowS
$cshowsPrec :: Int -> UpdateRoutingControlStateResponse -> ShowS
Prelude.Show, (forall x.
UpdateRoutingControlStateResponse
-> Rep UpdateRoutingControlStateResponse x)
-> (forall x.
Rep UpdateRoutingControlStateResponse x
-> UpdateRoutingControlStateResponse)
-> Generic UpdateRoutingControlStateResponse
forall x.
Rep UpdateRoutingControlStateResponse x
-> UpdateRoutingControlStateResponse
forall x.
UpdateRoutingControlStateResponse
-> Rep UpdateRoutingControlStateResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateRoutingControlStateResponse x
-> UpdateRoutingControlStateResponse
$cfrom :: forall x.
UpdateRoutingControlStateResponse
-> Rep UpdateRoutingControlStateResponse x
Prelude.Generic)
newUpdateRoutingControlStateResponse ::
Prelude.Int ->
UpdateRoutingControlStateResponse
newUpdateRoutingControlStateResponse :: Int -> UpdateRoutingControlStateResponse
newUpdateRoutingControlStateResponse Int
pHttpStatus_ =
UpdateRoutingControlStateResponse' :: Int -> UpdateRoutingControlStateResponse
UpdateRoutingControlStateResponse'
{ $sel:httpStatus:UpdateRoutingControlStateResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
updateRoutingControlStateResponse_httpStatus :: Lens.Lens' UpdateRoutingControlStateResponse Prelude.Int
updateRoutingControlStateResponse_httpStatus :: (Int -> f Int)
-> UpdateRoutingControlStateResponse
-> f UpdateRoutingControlStateResponse
updateRoutingControlStateResponse_httpStatus = (UpdateRoutingControlStateResponse -> Int)
-> (UpdateRoutingControlStateResponse
-> Int -> UpdateRoutingControlStateResponse)
-> Lens
UpdateRoutingControlStateResponse
UpdateRoutingControlStateResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRoutingControlStateResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateRoutingControlStateResponse' :: UpdateRoutingControlStateResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateRoutingControlStateResponse
s@UpdateRoutingControlStateResponse' {} Int
a -> UpdateRoutingControlStateResponse
s {$sel:httpStatus:UpdateRoutingControlStateResponse' :: Int
httpStatus = Int
a} :: UpdateRoutingControlStateResponse)
instance
Prelude.NFData
UpdateRoutingControlStateResponse