{-# 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.GetOperationDetail
(
getOperationDetail
, GetOperationDetail
, godOperationId
, getOperationDetailResponse
, GetOperationDetailResponse
, godrsStatus
, godrsSubmittedDate
, godrsDomainName
, godrsOperationId
, godrsType
, godrsMessage
, godrsResponseStatus
) 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 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 .?> "Status") <*> (x .?> "SubmittedDate") <*>
(x .?> "DomainName")
<*> (x .?> "OperationId")
<*> (x .?> "Type")
<*> (x .?> "Message")
<*> (pure (fromEnum s)))
instance Hashable GetOperationDetail
instance NFData GetOperationDetail
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'
{ _godrsStatus :: !(Maybe OperationStatus)
, _godrsSubmittedDate :: !(Maybe POSIX)
, _godrsDomainName :: !(Maybe Text)
, _godrsOperationId :: !(Maybe Text)
, _godrsType :: !(Maybe OperationType)
, _godrsMessage :: !(Maybe Text)
, _godrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getOperationDetailResponse
:: Int
-> GetOperationDetailResponse
getOperationDetailResponse pResponseStatus_ =
GetOperationDetailResponse'
{ _godrsStatus = Nothing
, _godrsSubmittedDate = Nothing
, _godrsDomainName = Nothing
, _godrsOperationId = Nothing
, _godrsType = Nothing
, _godrsMessage = Nothing
, _godrsResponseStatus = pResponseStatus_
}
godrsStatus :: Lens' GetOperationDetailResponse (Maybe OperationStatus)
godrsStatus = lens _godrsStatus (\ s a -> s{_godrsStatus = a});
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});
godrsResponseStatus :: Lens' GetOperationDetailResponse Int
godrsResponseStatus = lens _godrsResponseStatus (\ s a -> s{_godrsResponseStatus = a});
instance NFData GetOperationDetailResponse