{-# 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
, delrsOperation
, delrsResponseStatus
) 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 where
instance NFData DeleteDomain where
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'
{ _delrsOperation :: !(Maybe Operation)
, _delrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteDomainResponse
:: Int
-> DeleteDomainResponse
deleteDomainResponse pResponseStatus_ =
DeleteDomainResponse'
{_delrsOperation = Nothing, _delrsResponseStatus = pResponseStatus_}
delrsOperation :: Lens' DeleteDomainResponse (Maybe Operation)
delrsOperation = lens _delrsOperation (\ s a -> s{_delrsOperation = a})
delrsResponseStatus :: Lens' DeleteDomainResponse Int
delrsResponseStatus = lens _delrsResponseStatus (\ s a -> s{_delrsResponseStatus = a})
instance NFData DeleteDomainResponse where