postProjects method

Future<ProjectsProject?> postProjects(
  1. ProjectsCreate projectsCreate
)

Creates a project — the handle a site is deployed and served under — and answers 201 with it in draft.

Creates a project — the handle a site is deployed and served under — and answers 201 with it in draft. name is required; slug is derived from the name when omitted and is the identifier that matters — it becomes the S3 key segment, the public host <slug>.hanzo.app, and the handle every later call addresses, so it must match ^[a-z0-9]([a-z0-9-]{0,38}[a-z0-9])?$ and may not be a reserved label such as api or admin. framework is a build hint from a closed set, defaulting to static; it never gates a deploy, it only tells CI how to build a linked repo. Two defaults are worth knowing: the analytics beacon is ON unless analytics is explicitly false, and visibility is public unless asked otherwise. Publishing publicly is free; PRIVATE is the paid feature, and an unfunded org asking for it is refused rather than quietly published as public. Creation also provisions the project's data space and a canonical git repo, both best-effort — neither can fail the create. Scope: a validated principal is required (403 without one) and the project is created in THAT principal's org. The slug is unique per org, so a slug already used in the caller's own org is a 409 while the same slug in another org is irrelevant.

Parameters:

Implementation

Future<ProjectsProject?> postProjects(ProjectsCreate projectsCreate,) async {
  final response = await postProjectsWithHttpInfo(projectsCreate,);
  if (response.statusCode >= HttpStatus.badRequest) {
    throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  }
  // When a remote server returns no body with a status of 204, we shall not decode it.
  // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  // FormatException when trying to decode an empty string.
  if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
    return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ProjectsProject',) as ProjectsProject;

  }
  return null;
}