updateDeviceInstance method

Future<UpdateDeviceInstanceResult> updateDeviceInstance({
  1. required String arn,
  2. List<String>? labels,
  3. String? profileArn,
})

Updates information about a private device instance.

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

Parameter arn : The Amazon Resource Name (ARN) of the device instance.

Parameter labels : An array of strings that you want to associate with the device instance.

Parameter profileArn : The ARN of the profile that you want to associate with the device instance.

Implementation

Future<UpdateDeviceInstanceResult> updateDeviceInstance({
  required String arn,
  List<String>? labels,
  String? profileArn,
}) async {
  ArgumentError.checkNotNull(arn, 'arn');
  _s.validateStringLength(
    'arn',
    arn,
    32,
    1011,
    isRequired: true,
  );
  _s.validateStringLength(
    'profileArn',
    profileArn,
    32,
    1011,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'DeviceFarm_20150623.UpdateDeviceInstance'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'arn': arn,
      if (labels != null) 'labels': labels,
      if (profileArn != null) 'profileArn': profileArn,
    },
  );

  return UpdateDeviceInstanceResult.fromJson(jsonResponse.body);
}