module Network.AWS.APIGateway.GenerateClientCertificate
(
generateClientCertificate
, GenerateClientCertificate
, gccDescription
, clientCertificate
, ClientCertificate
, ccPemEncodedCertificate
, ccClientCertificateId
, ccCreatedDate
, ccExpirationDate
, ccDescription
) where
import Network.AWS.APIGateway.Types
import Network.AWS.APIGateway.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype GenerateClientCertificate = GenerateClientCertificate'
{ _gccDescription :: Maybe Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
generateClientCertificate
:: GenerateClientCertificate
generateClientCertificate =
GenerateClientCertificate' {_gccDescription = Nothing}
gccDescription :: Lens' GenerateClientCertificate (Maybe Text)
gccDescription = lens _gccDescription (\ s a -> s{_gccDescription = a});
instance AWSRequest GenerateClientCertificate where
type Rs GenerateClientCertificate = ClientCertificate
request = postJSON apiGateway
response = receiveJSON (\ s h x -> eitherParseJSON x)
instance Hashable GenerateClientCertificate where
instance NFData GenerateClientCertificate where
instance ToHeaders GenerateClientCertificate where
toHeaders
= const
(mconcat
["Accept" =# ("application/json" :: ByteString)])
instance ToJSON GenerateClientCertificate where
toJSON GenerateClientCertificate'{..}
= object
(catMaybes [("description" .=) <$> _gccDescription])
instance ToPath GenerateClientCertificate where
toPath = const "/clientcertificates"
instance ToQuery GenerateClientCertificate where
toQuery = const mempty