module Network.AWS.APIGateway.UpdateClientCertificate
(
updateClientCertificate
, UpdateClientCertificate
, uccPatchOperations
, uccClientCertificateId
, 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
data UpdateClientCertificate = UpdateClientCertificate'
{ _uccPatchOperations :: !(Maybe [PatchOperation])
, _uccClientCertificateId :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateClientCertificate
:: Text
-> UpdateClientCertificate
updateClientCertificate pClientCertificateId_ =
UpdateClientCertificate'
{ _uccPatchOperations = Nothing
, _uccClientCertificateId = pClientCertificateId_
}
uccPatchOperations :: Lens' UpdateClientCertificate [PatchOperation]
uccPatchOperations = lens _uccPatchOperations (\ s a -> s{_uccPatchOperations = a}) . _Default . _Coerce;
uccClientCertificateId :: Lens' UpdateClientCertificate Text
uccClientCertificateId = lens _uccClientCertificateId (\ s a -> s{_uccClientCertificateId = a});
instance AWSRequest UpdateClientCertificate where
type Rs UpdateClientCertificate = ClientCertificate
request = patchJSON apiGateway
response = receiveJSON (\ s h x -> eitherParseJSON x)
instance Hashable UpdateClientCertificate where
instance NFData UpdateClientCertificate where
instance ToHeaders UpdateClientCertificate where
toHeaders
= const
(mconcat
["Accept" =# ("application/json" :: ByteString)])
instance ToJSON UpdateClientCertificate where
toJSON UpdateClientCertificate'{..}
= object
(catMaybes
[("patchOperations" .=) <$> _uccPatchOperations])
instance ToPath UpdateClientCertificate where
toPath UpdateClientCertificate'{..}
= mconcat
["/clientcertificates/",
toBS _uccClientCertificateId]
instance ToQuery UpdateClientCertificate where
toQuery = const mempty