getProjectsBySlugDeploymentsById method

Future<ProjectsDeployment?> getProjectsBySlugDeploymentsById(
  1. String slug,
  2. String id
)

Returns one deployment of a project by id.

Returns one deployment of a project by id. It is how a console follows a build: the status (queued, uploading, live, error), the message a failure left, and the URL and prefix it went live at. Like the history, it never replays the upload grant. Scope: a validated principal is required (403 without one). Both the project and the deployment are resolved within that principal's org, so a deployment of another project — or of another tenant — is a 404.

Parameters:

  • String slug (required): Slug is the project the deployment belongs to, from the path.

  • String id (required): ID is the deployment id, from the path. A deployment of another project — or of another tenant's project — is not found.

Implementation

Future<ProjectsDeployment?> getProjectsBySlugDeploymentsById(String slug, String id,) async {
  final response = await getProjectsBySlugDeploymentsByIdWithHttpInfo(slug, id,);
  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;
}