postProjectsSitesDeploy method

Future<ProjectsSiteDeploy?> postProjectsSitesDeploy(
  1. ProjectsDeploySite projectsDeploySite
)

Deploys a caller-supplied file manifest — the deploy_site capability an agent calls — and answers with where it went live.

Deploys a caller-supplied file manifest — the deploy_site capability an agent calls — and answers with where it went live. files is a list of {path, content} pairs, the same shape the brief build emits, and it runs through the SAME guards: index.html required at the root, absolute and traversal paths rejected, per-file and total size capped, and a mobile viewport meta tag injected into every HTML document that lacks one — so a hand-built site is exactly as safe and as responsive as a generated one. slug and name are optional; a slug is derived from the name or minted. It writes into the SAME org-scoped store as /v1/projects, ensuring a project (framework static) for the resolved slug and recording a deployment. The hosting gate runs before the upload and the debit lands once, after the site is live — a failed upload is never billed. Answers 503 when object storage is unconfigured. Scope: a validated principal is required (403 without one) and the site is published into THAT principal's org.

Parameters:

Implementation

Future<ProjectsSiteDeploy?> postProjectsSitesDeploy(ProjectsDeploySite projectsDeploySite,) async {
  final response = await postProjectsSitesDeployWithHttpInfo(projectsDeploySite,);
  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), 'ProjectsSiteDeploy',) as ProjectsSiteDeploy;

  }
  return null;
}