updateNetworkProfile method

Future<UpdateNetworkProfileResult> updateNetworkProfile({
  1. required String arn,
  2. String? description,
  3. int? downlinkBandwidthBits,
  4. int? downlinkDelayMs,
  5. int? downlinkJitterMs,
  6. int? downlinkLossPercent,
  7. String? name,
  8. NetworkProfileType? type,
  9. int? uplinkBandwidthBits,
  10. int? uplinkDelayMs,
  11. int? uplinkJitterMs,
  12. int? uplinkLossPercent,
})

Updates the network profile.

May throw ArgumentException. May throw NotFoundException. May throw LimitExceededException. May throw ServiceAccountException.

Parameter arn : The Amazon Resource Name (ARN) of the project for which you want to update network profile settings.

Parameter description : The description of the network profile about which you are returning information.

Parameter downlinkBandwidthBits : The data throughput rate in bits per second, as an integer from 0 to 104857600.

Parameter downlinkDelayMs : Delay time for all packets to destination in milliseconds as an integer from 0 to 2000.

Parameter downlinkJitterMs : Time variation in the delay of received packets in milliseconds as an integer from 0 to 2000.

Parameter downlinkLossPercent : Proportion of received packets that fail to arrive from 0 to 100 percent.

Parameter name : The name of the network profile about which you are returning information.

Parameter type : The type of network profile to return information about. Valid values are listed here.

Parameter uplinkBandwidthBits : The data throughput rate in bits per second, as an integer from 0 to 104857600.

Parameter uplinkDelayMs : Delay time for all packets to destination in milliseconds as an integer from 0 to 2000.

Parameter uplinkJitterMs : Time variation in the delay of received packets in milliseconds as an integer from 0 to 2000.

Parameter uplinkLossPercent : Proportion of transmitted packets that fail to arrive from 0 to 100 percent.

Implementation

Future<UpdateNetworkProfileResult> updateNetworkProfile({
  required String arn,
  String? description,
  int? downlinkBandwidthBits,
  int? downlinkDelayMs,
  int? downlinkJitterMs,
  int? downlinkLossPercent,
  String? name,
  NetworkProfileType? type,
  int? uplinkBandwidthBits,
  int? uplinkDelayMs,
  int? uplinkJitterMs,
  int? uplinkLossPercent,
}) async {
  ArgumentError.checkNotNull(arn, 'arn');
  _s.validateStringLength(
    'arn',
    arn,
    32,
    1011,
    isRequired: true,
  );
  _s.validateStringLength(
    'description',
    description,
    0,
    16384,
  );
  _s.validateNumRange(
    'downlinkLossPercent',
    downlinkLossPercent,
    0,
    100,
  );
  _s.validateStringLength(
    'name',
    name,
    0,
    256,
  );
  _s.validateNumRange(
    'uplinkLossPercent',
    uplinkLossPercent,
    0,
    100,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'DeviceFarm_20150623.UpdateNetworkProfile'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'arn': arn,
      if (description != null) 'description': description,
      if (downlinkBandwidthBits != null)
        'downlinkBandwidthBits': downlinkBandwidthBits,
      if (downlinkDelayMs != null) 'downlinkDelayMs': downlinkDelayMs,
      if (downlinkJitterMs != null) 'downlinkJitterMs': downlinkJitterMs,
      if (downlinkLossPercent != null)
        'downlinkLossPercent': downlinkLossPercent,
      if (name != null) 'name': name,
      if (type != null) 'type': type.toValue(),
      if (uplinkBandwidthBits != null)
        'uplinkBandwidthBits': uplinkBandwidthBits,
      if (uplinkDelayMs != null) 'uplinkDelayMs': uplinkDelayMs,
      if (uplinkJitterMs != null) 'uplinkJitterMs': uplinkJitterMs,
      if (uplinkLossPercent != null) 'uplinkLossPercent': uplinkLossPercent,
    },
  );

  return UpdateNetworkProfileResult.fromJson(jsonResponse.body);
}