module Network.AWS.Route53Domains.RetrieveDomainAuthCode
(
retrieveDomainAuthCode
, RetrieveDomainAuthCode
, rdacDomainName
, retrieveDomainAuthCodeResponse
, RetrieveDomainAuthCodeResponse
, rdacrsStatus
, rdacrsAuthCode
) where
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
import Network.AWS.Route53Domains.Types
import Network.AWS.Route53Domains.Types.Product
newtype RetrieveDomainAuthCode = RetrieveDomainAuthCode'
{ _rdacDomainName :: Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
retrieveDomainAuthCode
:: Text
-> RetrieveDomainAuthCode
retrieveDomainAuthCode pDomainName_ =
RetrieveDomainAuthCode'
{ _rdacDomainName = pDomainName_
}
rdacDomainName :: Lens' RetrieveDomainAuthCode Text
rdacDomainName = lens _rdacDomainName (\ s a -> s{_rdacDomainName = a});
instance AWSRequest RetrieveDomainAuthCode where
type Rs RetrieveDomainAuthCode =
RetrieveDomainAuthCodeResponse
request = postJSON route53Domains
response
= receiveJSON
(\ s h x ->
RetrieveDomainAuthCodeResponse' <$>
(pure (fromEnum s)) <*> (x .:> "AuthCode"))
instance ToHeaders RetrieveDomainAuthCode where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("Route53Domains_v20140515.RetrieveDomainAuthCode" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON RetrieveDomainAuthCode where
toJSON RetrieveDomainAuthCode'{..}
= object
(catMaybes [Just ("DomainName" .= _rdacDomainName)])
instance ToPath RetrieveDomainAuthCode where
toPath = const "/"
instance ToQuery RetrieveDomainAuthCode where
toQuery = const mempty
data RetrieveDomainAuthCodeResponse = RetrieveDomainAuthCodeResponse'
{ _rdacrsStatus :: !Int
, _rdacrsAuthCode :: !(Sensitive Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
retrieveDomainAuthCodeResponse
:: Int
-> Text
-> RetrieveDomainAuthCodeResponse
retrieveDomainAuthCodeResponse pStatus_ pAuthCode_ =
RetrieveDomainAuthCodeResponse'
{ _rdacrsStatus = pStatus_
, _rdacrsAuthCode = _Sensitive # pAuthCode_
}
rdacrsStatus :: Lens' RetrieveDomainAuthCodeResponse Int
rdacrsStatus = lens _rdacrsStatus (\ s a -> s{_rdacrsStatus = a});
rdacrsAuthCode :: Lens' RetrieveDomainAuthCodeResponse Text
rdacrsAuthCode = lens _rdacrsAuthCode (\ s a -> s{_rdacrsAuthCode = a}) . _Sensitive;