{-# 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.Lightsail.DeleteDomain
(
deleteDomain
, DeleteDomain
, ddDomainName
, deleteDomainResponse
, DeleteDomainResponse
, ddrsOperation
, ddrsResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.Lightsail.Types
import Network.AWS.Lightsail.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype DeleteDomain = DeleteDomain'
{ _ddDomainName :: Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
deleteDomain
:: Text
-> DeleteDomain
deleteDomain pDomainName_ =
DeleteDomain'
{ _ddDomainName = pDomainName_
}
ddDomainName :: Lens' DeleteDomain Text
ddDomainName = lens _ddDomainName (\ s a -> s{_ddDomainName = a});
instance AWSRequest DeleteDomain where
type Rs DeleteDomain = DeleteDomainResponse
request = postJSON lightsail
response
= receiveJSON
(\ s h x ->
DeleteDomainResponse' <$>
(x .?> "operation") <*> (pure (fromEnum s)))
instance Hashable DeleteDomain
instance NFData DeleteDomain
instance ToHeaders DeleteDomain where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("Lightsail_20161128.DeleteDomain" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DeleteDomain where
toJSON DeleteDomain'{..}
= object
(catMaybes [Just ("domainName" .= _ddDomainName)])
instance ToPath DeleteDomain where
toPath = const "/"
instance ToQuery DeleteDomain where
toQuery = const mempty
data DeleteDomainResponse = DeleteDomainResponse'
{ _ddrsOperation :: !(Maybe Operation)
, _ddrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
deleteDomainResponse
:: Int
-> DeleteDomainResponse
deleteDomainResponse pResponseStatus_ =
DeleteDomainResponse'
{ _ddrsOperation = Nothing
, _ddrsResponseStatus = pResponseStatus_
}
ddrsOperation :: Lens' DeleteDomainResponse (Maybe Operation)
ddrsOperation = lens _ddrsOperation (\ s a -> s{_ddrsOperation = a});
ddrsResponseStatus :: Lens' DeleteDomainResponse Int
ddrsResponseStatus = lens _ddrsResponseStatus (\ s a -> s{_ddrsResponseStatus = a});
instance NFData DeleteDomainResponse