{-# 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.DescribeTopicsDetectionJob
(
describeTopicsDetectionJob
, DescribeTopicsDetectionJob
, dtdjJobId
, describeTopicsDetectionJobResponse
, DescribeTopicsDetectionJobResponse
, dtdjrsTopicsDetectionJobProperties
, dtdjrsResponseStatus
) 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
newtype DescribeTopicsDetectionJob = DescribeTopicsDetectionJob'
{ _dtdjJobId :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
describeTopicsDetectionJob
:: Text
-> DescribeTopicsDetectionJob
describeTopicsDetectionJob pJobId_ =
DescribeTopicsDetectionJob' {_dtdjJobId = pJobId_}
dtdjJobId :: Lens' DescribeTopicsDetectionJob Text
dtdjJobId = lens _dtdjJobId (\ s a -> s{_dtdjJobId = a})
instance AWSRequest DescribeTopicsDetectionJob where
type Rs DescribeTopicsDetectionJob =
DescribeTopicsDetectionJobResponse
request = postJSON comprehend
response
= receiveJSON
(\ s h x ->
DescribeTopicsDetectionJobResponse' <$>
(x .?> "TopicsDetectionJobProperties") <*>
(pure (fromEnum s)))
instance Hashable DescribeTopicsDetectionJob where
instance NFData DescribeTopicsDetectionJob where
instance ToHeaders DescribeTopicsDetectionJob where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("Comprehend_20171127.DescribeTopicsDetectionJob" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DescribeTopicsDetectionJob where
toJSON DescribeTopicsDetectionJob'{..}
= object (catMaybes [Just ("JobId" .= _dtdjJobId)])
instance ToPath DescribeTopicsDetectionJob where
toPath = const "/"
instance ToQuery DescribeTopicsDetectionJob where
toQuery = const mempty
data DescribeTopicsDetectionJobResponse = DescribeTopicsDetectionJobResponse'
{ _dtdjrsTopicsDetectionJobProperties :: !(Maybe TopicsDetectionJobProperties)
, _dtdjrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
describeTopicsDetectionJobResponse
:: Int
-> DescribeTopicsDetectionJobResponse
describeTopicsDetectionJobResponse pResponseStatus_ =
DescribeTopicsDetectionJobResponse'
{ _dtdjrsTopicsDetectionJobProperties = Nothing
, _dtdjrsResponseStatus = pResponseStatus_
}
dtdjrsTopicsDetectionJobProperties :: Lens' DescribeTopicsDetectionJobResponse (Maybe TopicsDetectionJobProperties)
dtdjrsTopicsDetectionJobProperties = lens _dtdjrsTopicsDetectionJobProperties (\ s a -> s{_dtdjrsTopicsDetectionJobProperties = a})
dtdjrsResponseStatus :: Lens' DescribeTopicsDetectionJobResponse Int
dtdjrsResponseStatus = lens _dtdjrsResponseStatus (\ s a -> s{_dtdjrsResponseStatus = a})
instance NFData DescribeTopicsDetectionJobResponse
where