module Network.AWS.DirectoryService.CreateConditionalForwarder
(
createConditionalForwarder
, CreateConditionalForwarder
, ccfDirectoryId
, ccfRemoteDomainName
, ccfDNSIPAddrs
, createConditionalForwarderResponse
, CreateConditionalForwarderResponse
, ccfrsResponseStatus
) where
import Network.AWS.DirectoryService.Types
import Network.AWS.DirectoryService.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data CreateConditionalForwarder = CreateConditionalForwarder'
{ _ccfDirectoryId :: !Text
, _ccfRemoteDomainName :: !Text
, _ccfDNSIPAddrs :: ![Text]
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createConditionalForwarder
:: Text
-> Text
-> CreateConditionalForwarder
createConditionalForwarder pDirectoryId_ pRemoteDomainName_ =
CreateConditionalForwarder'
{ _ccfDirectoryId = pDirectoryId_
, _ccfRemoteDomainName = pRemoteDomainName_
, _ccfDNSIPAddrs = mempty
}
ccfDirectoryId :: Lens' CreateConditionalForwarder Text
ccfDirectoryId = lens _ccfDirectoryId (\ s a -> s{_ccfDirectoryId = a});
ccfRemoteDomainName :: Lens' CreateConditionalForwarder Text
ccfRemoteDomainName = lens _ccfRemoteDomainName (\ s a -> s{_ccfRemoteDomainName = a});
ccfDNSIPAddrs :: Lens' CreateConditionalForwarder [Text]
ccfDNSIPAddrs = lens _ccfDNSIPAddrs (\ s a -> s{_ccfDNSIPAddrs = a}) . _Coerce;
instance AWSRequest CreateConditionalForwarder where
type Rs CreateConditionalForwarder =
CreateConditionalForwarderResponse
request = postJSON directoryService
response
= receiveEmpty
(\ s h x ->
CreateConditionalForwarderResponse' <$>
(pure (fromEnum s)))
instance Hashable CreateConditionalForwarder
instance NFData CreateConditionalForwarder
instance ToHeaders CreateConditionalForwarder where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("DirectoryService_20150416.CreateConditionalForwarder"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON CreateConditionalForwarder where
toJSON CreateConditionalForwarder'{..}
= object
(catMaybes
[Just ("DirectoryId" .= _ccfDirectoryId),
Just ("RemoteDomainName" .= _ccfRemoteDomainName),
Just ("DnsIpAddrs" .= _ccfDNSIPAddrs)])
instance ToPath CreateConditionalForwarder where
toPath = const "/"
instance ToQuery CreateConditionalForwarder where
toQuery = const mempty
newtype CreateConditionalForwarderResponse = CreateConditionalForwarderResponse'
{ _ccfrsResponseStatus :: Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createConditionalForwarderResponse
:: Int
-> CreateConditionalForwarderResponse
createConditionalForwarderResponse pResponseStatus_ =
CreateConditionalForwarderResponse'
{ _ccfrsResponseStatus = pResponseStatus_
}
ccfrsResponseStatus :: Lens' CreateConditionalForwarderResponse Int
ccfrsResponseStatus = lens _ccfrsResponseStatus (\ s a -> s{_ccfrsResponseStatus = a});
instance NFData CreateConditionalForwarderResponse