{-# 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.IoT.GetJobDocument
(
getJobDocument
, GetJobDocument
, gjdJobId
, getJobDocumentResponse
, GetJobDocumentResponse
, gjdrsDocument
, gjdrsResponseStatus
) where
import Network.AWS.IoT.Types
import Network.AWS.IoT.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype GetJobDocument = GetJobDocument'
{ _gjdJobId :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getJobDocument
:: Text
-> GetJobDocument
getJobDocument pJobId_ = GetJobDocument' {_gjdJobId = pJobId_}
gjdJobId :: Lens' GetJobDocument Text
gjdJobId = lens _gjdJobId (\ s a -> s{_gjdJobId = a})
instance AWSRequest GetJobDocument where
type Rs GetJobDocument = GetJobDocumentResponse
request = get ioT
response
= receiveJSON
(\ s h x ->
GetJobDocumentResponse' <$>
(x .?> "document") <*> (pure (fromEnum s)))
instance Hashable GetJobDocument where
instance NFData GetJobDocument where
instance ToHeaders GetJobDocument where
toHeaders = const mempty
instance ToPath GetJobDocument where
toPath GetJobDocument'{..}
= mconcat ["/jobs/", toBS _gjdJobId, "/job-document"]
instance ToQuery GetJobDocument where
toQuery = const mempty
data GetJobDocumentResponse = GetJobDocumentResponse'
{ _gjdrsDocument :: !(Maybe Text)
, _gjdrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getJobDocumentResponse
:: Int
-> GetJobDocumentResponse
getJobDocumentResponse pResponseStatus_ =
GetJobDocumentResponse'
{_gjdrsDocument = Nothing, _gjdrsResponseStatus = pResponseStatus_}
gjdrsDocument :: Lens' GetJobDocumentResponse (Maybe Text)
gjdrsDocument = lens _gjdrsDocument (\ s a -> s{_gjdrsDocument = a})
gjdrsResponseStatus :: Lens' GetJobDocumentResponse Int
gjdrsResponseStatus = lens _gjdrsResponseStatus (\ s a -> s{_gjdrsResponseStatus = a})
instance NFData GetJobDocumentResponse where