{-# 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.RDS.ApplyPendingMaintenanceAction
(
ApplyPendingMaintenanceAction (..),
newApplyPendingMaintenanceAction,
applyPendingMaintenanceAction_resourceIdentifier,
applyPendingMaintenanceAction_applyAction,
applyPendingMaintenanceAction_optInType,
ApplyPendingMaintenanceActionResponse (..),
newApplyPendingMaintenanceActionResponse,
applyPendingMaintenanceActionResponse_resourcePendingMaintenanceActions,
applyPendingMaintenanceActionResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.RDS.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ApplyPendingMaintenanceAction = ApplyPendingMaintenanceAction'
{
ApplyPendingMaintenanceAction -> Text
resourceIdentifier :: Prelude.Text,
ApplyPendingMaintenanceAction -> Text
applyAction :: Prelude.Text,
ApplyPendingMaintenanceAction -> Text
optInType :: Prelude.Text
}
deriving (ApplyPendingMaintenanceAction
-> ApplyPendingMaintenanceAction -> Bool
(ApplyPendingMaintenanceAction
-> ApplyPendingMaintenanceAction -> Bool)
-> (ApplyPendingMaintenanceAction
-> ApplyPendingMaintenanceAction -> Bool)
-> Eq ApplyPendingMaintenanceAction
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ApplyPendingMaintenanceAction
-> ApplyPendingMaintenanceAction -> Bool
$c/= :: ApplyPendingMaintenanceAction
-> ApplyPendingMaintenanceAction -> Bool
== :: ApplyPendingMaintenanceAction
-> ApplyPendingMaintenanceAction -> Bool
$c== :: ApplyPendingMaintenanceAction
-> ApplyPendingMaintenanceAction -> Bool
Prelude.Eq, ReadPrec [ApplyPendingMaintenanceAction]
ReadPrec ApplyPendingMaintenanceAction
Int -> ReadS ApplyPendingMaintenanceAction
ReadS [ApplyPendingMaintenanceAction]
(Int -> ReadS ApplyPendingMaintenanceAction)
-> ReadS [ApplyPendingMaintenanceAction]
-> ReadPrec ApplyPendingMaintenanceAction
-> ReadPrec [ApplyPendingMaintenanceAction]
-> Read ApplyPendingMaintenanceAction
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ApplyPendingMaintenanceAction]
$creadListPrec :: ReadPrec [ApplyPendingMaintenanceAction]
readPrec :: ReadPrec ApplyPendingMaintenanceAction
$creadPrec :: ReadPrec ApplyPendingMaintenanceAction
readList :: ReadS [ApplyPendingMaintenanceAction]
$creadList :: ReadS [ApplyPendingMaintenanceAction]
readsPrec :: Int -> ReadS ApplyPendingMaintenanceAction
$creadsPrec :: Int -> ReadS ApplyPendingMaintenanceAction
Prelude.Read, Int -> ApplyPendingMaintenanceAction -> ShowS
[ApplyPendingMaintenanceAction] -> ShowS
ApplyPendingMaintenanceAction -> String
(Int -> ApplyPendingMaintenanceAction -> ShowS)
-> (ApplyPendingMaintenanceAction -> String)
-> ([ApplyPendingMaintenanceAction] -> ShowS)
-> Show ApplyPendingMaintenanceAction
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ApplyPendingMaintenanceAction] -> ShowS
$cshowList :: [ApplyPendingMaintenanceAction] -> ShowS
show :: ApplyPendingMaintenanceAction -> String
$cshow :: ApplyPendingMaintenanceAction -> String
showsPrec :: Int -> ApplyPendingMaintenanceAction -> ShowS
$cshowsPrec :: Int -> ApplyPendingMaintenanceAction -> ShowS
Prelude.Show, (forall x.
ApplyPendingMaintenanceAction
-> Rep ApplyPendingMaintenanceAction x)
-> (forall x.
Rep ApplyPendingMaintenanceAction x
-> ApplyPendingMaintenanceAction)
-> Generic ApplyPendingMaintenanceAction
forall x.
Rep ApplyPendingMaintenanceAction x
-> ApplyPendingMaintenanceAction
forall x.
ApplyPendingMaintenanceAction
-> Rep ApplyPendingMaintenanceAction x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ApplyPendingMaintenanceAction x
-> ApplyPendingMaintenanceAction
$cfrom :: forall x.
ApplyPendingMaintenanceAction
-> Rep ApplyPendingMaintenanceAction x
Prelude.Generic)
newApplyPendingMaintenanceAction ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
ApplyPendingMaintenanceAction
newApplyPendingMaintenanceAction :: Text -> Text -> Text -> ApplyPendingMaintenanceAction
newApplyPendingMaintenanceAction
Text
pResourceIdentifier_
Text
pApplyAction_
Text
pOptInType_ =
ApplyPendingMaintenanceAction' :: Text -> Text -> Text -> ApplyPendingMaintenanceAction
ApplyPendingMaintenanceAction'
{ $sel:resourceIdentifier:ApplyPendingMaintenanceAction' :: Text
resourceIdentifier =
Text
pResourceIdentifier_,
$sel:applyAction:ApplyPendingMaintenanceAction' :: Text
applyAction = Text
pApplyAction_,
$sel:optInType:ApplyPendingMaintenanceAction' :: Text
optInType = Text
pOptInType_
}
applyPendingMaintenanceAction_resourceIdentifier :: Lens.Lens' ApplyPendingMaintenanceAction Prelude.Text
applyPendingMaintenanceAction_resourceIdentifier :: (Text -> f Text)
-> ApplyPendingMaintenanceAction -> f ApplyPendingMaintenanceAction
applyPendingMaintenanceAction_resourceIdentifier = (ApplyPendingMaintenanceAction -> Text)
-> (ApplyPendingMaintenanceAction
-> Text -> ApplyPendingMaintenanceAction)
-> Lens
ApplyPendingMaintenanceAction
ApplyPendingMaintenanceAction
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplyPendingMaintenanceAction' {Text
resourceIdentifier :: Text
$sel:resourceIdentifier:ApplyPendingMaintenanceAction' :: ApplyPendingMaintenanceAction -> Text
resourceIdentifier} -> Text
resourceIdentifier) (\s :: ApplyPendingMaintenanceAction
s@ApplyPendingMaintenanceAction' {} Text
a -> ApplyPendingMaintenanceAction
s {$sel:resourceIdentifier:ApplyPendingMaintenanceAction' :: Text
resourceIdentifier = Text
a} :: ApplyPendingMaintenanceAction)
applyPendingMaintenanceAction_applyAction :: Lens.Lens' ApplyPendingMaintenanceAction Prelude.Text
applyPendingMaintenanceAction_applyAction :: (Text -> f Text)
-> ApplyPendingMaintenanceAction -> f ApplyPendingMaintenanceAction
applyPendingMaintenanceAction_applyAction = (ApplyPendingMaintenanceAction -> Text)
-> (ApplyPendingMaintenanceAction
-> Text -> ApplyPendingMaintenanceAction)
-> Lens
ApplyPendingMaintenanceAction
ApplyPendingMaintenanceAction
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplyPendingMaintenanceAction' {Text
applyAction :: Text
$sel:applyAction:ApplyPendingMaintenanceAction' :: ApplyPendingMaintenanceAction -> Text
applyAction} -> Text
applyAction) (\s :: ApplyPendingMaintenanceAction
s@ApplyPendingMaintenanceAction' {} Text
a -> ApplyPendingMaintenanceAction
s {$sel:applyAction:ApplyPendingMaintenanceAction' :: Text
applyAction = Text
a} :: ApplyPendingMaintenanceAction)
applyPendingMaintenanceAction_optInType :: Lens.Lens' ApplyPendingMaintenanceAction Prelude.Text
applyPendingMaintenanceAction_optInType :: (Text -> f Text)
-> ApplyPendingMaintenanceAction -> f ApplyPendingMaintenanceAction
applyPendingMaintenanceAction_optInType = (ApplyPendingMaintenanceAction -> Text)
-> (ApplyPendingMaintenanceAction
-> Text -> ApplyPendingMaintenanceAction)
-> Lens
ApplyPendingMaintenanceAction
ApplyPendingMaintenanceAction
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplyPendingMaintenanceAction' {Text
optInType :: Text
$sel:optInType:ApplyPendingMaintenanceAction' :: ApplyPendingMaintenanceAction -> Text
optInType} -> Text
optInType) (\s :: ApplyPendingMaintenanceAction
s@ApplyPendingMaintenanceAction' {} Text
a -> ApplyPendingMaintenanceAction
s {$sel:optInType:ApplyPendingMaintenanceAction' :: Text
optInType = Text
a} :: ApplyPendingMaintenanceAction)
instance
Core.AWSRequest
ApplyPendingMaintenanceAction
where
type
AWSResponse ApplyPendingMaintenanceAction =
ApplyPendingMaintenanceActionResponse
request :: ApplyPendingMaintenanceAction
-> Request ApplyPendingMaintenanceAction
request = Service
-> ApplyPendingMaintenanceAction
-> Request ApplyPendingMaintenanceAction
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy ApplyPendingMaintenanceAction
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ApplyPendingMaintenanceAction)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse ApplyPendingMaintenanceAction))
-> Logger
-> Service
-> Proxy ApplyPendingMaintenanceAction
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ApplyPendingMaintenanceAction)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
Text
"ApplyPendingMaintenanceActionResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe ResourcePendingMaintenanceActions
-> Int -> ApplyPendingMaintenanceActionResponse
ApplyPendingMaintenanceActionResponse'
(Maybe ResourcePendingMaintenanceActions
-> Int -> ApplyPendingMaintenanceActionResponse)
-> Either String (Maybe ResourcePendingMaintenanceActions)
-> Either String (Int -> ApplyPendingMaintenanceActionResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node]
-> Text -> Either String (Maybe ResourcePendingMaintenanceActions)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ResourcePendingMaintenanceActions")
Either String (Int -> ApplyPendingMaintenanceActionResponse)
-> Either String Int
-> Either String ApplyPendingMaintenanceActionResponse
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
ApplyPendingMaintenanceAction
instance Prelude.NFData ApplyPendingMaintenanceAction
instance Core.ToHeaders ApplyPendingMaintenanceAction where
toHeaders :: ApplyPendingMaintenanceAction -> ResponseHeaders
toHeaders = ResponseHeaders -> ApplyPendingMaintenanceAction -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath ApplyPendingMaintenanceAction where
toPath :: ApplyPendingMaintenanceAction -> ByteString
toPath = ByteString -> ApplyPendingMaintenanceAction -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery ApplyPendingMaintenanceAction where
toQuery :: ApplyPendingMaintenanceAction -> QueryString
toQuery ApplyPendingMaintenanceAction' {Text
optInType :: Text
applyAction :: Text
resourceIdentifier :: Text
$sel:optInType:ApplyPendingMaintenanceAction' :: ApplyPendingMaintenanceAction -> Text
$sel:applyAction:ApplyPendingMaintenanceAction' :: ApplyPendingMaintenanceAction -> Text
$sel:resourceIdentifier:ApplyPendingMaintenanceAction' :: ApplyPendingMaintenanceAction -> Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: ( ByteString
"ApplyPendingMaintenanceAction" ::
Prelude.ByteString
),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2014-10-31" :: Prelude.ByteString),
ByteString
"ResourceIdentifier" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
resourceIdentifier,
ByteString
"ApplyAction" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
applyAction,
ByteString
"OptInType" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
optInType
]
data ApplyPendingMaintenanceActionResponse = ApplyPendingMaintenanceActionResponse'
{ ApplyPendingMaintenanceActionResponse
-> Maybe ResourcePendingMaintenanceActions
resourcePendingMaintenanceActions :: Prelude.Maybe ResourcePendingMaintenanceActions,
ApplyPendingMaintenanceActionResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ApplyPendingMaintenanceActionResponse
-> ApplyPendingMaintenanceActionResponse -> Bool
(ApplyPendingMaintenanceActionResponse
-> ApplyPendingMaintenanceActionResponse -> Bool)
-> (ApplyPendingMaintenanceActionResponse
-> ApplyPendingMaintenanceActionResponse -> Bool)
-> Eq ApplyPendingMaintenanceActionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ApplyPendingMaintenanceActionResponse
-> ApplyPendingMaintenanceActionResponse -> Bool
$c/= :: ApplyPendingMaintenanceActionResponse
-> ApplyPendingMaintenanceActionResponse -> Bool
== :: ApplyPendingMaintenanceActionResponse
-> ApplyPendingMaintenanceActionResponse -> Bool
$c== :: ApplyPendingMaintenanceActionResponse
-> ApplyPendingMaintenanceActionResponse -> Bool
Prelude.Eq, ReadPrec [ApplyPendingMaintenanceActionResponse]
ReadPrec ApplyPendingMaintenanceActionResponse
Int -> ReadS ApplyPendingMaintenanceActionResponse
ReadS [ApplyPendingMaintenanceActionResponse]
(Int -> ReadS ApplyPendingMaintenanceActionResponse)
-> ReadS [ApplyPendingMaintenanceActionResponse]
-> ReadPrec ApplyPendingMaintenanceActionResponse
-> ReadPrec [ApplyPendingMaintenanceActionResponse]
-> Read ApplyPendingMaintenanceActionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ApplyPendingMaintenanceActionResponse]
$creadListPrec :: ReadPrec [ApplyPendingMaintenanceActionResponse]
readPrec :: ReadPrec ApplyPendingMaintenanceActionResponse
$creadPrec :: ReadPrec ApplyPendingMaintenanceActionResponse
readList :: ReadS [ApplyPendingMaintenanceActionResponse]
$creadList :: ReadS [ApplyPendingMaintenanceActionResponse]
readsPrec :: Int -> ReadS ApplyPendingMaintenanceActionResponse
$creadsPrec :: Int -> ReadS ApplyPendingMaintenanceActionResponse
Prelude.Read, Int -> ApplyPendingMaintenanceActionResponse -> ShowS
[ApplyPendingMaintenanceActionResponse] -> ShowS
ApplyPendingMaintenanceActionResponse -> String
(Int -> ApplyPendingMaintenanceActionResponse -> ShowS)
-> (ApplyPendingMaintenanceActionResponse -> String)
-> ([ApplyPendingMaintenanceActionResponse] -> ShowS)
-> Show ApplyPendingMaintenanceActionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ApplyPendingMaintenanceActionResponse] -> ShowS
$cshowList :: [ApplyPendingMaintenanceActionResponse] -> ShowS
show :: ApplyPendingMaintenanceActionResponse -> String
$cshow :: ApplyPendingMaintenanceActionResponse -> String
showsPrec :: Int -> ApplyPendingMaintenanceActionResponse -> ShowS
$cshowsPrec :: Int -> ApplyPendingMaintenanceActionResponse -> ShowS
Prelude.Show, (forall x.
ApplyPendingMaintenanceActionResponse
-> Rep ApplyPendingMaintenanceActionResponse x)
-> (forall x.
Rep ApplyPendingMaintenanceActionResponse x
-> ApplyPendingMaintenanceActionResponse)
-> Generic ApplyPendingMaintenanceActionResponse
forall x.
Rep ApplyPendingMaintenanceActionResponse x
-> ApplyPendingMaintenanceActionResponse
forall x.
ApplyPendingMaintenanceActionResponse
-> Rep ApplyPendingMaintenanceActionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ApplyPendingMaintenanceActionResponse x
-> ApplyPendingMaintenanceActionResponse
$cfrom :: forall x.
ApplyPendingMaintenanceActionResponse
-> Rep ApplyPendingMaintenanceActionResponse x
Prelude.Generic)
newApplyPendingMaintenanceActionResponse ::
Prelude.Int ->
ApplyPendingMaintenanceActionResponse
newApplyPendingMaintenanceActionResponse :: Int -> ApplyPendingMaintenanceActionResponse
newApplyPendingMaintenanceActionResponse Int
pHttpStatus_ =
ApplyPendingMaintenanceActionResponse' :: Maybe ResourcePendingMaintenanceActions
-> Int -> ApplyPendingMaintenanceActionResponse
ApplyPendingMaintenanceActionResponse'
{ $sel:resourcePendingMaintenanceActions:ApplyPendingMaintenanceActionResponse' :: Maybe ResourcePendingMaintenanceActions
resourcePendingMaintenanceActions =
Maybe ResourcePendingMaintenanceActions
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ApplyPendingMaintenanceActionResponse' :: Int
httpStatus = Int
pHttpStatus_
}
applyPendingMaintenanceActionResponse_resourcePendingMaintenanceActions :: Lens.Lens' ApplyPendingMaintenanceActionResponse (Prelude.Maybe ResourcePendingMaintenanceActions)
applyPendingMaintenanceActionResponse_resourcePendingMaintenanceActions :: (Maybe ResourcePendingMaintenanceActions
-> f (Maybe ResourcePendingMaintenanceActions))
-> ApplyPendingMaintenanceActionResponse
-> f ApplyPendingMaintenanceActionResponse
applyPendingMaintenanceActionResponse_resourcePendingMaintenanceActions = (ApplyPendingMaintenanceActionResponse
-> Maybe ResourcePendingMaintenanceActions)
-> (ApplyPendingMaintenanceActionResponse
-> Maybe ResourcePendingMaintenanceActions
-> ApplyPendingMaintenanceActionResponse)
-> Lens
ApplyPendingMaintenanceActionResponse
ApplyPendingMaintenanceActionResponse
(Maybe ResourcePendingMaintenanceActions)
(Maybe ResourcePendingMaintenanceActions)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplyPendingMaintenanceActionResponse' {Maybe ResourcePendingMaintenanceActions
resourcePendingMaintenanceActions :: Maybe ResourcePendingMaintenanceActions
$sel:resourcePendingMaintenanceActions:ApplyPendingMaintenanceActionResponse' :: ApplyPendingMaintenanceActionResponse
-> Maybe ResourcePendingMaintenanceActions
resourcePendingMaintenanceActions} -> Maybe ResourcePendingMaintenanceActions
resourcePendingMaintenanceActions) (\s :: ApplyPendingMaintenanceActionResponse
s@ApplyPendingMaintenanceActionResponse' {} Maybe ResourcePendingMaintenanceActions
a -> ApplyPendingMaintenanceActionResponse
s {$sel:resourcePendingMaintenanceActions:ApplyPendingMaintenanceActionResponse' :: Maybe ResourcePendingMaintenanceActions
resourcePendingMaintenanceActions = Maybe ResourcePendingMaintenanceActions
a} :: ApplyPendingMaintenanceActionResponse)
applyPendingMaintenanceActionResponse_httpStatus :: Lens.Lens' ApplyPendingMaintenanceActionResponse Prelude.Int
applyPendingMaintenanceActionResponse_httpStatus :: (Int -> f Int)
-> ApplyPendingMaintenanceActionResponse
-> f ApplyPendingMaintenanceActionResponse
applyPendingMaintenanceActionResponse_httpStatus = (ApplyPendingMaintenanceActionResponse -> Int)
-> (ApplyPendingMaintenanceActionResponse
-> Int -> ApplyPendingMaintenanceActionResponse)
-> Lens
ApplyPendingMaintenanceActionResponse
ApplyPendingMaintenanceActionResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplyPendingMaintenanceActionResponse' {Int
httpStatus :: Int
$sel:httpStatus:ApplyPendingMaintenanceActionResponse' :: ApplyPendingMaintenanceActionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ApplyPendingMaintenanceActionResponse
s@ApplyPendingMaintenanceActionResponse' {} Int
a -> ApplyPendingMaintenanceActionResponse
s {$sel:httpStatus:ApplyPendingMaintenanceActionResponse' :: Int
httpStatus = Int
a} :: ApplyPendingMaintenanceActionResponse)
instance
Prelude.NFData
ApplyPendingMaintenanceActionResponse