updateProject method
Modifies the specified project name, given the project ARN and a new name.
May throw ArgumentException.
May throw LimitExceededException.
May throw NotFoundException.
May throw ServiceAccountException.
Parameter arn :
The Amazon Resource Name (ARN) of the project whose name to update.
Parameter defaultJobTimeoutMinutes :
The number of minutes a test run in the project executes before it times
out.
Parameter environmentVariables :
A set of environment variables which are used by default for all runs in
the project. These environment variables are applied to the test run
during the execution of a test spec file.
For more information about using test spec files, please see Custom test environments in AWS Device Farm.
Parameter executionRoleArn :
An IAM role to be assumed by the test host for all runs in the project.
Parameter name :
A string that represents the new name of the project that you are
updating.
Parameter vpcConfig :
The VPC security groups and subnets that are attached to a project.
Implementation
Future<UpdateProjectResult> updateProject({
required String arn,
int? defaultJobTimeoutMinutes,
List<EnvironmentVariable>? environmentVariables,
String? executionRoleArn,
String? name,
VpcConfig? vpcConfig,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'DeviceFarm_20150623.UpdateProject'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'arn': arn,
if (defaultJobTimeoutMinutes != null)
'defaultJobTimeoutMinutes': defaultJobTimeoutMinutes,
if (environmentVariables != null)
'environmentVariables': environmentVariables,
if (executionRoleArn != null) 'executionRoleArn': executionRoleArn,
if (name != null) 'name': name,
if (vpcConfig != null) 'vpcConfig': vpcConfig,
},
);
return UpdateProjectResult.fromJson(jsonResponse.body);
}