{-# 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.CognitoIdentityProvider.GetSigningCertificate
(
GetSigningCertificate (..),
newGetSigningCertificate,
getSigningCertificate_userPoolId,
GetSigningCertificateResponse (..),
newGetSigningCertificateResponse,
getSigningCertificateResponse_certificate,
getSigningCertificateResponse_httpStatus,
)
where
import Amazonka.CognitoIdentityProvider.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 GetSigningCertificate = GetSigningCertificate'
{
GetSigningCertificate -> Text
userPoolId :: Prelude.Text
}
deriving (GetSigningCertificate -> GetSigningCertificate -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetSigningCertificate -> GetSigningCertificate -> Bool
$c/= :: GetSigningCertificate -> GetSigningCertificate -> Bool
== :: GetSigningCertificate -> GetSigningCertificate -> Bool
$c== :: GetSigningCertificate -> GetSigningCertificate -> Bool
Prelude.Eq, ReadPrec [GetSigningCertificate]
ReadPrec GetSigningCertificate
Int -> ReadS GetSigningCertificate
ReadS [GetSigningCertificate]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetSigningCertificate]
$creadListPrec :: ReadPrec [GetSigningCertificate]
readPrec :: ReadPrec GetSigningCertificate
$creadPrec :: ReadPrec GetSigningCertificate
readList :: ReadS [GetSigningCertificate]
$creadList :: ReadS [GetSigningCertificate]
readsPrec :: Int -> ReadS GetSigningCertificate
$creadsPrec :: Int -> ReadS GetSigningCertificate
Prelude.Read, Int -> GetSigningCertificate -> ShowS
[GetSigningCertificate] -> ShowS
GetSigningCertificate -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetSigningCertificate] -> ShowS
$cshowList :: [GetSigningCertificate] -> ShowS
show :: GetSigningCertificate -> String
$cshow :: GetSigningCertificate -> String
showsPrec :: Int -> GetSigningCertificate -> ShowS
$cshowsPrec :: Int -> GetSigningCertificate -> ShowS
Prelude.Show, forall x. Rep GetSigningCertificate x -> GetSigningCertificate
forall x. GetSigningCertificate -> Rep GetSigningCertificate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetSigningCertificate x -> GetSigningCertificate
$cfrom :: forall x. GetSigningCertificate -> Rep GetSigningCertificate x
Prelude.Generic)
newGetSigningCertificate ::
Prelude.Text ->
GetSigningCertificate
newGetSigningCertificate :: Text -> GetSigningCertificate
newGetSigningCertificate Text
pUserPoolId_ =
GetSigningCertificate' {$sel:userPoolId:GetSigningCertificate' :: Text
userPoolId = Text
pUserPoolId_}
getSigningCertificate_userPoolId :: Lens.Lens' GetSigningCertificate Prelude.Text
getSigningCertificate_userPoolId :: Lens' GetSigningCertificate Text
getSigningCertificate_userPoolId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSigningCertificate' {Text
userPoolId :: Text
$sel:userPoolId:GetSigningCertificate' :: GetSigningCertificate -> Text
userPoolId} -> Text
userPoolId) (\s :: GetSigningCertificate
s@GetSigningCertificate' {} Text
a -> GetSigningCertificate
s {$sel:userPoolId:GetSigningCertificate' :: Text
userPoolId = Text
a} :: GetSigningCertificate)
instance Core.AWSRequest GetSigningCertificate where
type
AWSResponse GetSigningCertificate =
GetSigningCertificateResponse
request :: (Service -> Service)
-> GetSigningCertificate -> Request GetSigningCertificate
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 GetSigningCertificate
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetSigningCertificate)))
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 -> GetSigningCertificateResponse
GetSigningCertificateResponse'
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
"Certificate")
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 GetSigningCertificate where
hashWithSalt :: Int -> GetSigningCertificate -> Int
hashWithSalt Int
_salt GetSigningCertificate' {Text
userPoolId :: Text
$sel:userPoolId:GetSigningCertificate' :: GetSigningCertificate -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
userPoolId
instance Prelude.NFData GetSigningCertificate where
rnf :: GetSigningCertificate -> ()
rnf GetSigningCertificate' {Text
userPoolId :: Text
$sel:userPoolId:GetSigningCertificate' :: GetSigningCertificate -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
userPoolId
instance Data.ToHeaders GetSigningCertificate where
toHeaders :: GetSigningCertificate -> 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
"AWSCognitoIdentityProviderService.GetSigningCertificate" ::
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 GetSigningCertificate where
toJSON :: GetSigningCertificate -> Value
toJSON GetSigningCertificate' {Text
userPoolId :: Text
$sel:userPoolId:GetSigningCertificate' :: GetSigningCertificate -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[forall a. a -> Maybe a
Prelude.Just (Key
"UserPoolId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
userPoolId)]
)
instance Data.ToPath GetSigningCertificate where
toPath :: GetSigningCertificate -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery GetSigningCertificate where
toQuery :: GetSigningCertificate -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data GetSigningCertificateResponse = GetSigningCertificateResponse'
{
GetSigningCertificateResponse -> Maybe Text
certificate :: Prelude.Maybe Prelude.Text,
GetSigningCertificateResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetSigningCertificateResponse
-> GetSigningCertificateResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetSigningCertificateResponse
-> GetSigningCertificateResponse -> Bool
$c/= :: GetSigningCertificateResponse
-> GetSigningCertificateResponse -> Bool
== :: GetSigningCertificateResponse
-> GetSigningCertificateResponse -> Bool
$c== :: GetSigningCertificateResponse
-> GetSigningCertificateResponse -> Bool
Prelude.Eq, ReadPrec [GetSigningCertificateResponse]
ReadPrec GetSigningCertificateResponse
Int -> ReadS GetSigningCertificateResponse
ReadS [GetSigningCertificateResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetSigningCertificateResponse]
$creadListPrec :: ReadPrec [GetSigningCertificateResponse]
readPrec :: ReadPrec GetSigningCertificateResponse
$creadPrec :: ReadPrec GetSigningCertificateResponse
readList :: ReadS [GetSigningCertificateResponse]
$creadList :: ReadS [GetSigningCertificateResponse]
readsPrec :: Int -> ReadS GetSigningCertificateResponse
$creadsPrec :: Int -> ReadS GetSigningCertificateResponse
Prelude.Read, Int -> GetSigningCertificateResponse -> ShowS
[GetSigningCertificateResponse] -> ShowS
GetSigningCertificateResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetSigningCertificateResponse] -> ShowS
$cshowList :: [GetSigningCertificateResponse] -> ShowS
show :: GetSigningCertificateResponse -> String
$cshow :: GetSigningCertificateResponse -> String
showsPrec :: Int -> GetSigningCertificateResponse -> ShowS
$cshowsPrec :: Int -> GetSigningCertificateResponse -> ShowS
Prelude.Show, forall x.
Rep GetSigningCertificateResponse x
-> GetSigningCertificateResponse
forall x.
GetSigningCertificateResponse
-> Rep GetSigningCertificateResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetSigningCertificateResponse x
-> GetSigningCertificateResponse
$cfrom :: forall x.
GetSigningCertificateResponse
-> Rep GetSigningCertificateResponse x
Prelude.Generic)
newGetSigningCertificateResponse ::
Prelude.Int ->
GetSigningCertificateResponse
newGetSigningCertificateResponse :: Int -> GetSigningCertificateResponse
newGetSigningCertificateResponse Int
pHttpStatus_ =
GetSigningCertificateResponse'
{ $sel:certificate:GetSigningCertificateResponse' :: Maybe Text
certificate =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetSigningCertificateResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getSigningCertificateResponse_certificate :: Lens.Lens' GetSigningCertificateResponse (Prelude.Maybe Prelude.Text)
getSigningCertificateResponse_certificate :: Lens' GetSigningCertificateResponse (Maybe Text)
getSigningCertificateResponse_certificate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSigningCertificateResponse' {Maybe Text
certificate :: Maybe Text
$sel:certificate:GetSigningCertificateResponse' :: GetSigningCertificateResponse -> Maybe Text
certificate} -> Maybe Text
certificate) (\s :: GetSigningCertificateResponse
s@GetSigningCertificateResponse' {} Maybe Text
a -> GetSigningCertificateResponse
s {$sel:certificate:GetSigningCertificateResponse' :: Maybe Text
certificate = Maybe Text
a} :: GetSigningCertificateResponse)
getSigningCertificateResponse_httpStatus :: Lens.Lens' GetSigningCertificateResponse Prelude.Int
getSigningCertificateResponse_httpStatus :: Lens' GetSigningCertificateResponse Int
getSigningCertificateResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSigningCertificateResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetSigningCertificateResponse' :: GetSigningCertificateResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetSigningCertificateResponse
s@GetSigningCertificateResponse' {} Int
a -> GetSigningCertificateResponse
s {$sel:httpStatus:GetSigningCertificateResponse' :: Int
httpStatus = Int
a} :: GetSigningCertificateResponse)
instance Prelude.NFData GetSigningCertificateResponse where
rnf :: GetSigningCertificateResponse -> ()
rnf GetSigningCertificateResponse' {Int
Maybe Text
httpStatus :: Int
certificate :: Maybe Text
$sel:httpStatus:GetSigningCertificateResponse' :: GetSigningCertificateResponse -> Int
$sel:certificate:GetSigningCertificateResponse' :: GetSigningCertificateResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
certificate
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus