module Network.AWS.DeviceFarm.CreateDevicePool
(
createDevicePool
, CreateDevicePool
, cdpDescription
, cdpProjectARN
, cdpName
, cdpRules
, createDevicePoolResponse
, CreateDevicePoolResponse
, cdprsDevicePool
, cdprsStatus
) 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 CreateDevicePool = CreateDevicePool'
{ _cdpDescription :: !(Maybe Text)
, _cdpProjectARN :: !Text
, _cdpName :: !Text
, _cdpRules :: ![Rule]
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createDevicePool
:: Text
-> Text
-> CreateDevicePool
createDevicePool pProjectARN_ pName_ =
CreateDevicePool'
{ _cdpDescription = Nothing
, _cdpProjectARN = pProjectARN_
, _cdpName = pName_
, _cdpRules = mempty
}
cdpDescription :: Lens' CreateDevicePool (Maybe Text)
cdpDescription = lens _cdpDescription (\ s a -> s{_cdpDescription = a});
cdpProjectARN :: Lens' CreateDevicePool Text
cdpProjectARN = lens _cdpProjectARN (\ s a -> s{_cdpProjectARN = a});
cdpName :: Lens' CreateDevicePool Text
cdpName = lens _cdpName (\ s a -> s{_cdpName = a});
cdpRules :: Lens' CreateDevicePool [Rule]
cdpRules = lens _cdpRules (\ s a -> s{_cdpRules = a}) . _Coerce;
instance AWSRequest CreateDevicePool where
type Sv CreateDevicePool = DeviceFarm
type Rs CreateDevicePool = CreateDevicePoolResponse
request = postJSON
response
= receiveJSON
(\ s h x ->
CreateDevicePoolResponse' <$>
(x .?> "devicePool") <*> (pure (fromEnum s)))
instance ToHeaders CreateDevicePool where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("DeviceFarm_20150623.CreateDevicePool" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON CreateDevicePool where
toJSON CreateDevicePool'{..}
= object
["description" .= _cdpDescription,
"projectArn" .= _cdpProjectARN, "name" .= _cdpName,
"rules" .= _cdpRules]
instance ToPath CreateDevicePool where
toPath = const "/"
instance ToQuery CreateDevicePool where
toQuery = const mempty
data CreateDevicePoolResponse = CreateDevicePoolResponse'
{ _cdprsDevicePool :: !(Maybe DevicePool)
, _cdprsStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createDevicePoolResponse
:: Int
-> CreateDevicePoolResponse
createDevicePoolResponse pStatus_ =
CreateDevicePoolResponse'
{ _cdprsDevicePool = Nothing
, _cdprsStatus = pStatus_
}
cdprsDevicePool :: Lens' CreateDevicePoolResponse (Maybe DevicePool)
cdprsDevicePool = lens _cdprsDevicePool (\ s a -> s{_cdprsDevicePool = a});
cdprsStatus :: Lens' CreateDevicePoolResponse Int
cdprsStatus = lens _cdprsStatus (\ s a -> s{_cdprsStatus = a});