{-# 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.GetCertificateAuthorityCsr
(
GetCertificateAuthorityCsr (..),
newGetCertificateAuthorityCsr,
getCertificateAuthorityCsr_certificateAuthorityArn,
GetCertificateAuthorityCsrResponse (..),
newGetCertificateAuthorityCsrResponse,
getCertificateAuthorityCsrResponse_csr,
getCertificateAuthorityCsrResponse_httpStatus,
)
where
import Amazonka.CertificateManagerPCA.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data GetCertificateAuthorityCsr = GetCertificateAuthorityCsr'
{
GetCertificateAuthorityCsr -> Text
certificateAuthorityArn :: Prelude.Text
}
deriving (GetCertificateAuthorityCsr -> GetCertificateAuthorityCsr -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetCertificateAuthorityCsr -> GetCertificateAuthorityCsr -> Bool
$c/= :: GetCertificateAuthorityCsr -> GetCertificateAuthorityCsr -> Bool
== :: GetCertificateAuthorityCsr -> GetCertificateAuthorityCsr -> Bool
$c== :: GetCertificateAuthorityCsr -> GetCertificateAuthorityCsr -> Bool
Prelude.Eq, ReadPrec [GetCertificateAuthorityCsr]
ReadPrec GetCertificateAuthorityCsr
Int -> ReadS GetCertificateAuthorityCsr
ReadS [GetCertificateAuthorityCsr]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetCertificateAuthorityCsr]
$creadListPrec :: ReadPrec [GetCertificateAuthorityCsr]
readPrec :: ReadPrec GetCertificateAuthorityCsr
$creadPrec :: ReadPrec GetCertificateAuthorityCsr
readList :: ReadS [GetCertificateAuthorityCsr]
$creadList :: ReadS [GetCertificateAuthorityCsr]
readsPrec :: Int -> ReadS GetCertificateAuthorityCsr
$creadsPrec :: Int -> ReadS GetCertificateAuthorityCsr
Prelude.Read, Int -> GetCertificateAuthorityCsr -> ShowS
[GetCertificateAuthorityCsr] -> ShowS
GetCertificateAuthorityCsr -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetCertificateAuthorityCsr] -> ShowS
$cshowList :: [GetCertificateAuthorityCsr] -> ShowS
show :: GetCertificateAuthorityCsr -> String
$cshow :: GetCertificateAuthorityCsr -> String
showsPrec :: Int -> GetCertificateAuthorityCsr -> ShowS
$cshowsPrec :: Int -> GetCertificateAuthorityCsr -> ShowS
Prelude.Show, forall x.
Rep GetCertificateAuthorityCsr x -> GetCertificateAuthorityCsr
forall x.
GetCertificateAuthorityCsr -> Rep GetCertificateAuthorityCsr x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetCertificateAuthorityCsr x -> GetCertificateAuthorityCsr
$cfrom :: forall x.
GetCertificateAuthorityCsr -> Rep GetCertificateAuthorityCsr x
Prelude.Generic)
newGetCertificateAuthorityCsr ::
Prelude.Text ->
GetCertificateAuthorityCsr
newGetCertificateAuthorityCsr :: Text -> GetCertificateAuthorityCsr
newGetCertificateAuthorityCsr
Text
pCertificateAuthorityArn_ =
GetCertificateAuthorityCsr'
{ $sel:certificateAuthorityArn:GetCertificateAuthorityCsr' :: Text
certificateAuthorityArn =
Text
pCertificateAuthorityArn_
}
getCertificateAuthorityCsr_certificateAuthorityArn :: Lens.Lens' GetCertificateAuthorityCsr Prelude.Text
getCertificateAuthorityCsr_certificateAuthorityArn :: Lens' GetCertificateAuthorityCsr Text
getCertificateAuthorityCsr_certificateAuthorityArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCertificateAuthorityCsr' {Text
certificateAuthorityArn :: Text
$sel:certificateAuthorityArn:GetCertificateAuthorityCsr' :: GetCertificateAuthorityCsr -> Text
certificateAuthorityArn} -> Text
certificateAuthorityArn) (\s :: GetCertificateAuthorityCsr
s@GetCertificateAuthorityCsr' {} Text
a -> GetCertificateAuthorityCsr
s {$sel:certificateAuthorityArn:GetCertificateAuthorityCsr' :: Text
certificateAuthorityArn = Text
a} :: GetCertificateAuthorityCsr)
instance Core.AWSRequest GetCertificateAuthorityCsr where
type
AWSResponse GetCertificateAuthorityCsr =
GetCertificateAuthorityCsrResponse
request :: (Service -> Service)
-> GetCertificateAuthorityCsr -> Request GetCertificateAuthorityCsr
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy GetCertificateAuthorityCsr
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetCertificateAuthorityCsr)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text -> Int -> GetCertificateAuthorityCsrResponse
GetCertificateAuthorityCsrResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Csr")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable GetCertificateAuthorityCsr where
hashWithSalt :: Int -> GetCertificateAuthorityCsr -> Int
hashWithSalt Int
_salt GetCertificateAuthorityCsr' {Text
certificateAuthorityArn :: Text
$sel:certificateAuthorityArn:GetCertificateAuthorityCsr' :: GetCertificateAuthorityCsr -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
certificateAuthorityArn
instance Prelude.NFData GetCertificateAuthorityCsr where
rnf :: GetCertificateAuthorityCsr -> ()
rnf GetCertificateAuthorityCsr' {Text
certificateAuthorityArn :: Text
$sel:certificateAuthorityArn:GetCertificateAuthorityCsr' :: GetCertificateAuthorityCsr -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
certificateAuthorityArn
instance Data.ToHeaders GetCertificateAuthorityCsr where
toHeaders :: GetCertificateAuthorityCsr -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"ACMPrivateCA.GetCertificateAuthorityCsr" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON GetCertificateAuthorityCsr where
toJSON :: GetCertificateAuthorityCsr -> Value
toJSON GetCertificateAuthorityCsr' {Text
certificateAuthorityArn :: Text
$sel:certificateAuthorityArn:GetCertificateAuthorityCsr' :: GetCertificateAuthorityCsr -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
( Key
"CertificateAuthorityArn"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
certificateAuthorityArn
)
]
)
instance Data.ToPath GetCertificateAuthorityCsr where
toPath :: GetCertificateAuthorityCsr -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery GetCertificateAuthorityCsr where
toQuery :: GetCertificateAuthorityCsr -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data GetCertificateAuthorityCsrResponse = GetCertificateAuthorityCsrResponse'
{
GetCertificateAuthorityCsrResponse -> Maybe Text
csr :: Prelude.Maybe Prelude.Text,
GetCertificateAuthorityCsrResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetCertificateAuthorityCsrResponse
-> GetCertificateAuthorityCsrResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetCertificateAuthorityCsrResponse
-> GetCertificateAuthorityCsrResponse -> Bool
$c/= :: GetCertificateAuthorityCsrResponse
-> GetCertificateAuthorityCsrResponse -> Bool
== :: GetCertificateAuthorityCsrResponse
-> GetCertificateAuthorityCsrResponse -> Bool
$c== :: GetCertificateAuthorityCsrResponse
-> GetCertificateAuthorityCsrResponse -> Bool
Prelude.Eq, ReadPrec [GetCertificateAuthorityCsrResponse]
ReadPrec GetCertificateAuthorityCsrResponse
Int -> ReadS GetCertificateAuthorityCsrResponse
ReadS [GetCertificateAuthorityCsrResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetCertificateAuthorityCsrResponse]
$creadListPrec :: ReadPrec [GetCertificateAuthorityCsrResponse]
readPrec :: ReadPrec GetCertificateAuthorityCsrResponse
$creadPrec :: ReadPrec GetCertificateAuthorityCsrResponse
readList :: ReadS [GetCertificateAuthorityCsrResponse]
$creadList :: ReadS [GetCertificateAuthorityCsrResponse]
readsPrec :: Int -> ReadS GetCertificateAuthorityCsrResponse
$creadsPrec :: Int -> ReadS GetCertificateAuthorityCsrResponse
Prelude.Read, Int -> GetCertificateAuthorityCsrResponse -> ShowS
[GetCertificateAuthorityCsrResponse] -> ShowS
GetCertificateAuthorityCsrResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetCertificateAuthorityCsrResponse] -> ShowS
$cshowList :: [GetCertificateAuthorityCsrResponse] -> ShowS
show :: GetCertificateAuthorityCsrResponse -> String
$cshow :: GetCertificateAuthorityCsrResponse -> String
showsPrec :: Int -> GetCertificateAuthorityCsrResponse -> ShowS
$cshowsPrec :: Int -> GetCertificateAuthorityCsrResponse -> ShowS
Prelude.Show, forall x.
Rep GetCertificateAuthorityCsrResponse x
-> GetCertificateAuthorityCsrResponse
forall x.
GetCertificateAuthorityCsrResponse
-> Rep GetCertificateAuthorityCsrResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetCertificateAuthorityCsrResponse x
-> GetCertificateAuthorityCsrResponse
$cfrom :: forall x.
GetCertificateAuthorityCsrResponse
-> Rep GetCertificateAuthorityCsrResponse x
Prelude.Generic)
newGetCertificateAuthorityCsrResponse ::
Prelude.Int ->
GetCertificateAuthorityCsrResponse
newGetCertificateAuthorityCsrResponse :: Int -> GetCertificateAuthorityCsrResponse
newGetCertificateAuthorityCsrResponse Int
pHttpStatus_ =
GetCertificateAuthorityCsrResponse'
{ $sel:csr:GetCertificateAuthorityCsrResponse' :: Maybe Text
csr =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetCertificateAuthorityCsrResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getCertificateAuthorityCsrResponse_csr :: Lens.Lens' GetCertificateAuthorityCsrResponse (Prelude.Maybe Prelude.Text)
getCertificateAuthorityCsrResponse_csr :: Lens' GetCertificateAuthorityCsrResponse (Maybe Text)
getCertificateAuthorityCsrResponse_csr = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCertificateAuthorityCsrResponse' {Maybe Text
csr :: Maybe Text
$sel:csr:GetCertificateAuthorityCsrResponse' :: GetCertificateAuthorityCsrResponse -> Maybe Text
csr} -> Maybe Text
csr) (\s :: GetCertificateAuthorityCsrResponse
s@GetCertificateAuthorityCsrResponse' {} Maybe Text
a -> GetCertificateAuthorityCsrResponse
s {$sel:csr:GetCertificateAuthorityCsrResponse' :: Maybe Text
csr = Maybe Text
a} :: GetCertificateAuthorityCsrResponse)
getCertificateAuthorityCsrResponse_httpStatus :: Lens.Lens' GetCertificateAuthorityCsrResponse Prelude.Int
getCertificateAuthorityCsrResponse_httpStatus :: Lens' GetCertificateAuthorityCsrResponse Int
getCertificateAuthorityCsrResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCertificateAuthorityCsrResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetCertificateAuthorityCsrResponse' :: GetCertificateAuthorityCsrResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetCertificateAuthorityCsrResponse
s@GetCertificateAuthorityCsrResponse' {} Int
a -> GetCertificateAuthorityCsrResponse
s {$sel:httpStatus:GetCertificateAuthorityCsrResponse' :: Int
httpStatus = Int
a} :: GetCertificateAuthorityCsrResponse)
instance
Prelude.NFData
GetCertificateAuthorityCsrResponse
where
rnf :: GetCertificateAuthorityCsrResponse -> ()
rnf GetCertificateAuthorityCsrResponse' {Int
Maybe Text
httpStatus :: Int
csr :: Maybe Text
$sel:httpStatus:GetCertificateAuthorityCsrResponse' :: GetCertificateAuthorityCsrResponse -> Int
$sel:csr:GetCertificateAuthorityCsrResponse' :: GetCertificateAuthorityCsrResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
csr
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus