{-# 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.StopRun
(
stopRun
, StopRun
, srArn
, stopRunResponse
, StopRunResponse
, srsRun
, srsResponseStatus
) 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 StopRun = StopRun'
{ _srArn :: Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
stopRun
:: Text
-> StopRun
stopRun pArn_ =
StopRun'
{ _srArn = pArn_
}
srArn :: Lens' StopRun Text
srArn = lens _srArn (\ s a -> s{_srArn = a});
instance AWSRequest StopRun where
type Rs StopRun = StopRunResponse
request = postJSON deviceFarm
response
= receiveJSON
(\ s h x ->
StopRunResponse' <$>
(x .?> "run") <*> (pure (fromEnum s)))
instance Hashable StopRun
instance NFData StopRun
instance ToHeaders StopRun where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("DeviceFarm_20150623.StopRun" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON StopRun where
toJSON StopRun'{..}
= object (catMaybes [Just ("arn" .= _srArn)])
instance ToPath StopRun where
toPath = const "/"
instance ToQuery StopRun where
toQuery = const mempty
data StopRunResponse = StopRunResponse'
{ _srsRun :: !(Maybe Run)
, _srsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
stopRunResponse
:: Int
-> StopRunResponse
stopRunResponse pResponseStatus_ =
StopRunResponse'
{ _srsRun = Nothing
, _srsResponseStatus = pResponseStatus_
}
srsRun :: Lens' StopRunResponse (Maybe Run)
srsRun = lens _srsRun (\ s a -> s{_srsRun = a});
srsResponseStatus :: Lens' StopRunResponse Int
srsResponseStatus = lens _srsResponseStatus (\ s a -> s{_srsResponseStatus = a});
instance NFData StopRunResponse