postPlatformProjectsByProjectAppsByAppPromote method
- String project,
- String app,
- PromoteReq promoteReq
Promotes an already-built release to the app.
Promotes an already-built release to the app. It redeploys an image that already exists — named either by deploymentId, which promotes that deployment's exact built image, or by tag, resolved the same way a deploy resolves one. One of the two is required; neither is 400. Promotion never builds. A deployment that carries no built image cannot be promoted and is 400, and a deployment id outside this app is 404. It runs through the same deploy core as everything else, so it takes a NEW version number and is subject to the same per-org concurrency cap. Requires a validated principal; 403 without one.
Parameters:
-
String project (required): Project is the project the application lives under, from the path.
-
String app (required): App is the application's slug, from the path.
-
PromoteReq promoteReq (required):
Implementation
Future<DeploymentView?> postPlatformProjectsByProjectAppsByAppPromote(String project, String app, PromoteReq promoteReq,) async {
final response = await postPlatformProjectsByProjectAppsByAppPromoteWithHttpInfo(project, app, promoteReq,);
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), 'DeploymentView',) as DeploymentView;
}
return null;
}