{-# 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.ModifyCertificates
(
ModifyCertificates (..),
newModifyCertificates,
modifyCertificates_certificateIdentifier,
modifyCertificates_removeCustomerOverride,
ModifyCertificatesResponse (..),
newModifyCertificatesResponse,
modifyCertificatesResponse_certificate,
modifyCertificatesResponse_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 ModifyCertificates = ModifyCertificates'
{
ModifyCertificates -> Maybe Text
certificateIdentifier :: Prelude.Maybe Prelude.Text,
ModifyCertificates -> Maybe Bool
removeCustomerOverride :: Prelude.Maybe Prelude.Bool
}
deriving (ModifyCertificates -> ModifyCertificates -> Bool
(ModifyCertificates -> ModifyCertificates -> Bool)
-> (ModifyCertificates -> ModifyCertificates -> Bool)
-> Eq ModifyCertificates
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModifyCertificates -> ModifyCertificates -> Bool
$c/= :: ModifyCertificates -> ModifyCertificates -> Bool
== :: ModifyCertificates -> ModifyCertificates -> Bool
$c== :: ModifyCertificates -> ModifyCertificates -> Bool
Prelude.Eq, ReadPrec [ModifyCertificates]
ReadPrec ModifyCertificates
Int -> ReadS ModifyCertificates
ReadS [ModifyCertificates]
(Int -> ReadS ModifyCertificates)
-> ReadS [ModifyCertificates]
-> ReadPrec ModifyCertificates
-> ReadPrec [ModifyCertificates]
-> Read ModifyCertificates
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModifyCertificates]
$creadListPrec :: ReadPrec [ModifyCertificates]
readPrec :: ReadPrec ModifyCertificates
$creadPrec :: ReadPrec ModifyCertificates
readList :: ReadS [ModifyCertificates]
$creadList :: ReadS [ModifyCertificates]
readsPrec :: Int -> ReadS ModifyCertificates
$creadsPrec :: Int -> ReadS ModifyCertificates
Prelude.Read, Int -> ModifyCertificates -> ShowS
[ModifyCertificates] -> ShowS
ModifyCertificates -> String
(Int -> ModifyCertificates -> ShowS)
-> (ModifyCertificates -> String)
-> ([ModifyCertificates] -> ShowS)
-> Show ModifyCertificates
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModifyCertificates] -> ShowS
$cshowList :: [ModifyCertificates] -> ShowS
show :: ModifyCertificates -> String
$cshow :: ModifyCertificates -> String
showsPrec :: Int -> ModifyCertificates -> ShowS
$cshowsPrec :: Int -> ModifyCertificates -> ShowS
Prelude.Show, (forall x. ModifyCertificates -> Rep ModifyCertificates x)
-> (forall x. Rep ModifyCertificates x -> ModifyCertificates)
-> Generic ModifyCertificates
forall x. Rep ModifyCertificates x -> ModifyCertificates
forall x. ModifyCertificates -> Rep ModifyCertificates x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ModifyCertificates x -> ModifyCertificates
$cfrom :: forall x. ModifyCertificates -> Rep ModifyCertificates x
Prelude.Generic)
newModifyCertificates ::
ModifyCertificates
newModifyCertificates :: ModifyCertificates
newModifyCertificates =
ModifyCertificates' :: Maybe Text -> Maybe Bool -> ModifyCertificates
ModifyCertificates'
{ $sel:certificateIdentifier:ModifyCertificates' :: Maybe Text
certificateIdentifier =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:removeCustomerOverride:ModifyCertificates' :: Maybe Bool
removeCustomerOverride = Maybe Bool
forall a. Maybe a
Prelude.Nothing
}
modifyCertificates_certificateIdentifier :: Lens.Lens' ModifyCertificates (Prelude.Maybe Prelude.Text)
modifyCertificates_certificateIdentifier :: (Maybe Text -> f (Maybe Text))
-> ModifyCertificates -> f ModifyCertificates
modifyCertificates_certificateIdentifier = (ModifyCertificates -> Maybe Text)
-> (ModifyCertificates -> Maybe Text -> ModifyCertificates)
-> Lens
ModifyCertificates ModifyCertificates (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyCertificates' {Maybe Text
certificateIdentifier :: Maybe Text
$sel:certificateIdentifier:ModifyCertificates' :: ModifyCertificates -> Maybe Text
certificateIdentifier} -> Maybe Text
certificateIdentifier) (\s :: ModifyCertificates
s@ModifyCertificates' {} Maybe Text
a -> ModifyCertificates
s {$sel:certificateIdentifier:ModifyCertificates' :: Maybe Text
certificateIdentifier = Maybe Text
a} :: ModifyCertificates)
modifyCertificates_removeCustomerOverride :: Lens.Lens' ModifyCertificates (Prelude.Maybe Prelude.Bool)
modifyCertificates_removeCustomerOverride :: (Maybe Bool -> f (Maybe Bool))
-> ModifyCertificates -> f ModifyCertificates
modifyCertificates_removeCustomerOverride = (ModifyCertificates -> Maybe Bool)
-> (ModifyCertificates -> Maybe Bool -> ModifyCertificates)
-> Lens
ModifyCertificates ModifyCertificates (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyCertificates' {Maybe Bool
removeCustomerOverride :: Maybe Bool
$sel:removeCustomerOverride:ModifyCertificates' :: ModifyCertificates -> Maybe Bool
removeCustomerOverride} -> Maybe Bool
removeCustomerOverride) (\s :: ModifyCertificates
s@ModifyCertificates' {} Maybe Bool
a -> ModifyCertificates
s {$sel:removeCustomerOverride:ModifyCertificates' :: Maybe Bool
removeCustomerOverride = Maybe Bool
a} :: ModifyCertificates)
instance Core.AWSRequest ModifyCertificates where
type
AWSResponse ModifyCertificates =
ModifyCertificatesResponse
request :: ModifyCertificates -> Request ModifyCertificates
request = Service -> ModifyCertificates -> Request ModifyCertificates
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy ModifyCertificates
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ModifyCertificates)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse ModifyCertificates))
-> Logger
-> Service
-> Proxy ModifyCertificates
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ModifyCertificates)))
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
"ModifyCertificatesResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe Certificate -> Int -> ModifyCertificatesResponse
ModifyCertificatesResponse'
(Maybe Certificate -> Int -> ModifyCertificatesResponse)
-> Either String (Maybe Certificate)
-> Either String (Int -> ModifyCertificatesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Certificate)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Certificate")
Either String (Int -> ModifyCertificatesResponse)
-> Either String Int -> Either String ModifyCertificatesResponse
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 ModifyCertificates
instance Prelude.NFData ModifyCertificates
instance Core.ToHeaders ModifyCertificates where
toHeaders :: ModifyCertificates -> ResponseHeaders
toHeaders = ResponseHeaders -> ModifyCertificates -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath ModifyCertificates where
toPath :: ModifyCertificates -> ByteString
toPath = ByteString -> ModifyCertificates -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery ModifyCertificates where
toQuery :: ModifyCertificates -> QueryString
toQuery ModifyCertificates' {Maybe Bool
Maybe Text
removeCustomerOverride :: Maybe Bool
certificateIdentifier :: Maybe Text
$sel:removeCustomerOverride:ModifyCertificates' :: ModifyCertificates -> Maybe Bool
$sel:certificateIdentifier:ModifyCertificates' :: ModifyCertificates -> Maybe 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
"ModifyCertificates" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2014-10-31" :: Prelude.ByteString),
ByteString
"CertificateIdentifier"
ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
certificateIdentifier,
ByteString
"RemoveCustomerOverride"
ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
removeCustomerOverride
]
data ModifyCertificatesResponse = ModifyCertificatesResponse'
{ ModifyCertificatesResponse -> Maybe Certificate
certificate :: Prelude.Maybe Certificate,
ModifyCertificatesResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ModifyCertificatesResponse -> ModifyCertificatesResponse -> Bool
(ModifyCertificatesResponse -> ModifyCertificatesResponse -> Bool)
-> (ModifyCertificatesResponse
-> ModifyCertificatesResponse -> Bool)
-> Eq ModifyCertificatesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModifyCertificatesResponse -> ModifyCertificatesResponse -> Bool
$c/= :: ModifyCertificatesResponse -> ModifyCertificatesResponse -> Bool
== :: ModifyCertificatesResponse -> ModifyCertificatesResponse -> Bool
$c== :: ModifyCertificatesResponse -> ModifyCertificatesResponse -> Bool
Prelude.Eq, ReadPrec [ModifyCertificatesResponse]
ReadPrec ModifyCertificatesResponse
Int -> ReadS ModifyCertificatesResponse
ReadS [ModifyCertificatesResponse]
(Int -> ReadS ModifyCertificatesResponse)
-> ReadS [ModifyCertificatesResponse]
-> ReadPrec ModifyCertificatesResponse
-> ReadPrec [ModifyCertificatesResponse]
-> Read ModifyCertificatesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModifyCertificatesResponse]
$creadListPrec :: ReadPrec [ModifyCertificatesResponse]
readPrec :: ReadPrec ModifyCertificatesResponse
$creadPrec :: ReadPrec ModifyCertificatesResponse
readList :: ReadS [ModifyCertificatesResponse]
$creadList :: ReadS [ModifyCertificatesResponse]
readsPrec :: Int -> ReadS ModifyCertificatesResponse
$creadsPrec :: Int -> ReadS ModifyCertificatesResponse
Prelude.Read, Int -> ModifyCertificatesResponse -> ShowS
[ModifyCertificatesResponse] -> ShowS
ModifyCertificatesResponse -> String
(Int -> ModifyCertificatesResponse -> ShowS)
-> (ModifyCertificatesResponse -> String)
-> ([ModifyCertificatesResponse] -> ShowS)
-> Show ModifyCertificatesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModifyCertificatesResponse] -> ShowS
$cshowList :: [ModifyCertificatesResponse] -> ShowS
show :: ModifyCertificatesResponse -> String
$cshow :: ModifyCertificatesResponse -> String
showsPrec :: Int -> ModifyCertificatesResponse -> ShowS
$cshowsPrec :: Int -> ModifyCertificatesResponse -> ShowS
Prelude.Show, (forall x.
ModifyCertificatesResponse -> Rep ModifyCertificatesResponse x)
-> (forall x.
Rep ModifyCertificatesResponse x -> ModifyCertificatesResponse)
-> Generic ModifyCertificatesResponse
forall x.
Rep ModifyCertificatesResponse x -> ModifyCertificatesResponse
forall x.
ModifyCertificatesResponse -> Rep ModifyCertificatesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ModifyCertificatesResponse x -> ModifyCertificatesResponse
$cfrom :: forall x.
ModifyCertificatesResponse -> Rep ModifyCertificatesResponse x
Prelude.Generic)
newModifyCertificatesResponse ::
Prelude.Int ->
ModifyCertificatesResponse
newModifyCertificatesResponse :: Int -> ModifyCertificatesResponse
newModifyCertificatesResponse Int
pHttpStatus_ =
ModifyCertificatesResponse' :: Maybe Certificate -> Int -> ModifyCertificatesResponse
ModifyCertificatesResponse'
{ $sel:certificate:ModifyCertificatesResponse' :: Maybe Certificate
certificate =
Maybe Certificate
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ModifyCertificatesResponse' :: Int
httpStatus = Int
pHttpStatus_
}
modifyCertificatesResponse_certificate :: Lens.Lens' ModifyCertificatesResponse (Prelude.Maybe Certificate)
modifyCertificatesResponse_certificate :: (Maybe Certificate -> f (Maybe Certificate))
-> ModifyCertificatesResponse -> f ModifyCertificatesResponse
modifyCertificatesResponse_certificate = (ModifyCertificatesResponse -> Maybe Certificate)
-> (ModifyCertificatesResponse
-> Maybe Certificate -> ModifyCertificatesResponse)
-> Lens
ModifyCertificatesResponse
ModifyCertificatesResponse
(Maybe Certificate)
(Maybe Certificate)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyCertificatesResponse' {Maybe Certificate
certificate :: Maybe Certificate
$sel:certificate:ModifyCertificatesResponse' :: ModifyCertificatesResponse -> Maybe Certificate
certificate} -> Maybe Certificate
certificate) (\s :: ModifyCertificatesResponse
s@ModifyCertificatesResponse' {} Maybe Certificate
a -> ModifyCertificatesResponse
s {$sel:certificate:ModifyCertificatesResponse' :: Maybe Certificate
certificate = Maybe Certificate
a} :: ModifyCertificatesResponse)
modifyCertificatesResponse_httpStatus :: Lens.Lens' ModifyCertificatesResponse Prelude.Int
modifyCertificatesResponse_httpStatus :: (Int -> f Int)
-> ModifyCertificatesResponse -> f ModifyCertificatesResponse
modifyCertificatesResponse_httpStatus = (ModifyCertificatesResponse -> Int)
-> (ModifyCertificatesResponse
-> Int -> ModifyCertificatesResponse)
-> Lens
ModifyCertificatesResponse ModifyCertificatesResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyCertificatesResponse' {Int
httpStatus :: Int
$sel:httpStatus:ModifyCertificatesResponse' :: ModifyCertificatesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ModifyCertificatesResponse
s@ModifyCertificatesResponse' {} Int
a -> ModifyCertificatesResponse
s {$sel:httpStatus:ModifyCertificatesResponse' :: Int
httpStatus = Int
a} :: ModifyCertificatesResponse)
instance Prelude.NFData ModifyCertificatesResponse