{-# 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.DeleteDomainEntry
(
deleteDomainEntry
, DeleteDomainEntry
, ddeDomainName
, ddeDomainEntry
, deleteDomainEntryResponse
, DeleteDomainEntryResponse
, ddersOperation
, ddersResponseStatus
) 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
data DeleteDomainEntry = DeleteDomainEntry'
{ _ddeDomainName :: !Text
, _ddeDomainEntry :: !DomainEntry
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteDomainEntry
:: Text
-> DomainEntry
-> DeleteDomainEntry
deleteDomainEntry pDomainName_ pDomainEntry_ =
DeleteDomainEntry'
{_ddeDomainName = pDomainName_, _ddeDomainEntry = pDomainEntry_}
ddeDomainName :: Lens' DeleteDomainEntry Text
ddeDomainName = lens _ddeDomainName (\ s a -> s{_ddeDomainName = a})
ddeDomainEntry :: Lens' DeleteDomainEntry DomainEntry
ddeDomainEntry = lens _ddeDomainEntry (\ s a -> s{_ddeDomainEntry = a})
instance AWSRequest DeleteDomainEntry where
type Rs DeleteDomainEntry = DeleteDomainEntryResponse
request = postJSON lightsail
response
= receiveJSON
(\ s h x ->
DeleteDomainEntryResponse' <$>
(x .?> "operation") <*> (pure (fromEnum s)))
instance Hashable DeleteDomainEntry where
instance NFData DeleteDomainEntry where
instance ToHeaders DeleteDomainEntry where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("Lightsail_20161128.DeleteDomainEntry" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DeleteDomainEntry where
toJSON DeleteDomainEntry'{..}
= object
(catMaybes
[Just ("domainName" .= _ddeDomainName),
Just ("domainEntry" .= _ddeDomainEntry)])
instance ToPath DeleteDomainEntry where
toPath = const "/"
instance ToQuery DeleteDomainEntry where
toQuery = const mempty
data DeleteDomainEntryResponse = DeleteDomainEntryResponse'
{ _ddersOperation :: !(Maybe Operation)
, _ddersResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteDomainEntryResponse
:: Int
-> DeleteDomainEntryResponse
deleteDomainEntryResponse pResponseStatus_ =
DeleteDomainEntryResponse'
{_ddersOperation = Nothing, _ddersResponseStatus = pResponseStatus_}
ddersOperation :: Lens' DeleteDomainEntryResponse (Maybe Operation)
ddersOperation = lens _ddersOperation (\ s a -> s{_ddersOperation = a})
ddersResponseStatus :: Lens' DeleteDomainEntryResponse Int
ddersResponseStatus = lens _ddersResponseStatus (\ s a -> s{_ddersResponseStatus = a})
instance NFData DeleteDomainEntryResponse where