createTestGridProject method

Future<CreateTestGridProjectResult> createTestGridProject({
  1. required String name,
  2. String? description,
  3. TestGridVpcConfig? vpcConfig,
})

Creates a Selenium testing project. Projects are used to track TestGridSession instances.

May throw ArgumentException. May throw InternalServiceException. May throw LimitExceededException.

Parameter name : Human-readable name of the Selenium testing project.

Parameter description : Human-readable description of the project.

Parameter vpcConfig : The VPC security groups and subnets that are attached to a project.

Implementation

Future<CreateTestGridProjectResult> createTestGridProject({
  required String name,
  String? description,
  TestGridVpcConfig? vpcConfig,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'DeviceFarm_20150623.CreateTestGridProject'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'name': name,
      if (description != null) 'description': description,
      if (vpcConfig != null) 'vpcConfig': vpcConfig,
    },
  );

  return CreateTestGridProjectResult.fromJson(jsonResponse.body);
}