{-# 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.GetCertificateAuthorityCertificate
(
GetCertificateAuthorityCertificate (..),
newGetCertificateAuthorityCertificate,
getCertificateAuthorityCertificate_certificateAuthorityArn,
GetCertificateAuthorityCertificateResponse (..),
newGetCertificateAuthorityCertificateResponse,
getCertificateAuthorityCertificateResponse_certificate,
getCertificateAuthorityCertificateResponse_certificateChain,
getCertificateAuthorityCertificateResponse_httpStatus,
)
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 GetCertificateAuthorityCertificate = GetCertificateAuthorityCertificate'
{
GetCertificateAuthorityCertificate -> Text
certificateAuthorityArn :: Prelude.Text
}
deriving (GetCertificateAuthorityCertificate
-> GetCertificateAuthorityCertificate -> Bool
(GetCertificateAuthorityCertificate
-> GetCertificateAuthorityCertificate -> Bool)
-> (GetCertificateAuthorityCertificate
-> GetCertificateAuthorityCertificate -> Bool)
-> Eq GetCertificateAuthorityCertificate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetCertificateAuthorityCertificate
-> GetCertificateAuthorityCertificate -> Bool
$c/= :: GetCertificateAuthorityCertificate
-> GetCertificateAuthorityCertificate -> Bool
== :: GetCertificateAuthorityCertificate
-> GetCertificateAuthorityCertificate -> Bool
$c== :: GetCertificateAuthorityCertificate
-> GetCertificateAuthorityCertificate -> Bool
Prelude.Eq, ReadPrec [GetCertificateAuthorityCertificate]
ReadPrec GetCertificateAuthorityCertificate
Int -> ReadS GetCertificateAuthorityCertificate
ReadS [GetCertificateAuthorityCertificate]
(Int -> ReadS GetCertificateAuthorityCertificate)
-> ReadS [GetCertificateAuthorityCertificate]
-> ReadPrec GetCertificateAuthorityCertificate
-> ReadPrec [GetCertificateAuthorityCertificate]
-> Read GetCertificateAuthorityCertificate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetCertificateAuthorityCertificate]
$creadListPrec :: ReadPrec [GetCertificateAuthorityCertificate]
readPrec :: ReadPrec GetCertificateAuthorityCertificate
$creadPrec :: ReadPrec GetCertificateAuthorityCertificate
readList :: ReadS [GetCertificateAuthorityCertificate]
$creadList :: ReadS [GetCertificateAuthorityCertificate]
readsPrec :: Int -> ReadS GetCertificateAuthorityCertificate
$creadsPrec :: Int -> ReadS GetCertificateAuthorityCertificate
Prelude.Read, Int -> GetCertificateAuthorityCertificate -> ShowS
[GetCertificateAuthorityCertificate] -> ShowS
GetCertificateAuthorityCertificate -> String
(Int -> GetCertificateAuthorityCertificate -> ShowS)
-> (GetCertificateAuthorityCertificate -> String)
-> ([GetCertificateAuthorityCertificate] -> ShowS)
-> Show GetCertificateAuthorityCertificate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetCertificateAuthorityCertificate] -> ShowS
$cshowList :: [GetCertificateAuthorityCertificate] -> ShowS
show :: GetCertificateAuthorityCertificate -> String
$cshow :: GetCertificateAuthorityCertificate -> String
showsPrec :: Int -> GetCertificateAuthorityCertificate -> ShowS
$cshowsPrec :: Int -> GetCertificateAuthorityCertificate -> ShowS
Prelude.Show, (forall x.
GetCertificateAuthorityCertificate
-> Rep GetCertificateAuthorityCertificate x)
-> (forall x.
Rep GetCertificateAuthorityCertificate x
-> GetCertificateAuthorityCertificate)
-> Generic GetCertificateAuthorityCertificate
forall x.
Rep GetCertificateAuthorityCertificate x
-> GetCertificateAuthorityCertificate
forall x.
GetCertificateAuthorityCertificate
-> Rep GetCertificateAuthorityCertificate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetCertificateAuthorityCertificate x
-> GetCertificateAuthorityCertificate
$cfrom :: forall x.
GetCertificateAuthorityCertificate
-> Rep GetCertificateAuthorityCertificate x
Prelude.Generic)
newGetCertificateAuthorityCertificate ::
Prelude.Text ->
GetCertificateAuthorityCertificate
newGetCertificateAuthorityCertificate :: Text -> GetCertificateAuthorityCertificate
newGetCertificateAuthorityCertificate
Text
pCertificateAuthorityArn_ =
GetCertificateAuthorityCertificate' :: Text -> GetCertificateAuthorityCertificate
GetCertificateAuthorityCertificate'
{ $sel:certificateAuthorityArn:GetCertificateAuthorityCertificate' :: Text
certificateAuthorityArn =
Text
pCertificateAuthorityArn_
}
getCertificateAuthorityCertificate_certificateAuthorityArn :: Lens.Lens' GetCertificateAuthorityCertificate Prelude.Text
getCertificateAuthorityCertificate_certificateAuthorityArn :: (Text -> f Text)
-> GetCertificateAuthorityCertificate
-> f GetCertificateAuthorityCertificate
getCertificateAuthorityCertificate_certificateAuthorityArn = (GetCertificateAuthorityCertificate -> Text)
-> (GetCertificateAuthorityCertificate
-> Text -> GetCertificateAuthorityCertificate)
-> Lens
GetCertificateAuthorityCertificate
GetCertificateAuthorityCertificate
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCertificateAuthorityCertificate' {Text
certificateAuthorityArn :: Text
$sel:certificateAuthorityArn:GetCertificateAuthorityCertificate' :: GetCertificateAuthorityCertificate -> Text
certificateAuthorityArn} -> Text
certificateAuthorityArn) (\s :: GetCertificateAuthorityCertificate
s@GetCertificateAuthorityCertificate' {} Text
a -> GetCertificateAuthorityCertificate
s {$sel:certificateAuthorityArn:GetCertificateAuthorityCertificate' :: Text
certificateAuthorityArn = Text
a} :: GetCertificateAuthorityCertificate)
instance
Core.AWSRequest
GetCertificateAuthorityCertificate
where
type
AWSResponse GetCertificateAuthorityCertificate =
GetCertificateAuthorityCertificateResponse
request :: GetCertificateAuthorityCertificate
-> Request GetCertificateAuthorityCertificate
request = Service
-> GetCertificateAuthorityCertificate
-> Request GetCertificateAuthorityCertificate
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy GetCertificateAuthorityCertificate
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse GetCertificateAuthorityCertificate)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetCertificateAuthorityCertificate))
-> Logger
-> Service
-> Proxy GetCertificateAuthorityCertificate
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse GetCertificateAuthorityCertificate)))
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 Text
-> Maybe Text -> Int -> GetCertificateAuthorityCertificateResponse
GetCertificateAuthorityCertificateResponse'
(Maybe Text
-> Maybe Text -> Int -> GetCertificateAuthorityCertificateResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe Text -> Int -> GetCertificateAuthorityCertificateResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Certificate")
Either
String
(Maybe Text -> Int -> GetCertificateAuthorityCertificateResponse)
-> Either String (Maybe Text)
-> Either
String (Int -> GetCertificateAuthorityCertificateResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"CertificateChain")
Either String (Int -> GetCertificateAuthorityCertificateResponse)
-> Either String Int
-> Either String GetCertificateAuthorityCertificateResponse
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
GetCertificateAuthorityCertificate
instance
Prelude.NFData
GetCertificateAuthorityCertificate
instance
Core.ToHeaders
GetCertificateAuthorityCertificate
where
toHeaders :: GetCertificateAuthorityCertificate -> ResponseHeaders
toHeaders =
ResponseHeaders
-> GetCertificateAuthorityCertificate -> 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
"ACMPrivateCA.GetCertificateAuthorityCertificate" ::
Prelude.ByteString
),
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
GetCertificateAuthorityCertificate
where
toJSON :: GetCertificateAuthorityCertificate -> Value
toJSON GetCertificateAuthorityCertificate' {Text
certificateAuthorityArn :: Text
$sel:certificateAuthorityArn:GetCertificateAuthorityCertificate' :: GetCertificateAuthorityCertificate -> 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
"CertificateAuthorityArn"
Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
certificateAuthorityArn
)
]
)
instance
Core.ToPath
GetCertificateAuthorityCertificate
where
toPath :: GetCertificateAuthorityCertificate -> ByteString
toPath = ByteString -> GetCertificateAuthorityCertificate -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance
Core.ToQuery
GetCertificateAuthorityCertificate
where
toQuery :: GetCertificateAuthorityCertificate -> QueryString
toQuery = QueryString -> GetCertificateAuthorityCertificate -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GetCertificateAuthorityCertificateResponse = GetCertificateAuthorityCertificateResponse'
{
GetCertificateAuthorityCertificateResponse -> Maybe Text
certificate :: Prelude.Maybe Prelude.Text,
GetCertificateAuthorityCertificateResponse -> Maybe Text
certificateChain :: Prelude.Maybe Prelude.Text,
GetCertificateAuthorityCertificateResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetCertificateAuthorityCertificateResponse
-> GetCertificateAuthorityCertificateResponse -> Bool
(GetCertificateAuthorityCertificateResponse
-> GetCertificateAuthorityCertificateResponse -> Bool)
-> (GetCertificateAuthorityCertificateResponse
-> GetCertificateAuthorityCertificateResponse -> Bool)
-> Eq GetCertificateAuthorityCertificateResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetCertificateAuthorityCertificateResponse
-> GetCertificateAuthorityCertificateResponse -> Bool
$c/= :: GetCertificateAuthorityCertificateResponse
-> GetCertificateAuthorityCertificateResponse -> Bool
== :: GetCertificateAuthorityCertificateResponse
-> GetCertificateAuthorityCertificateResponse -> Bool
$c== :: GetCertificateAuthorityCertificateResponse
-> GetCertificateAuthorityCertificateResponse -> Bool
Prelude.Eq, ReadPrec [GetCertificateAuthorityCertificateResponse]
ReadPrec GetCertificateAuthorityCertificateResponse
Int -> ReadS GetCertificateAuthorityCertificateResponse
ReadS [GetCertificateAuthorityCertificateResponse]
(Int -> ReadS GetCertificateAuthorityCertificateResponse)
-> ReadS [GetCertificateAuthorityCertificateResponse]
-> ReadPrec GetCertificateAuthorityCertificateResponse
-> ReadPrec [GetCertificateAuthorityCertificateResponse]
-> Read GetCertificateAuthorityCertificateResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetCertificateAuthorityCertificateResponse]
$creadListPrec :: ReadPrec [GetCertificateAuthorityCertificateResponse]
readPrec :: ReadPrec GetCertificateAuthorityCertificateResponse
$creadPrec :: ReadPrec GetCertificateAuthorityCertificateResponse
readList :: ReadS [GetCertificateAuthorityCertificateResponse]
$creadList :: ReadS [GetCertificateAuthorityCertificateResponse]
readsPrec :: Int -> ReadS GetCertificateAuthorityCertificateResponse
$creadsPrec :: Int -> ReadS GetCertificateAuthorityCertificateResponse
Prelude.Read, Int -> GetCertificateAuthorityCertificateResponse -> ShowS
[GetCertificateAuthorityCertificateResponse] -> ShowS
GetCertificateAuthorityCertificateResponse -> String
(Int -> GetCertificateAuthorityCertificateResponse -> ShowS)
-> (GetCertificateAuthorityCertificateResponse -> String)
-> ([GetCertificateAuthorityCertificateResponse] -> ShowS)
-> Show GetCertificateAuthorityCertificateResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetCertificateAuthorityCertificateResponse] -> ShowS
$cshowList :: [GetCertificateAuthorityCertificateResponse] -> ShowS
show :: GetCertificateAuthorityCertificateResponse -> String
$cshow :: GetCertificateAuthorityCertificateResponse -> String
showsPrec :: Int -> GetCertificateAuthorityCertificateResponse -> ShowS
$cshowsPrec :: Int -> GetCertificateAuthorityCertificateResponse -> ShowS
Prelude.Show, (forall x.
GetCertificateAuthorityCertificateResponse
-> Rep GetCertificateAuthorityCertificateResponse x)
-> (forall x.
Rep GetCertificateAuthorityCertificateResponse x
-> GetCertificateAuthorityCertificateResponse)
-> Generic GetCertificateAuthorityCertificateResponse
forall x.
Rep GetCertificateAuthorityCertificateResponse x
-> GetCertificateAuthorityCertificateResponse
forall x.
GetCertificateAuthorityCertificateResponse
-> Rep GetCertificateAuthorityCertificateResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetCertificateAuthorityCertificateResponse x
-> GetCertificateAuthorityCertificateResponse
$cfrom :: forall x.
GetCertificateAuthorityCertificateResponse
-> Rep GetCertificateAuthorityCertificateResponse x
Prelude.Generic)
newGetCertificateAuthorityCertificateResponse ::
Prelude.Int ->
GetCertificateAuthorityCertificateResponse
newGetCertificateAuthorityCertificateResponse :: Int -> GetCertificateAuthorityCertificateResponse
newGetCertificateAuthorityCertificateResponse
Int
pHttpStatus_ =
GetCertificateAuthorityCertificateResponse' :: Maybe Text
-> Maybe Text -> Int -> GetCertificateAuthorityCertificateResponse
GetCertificateAuthorityCertificateResponse'
{ $sel:certificate:GetCertificateAuthorityCertificateResponse' :: Maybe Text
certificate =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:certificateChain:GetCertificateAuthorityCertificateResponse' :: Maybe Text
certificateChain =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetCertificateAuthorityCertificateResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getCertificateAuthorityCertificateResponse_certificate :: Lens.Lens' GetCertificateAuthorityCertificateResponse (Prelude.Maybe Prelude.Text)
getCertificateAuthorityCertificateResponse_certificate :: (Maybe Text -> f (Maybe Text))
-> GetCertificateAuthorityCertificateResponse
-> f GetCertificateAuthorityCertificateResponse
getCertificateAuthorityCertificateResponse_certificate = (GetCertificateAuthorityCertificateResponse -> Maybe Text)
-> (GetCertificateAuthorityCertificateResponse
-> Maybe Text -> GetCertificateAuthorityCertificateResponse)
-> Lens
GetCertificateAuthorityCertificateResponse
GetCertificateAuthorityCertificateResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCertificateAuthorityCertificateResponse' {Maybe Text
certificate :: Maybe Text
$sel:certificate:GetCertificateAuthorityCertificateResponse' :: GetCertificateAuthorityCertificateResponse -> Maybe Text
certificate} -> Maybe Text
certificate) (\s :: GetCertificateAuthorityCertificateResponse
s@GetCertificateAuthorityCertificateResponse' {} Maybe Text
a -> GetCertificateAuthorityCertificateResponse
s {$sel:certificate:GetCertificateAuthorityCertificateResponse' :: Maybe Text
certificate = Maybe Text
a} :: GetCertificateAuthorityCertificateResponse)
getCertificateAuthorityCertificateResponse_certificateChain :: Lens.Lens' GetCertificateAuthorityCertificateResponse (Prelude.Maybe Prelude.Text)
getCertificateAuthorityCertificateResponse_certificateChain :: (Maybe Text -> f (Maybe Text))
-> GetCertificateAuthorityCertificateResponse
-> f GetCertificateAuthorityCertificateResponse
getCertificateAuthorityCertificateResponse_certificateChain = (GetCertificateAuthorityCertificateResponse -> Maybe Text)
-> (GetCertificateAuthorityCertificateResponse
-> Maybe Text -> GetCertificateAuthorityCertificateResponse)
-> Lens
GetCertificateAuthorityCertificateResponse
GetCertificateAuthorityCertificateResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCertificateAuthorityCertificateResponse' {Maybe Text
certificateChain :: Maybe Text
$sel:certificateChain:GetCertificateAuthorityCertificateResponse' :: GetCertificateAuthorityCertificateResponse -> Maybe Text
certificateChain} -> Maybe Text
certificateChain) (\s :: GetCertificateAuthorityCertificateResponse
s@GetCertificateAuthorityCertificateResponse' {} Maybe Text
a -> GetCertificateAuthorityCertificateResponse
s {$sel:certificateChain:GetCertificateAuthorityCertificateResponse' :: Maybe Text
certificateChain = Maybe Text
a} :: GetCertificateAuthorityCertificateResponse)
getCertificateAuthorityCertificateResponse_httpStatus :: Lens.Lens' GetCertificateAuthorityCertificateResponse Prelude.Int
getCertificateAuthorityCertificateResponse_httpStatus :: (Int -> f Int)
-> GetCertificateAuthorityCertificateResponse
-> f GetCertificateAuthorityCertificateResponse
getCertificateAuthorityCertificateResponse_httpStatus = (GetCertificateAuthorityCertificateResponse -> Int)
-> (GetCertificateAuthorityCertificateResponse
-> Int -> GetCertificateAuthorityCertificateResponse)
-> Lens
GetCertificateAuthorityCertificateResponse
GetCertificateAuthorityCertificateResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCertificateAuthorityCertificateResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetCertificateAuthorityCertificateResponse' :: GetCertificateAuthorityCertificateResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetCertificateAuthorityCertificateResponse
s@GetCertificateAuthorityCertificateResponse' {} Int
a -> GetCertificateAuthorityCertificateResponse
s {$sel:httpStatus:GetCertificateAuthorityCertificateResponse' :: Int
httpStatus = Int
a} :: GetCertificateAuthorityCertificateResponse)
instance
Prelude.NFData
GetCertificateAuthorityCertificateResponse