module Network.AWS.DeviceFarm.ScheduleRun
(
scheduleRun
, ScheduleRun
, srName
, srConfiguration
, srProjectARN
, srAppARN
, srDevicePoolARN
, srTest
, scheduleRunResponse
, ScheduleRunResponse
, srrsRun
, srrsResponseStatus
) where
import Network.AWS.DeviceFarm.Types
import Network.AWS.DeviceFarm.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data ScheduleRun = ScheduleRun'
{ _srName :: !(Maybe Text)
, _srConfiguration :: !(Maybe ScheduleRunConfiguration)
, _srProjectARN :: !Text
, _srAppARN :: !Text
, _srDevicePoolARN :: !Text
, _srTest :: !ScheduleRunTest
} deriving (Eq,Read,Show,Data,Typeable,Generic)
scheduleRun
:: Text
-> Text
-> Text
-> ScheduleRunTest
-> ScheduleRun
scheduleRun pProjectARN_ pAppARN_ pDevicePoolARN_ pTest_ =
ScheduleRun'
{ _srName = Nothing
, _srConfiguration = Nothing
, _srProjectARN = pProjectARN_
, _srAppARN = pAppARN_
, _srDevicePoolARN = pDevicePoolARN_
, _srTest = pTest_
}
srName :: Lens' ScheduleRun (Maybe Text)
srName = lens _srName (\ s a -> s{_srName = a});
srConfiguration :: Lens' ScheduleRun (Maybe ScheduleRunConfiguration)
srConfiguration = lens _srConfiguration (\ s a -> s{_srConfiguration = a});
srProjectARN :: Lens' ScheduleRun Text
srProjectARN = lens _srProjectARN (\ s a -> s{_srProjectARN = a});
srAppARN :: Lens' ScheduleRun Text
srAppARN = lens _srAppARN (\ s a -> s{_srAppARN = a});
srDevicePoolARN :: Lens' ScheduleRun Text
srDevicePoolARN = lens _srDevicePoolARN (\ s a -> s{_srDevicePoolARN = a});
srTest :: Lens' ScheduleRun ScheduleRunTest
srTest = lens _srTest (\ s a -> s{_srTest = a});
instance AWSRequest ScheduleRun where
type Rs ScheduleRun = ScheduleRunResponse
request = postJSON deviceFarm
response
= receiveJSON
(\ s h x ->
ScheduleRunResponse' <$>
(x .?> "run") <*> (pure (fromEnum s)))
instance ToHeaders ScheduleRun where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("DeviceFarm_20150623.ScheduleRun" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON ScheduleRun where
toJSON ScheduleRun'{..}
= object
(catMaybes
[("name" .=) <$> _srName,
("configuration" .=) <$> _srConfiguration,
Just ("projectArn" .= _srProjectARN),
Just ("appArn" .= _srAppARN),
Just ("devicePoolArn" .= _srDevicePoolARN),
Just ("test" .= _srTest)])
instance ToPath ScheduleRun where
toPath = const "/"
instance ToQuery ScheduleRun where
toQuery = const mempty
data ScheduleRunResponse = ScheduleRunResponse'
{ _srrsRun :: !(Maybe Run)
, _srrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
scheduleRunResponse
:: Int
-> ScheduleRunResponse
scheduleRunResponse pResponseStatus_ =
ScheduleRunResponse'
{ _srrsRun = Nothing
, _srrsResponseStatus = pResponseStatus_
}
srrsRun :: Lens' ScheduleRunResponse (Maybe Run)
srrsRun = lens _srrsRun (\ s a -> s{_srrsRun = a});
srrsResponseStatus :: Lens' ScheduleRunResponse Int
srrsResponseStatus = lens _srrsResponseStatus (\ s a -> s{_srrsResponseStatus = a});