postProjectsBySlugDeploymentsByIdComplete method
- String slug,
- String id,
- ProjectsComplete projectsComplete
CompleteDeployment is the CI completion hook that flips a queued git deployment to live (or error) once CI has synced the built site to S3.
CompleteDeployment is the CI completion hook that flips a queued git deployment to live (or error) once CI has synced the built site to S3. status must be live or error. On a LIVE completion the public host is claimed FIRST, so the deployment reports the URL it actually OWNS — a CI-supplied liveUrl is a hint that can refine that URL but can never assert a subdomain another tenant holds. keys is the manifest CI just uploaded, relative to the deployment prefix: cloud reconciles the prefix against it so a page deleted from the build actually stops serving. Omit keys and nothing is deleted — the prefix only grows. Reconciliation runs only on a live completion (pruning against a failed build's manifest would delete the site the last good build is still serving) and is best-effort, so a stale leftover never turns a successful deploy into a 500. A live completion is also the one billable moment on the git path; an error completion bills nothing. Scope: a validated principal is required (403 without one). CI authenticates with an org-scoped token through the gateway, so the deployment is resolved within that principal's org and another tenant's slug or deployment id is a 404.
Parameters:
-
String slug (required): Slug is the project the deployment belongs to, from the path.
-
String id (required): ID is the queued deployment to complete, from the path.
-
ProjectsComplete projectsComplete (required):
Implementation
Future<ProjectsDeployment?> postProjectsBySlugDeploymentsByIdComplete(String slug, String id, ProjectsComplete projectsComplete,) async {
final response = await postProjectsBySlugDeploymentsByIdCompleteWithHttpInfo(slug, id, projectsComplete,);
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), 'ProjectsDeployment',) as ProjectsDeployment;
}
return null;
}