{-# 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.UpdateRoutingControlStates
(
UpdateRoutingControlStates (..),
newUpdateRoutingControlStates,
updateRoutingControlStates_updateRoutingControlStateEntries,
UpdateRoutingControlStatesResponse (..),
newUpdateRoutingControlStatesResponse,
updateRoutingControlStatesResponse_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 UpdateRoutingControlStates = UpdateRoutingControlStates'
{
UpdateRoutingControlStates -> [UpdateRoutingControlStateEntry]
updateRoutingControlStateEntries :: [UpdateRoutingControlStateEntry]
}
deriving (UpdateRoutingControlStates -> UpdateRoutingControlStates -> Bool
(UpdateRoutingControlStates -> UpdateRoutingControlStates -> Bool)
-> (UpdateRoutingControlStates
-> UpdateRoutingControlStates -> Bool)
-> Eq UpdateRoutingControlStates
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateRoutingControlStates -> UpdateRoutingControlStates -> Bool
$c/= :: UpdateRoutingControlStates -> UpdateRoutingControlStates -> Bool
== :: UpdateRoutingControlStates -> UpdateRoutingControlStates -> Bool
$c== :: UpdateRoutingControlStates -> UpdateRoutingControlStates -> Bool
Prelude.Eq, ReadPrec [UpdateRoutingControlStates]
ReadPrec UpdateRoutingControlStates
Int -> ReadS UpdateRoutingControlStates
ReadS [UpdateRoutingControlStates]
(Int -> ReadS UpdateRoutingControlStates)
-> ReadS [UpdateRoutingControlStates]
-> ReadPrec UpdateRoutingControlStates
-> ReadPrec [UpdateRoutingControlStates]
-> Read UpdateRoutingControlStates
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateRoutingControlStates]
$creadListPrec :: ReadPrec [UpdateRoutingControlStates]
readPrec :: ReadPrec UpdateRoutingControlStates
$creadPrec :: ReadPrec UpdateRoutingControlStates
readList :: ReadS [UpdateRoutingControlStates]
$creadList :: ReadS [UpdateRoutingControlStates]
readsPrec :: Int -> ReadS UpdateRoutingControlStates
$creadsPrec :: Int -> ReadS UpdateRoutingControlStates
Prelude.Read, Int -> UpdateRoutingControlStates -> ShowS
[UpdateRoutingControlStates] -> ShowS
UpdateRoutingControlStates -> String
(Int -> UpdateRoutingControlStates -> ShowS)
-> (UpdateRoutingControlStates -> String)
-> ([UpdateRoutingControlStates] -> ShowS)
-> Show UpdateRoutingControlStates
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateRoutingControlStates] -> ShowS
$cshowList :: [UpdateRoutingControlStates] -> ShowS
show :: UpdateRoutingControlStates -> String
$cshow :: UpdateRoutingControlStates -> String
showsPrec :: Int -> UpdateRoutingControlStates -> ShowS
$cshowsPrec :: Int -> UpdateRoutingControlStates -> ShowS
Prelude.Show, (forall x.
UpdateRoutingControlStates -> Rep UpdateRoutingControlStates x)
-> (forall x.
Rep UpdateRoutingControlStates x -> UpdateRoutingControlStates)
-> Generic UpdateRoutingControlStates
forall x.
Rep UpdateRoutingControlStates x -> UpdateRoutingControlStates
forall x.
UpdateRoutingControlStates -> Rep UpdateRoutingControlStates x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateRoutingControlStates x -> UpdateRoutingControlStates
$cfrom :: forall x.
UpdateRoutingControlStates -> Rep UpdateRoutingControlStates x
Prelude.Generic)
newUpdateRoutingControlStates ::
UpdateRoutingControlStates
newUpdateRoutingControlStates :: UpdateRoutingControlStates
newUpdateRoutingControlStates =
UpdateRoutingControlStates' :: [UpdateRoutingControlStateEntry] -> UpdateRoutingControlStates
UpdateRoutingControlStates'
{ $sel:updateRoutingControlStateEntries:UpdateRoutingControlStates' :: [UpdateRoutingControlStateEntry]
updateRoutingControlStateEntries =
[UpdateRoutingControlStateEntry]
forall a. Monoid a => a
Prelude.mempty
}
updateRoutingControlStates_updateRoutingControlStateEntries :: Lens.Lens' UpdateRoutingControlStates [UpdateRoutingControlStateEntry]
updateRoutingControlStates_updateRoutingControlStateEntries :: ([UpdateRoutingControlStateEntry]
-> f [UpdateRoutingControlStateEntry])
-> UpdateRoutingControlStates -> f UpdateRoutingControlStates
updateRoutingControlStates_updateRoutingControlStateEntries = (UpdateRoutingControlStates -> [UpdateRoutingControlStateEntry])
-> (UpdateRoutingControlStates
-> [UpdateRoutingControlStateEntry] -> UpdateRoutingControlStates)
-> Lens
UpdateRoutingControlStates
UpdateRoutingControlStates
[UpdateRoutingControlStateEntry]
[UpdateRoutingControlStateEntry]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRoutingControlStates' {[UpdateRoutingControlStateEntry]
updateRoutingControlStateEntries :: [UpdateRoutingControlStateEntry]
$sel:updateRoutingControlStateEntries:UpdateRoutingControlStates' :: UpdateRoutingControlStates -> [UpdateRoutingControlStateEntry]
updateRoutingControlStateEntries} -> [UpdateRoutingControlStateEntry]
updateRoutingControlStateEntries) (\s :: UpdateRoutingControlStates
s@UpdateRoutingControlStates' {} [UpdateRoutingControlStateEntry]
a -> UpdateRoutingControlStates
s {$sel:updateRoutingControlStateEntries:UpdateRoutingControlStates' :: [UpdateRoutingControlStateEntry]
updateRoutingControlStateEntries = [UpdateRoutingControlStateEntry]
a} :: UpdateRoutingControlStates) (([UpdateRoutingControlStateEntry]
-> f [UpdateRoutingControlStateEntry])
-> UpdateRoutingControlStates -> f UpdateRoutingControlStates)
-> (([UpdateRoutingControlStateEntry]
-> f [UpdateRoutingControlStateEntry])
-> [UpdateRoutingControlStateEntry]
-> f [UpdateRoutingControlStateEntry])
-> ([UpdateRoutingControlStateEntry]
-> f [UpdateRoutingControlStateEntry])
-> UpdateRoutingControlStates
-> f UpdateRoutingControlStates
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([UpdateRoutingControlStateEntry]
-> f [UpdateRoutingControlStateEntry])
-> [UpdateRoutingControlStateEntry]
-> f [UpdateRoutingControlStateEntry]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.AWSRequest UpdateRoutingControlStates where
type
AWSResponse UpdateRoutingControlStates =
UpdateRoutingControlStatesResponse
request :: UpdateRoutingControlStates -> Request UpdateRoutingControlStates
request = Service
-> UpdateRoutingControlStates -> Request UpdateRoutingControlStates
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateRoutingControlStates
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateRoutingControlStates)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse UpdateRoutingControlStates))
-> Logger
-> Service
-> Proxy UpdateRoutingControlStates
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateRoutingControlStates)))
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 -> UpdateRoutingControlStatesResponse
UpdateRoutingControlStatesResponse'
(Int -> UpdateRoutingControlStatesResponse)
-> Either String Int
-> Either String UpdateRoutingControlStatesResponse
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 UpdateRoutingControlStates
instance Prelude.NFData UpdateRoutingControlStates
instance Core.ToHeaders UpdateRoutingControlStates where
toHeaders :: UpdateRoutingControlStates -> ResponseHeaders
toHeaders =
ResponseHeaders -> UpdateRoutingControlStates -> 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.UpdateRoutingControlStates" ::
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 UpdateRoutingControlStates where
toJSON :: UpdateRoutingControlStates -> Value
toJSON UpdateRoutingControlStates' {[UpdateRoutingControlStateEntry]
updateRoutingControlStateEntries :: [UpdateRoutingControlStateEntry]
$sel:updateRoutingControlStateEntries:UpdateRoutingControlStates' :: UpdateRoutingControlStates -> [UpdateRoutingControlStateEntry]
..} =
[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
"UpdateRoutingControlStateEntries"
Text -> [UpdateRoutingControlStateEntry] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [UpdateRoutingControlStateEntry]
updateRoutingControlStateEntries
)
]
)
instance Core.ToPath UpdateRoutingControlStates where
toPath :: UpdateRoutingControlStates -> ByteString
toPath = ByteString -> UpdateRoutingControlStates -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery UpdateRoutingControlStates where
toQuery :: UpdateRoutingControlStates -> QueryString
toQuery = QueryString -> UpdateRoutingControlStates -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateRoutingControlStatesResponse = UpdateRoutingControlStatesResponse'
{
UpdateRoutingControlStatesResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateRoutingControlStatesResponse
-> UpdateRoutingControlStatesResponse -> Bool
(UpdateRoutingControlStatesResponse
-> UpdateRoutingControlStatesResponse -> Bool)
-> (UpdateRoutingControlStatesResponse
-> UpdateRoutingControlStatesResponse -> Bool)
-> Eq UpdateRoutingControlStatesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateRoutingControlStatesResponse
-> UpdateRoutingControlStatesResponse -> Bool
$c/= :: UpdateRoutingControlStatesResponse
-> UpdateRoutingControlStatesResponse -> Bool
== :: UpdateRoutingControlStatesResponse
-> UpdateRoutingControlStatesResponse -> Bool
$c== :: UpdateRoutingControlStatesResponse
-> UpdateRoutingControlStatesResponse -> Bool
Prelude.Eq, ReadPrec [UpdateRoutingControlStatesResponse]
ReadPrec UpdateRoutingControlStatesResponse
Int -> ReadS UpdateRoutingControlStatesResponse
ReadS [UpdateRoutingControlStatesResponse]
(Int -> ReadS UpdateRoutingControlStatesResponse)
-> ReadS [UpdateRoutingControlStatesResponse]
-> ReadPrec UpdateRoutingControlStatesResponse
-> ReadPrec [UpdateRoutingControlStatesResponse]
-> Read UpdateRoutingControlStatesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateRoutingControlStatesResponse]
$creadListPrec :: ReadPrec [UpdateRoutingControlStatesResponse]
readPrec :: ReadPrec UpdateRoutingControlStatesResponse
$creadPrec :: ReadPrec UpdateRoutingControlStatesResponse
readList :: ReadS [UpdateRoutingControlStatesResponse]
$creadList :: ReadS [UpdateRoutingControlStatesResponse]
readsPrec :: Int -> ReadS UpdateRoutingControlStatesResponse
$creadsPrec :: Int -> ReadS UpdateRoutingControlStatesResponse
Prelude.Read, Int -> UpdateRoutingControlStatesResponse -> ShowS
[UpdateRoutingControlStatesResponse] -> ShowS
UpdateRoutingControlStatesResponse -> String
(Int -> UpdateRoutingControlStatesResponse -> ShowS)
-> (UpdateRoutingControlStatesResponse -> String)
-> ([UpdateRoutingControlStatesResponse] -> ShowS)
-> Show UpdateRoutingControlStatesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateRoutingControlStatesResponse] -> ShowS
$cshowList :: [UpdateRoutingControlStatesResponse] -> ShowS
show :: UpdateRoutingControlStatesResponse -> String
$cshow :: UpdateRoutingControlStatesResponse -> String
showsPrec :: Int -> UpdateRoutingControlStatesResponse -> ShowS
$cshowsPrec :: Int -> UpdateRoutingControlStatesResponse -> ShowS
Prelude.Show, (forall x.
UpdateRoutingControlStatesResponse
-> Rep UpdateRoutingControlStatesResponse x)
-> (forall x.
Rep UpdateRoutingControlStatesResponse x
-> UpdateRoutingControlStatesResponse)
-> Generic UpdateRoutingControlStatesResponse
forall x.
Rep UpdateRoutingControlStatesResponse x
-> UpdateRoutingControlStatesResponse
forall x.
UpdateRoutingControlStatesResponse
-> Rep UpdateRoutingControlStatesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateRoutingControlStatesResponse x
-> UpdateRoutingControlStatesResponse
$cfrom :: forall x.
UpdateRoutingControlStatesResponse
-> Rep UpdateRoutingControlStatesResponse x
Prelude.Generic)
newUpdateRoutingControlStatesResponse ::
Prelude.Int ->
UpdateRoutingControlStatesResponse
newUpdateRoutingControlStatesResponse :: Int -> UpdateRoutingControlStatesResponse
newUpdateRoutingControlStatesResponse Int
pHttpStatus_ =
UpdateRoutingControlStatesResponse' :: Int -> UpdateRoutingControlStatesResponse
UpdateRoutingControlStatesResponse'
{ $sel:httpStatus:UpdateRoutingControlStatesResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
updateRoutingControlStatesResponse_httpStatus :: Lens.Lens' UpdateRoutingControlStatesResponse Prelude.Int
updateRoutingControlStatesResponse_httpStatus :: (Int -> f Int)
-> UpdateRoutingControlStatesResponse
-> f UpdateRoutingControlStatesResponse
updateRoutingControlStatesResponse_httpStatus = (UpdateRoutingControlStatesResponse -> Int)
-> (UpdateRoutingControlStatesResponse
-> Int -> UpdateRoutingControlStatesResponse)
-> Lens
UpdateRoutingControlStatesResponse
UpdateRoutingControlStatesResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRoutingControlStatesResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateRoutingControlStatesResponse' :: UpdateRoutingControlStatesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateRoutingControlStatesResponse
s@UpdateRoutingControlStatesResponse' {} Int
a -> UpdateRoutingControlStatesResponse
s {$sel:httpStatus:UpdateRoutingControlStatesResponse' :: Int
httpStatus = Int
a} :: UpdateRoutingControlStatesResponse)
instance
Prelude.NFData
UpdateRoutingControlStatesResponse