{-# 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.CertificateManagerPCA.UpdateCertificateAuthority
(
UpdateCertificateAuthority (..),
newUpdateCertificateAuthority,
updateCertificateAuthority_status,
updateCertificateAuthority_revocationConfiguration,
updateCertificateAuthority_certificateAuthorityArn,
UpdateCertificateAuthorityResponse (..),
newUpdateCertificateAuthorityResponse,
)
where
import Amazonka.CertificateManagerPCA.Types
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
data UpdateCertificateAuthority = UpdateCertificateAuthority'
{
UpdateCertificateAuthority -> Maybe CertificateAuthorityStatus
status :: Prelude.Maybe CertificateAuthorityStatus,
UpdateCertificateAuthority -> Maybe RevocationConfiguration
revocationConfiguration :: Prelude.Maybe RevocationConfiguration,
UpdateCertificateAuthority -> Text
certificateAuthorityArn :: Prelude.Text
}
deriving (UpdateCertificateAuthority -> UpdateCertificateAuthority -> Bool
(UpdateCertificateAuthority -> UpdateCertificateAuthority -> Bool)
-> (UpdateCertificateAuthority
-> UpdateCertificateAuthority -> Bool)
-> Eq UpdateCertificateAuthority
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateCertificateAuthority -> UpdateCertificateAuthority -> Bool
$c/= :: UpdateCertificateAuthority -> UpdateCertificateAuthority -> Bool
== :: UpdateCertificateAuthority -> UpdateCertificateAuthority -> Bool
$c== :: UpdateCertificateAuthority -> UpdateCertificateAuthority -> Bool
Prelude.Eq, ReadPrec [UpdateCertificateAuthority]
ReadPrec UpdateCertificateAuthority
Int -> ReadS UpdateCertificateAuthority
ReadS [UpdateCertificateAuthority]
(Int -> ReadS UpdateCertificateAuthority)
-> ReadS [UpdateCertificateAuthority]
-> ReadPrec UpdateCertificateAuthority
-> ReadPrec [UpdateCertificateAuthority]
-> Read UpdateCertificateAuthority
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateCertificateAuthority]
$creadListPrec :: ReadPrec [UpdateCertificateAuthority]
readPrec :: ReadPrec UpdateCertificateAuthority
$creadPrec :: ReadPrec UpdateCertificateAuthority
readList :: ReadS [UpdateCertificateAuthority]
$creadList :: ReadS [UpdateCertificateAuthority]
readsPrec :: Int -> ReadS UpdateCertificateAuthority
$creadsPrec :: Int -> ReadS UpdateCertificateAuthority
Prelude.Read, Int -> UpdateCertificateAuthority -> ShowS
[UpdateCertificateAuthority] -> ShowS
UpdateCertificateAuthority -> String
(Int -> UpdateCertificateAuthority -> ShowS)
-> (UpdateCertificateAuthority -> String)
-> ([UpdateCertificateAuthority] -> ShowS)
-> Show UpdateCertificateAuthority
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateCertificateAuthority] -> ShowS
$cshowList :: [UpdateCertificateAuthority] -> ShowS
show :: UpdateCertificateAuthority -> String
$cshow :: UpdateCertificateAuthority -> String
showsPrec :: Int -> UpdateCertificateAuthority -> ShowS
$cshowsPrec :: Int -> UpdateCertificateAuthority -> ShowS
Prelude.Show, (forall x.
UpdateCertificateAuthority -> Rep UpdateCertificateAuthority x)
-> (forall x.
Rep UpdateCertificateAuthority x -> UpdateCertificateAuthority)
-> Generic UpdateCertificateAuthority
forall x.
Rep UpdateCertificateAuthority x -> UpdateCertificateAuthority
forall x.
UpdateCertificateAuthority -> Rep UpdateCertificateAuthority x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateCertificateAuthority x -> UpdateCertificateAuthority
$cfrom :: forall x.
UpdateCertificateAuthority -> Rep UpdateCertificateAuthority x
Prelude.Generic)
newUpdateCertificateAuthority ::
Prelude.Text ->
UpdateCertificateAuthority
newUpdateCertificateAuthority :: Text -> UpdateCertificateAuthority
newUpdateCertificateAuthority
Text
pCertificateAuthorityArn_ =
UpdateCertificateAuthority' :: Maybe CertificateAuthorityStatus
-> Maybe RevocationConfiguration
-> Text
-> UpdateCertificateAuthority
UpdateCertificateAuthority'
{ $sel:status:UpdateCertificateAuthority' :: Maybe CertificateAuthorityStatus
status =
Maybe CertificateAuthorityStatus
forall a. Maybe a
Prelude.Nothing,
$sel:revocationConfiguration:UpdateCertificateAuthority' :: Maybe RevocationConfiguration
revocationConfiguration = Maybe RevocationConfiguration
forall a. Maybe a
Prelude.Nothing,
$sel:certificateAuthorityArn:UpdateCertificateAuthority' :: Text
certificateAuthorityArn =
Text
pCertificateAuthorityArn_
}
updateCertificateAuthority_status :: Lens.Lens' UpdateCertificateAuthority (Prelude.Maybe CertificateAuthorityStatus)
updateCertificateAuthority_status :: (Maybe CertificateAuthorityStatus
-> f (Maybe CertificateAuthorityStatus))
-> UpdateCertificateAuthority -> f UpdateCertificateAuthority
updateCertificateAuthority_status = (UpdateCertificateAuthority -> Maybe CertificateAuthorityStatus)
-> (UpdateCertificateAuthority
-> Maybe CertificateAuthorityStatus -> UpdateCertificateAuthority)
-> Lens
UpdateCertificateAuthority
UpdateCertificateAuthority
(Maybe CertificateAuthorityStatus)
(Maybe CertificateAuthorityStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCertificateAuthority' {Maybe CertificateAuthorityStatus
status :: Maybe CertificateAuthorityStatus
$sel:status:UpdateCertificateAuthority' :: UpdateCertificateAuthority -> Maybe CertificateAuthorityStatus
status} -> Maybe CertificateAuthorityStatus
status) (\s :: UpdateCertificateAuthority
s@UpdateCertificateAuthority' {} Maybe CertificateAuthorityStatus
a -> UpdateCertificateAuthority
s {$sel:status:UpdateCertificateAuthority' :: Maybe CertificateAuthorityStatus
status = Maybe CertificateAuthorityStatus
a} :: UpdateCertificateAuthority)
updateCertificateAuthority_revocationConfiguration :: Lens.Lens' UpdateCertificateAuthority (Prelude.Maybe RevocationConfiguration)
updateCertificateAuthority_revocationConfiguration :: (Maybe RevocationConfiguration
-> f (Maybe RevocationConfiguration))
-> UpdateCertificateAuthority -> f UpdateCertificateAuthority
updateCertificateAuthority_revocationConfiguration = (UpdateCertificateAuthority -> Maybe RevocationConfiguration)
-> (UpdateCertificateAuthority
-> Maybe RevocationConfiguration -> UpdateCertificateAuthority)
-> Lens
UpdateCertificateAuthority
UpdateCertificateAuthority
(Maybe RevocationConfiguration)
(Maybe RevocationConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCertificateAuthority' {Maybe RevocationConfiguration
revocationConfiguration :: Maybe RevocationConfiguration
$sel:revocationConfiguration:UpdateCertificateAuthority' :: UpdateCertificateAuthority -> Maybe RevocationConfiguration
revocationConfiguration} -> Maybe RevocationConfiguration
revocationConfiguration) (\s :: UpdateCertificateAuthority
s@UpdateCertificateAuthority' {} Maybe RevocationConfiguration
a -> UpdateCertificateAuthority
s {$sel:revocationConfiguration:UpdateCertificateAuthority' :: Maybe RevocationConfiguration
revocationConfiguration = Maybe RevocationConfiguration
a} :: UpdateCertificateAuthority)
updateCertificateAuthority_certificateAuthorityArn :: Lens.Lens' UpdateCertificateAuthority Prelude.Text
updateCertificateAuthority_certificateAuthorityArn :: (Text -> f Text)
-> UpdateCertificateAuthority -> f UpdateCertificateAuthority
updateCertificateAuthority_certificateAuthorityArn = (UpdateCertificateAuthority -> Text)
-> (UpdateCertificateAuthority
-> Text -> UpdateCertificateAuthority)
-> Lens
UpdateCertificateAuthority UpdateCertificateAuthority Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCertificateAuthority' {Text
certificateAuthorityArn :: Text
$sel:certificateAuthorityArn:UpdateCertificateAuthority' :: UpdateCertificateAuthority -> Text
certificateAuthorityArn} -> Text
certificateAuthorityArn) (\s :: UpdateCertificateAuthority
s@UpdateCertificateAuthority' {} Text
a -> UpdateCertificateAuthority
s {$sel:certificateAuthorityArn:UpdateCertificateAuthority' :: Text
certificateAuthorityArn = Text
a} :: UpdateCertificateAuthority)
instance Core.AWSRequest UpdateCertificateAuthority where
type
AWSResponse UpdateCertificateAuthority =
UpdateCertificateAuthorityResponse
request :: UpdateCertificateAuthority -> Request UpdateCertificateAuthority
request = Service
-> UpdateCertificateAuthority -> Request UpdateCertificateAuthority
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateCertificateAuthority
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateCertificateAuthority)))
response =
AWSResponse UpdateCertificateAuthority
-> Logger
-> Service
-> Proxy UpdateCertificateAuthority
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateCertificateAuthority)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
AWSResponse UpdateCertificateAuthority
UpdateCertificateAuthorityResponse
UpdateCertificateAuthorityResponse'
instance Prelude.Hashable UpdateCertificateAuthority
instance Prelude.NFData UpdateCertificateAuthority
instance Core.ToHeaders UpdateCertificateAuthority where
toHeaders :: UpdateCertificateAuthority -> [Header]
toHeaders =
[Header] -> UpdateCertificateAuthority -> [Header]
forall a b. a -> b -> a
Prelude.const
( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"ACMPrivateCA.UpdateCertificateAuthority" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON UpdateCertificateAuthority where
toJSON :: UpdateCertificateAuthority -> Value
toJSON UpdateCertificateAuthority' {Maybe CertificateAuthorityStatus
Maybe RevocationConfiguration
Text
certificateAuthorityArn :: Text
revocationConfiguration :: Maybe RevocationConfiguration
status :: Maybe CertificateAuthorityStatus
$sel:certificateAuthorityArn:UpdateCertificateAuthority' :: UpdateCertificateAuthority -> Text
$sel:revocationConfiguration:UpdateCertificateAuthority' :: UpdateCertificateAuthority -> Maybe RevocationConfiguration
$sel:status:UpdateCertificateAuthority' :: UpdateCertificateAuthority -> Maybe CertificateAuthorityStatus
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Status" Text -> CertificateAuthorityStatus -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (CertificateAuthorityStatus -> Pair)
-> Maybe CertificateAuthorityStatus -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CertificateAuthorityStatus
status,
(Text
"RevocationConfiguration" Text -> RevocationConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(RevocationConfiguration -> Pair)
-> Maybe RevocationConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RevocationConfiguration
revocationConfiguration,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"CertificateAuthorityArn"
Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
certificateAuthorityArn
)
]
)
instance Core.ToPath UpdateCertificateAuthority where
toPath :: UpdateCertificateAuthority -> ByteString
toPath = ByteString -> UpdateCertificateAuthority -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery UpdateCertificateAuthority where
toQuery :: UpdateCertificateAuthority -> QueryString
toQuery = QueryString -> UpdateCertificateAuthority -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateCertificateAuthorityResponse = UpdateCertificateAuthorityResponse'
{
}
deriving (UpdateCertificateAuthorityResponse
-> UpdateCertificateAuthorityResponse -> Bool
(UpdateCertificateAuthorityResponse
-> UpdateCertificateAuthorityResponse -> Bool)
-> (UpdateCertificateAuthorityResponse
-> UpdateCertificateAuthorityResponse -> Bool)
-> Eq UpdateCertificateAuthorityResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateCertificateAuthorityResponse
-> UpdateCertificateAuthorityResponse -> Bool
$c/= :: UpdateCertificateAuthorityResponse
-> UpdateCertificateAuthorityResponse -> Bool
== :: UpdateCertificateAuthorityResponse
-> UpdateCertificateAuthorityResponse -> Bool
$c== :: UpdateCertificateAuthorityResponse
-> UpdateCertificateAuthorityResponse -> Bool
Prelude.Eq, ReadPrec [UpdateCertificateAuthorityResponse]
ReadPrec UpdateCertificateAuthorityResponse
Int -> ReadS UpdateCertificateAuthorityResponse
ReadS [UpdateCertificateAuthorityResponse]
(Int -> ReadS UpdateCertificateAuthorityResponse)
-> ReadS [UpdateCertificateAuthorityResponse]
-> ReadPrec UpdateCertificateAuthorityResponse
-> ReadPrec [UpdateCertificateAuthorityResponse]
-> Read UpdateCertificateAuthorityResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateCertificateAuthorityResponse]
$creadListPrec :: ReadPrec [UpdateCertificateAuthorityResponse]
readPrec :: ReadPrec UpdateCertificateAuthorityResponse
$creadPrec :: ReadPrec UpdateCertificateAuthorityResponse
readList :: ReadS [UpdateCertificateAuthorityResponse]
$creadList :: ReadS [UpdateCertificateAuthorityResponse]
readsPrec :: Int -> ReadS UpdateCertificateAuthorityResponse
$creadsPrec :: Int -> ReadS UpdateCertificateAuthorityResponse
Prelude.Read, Int -> UpdateCertificateAuthorityResponse -> ShowS
[UpdateCertificateAuthorityResponse] -> ShowS
UpdateCertificateAuthorityResponse -> String
(Int -> UpdateCertificateAuthorityResponse -> ShowS)
-> (UpdateCertificateAuthorityResponse -> String)
-> ([UpdateCertificateAuthorityResponse] -> ShowS)
-> Show UpdateCertificateAuthorityResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateCertificateAuthorityResponse] -> ShowS
$cshowList :: [UpdateCertificateAuthorityResponse] -> ShowS
show :: UpdateCertificateAuthorityResponse -> String
$cshow :: UpdateCertificateAuthorityResponse -> String
showsPrec :: Int -> UpdateCertificateAuthorityResponse -> ShowS
$cshowsPrec :: Int -> UpdateCertificateAuthorityResponse -> ShowS
Prelude.Show, (forall x.
UpdateCertificateAuthorityResponse
-> Rep UpdateCertificateAuthorityResponse x)
-> (forall x.
Rep UpdateCertificateAuthorityResponse x
-> UpdateCertificateAuthorityResponse)
-> Generic UpdateCertificateAuthorityResponse
forall x.
Rep UpdateCertificateAuthorityResponse x
-> UpdateCertificateAuthorityResponse
forall x.
UpdateCertificateAuthorityResponse
-> Rep UpdateCertificateAuthorityResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateCertificateAuthorityResponse x
-> UpdateCertificateAuthorityResponse
$cfrom :: forall x.
UpdateCertificateAuthorityResponse
-> Rep UpdateCertificateAuthorityResponse x
Prelude.Generic)
newUpdateCertificateAuthorityResponse ::
UpdateCertificateAuthorityResponse
newUpdateCertificateAuthorityResponse :: UpdateCertificateAuthorityResponse
newUpdateCertificateAuthorityResponse =
UpdateCertificateAuthorityResponse
UpdateCertificateAuthorityResponse'
instance
Prelude.NFData
UpdateCertificateAuthorityResponse