createTestGridProject method

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

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

May throw InternalServiceException.

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

Parameter description : Human-readable description of the project.

Implementation

Future<CreateTestGridProjectResult> createTestGridProject({
  required String name,
  String? description,
}) async {
  ArgumentError.checkNotNull(name, 'name');
  _s.validateStringLength(
    'name',
    name,
    1,
    64,
    isRequired: true,
  );
  _s.validateStringLength(
    'description',
    description,
    1,
    2048,
  );
  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,
    },
  );

  return CreateTestGridProjectResult.fromJson(jsonResponse.body);
}