postProjectsBySlugPublishWithHttpInfo method

Future<Response> postProjectsBySlugPublishWithHttpInfo(
  1. String slug,
  2. ProjectsPublish projectsPublish
)

Promotes a build output into a new release AND goes live with it — create+activate in one call, which is the 99% path.

Promotes a build output into a new release AND goes live with it — create+activate in one call, which is the 99% path. It is exactly the two halves in sequence with no extra semantics, so the staged flow and the one-shot flow can never drift apart: source is promoted under the same org-relative rule and the same guards CreateRelease applies, then the site's pointer is flipped to it, the public host is claimed and the edge is purged. Idempotent on unchanged bytes — same manifest, same release id, no copy — and billed once, after the release exists. Scope: a validated principal is required (403 without one) and the site is resolved within that principal's org, so another tenant's slug is a 404.

Note: This method returns the HTTP Response.

Parameters:

  • String slug (required): Slug is the site to publish, from the path.

  • ProjectsPublish projectsPublish (required):

Implementation

Future<Response> postProjectsBySlugPublishWithHttpInfo(String slug, ProjectsPublish projectsPublish,) async {
  // ignore: prefer_const_declarations
  final path = r'/v1/projects/{slug}/publish'
    .replaceAll('{slug}', slug);

  // ignore: prefer_final_locals
  Object? postBody = projectsPublish;

  final queryParams = <QueryParam>[];
  final headerParams = <String, String>{};
  final formParams = <String, String>{};

  const contentTypes = <String>['application/json'];


  return apiClient.invokeAPI(
    path,
    'POST',
    queryParams,
    postBody,
    headerParams,
    formParams,
    contentTypes.isEmpty ? null : contentTypes.first,
  );
}