createProject method
inherited
Creates a new project.
name must be URL-safe (alphanumeric with hyphens).
description is an optional human-readable description.
Throws a gRPC error if the project already exists.
Throws a ProjectLimitError if the server returns RESOURCE_EXHAUSTED
(for example, when the project limit has been reached).
Implementation
Future<ProjectResponse> createProject(
String name, {
String? description,
}) async {
final request =
CreateProjectRequest()
..name = name
..description = description ?? '';
try {
return await stub.createProject(request, options: callOptions);
} on GrpcError catch (e) {
if (e.code == StatusCode.resourceExhausted) {
throw ProjectLimitError(e.message ?? 'Project limit reached');
}
rethrow;
}
}