{-# 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.Comprehend.StartTopicsDetectionJob
(
startTopicsDetectionJob
, StartTopicsDetectionJob
, stdjJobName
, stdjNumberOfTopics
, stdjClientRequestToken
, stdjInputDataConfig
, stdjOutputDataConfig
, stdjDataAccessRoleARN
, startTopicsDetectionJobResponse
, StartTopicsDetectionJobResponse
, stdjrsJobId
, stdjrsJobStatus
, stdjrsResponseStatus
) where
import Network.AWS.Comprehend.Types
import Network.AWS.Comprehend.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data StartTopicsDetectionJob = StartTopicsDetectionJob'
{ _stdjJobName :: !(Maybe Text)
, _stdjNumberOfTopics :: !(Maybe Nat)
, _stdjClientRequestToken :: !(Maybe Text)
, _stdjInputDataConfig :: !InputDataConfig
, _stdjOutputDataConfig :: !OutputDataConfig
, _stdjDataAccessRoleARN :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
startTopicsDetectionJob
:: InputDataConfig
-> OutputDataConfig
-> Text
-> StartTopicsDetectionJob
startTopicsDetectionJob pInputDataConfig_ pOutputDataConfig_ pDataAccessRoleARN_ =
StartTopicsDetectionJob'
{ _stdjJobName = Nothing
, _stdjNumberOfTopics = Nothing
, _stdjClientRequestToken = Nothing
, _stdjInputDataConfig = pInputDataConfig_
, _stdjOutputDataConfig = pOutputDataConfig_
, _stdjDataAccessRoleARN = pDataAccessRoleARN_
}
stdjJobName :: Lens' StartTopicsDetectionJob (Maybe Text)
stdjJobName = lens _stdjJobName (\ s a -> s{_stdjJobName = a})
stdjNumberOfTopics :: Lens' StartTopicsDetectionJob (Maybe Natural)
stdjNumberOfTopics = lens _stdjNumberOfTopics (\ s a -> s{_stdjNumberOfTopics = a}) . mapping _Nat
stdjClientRequestToken :: Lens' StartTopicsDetectionJob (Maybe Text)
stdjClientRequestToken = lens _stdjClientRequestToken (\ s a -> s{_stdjClientRequestToken = a})
stdjInputDataConfig :: Lens' StartTopicsDetectionJob InputDataConfig
stdjInputDataConfig = lens _stdjInputDataConfig (\ s a -> s{_stdjInputDataConfig = a})
stdjOutputDataConfig :: Lens' StartTopicsDetectionJob OutputDataConfig
stdjOutputDataConfig = lens _stdjOutputDataConfig (\ s a -> s{_stdjOutputDataConfig = a})
stdjDataAccessRoleARN :: Lens' StartTopicsDetectionJob Text
stdjDataAccessRoleARN = lens _stdjDataAccessRoleARN (\ s a -> s{_stdjDataAccessRoleARN = a})
instance AWSRequest StartTopicsDetectionJob where
type Rs StartTopicsDetectionJob =
StartTopicsDetectionJobResponse
request = postJSON comprehend
response
= receiveJSON
(\ s h x ->
StartTopicsDetectionJobResponse' <$>
(x .?> "JobId") <*> (x .?> "JobStatus") <*>
(pure (fromEnum s)))
instance Hashable StartTopicsDetectionJob where
instance NFData StartTopicsDetectionJob where
instance ToHeaders StartTopicsDetectionJob where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("Comprehend_20171127.StartTopicsDetectionJob" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON StartTopicsDetectionJob where
toJSON StartTopicsDetectionJob'{..}
= object
(catMaybes
[("JobName" .=) <$> _stdjJobName,
("NumberOfTopics" .=) <$> _stdjNumberOfTopics,
("ClientRequestToken" .=) <$>
_stdjClientRequestToken,
Just ("InputDataConfig" .= _stdjInputDataConfig),
Just ("OutputDataConfig" .= _stdjOutputDataConfig),
Just
("DataAccessRoleArn" .= _stdjDataAccessRoleARN)])
instance ToPath StartTopicsDetectionJob where
toPath = const "/"
instance ToQuery StartTopicsDetectionJob where
toQuery = const mempty
data StartTopicsDetectionJobResponse = StartTopicsDetectionJobResponse'
{ _stdjrsJobId :: !(Maybe Text)
, _stdjrsJobStatus :: !(Maybe JobStatus)
, _stdjrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
startTopicsDetectionJobResponse
:: Int
-> StartTopicsDetectionJobResponse
startTopicsDetectionJobResponse pResponseStatus_ =
StartTopicsDetectionJobResponse'
{ _stdjrsJobId = Nothing
, _stdjrsJobStatus = Nothing
, _stdjrsResponseStatus = pResponseStatus_
}
stdjrsJobId :: Lens' StartTopicsDetectionJobResponse (Maybe Text)
stdjrsJobId = lens _stdjrsJobId (\ s a -> s{_stdjrsJobId = a})
stdjrsJobStatus :: Lens' StartTopicsDetectionJobResponse (Maybe JobStatus)
stdjrsJobStatus = lens _stdjrsJobStatus (\ s a -> s{_stdjrsJobStatus = a})
stdjrsResponseStatus :: Lens' StartTopicsDetectionJobResponse Int
stdjrsResponseStatus = lens _stdjrsResponseStatus (\ s a -> s{_stdjrsResponseStatus = a})
instance NFData StartTopicsDetectionJobResponse where