module Network.AWS.ElasticBeanstalk.CheckDNSAvailability
(
checkDNSAvailability
, CheckDNSAvailability
, cdaCNAMEPrefix
, checkDNSAvailabilityResponse
, CheckDNSAvailabilityResponse
, cdarsFullyQualifiedCNAME
, cdarsAvailable
, cdarsResponseStatus
) where
import Network.AWS.ElasticBeanstalk.Types
import Network.AWS.ElasticBeanstalk.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype CheckDNSAvailability = CheckDNSAvailability'
{ _cdaCNAMEPrefix :: Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
checkDNSAvailability
:: Text
-> CheckDNSAvailability
checkDNSAvailability pCNAMEPrefix_ =
CheckDNSAvailability'
{ _cdaCNAMEPrefix = pCNAMEPrefix_
}
cdaCNAMEPrefix :: Lens' CheckDNSAvailability Text
cdaCNAMEPrefix = lens _cdaCNAMEPrefix (\ s a -> s{_cdaCNAMEPrefix = a});
instance AWSRequest CheckDNSAvailability where
type Rs CheckDNSAvailability =
CheckDNSAvailabilityResponse
request = postQuery elasticBeanstalk
response
= receiveXMLWrapper "CheckDNSAvailabilityResult"
(\ s h x ->
CheckDNSAvailabilityResponse' <$>
(x .@? "FullyQualifiedCNAME") <*> (x .@? "Available")
<*> (pure (fromEnum s)))
instance Hashable CheckDNSAvailability
instance ToHeaders CheckDNSAvailability where
toHeaders = const mempty
instance ToPath CheckDNSAvailability where
toPath = const "/"
instance ToQuery CheckDNSAvailability where
toQuery CheckDNSAvailability'{..}
= mconcat
["Action" =: ("CheckDNSAvailability" :: ByteString),
"Version" =: ("2010-12-01" :: ByteString),
"CNAMEPrefix" =: _cdaCNAMEPrefix]
data CheckDNSAvailabilityResponse = CheckDNSAvailabilityResponse'
{ _cdarsFullyQualifiedCNAME :: !(Maybe Text)
, _cdarsAvailable :: !(Maybe Bool)
, _cdarsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
checkDNSAvailabilityResponse
:: Int
-> CheckDNSAvailabilityResponse
checkDNSAvailabilityResponse pResponseStatus_ =
CheckDNSAvailabilityResponse'
{ _cdarsFullyQualifiedCNAME = Nothing
, _cdarsAvailable = Nothing
, _cdarsResponseStatus = pResponseStatus_
}
cdarsFullyQualifiedCNAME :: Lens' CheckDNSAvailabilityResponse (Maybe Text)
cdarsFullyQualifiedCNAME = lens _cdarsFullyQualifiedCNAME (\ s a -> s{_cdarsFullyQualifiedCNAME = a});
cdarsAvailable :: Lens' CheckDNSAvailabilityResponse (Maybe Bool)
cdarsAvailable = lens _cdarsAvailable (\ s a -> s{_cdarsAvailable = a});
cdarsResponseStatus :: Lens' CheckDNSAvailabilityResponse Int
cdarsResponseStatus = lens _cdarsResponseStatus (\ s a -> s{_cdarsResponseStatus = a});