module Network.AWS.Route53Domains.GetOperationDetail
(
getOperationDetail
, GetOperationDetail
, godOperationId
, getOperationDetailResponse
, GetOperationDetailResponse
, godrsSubmittedDate
, godrsDomainName
, godrsOperationId
, godrsType
, godrsMessage
, godrsStatus
) 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 GetOperationDetail = GetOperationDetail'
{ _godOperationId :: Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getOperationDetail
:: Text
-> GetOperationDetail
getOperationDetail pOperationId_ =
GetOperationDetail'
{ _godOperationId = pOperationId_
}
godOperationId :: Lens' GetOperationDetail Text
godOperationId = lens _godOperationId (\ s a -> s{_godOperationId = a});
instance AWSRequest GetOperationDetail where
type Rs GetOperationDetail =
GetOperationDetailResponse
request = postJSON route53Domains
response
= receiveJSON
(\ s h x ->
GetOperationDetailResponse' <$>
(x .?> "SubmittedDate") <*> (x .?> "DomainName") <*>
(x .?> "OperationId")
<*> (x .?> "Type")
<*> (x .?> "Message")
<*> (pure (fromEnum s)))
instance ToHeaders GetOperationDetail where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("Route53Domains_v20140515.GetOperationDetail" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON GetOperationDetail where
toJSON GetOperationDetail'{..}
= object
(catMaybes [Just ("OperationId" .= _godOperationId)])
instance ToPath GetOperationDetail where
toPath = const "/"
instance ToQuery GetOperationDetail where
toQuery = const mempty
data GetOperationDetailResponse = GetOperationDetailResponse'
{ _godrsSubmittedDate :: !(Maybe POSIX)
, _godrsDomainName :: !(Maybe Text)
, _godrsOperationId :: !(Maybe Text)
, _godrsType :: !(Maybe OperationType)
, _godrsMessage :: !(Maybe Text)
, _godrsStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getOperationDetailResponse
:: Int
-> GetOperationDetailResponse
getOperationDetailResponse pStatus_ =
GetOperationDetailResponse'
{ _godrsSubmittedDate = Nothing
, _godrsDomainName = Nothing
, _godrsOperationId = Nothing
, _godrsType = Nothing
, _godrsMessage = Nothing
, _godrsStatus = pStatus_
}
godrsSubmittedDate :: Lens' GetOperationDetailResponse (Maybe UTCTime)
godrsSubmittedDate = lens _godrsSubmittedDate (\ s a -> s{_godrsSubmittedDate = a}) . mapping _Time;
godrsDomainName :: Lens' GetOperationDetailResponse (Maybe Text)
godrsDomainName = lens _godrsDomainName (\ s a -> s{_godrsDomainName = a});
godrsOperationId :: Lens' GetOperationDetailResponse (Maybe Text)
godrsOperationId = lens _godrsOperationId (\ s a -> s{_godrsOperationId = a});
godrsType :: Lens' GetOperationDetailResponse (Maybe OperationType)
godrsType = lens _godrsType (\ s a -> s{_godrsType = a});
godrsMessage :: Lens' GetOperationDetailResponse (Maybe Text)
godrsMessage = lens _godrsMessage (\ s a -> s{_godrsMessage = a});
godrsStatus :: Lens' GetOperationDetailResponse Int
godrsStatus = lens _godrsStatus (\ s a -> s{_godrsStatus = a});