createProject method
Creates a project.
May throw ArgumentException. May throw NotFoundException. May throw LimitExceededException. May throw ServiceAccountException. May throw TagOperationException.
Parameter name
:
The project's name.
Parameter defaultJobTimeoutMinutes
:
Sets the execution timeout value (in minutes) for a project. All test runs
in this project use the specified execution timeout value unless
overridden when scheduling a run.
Implementation
Future<CreateProjectResult> createProject({
required String name,
int? defaultJobTimeoutMinutes,
}) async {
ArgumentError.checkNotNull(name, 'name');
_s.validateStringLength(
'name',
name,
0,
256,
isRequired: true,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'DeviceFarm_20150623.CreateProject'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'name': name,
if (defaultJobTimeoutMinutes != null)
'defaultJobTimeoutMinutes': defaultJobTimeoutMinutes,
},
);
return CreateProjectResult.fromJson(jsonResponse.body);
}