updateInstanceProfile method

Future<UpdateInstanceProfileResult> updateInstanceProfile({
  1. required String arn,
  2. String? description,
  3. List<String>? excludeAppPackagesFromCleanup,
  4. String? name,
  5. bool? packageCleanup,
  6. bool? rebootAfterUse,
})

Updates information about an existing private device instance profile.

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

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

Parameter description : The updated description for your instance profile.

Parameter excludeAppPackagesFromCleanup : An array of strings that specifies the list of app packages that should not be cleaned up from the device after a test run is over.

The list of packages is only considered if you set packageCleanup to true.

Parameter name : The updated name for your instance profile.

Parameter packageCleanup : The updated choice for whether you want to specify package cleanup. The default value is false for private devices.

Parameter rebootAfterUse : The updated choice for whether you want to reboot the device after use. The default value is true.

Implementation

Future<UpdateInstanceProfileResult> updateInstanceProfile({
  required String arn,
  String? description,
  List<String>? excludeAppPackagesFromCleanup,
  String? name,
  bool? packageCleanup,
  bool? rebootAfterUse,
}) async {
  ArgumentError.checkNotNull(arn, 'arn');
  _s.validateStringLength(
    'arn',
    arn,
    32,
    1011,
    isRequired: true,
  );
  _s.validateStringLength(
    'description',
    description,
    0,
    16384,
  );
  _s.validateStringLength(
    'name',
    name,
    0,
    256,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'DeviceFarm_20150623.UpdateInstanceProfile'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'arn': arn,
      if (description != null) 'description': description,
      if (excludeAppPackagesFromCleanup != null)
        'excludeAppPackagesFromCleanup': excludeAppPackagesFromCleanup,
      if (name != null) 'name': name,
      if (packageCleanup != null) 'packageCleanup': packageCleanup,
      if (rebootAfterUse != null) 'rebootAfterUse': rebootAfterUse,
    },
  );

  return UpdateInstanceProfileResult.fromJson(jsonResponse.body);
}