createProject method

Future<CreateProjectResponse> createProject({
  1. required String projectName,
})

Creates a new Amazon Rekognition Custom Labels project. A project is a logical grouping of resources (images, Labels, models) and operations (training, evaluation and detection).

This operation requires permissions to perform the rekognition:CreateProject action.

May throw ResourceInUseException. May throw LimitExceededException. May throw InvalidParameterException. May throw AccessDeniedException. May throw InternalServerError. May throw ThrottlingException. May throw ProvisionedThroughputExceededException.

Parameter projectName : The name of the project to create.

Implementation

Future<CreateProjectResponse> createProject({
  required String projectName,
}) async {
  ArgumentError.checkNotNull(projectName, 'projectName');
  _s.validateStringLength(
    'projectName',
    projectName,
    1,
    255,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'RekognitionService.CreateProject'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ProjectName': projectName,
    },
  );

  return CreateProjectResponse.fromJson(jsonResponse.body);
}