{-# 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.Route53Domains.GetContactReachabilityStatus
(
getContactReachabilityStatus
, GetContactReachabilityStatus
, gcrsDomainName
, getContactReachabilityStatusResponse
, GetContactReachabilityStatusResponse
, gcrsrsStatus
, gcrsrsDomainName
, gcrsrsResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
import Network.AWS.Route53Domains.Types
import Network.AWS.Route53Domains.Types.Product
newtype GetContactReachabilityStatus = GetContactReachabilityStatus'
{ _gcrsDomainName :: Maybe Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getContactReachabilityStatus
:: GetContactReachabilityStatus
getContactReachabilityStatus =
GetContactReachabilityStatus'
{ _gcrsDomainName = Nothing
}
gcrsDomainName :: Lens' GetContactReachabilityStatus (Maybe Text)
gcrsDomainName = lens _gcrsDomainName (\ s a -> s{_gcrsDomainName = a});
instance AWSRequest GetContactReachabilityStatus
where
type Rs GetContactReachabilityStatus =
GetContactReachabilityStatusResponse
request = postJSON route53Domains
response
= receiveJSON
(\ s h x ->
GetContactReachabilityStatusResponse' <$>
(x .?> "status") <*> (x .?> "domainName") <*>
(pure (fromEnum s)))
instance Hashable GetContactReachabilityStatus
instance NFData GetContactReachabilityStatus
instance ToHeaders GetContactReachabilityStatus where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("Route53Domains_v20140515.GetContactReachabilityStatus"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON GetContactReachabilityStatus where
toJSON GetContactReachabilityStatus'{..}
= object
(catMaybes [("domainName" .=) <$> _gcrsDomainName])
instance ToPath GetContactReachabilityStatus where
toPath = const "/"
instance ToQuery GetContactReachabilityStatus where
toQuery = const mempty
data GetContactReachabilityStatusResponse = GetContactReachabilityStatusResponse'
{ _gcrsrsStatus :: !(Maybe ReachabilityStatus)
, _gcrsrsDomainName :: !(Maybe Text)
, _gcrsrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getContactReachabilityStatusResponse
:: Int
-> GetContactReachabilityStatusResponse
getContactReachabilityStatusResponse pResponseStatus_ =
GetContactReachabilityStatusResponse'
{ _gcrsrsStatus = Nothing
, _gcrsrsDomainName = Nothing
, _gcrsrsResponseStatus = pResponseStatus_
}
gcrsrsStatus :: Lens' GetContactReachabilityStatusResponse (Maybe ReachabilityStatus)
gcrsrsStatus = lens _gcrsrsStatus (\ s a -> s{_gcrsrsStatus = a});
gcrsrsDomainName :: Lens' GetContactReachabilityStatusResponse (Maybe Text)
gcrsrsDomainName = lens _gcrsrsDomainName (\ s a -> s{_gcrsrsDomainName = a});
gcrsrsResponseStatus :: Lens' GetContactReachabilityStatusResponse Int
gcrsrsResponseStatus = lens _gcrsrsResponseStatus (\ s a -> s{_gcrsrsResponseStatus = a});
instance NFData GetContactReachabilityStatusResponse