module Network.AWS.DeviceFarm.CreateNetworkProfile
(
createNetworkProfile
, CreateNetworkProfile
, cnpUplinkJitterMs
, cnpUplinkLossPercent
, cnpDownlinkJitterMs
, cnpDownlinkLossPercent
, cnpType
, cnpUplinkDelayMs
, cnpUplinkBandwidthBits
, cnpDescription
, cnpDownlinkDelayMs
, cnpDownlinkBandwidthBits
, cnpProjectARN
, cnpName
, createNetworkProfileResponse
, CreateNetworkProfileResponse
, cnprsNetworkProfile
, cnprsResponseStatus
) 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 CreateNetworkProfile = CreateNetworkProfile'
{ _cnpUplinkJitterMs :: !(Maybe Integer)
, _cnpUplinkLossPercent :: !(Maybe Nat)
, _cnpDownlinkJitterMs :: !(Maybe Integer)
, _cnpDownlinkLossPercent :: !(Maybe Nat)
, _cnpType :: !(Maybe NetworkProfileType)
, _cnpUplinkDelayMs :: !(Maybe Integer)
, _cnpUplinkBandwidthBits :: !(Maybe Integer)
, _cnpDescription :: !(Maybe Text)
, _cnpDownlinkDelayMs :: !(Maybe Integer)
, _cnpDownlinkBandwidthBits :: !(Maybe Integer)
, _cnpProjectARN :: !Text
, _cnpName :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
createNetworkProfile
:: Text
-> Text
-> CreateNetworkProfile
createNetworkProfile pProjectARN_ pName_ =
CreateNetworkProfile'
{ _cnpUplinkJitterMs = Nothing
, _cnpUplinkLossPercent = Nothing
, _cnpDownlinkJitterMs = Nothing
, _cnpDownlinkLossPercent = Nothing
, _cnpType = Nothing
, _cnpUplinkDelayMs = Nothing
, _cnpUplinkBandwidthBits = Nothing
, _cnpDescription = Nothing
, _cnpDownlinkDelayMs = Nothing
, _cnpDownlinkBandwidthBits = Nothing
, _cnpProjectARN = pProjectARN_
, _cnpName = pName_
}
cnpUplinkJitterMs :: Lens' CreateNetworkProfile (Maybe Integer)
cnpUplinkJitterMs = lens _cnpUplinkJitterMs (\ s a -> s{_cnpUplinkJitterMs = a});
cnpUplinkLossPercent :: Lens' CreateNetworkProfile (Maybe Natural)
cnpUplinkLossPercent = lens _cnpUplinkLossPercent (\ s a -> s{_cnpUplinkLossPercent = a}) . mapping _Nat;
cnpDownlinkJitterMs :: Lens' CreateNetworkProfile (Maybe Integer)
cnpDownlinkJitterMs = lens _cnpDownlinkJitterMs (\ s a -> s{_cnpDownlinkJitterMs = a});
cnpDownlinkLossPercent :: Lens' CreateNetworkProfile (Maybe Natural)
cnpDownlinkLossPercent = lens _cnpDownlinkLossPercent (\ s a -> s{_cnpDownlinkLossPercent = a}) . mapping _Nat;
cnpType :: Lens' CreateNetworkProfile (Maybe NetworkProfileType)
cnpType = lens _cnpType (\ s a -> s{_cnpType = a});
cnpUplinkDelayMs :: Lens' CreateNetworkProfile (Maybe Integer)
cnpUplinkDelayMs = lens _cnpUplinkDelayMs (\ s a -> s{_cnpUplinkDelayMs = a});
cnpUplinkBandwidthBits :: Lens' CreateNetworkProfile (Maybe Integer)
cnpUplinkBandwidthBits = lens _cnpUplinkBandwidthBits (\ s a -> s{_cnpUplinkBandwidthBits = a});
cnpDescription :: Lens' CreateNetworkProfile (Maybe Text)
cnpDescription = lens _cnpDescription (\ s a -> s{_cnpDescription = a});
cnpDownlinkDelayMs :: Lens' CreateNetworkProfile (Maybe Integer)
cnpDownlinkDelayMs = lens _cnpDownlinkDelayMs (\ s a -> s{_cnpDownlinkDelayMs = a});
cnpDownlinkBandwidthBits :: Lens' CreateNetworkProfile (Maybe Integer)
cnpDownlinkBandwidthBits = lens _cnpDownlinkBandwidthBits (\ s a -> s{_cnpDownlinkBandwidthBits = a});
cnpProjectARN :: Lens' CreateNetworkProfile Text
cnpProjectARN = lens _cnpProjectARN (\ s a -> s{_cnpProjectARN = a});
cnpName :: Lens' CreateNetworkProfile Text
cnpName = lens _cnpName (\ s a -> s{_cnpName = a});
instance AWSRequest CreateNetworkProfile where
type Rs CreateNetworkProfile =
CreateNetworkProfileResponse
request = postJSON deviceFarm
response
= receiveJSON
(\ s h x ->
CreateNetworkProfileResponse' <$>
(x .?> "networkProfile") <*> (pure (fromEnum s)))
instance Hashable CreateNetworkProfile where
instance NFData CreateNetworkProfile where
instance ToHeaders CreateNetworkProfile where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("DeviceFarm_20150623.CreateNetworkProfile" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON CreateNetworkProfile where
toJSON CreateNetworkProfile'{..}
= object
(catMaybes
[("uplinkJitterMs" .=) <$> _cnpUplinkJitterMs,
("uplinkLossPercent" .=) <$> _cnpUplinkLossPercent,
("downlinkJitterMs" .=) <$> _cnpDownlinkJitterMs,
("downlinkLossPercent" .=) <$>
_cnpDownlinkLossPercent,
("type" .=) <$> _cnpType,
("uplinkDelayMs" .=) <$> _cnpUplinkDelayMs,
("uplinkBandwidthBits" .=) <$>
_cnpUplinkBandwidthBits,
("description" .=) <$> _cnpDescription,
("downlinkDelayMs" .=) <$> _cnpDownlinkDelayMs,
("downlinkBandwidthBits" .=) <$>
_cnpDownlinkBandwidthBits,
Just ("projectArn" .= _cnpProjectARN),
Just ("name" .= _cnpName)])
instance ToPath CreateNetworkProfile where
toPath = const "/"
instance ToQuery CreateNetworkProfile where
toQuery = const mempty
data CreateNetworkProfileResponse = CreateNetworkProfileResponse'
{ _cnprsNetworkProfile :: !(Maybe NetworkProfile)
, _cnprsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
createNetworkProfileResponse
:: Int
-> CreateNetworkProfileResponse
createNetworkProfileResponse pResponseStatus_ =
CreateNetworkProfileResponse'
{_cnprsNetworkProfile = Nothing, _cnprsResponseStatus = pResponseStatus_}
cnprsNetworkProfile :: Lens' CreateNetworkProfileResponse (Maybe NetworkProfile)
cnprsNetworkProfile = lens _cnprsNetworkProfile (\ s a -> s{_cnprsNetworkProfile = a});
cnprsResponseStatus :: Lens' CreateNetworkProfileResponse Int
cnprsResponseStatus = lens _cnprsResponseStatus (\ s a -> s{_cnprsResponseStatus = a});
instance NFData CreateNetworkProfileResponse where