module Network.AWS.DirectoryService.VerifyTrust
(
verifyTrust
, VerifyTrust
, vtTrustId
, verifyTrustResponse
, VerifyTrustResponse
, vtrsTrustId
, vtrsResponseStatus
) where
import Network.AWS.DirectoryService.Types
import Network.AWS.DirectoryService.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype VerifyTrust = VerifyTrust'
{ _vtTrustId :: Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
verifyTrust
:: Text
-> VerifyTrust
verifyTrust pTrustId_ =
VerifyTrust'
{ _vtTrustId = pTrustId_
}
vtTrustId :: Lens' VerifyTrust Text
vtTrustId = lens _vtTrustId (\ s a -> s{_vtTrustId = a});
instance AWSRequest VerifyTrust where
type Rs VerifyTrust = VerifyTrustResponse
request = postJSON directoryService
response
= receiveJSON
(\ s h x ->
VerifyTrustResponse' <$>
(x .?> "TrustId") <*> (pure (fromEnum s)))
instance Hashable VerifyTrust
instance NFData VerifyTrust
instance ToHeaders VerifyTrust where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("DirectoryService_20150416.VerifyTrust" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON VerifyTrust where
toJSON VerifyTrust'{..}
= object (catMaybes [Just ("TrustId" .= _vtTrustId)])
instance ToPath VerifyTrust where
toPath = const "/"
instance ToQuery VerifyTrust where
toQuery = const mempty
data VerifyTrustResponse = VerifyTrustResponse'
{ _vtrsTrustId :: !(Maybe Text)
, _vtrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
verifyTrustResponse
:: Int
-> VerifyTrustResponse
verifyTrustResponse pResponseStatus_ =
VerifyTrustResponse'
{ _vtrsTrustId = Nothing
, _vtrsResponseStatus = pResponseStatus_
}
vtrsTrustId :: Lens' VerifyTrustResponse (Maybe Text)
vtrsTrustId = lens _vtrsTrustId (\ s a -> s{_vtrsTrustId = a});
vtrsResponseStatus :: Lens' VerifyTrustResponse Int
vtrsResponseStatus = lens _vtrsResponseStatus (\ s a -> s{_vtrsResponseStatus = a});
instance NFData VerifyTrustResponse