module Network.AWS.Route53Domains.RetrieveDomainAuthCode
(
RetrieveDomainAuthCode
, retrieveDomainAuthCode
, rdacDomainName
, RetrieveDomainAuthCodeResponse
, retrieveDomainAuthCodeResponse
, rdacrAuthCode
) where
import Network.AWS.Prelude
import Network.AWS.Request.JSON
import Network.AWS.Route53Domains.Types
import qualified GHC.Exts
newtype RetrieveDomainAuthCode = RetrieveDomainAuthCode
{ _rdacDomainName :: Text
} deriving (Eq, Ord, Read, Show, Monoid, IsString)
retrieveDomainAuthCode :: Text
-> RetrieveDomainAuthCode
retrieveDomainAuthCode p1 = RetrieveDomainAuthCode
{ _rdacDomainName = p1
}
rdacDomainName :: Lens' RetrieveDomainAuthCode Text
rdacDomainName = lens _rdacDomainName (\s a -> s { _rdacDomainName = a })
newtype RetrieveDomainAuthCodeResponse = RetrieveDomainAuthCodeResponse
{ _rdacrAuthCode :: Sensitive Text
} deriving (Eq, Ord, Read, Show, Monoid, IsString)
retrieveDomainAuthCodeResponse :: Text
-> RetrieveDomainAuthCodeResponse
retrieveDomainAuthCodeResponse p1 = RetrieveDomainAuthCodeResponse
{ _rdacrAuthCode = withIso _Sensitive (const id) p1
}
rdacrAuthCode :: Lens' RetrieveDomainAuthCodeResponse Text
rdacrAuthCode = lens _rdacrAuthCode (\s a -> s { _rdacrAuthCode = a }) . _Sensitive
instance ToPath RetrieveDomainAuthCode where
toPath = const "/"
instance ToQuery RetrieveDomainAuthCode where
toQuery = const mempty
instance ToHeaders RetrieveDomainAuthCode
instance ToJSON RetrieveDomainAuthCode where
toJSON RetrieveDomainAuthCode{..} = object
[ "DomainName" .= _rdacDomainName
]
instance AWSRequest RetrieveDomainAuthCode where
type Sv RetrieveDomainAuthCode = Route53Domains
type Rs RetrieveDomainAuthCode = RetrieveDomainAuthCodeResponse
request = post "RetrieveDomainAuthCode"
response = jsonResponse
instance FromJSON RetrieveDomainAuthCodeResponse where
parseJSON = withObject "RetrieveDomainAuthCodeResponse" $ \o -> RetrieveDomainAuthCodeResponse
<$> o .: "AuthCode"