{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Network.AWS.APIGateway.UpdateDomainName
(
updateDomainName
, UpdateDomainName
, udnPatchOperations
, udnDomainName
, domainName
, DomainName
, dnCertificateName
, dnDomainName
, dnCertificateUploadDate
, dnDistributionDomainName
) 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 UpdateDomainName = UpdateDomainName'
{ _udnPatchOperations :: !(Maybe [PatchOperation])
, _udnDomainName :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
updateDomainName
:: Text
-> UpdateDomainName
updateDomainName pDomainName_ =
UpdateDomainName'
{ _udnPatchOperations = Nothing
, _udnDomainName = pDomainName_
}
udnPatchOperations :: Lens' UpdateDomainName [PatchOperation]
udnPatchOperations = lens _udnPatchOperations (\ s a -> s{_udnPatchOperations = a}) . _Default . _Coerce;
udnDomainName :: Lens' UpdateDomainName Text
udnDomainName = lens _udnDomainName (\ s a -> s{_udnDomainName = a});
instance AWSRequest UpdateDomainName where
type Rs UpdateDomainName = DomainName
request = patchJSON apiGateway
response = receiveJSON (\ s h x -> eitherParseJSON x)
instance Hashable UpdateDomainName
instance NFData UpdateDomainName
instance ToHeaders UpdateDomainName where
toHeaders
= const
(mconcat
["Accept" =# ("application/json" :: ByteString)])
instance ToJSON UpdateDomainName where
toJSON UpdateDomainName'{..}
= object
(catMaybes
[("patchOperations" .=) <$> _udnPatchOperations])
instance ToPath UpdateDomainName where
toPath UpdateDomainName'{..}
= mconcat ["/domainnames/", toBS _udnDomainName]
instance ToQuery UpdateDomainName where
toQuery = const mempty