{-# 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.UpdateControlPanel
(
UpdateControlPanel (..),
newUpdateControlPanel,
updateControlPanel_controlPanelArn,
updateControlPanel_controlPanelName,
UpdateControlPanelResponse (..),
newUpdateControlPanelResponse,
updateControlPanelResponse_controlPanel,
updateControlPanelResponse_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 UpdateControlPanel = UpdateControlPanel'
{
UpdateControlPanel -> Text
controlPanelArn :: Prelude.Text,
UpdateControlPanel -> Text
controlPanelName :: Prelude.Text
}
deriving (UpdateControlPanel -> UpdateControlPanel -> Bool
(UpdateControlPanel -> UpdateControlPanel -> Bool)
-> (UpdateControlPanel -> UpdateControlPanel -> Bool)
-> Eq UpdateControlPanel
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateControlPanel -> UpdateControlPanel -> Bool
$c/= :: UpdateControlPanel -> UpdateControlPanel -> Bool
== :: UpdateControlPanel -> UpdateControlPanel -> Bool
$c== :: UpdateControlPanel -> UpdateControlPanel -> Bool
Prelude.Eq, ReadPrec [UpdateControlPanel]
ReadPrec UpdateControlPanel
Int -> ReadS UpdateControlPanel
ReadS [UpdateControlPanel]
(Int -> ReadS UpdateControlPanel)
-> ReadS [UpdateControlPanel]
-> ReadPrec UpdateControlPanel
-> ReadPrec [UpdateControlPanel]
-> Read UpdateControlPanel
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateControlPanel]
$creadListPrec :: ReadPrec [UpdateControlPanel]
readPrec :: ReadPrec UpdateControlPanel
$creadPrec :: ReadPrec UpdateControlPanel
readList :: ReadS [UpdateControlPanel]
$creadList :: ReadS [UpdateControlPanel]
readsPrec :: Int -> ReadS UpdateControlPanel
$creadsPrec :: Int -> ReadS UpdateControlPanel
Prelude.Read, Int -> UpdateControlPanel -> ShowS
[UpdateControlPanel] -> ShowS
UpdateControlPanel -> String
(Int -> UpdateControlPanel -> ShowS)
-> (UpdateControlPanel -> String)
-> ([UpdateControlPanel] -> ShowS)
-> Show UpdateControlPanel
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateControlPanel] -> ShowS
$cshowList :: [UpdateControlPanel] -> ShowS
show :: UpdateControlPanel -> String
$cshow :: UpdateControlPanel -> String
showsPrec :: Int -> UpdateControlPanel -> ShowS
$cshowsPrec :: Int -> UpdateControlPanel -> ShowS
Prelude.Show, (forall x. UpdateControlPanel -> Rep UpdateControlPanel x)
-> (forall x. Rep UpdateControlPanel x -> UpdateControlPanel)
-> Generic UpdateControlPanel
forall x. Rep UpdateControlPanel x -> UpdateControlPanel
forall x. UpdateControlPanel -> Rep UpdateControlPanel x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateControlPanel x -> UpdateControlPanel
$cfrom :: forall x. UpdateControlPanel -> Rep UpdateControlPanel x
Prelude.Generic)
newUpdateControlPanel ::
Prelude.Text ->
Prelude.Text ->
UpdateControlPanel
newUpdateControlPanel :: Text -> Text -> UpdateControlPanel
newUpdateControlPanel
Text
pControlPanelArn_
Text
pControlPanelName_ =
UpdateControlPanel' :: Text -> Text -> UpdateControlPanel
UpdateControlPanel'
{ $sel:controlPanelArn:UpdateControlPanel' :: Text
controlPanelArn =
Text
pControlPanelArn_,
$sel:controlPanelName:UpdateControlPanel' :: Text
controlPanelName = Text
pControlPanelName_
}
updateControlPanel_controlPanelArn :: Lens.Lens' UpdateControlPanel Prelude.Text
updateControlPanel_controlPanelArn :: (Text -> f Text) -> UpdateControlPanel -> f UpdateControlPanel
updateControlPanel_controlPanelArn = (UpdateControlPanel -> Text)
-> (UpdateControlPanel -> Text -> UpdateControlPanel)
-> Lens UpdateControlPanel UpdateControlPanel Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateControlPanel' {Text
controlPanelArn :: Text
$sel:controlPanelArn:UpdateControlPanel' :: UpdateControlPanel -> Text
controlPanelArn} -> Text
controlPanelArn) (\s :: UpdateControlPanel
s@UpdateControlPanel' {} Text
a -> UpdateControlPanel
s {$sel:controlPanelArn:UpdateControlPanel' :: Text
controlPanelArn = Text
a} :: UpdateControlPanel)
updateControlPanel_controlPanelName :: Lens.Lens' UpdateControlPanel Prelude.Text
updateControlPanel_controlPanelName :: (Text -> f Text) -> UpdateControlPanel -> f UpdateControlPanel
updateControlPanel_controlPanelName = (UpdateControlPanel -> Text)
-> (UpdateControlPanel -> Text -> UpdateControlPanel)
-> Lens UpdateControlPanel UpdateControlPanel Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateControlPanel' {Text
controlPanelName :: Text
$sel:controlPanelName:UpdateControlPanel' :: UpdateControlPanel -> Text
controlPanelName} -> Text
controlPanelName) (\s :: UpdateControlPanel
s@UpdateControlPanel' {} Text
a -> UpdateControlPanel
s {$sel:controlPanelName:UpdateControlPanel' :: Text
controlPanelName = Text
a} :: UpdateControlPanel)
instance Core.AWSRequest UpdateControlPanel where
type
AWSResponse UpdateControlPanel =
UpdateControlPanelResponse
request :: UpdateControlPanel -> Request UpdateControlPanel
request = Service -> UpdateControlPanel -> Request UpdateControlPanel
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateControlPanel
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateControlPanel)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse UpdateControlPanel))
-> Logger
-> Service
-> Proxy UpdateControlPanel
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateControlPanel)))
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 ControlPanel -> Int -> UpdateControlPanelResponse
UpdateControlPanelResponse'
(Maybe ControlPanel -> Int -> UpdateControlPanelResponse)
-> Either String (Maybe ControlPanel)
-> Either String (Int -> UpdateControlPanelResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe ControlPanel)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ControlPanel")
Either String (Int -> UpdateControlPanelResponse)
-> Either String Int -> Either String UpdateControlPanelResponse
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 UpdateControlPanel
instance Prelude.NFData UpdateControlPanel
instance Core.ToHeaders UpdateControlPanel where
toHeaders :: UpdateControlPanel -> ResponseHeaders
toHeaders =
ResponseHeaders -> UpdateControlPanel -> 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.ToJSON UpdateControlPanel where
toJSON :: UpdateControlPanel -> Value
toJSON UpdateControlPanel' {Text
controlPanelName :: Text
controlPanelArn :: Text
$sel:controlPanelName:UpdateControlPanel' :: UpdateControlPanel -> Text
$sel:controlPanelArn:UpdateControlPanel' :: UpdateControlPanel -> 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
"ControlPanelArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
controlPanelArn),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"ControlPanelName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
controlPanelName)
]
)
instance Core.ToPath UpdateControlPanel where
toPath :: UpdateControlPanel -> ByteString
toPath = ByteString -> UpdateControlPanel -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/controlpanel"
instance Core.ToQuery UpdateControlPanel where
toQuery :: UpdateControlPanel -> QueryString
toQuery = QueryString -> UpdateControlPanel -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateControlPanelResponse = UpdateControlPanelResponse'
{
UpdateControlPanelResponse -> Maybe ControlPanel
controlPanel :: Prelude.Maybe ControlPanel,
UpdateControlPanelResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateControlPanelResponse -> UpdateControlPanelResponse -> Bool
(UpdateControlPanelResponse -> UpdateControlPanelResponse -> Bool)
-> (UpdateControlPanelResponse
-> UpdateControlPanelResponse -> Bool)
-> Eq UpdateControlPanelResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateControlPanelResponse -> UpdateControlPanelResponse -> Bool
$c/= :: UpdateControlPanelResponse -> UpdateControlPanelResponse -> Bool
== :: UpdateControlPanelResponse -> UpdateControlPanelResponse -> Bool
$c== :: UpdateControlPanelResponse -> UpdateControlPanelResponse -> Bool
Prelude.Eq, ReadPrec [UpdateControlPanelResponse]
ReadPrec UpdateControlPanelResponse
Int -> ReadS UpdateControlPanelResponse
ReadS [UpdateControlPanelResponse]
(Int -> ReadS UpdateControlPanelResponse)
-> ReadS [UpdateControlPanelResponse]
-> ReadPrec UpdateControlPanelResponse
-> ReadPrec [UpdateControlPanelResponse]
-> Read UpdateControlPanelResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateControlPanelResponse]
$creadListPrec :: ReadPrec [UpdateControlPanelResponse]
readPrec :: ReadPrec UpdateControlPanelResponse
$creadPrec :: ReadPrec UpdateControlPanelResponse
readList :: ReadS [UpdateControlPanelResponse]
$creadList :: ReadS [UpdateControlPanelResponse]
readsPrec :: Int -> ReadS UpdateControlPanelResponse
$creadsPrec :: Int -> ReadS UpdateControlPanelResponse
Prelude.Read, Int -> UpdateControlPanelResponse -> ShowS
[UpdateControlPanelResponse] -> ShowS
UpdateControlPanelResponse -> String
(Int -> UpdateControlPanelResponse -> ShowS)
-> (UpdateControlPanelResponse -> String)
-> ([UpdateControlPanelResponse] -> ShowS)
-> Show UpdateControlPanelResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateControlPanelResponse] -> ShowS
$cshowList :: [UpdateControlPanelResponse] -> ShowS
show :: UpdateControlPanelResponse -> String
$cshow :: UpdateControlPanelResponse -> String
showsPrec :: Int -> UpdateControlPanelResponse -> ShowS
$cshowsPrec :: Int -> UpdateControlPanelResponse -> ShowS
Prelude.Show, (forall x.
UpdateControlPanelResponse -> Rep UpdateControlPanelResponse x)
-> (forall x.
Rep UpdateControlPanelResponse x -> UpdateControlPanelResponse)
-> Generic UpdateControlPanelResponse
forall x.
Rep UpdateControlPanelResponse x -> UpdateControlPanelResponse
forall x.
UpdateControlPanelResponse -> Rep UpdateControlPanelResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateControlPanelResponse x -> UpdateControlPanelResponse
$cfrom :: forall x.
UpdateControlPanelResponse -> Rep UpdateControlPanelResponse x
Prelude.Generic)
newUpdateControlPanelResponse ::
Prelude.Int ->
UpdateControlPanelResponse
newUpdateControlPanelResponse :: Int -> UpdateControlPanelResponse
newUpdateControlPanelResponse Int
pHttpStatus_ =
UpdateControlPanelResponse' :: Maybe ControlPanel -> Int -> UpdateControlPanelResponse
UpdateControlPanelResponse'
{ $sel:controlPanel:UpdateControlPanelResponse' :: Maybe ControlPanel
controlPanel =
Maybe ControlPanel
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:UpdateControlPanelResponse' :: Int
httpStatus = Int
pHttpStatus_
}
updateControlPanelResponse_controlPanel :: Lens.Lens' UpdateControlPanelResponse (Prelude.Maybe ControlPanel)
updateControlPanelResponse_controlPanel :: (Maybe ControlPanel -> f (Maybe ControlPanel))
-> UpdateControlPanelResponse -> f UpdateControlPanelResponse
updateControlPanelResponse_controlPanel = (UpdateControlPanelResponse -> Maybe ControlPanel)
-> (UpdateControlPanelResponse
-> Maybe ControlPanel -> UpdateControlPanelResponse)
-> Lens
UpdateControlPanelResponse
UpdateControlPanelResponse
(Maybe ControlPanel)
(Maybe ControlPanel)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateControlPanelResponse' {Maybe ControlPanel
controlPanel :: Maybe ControlPanel
$sel:controlPanel:UpdateControlPanelResponse' :: UpdateControlPanelResponse -> Maybe ControlPanel
controlPanel} -> Maybe ControlPanel
controlPanel) (\s :: UpdateControlPanelResponse
s@UpdateControlPanelResponse' {} Maybe ControlPanel
a -> UpdateControlPanelResponse
s {$sel:controlPanel:UpdateControlPanelResponse' :: Maybe ControlPanel
controlPanel = Maybe ControlPanel
a} :: UpdateControlPanelResponse)
updateControlPanelResponse_httpStatus :: Lens.Lens' UpdateControlPanelResponse Prelude.Int
updateControlPanelResponse_httpStatus :: (Int -> f Int)
-> UpdateControlPanelResponse -> f UpdateControlPanelResponse
updateControlPanelResponse_httpStatus = (UpdateControlPanelResponse -> Int)
-> (UpdateControlPanelResponse
-> Int -> UpdateControlPanelResponse)
-> Lens
UpdateControlPanelResponse UpdateControlPanelResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateControlPanelResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateControlPanelResponse' :: UpdateControlPanelResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateControlPanelResponse
s@UpdateControlPanelResponse' {} Int
a -> UpdateControlPanelResponse
s {$sel:httpStatus:UpdateControlPanelResponse' :: Int
httpStatus = Int
a} :: UpdateControlPanelResponse)
instance Prelude.NFData UpdateControlPanelResponse