module Network.AWS.DeviceFarm.UpdateDevicePool
(
updateDevicePool
, UpdateDevicePool
, udpRules
, udpName
, udpDescription
, udpArn
, updateDevicePoolResponse
, UpdateDevicePoolResponse
, udprsDevicePool
, udprsResponseStatus
) 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
data UpdateDevicePool = UpdateDevicePool'
{ _udpRules :: !(Maybe [Rule])
, _udpName :: !(Maybe Text)
, _udpDescription :: !(Maybe Text)
, _udpArn :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
updateDevicePool
:: Text
-> UpdateDevicePool
updateDevicePool pArn_ =
UpdateDevicePool'
{ _udpRules = Nothing
, _udpName = Nothing
, _udpDescription = Nothing
, _udpArn = pArn_
}
udpRules :: Lens' UpdateDevicePool [Rule]
udpRules = lens _udpRules (\ s a -> s{_udpRules = a}) . _Default . _Coerce;
udpName :: Lens' UpdateDevicePool (Maybe Text)
udpName = lens _udpName (\ s a -> s{_udpName = a});
udpDescription :: Lens' UpdateDevicePool (Maybe Text)
udpDescription = lens _udpDescription (\ s a -> s{_udpDescription = a});
udpArn :: Lens' UpdateDevicePool Text
udpArn = lens _udpArn (\ s a -> s{_udpArn = a});
instance AWSRequest UpdateDevicePool where
type Rs UpdateDevicePool = UpdateDevicePoolResponse
request = postJSON deviceFarm
response
= receiveJSON
(\ s h x ->
UpdateDevicePoolResponse' <$>
(x .?> "devicePool") <*> (pure (fromEnum s)))
instance Hashable UpdateDevicePool
instance NFData UpdateDevicePool
instance ToHeaders UpdateDevicePool where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("DeviceFarm_20150623.UpdateDevicePool" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON UpdateDevicePool where
toJSON UpdateDevicePool'{..}
= object
(catMaybes
[("rules" .=) <$> _udpRules,
("name" .=) <$> _udpName,
("description" .=) <$> _udpDescription,
Just ("arn" .= _udpArn)])
instance ToPath UpdateDevicePool where
toPath = const "/"
instance ToQuery UpdateDevicePool where
toQuery = const mempty
data UpdateDevicePoolResponse = UpdateDevicePoolResponse'
{ _udprsDevicePool :: !(Maybe DevicePool)
, _udprsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
updateDevicePoolResponse
:: Int
-> UpdateDevicePoolResponse
updateDevicePoolResponse pResponseStatus_ =
UpdateDevicePoolResponse'
{ _udprsDevicePool = Nothing
, _udprsResponseStatus = pResponseStatus_
}
udprsDevicePool :: Lens' UpdateDevicePoolResponse (Maybe DevicePool)
udprsDevicePool = lens _udprsDevicePool (\ s a -> s{_udprsDevicePool = a});
udprsResponseStatus :: Lens' UpdateDevicePoolResponse Int
udprsResponseStatus = lens _udprsResponseStatus (\ s a -> s{_udprsResponseStatus = a});
instance NFData UpdateDevicePoolResponse