{-# 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.DeviceFarm.GetJob
(
getJob
, GetJob
, gjArn
, getJobResponse
, GetJobResponse
, gjrsJob
, gjrsResponseStatus
) where
import Network.AWS.DeviceFarm.Types
import Network.AWS.DeviceFarm.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype GetJob = GetJob'
{ _gjArn :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getJob
:: Text
-> GetJob
getJob pArn_ = GetJob' {_gjArn = pArn_}
gjArn :: Lens' GetJob Text
gjArn = lens _gjArn (\ s a -> s{_gjArn = a})
instance AWSRequest GetJob where
type Rs GetJob = GetJobResponse
request = postJSON deviceFarm
response
= receiveJSON
(\ s h x ->
GetJobResponse' <$>
(x .?> "job") <*> (pure (fromEnum s)))
instance Hashable GetJob where
instance NFData GetJob where
instance ToHeaders GetJob where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("DeviceFarm_20150623.GetJob" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON GetJob where
toJSON GetJob'{..}
= object (catMaybes [Just ("arn" .= _gjArn)])
instance ToPath GetJob where
toPath = const "/"
instance ToQuery GetJob where
toQuery = const mempty
data GetJobResponse = GetJobResponse'
{ _gjrsJob :: !(Maybe Job)
, _gjrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getJobResponse
:: Int
-> GetJobResponse
getJobResponse pResponseStatus_ =
GetJobResponse' {_gjrsJob = Nothing, _gjrsResponseStatus = pResponseStatus_}
gjrsJob :: Lens' GetJobResponse (Maybe Job)
gjrsJob = lens _gjrsJob (\ s a -> s{_gjrsJob = a})
gjrsResponseStatus :: Lens' GetJobResponse Int
gjrsResponseStatus = lens _gjrsResponseStatus (\ s a -> s{_gjrsResponseStatus = a})
instance NFData GetJobResponse where