postPlatformProjectsByProjectAppsByAppPreviewWithHttpInfo method

Future<Response> postPlatformProjectsByProjectAppsByAppPreviewWithHttpInfo(
  1. String project,
  2. String app,
  3. PreviewReq previewReq
)

Puts a branch on its own URL.

Puts a branch on its own URL. It deploys an already-built image to a per-branch preview and answers its URL, the branch, the preview's slug and the deployment. The preview is a FIRST-CLASS application named <app>-<branch> in the same project and tenant namespace, with its own default host — so it is completely isolated from production while reusing the same deploy mechanic. Re-previewing a branch converges that same target in place rather than stacking another one. It carries NO environment variables, deliberately: a preview never inherits production's secrets. It also does not build — image is required and must already exist, and branch defaults to the parent app's. A branch that does not resolve to a valid slug distinct from the parent's is 400. Requires a validated principal; 403 without one.

Note: This method returns the HTTP Response.

Parameters:

  • String project (required): Project is the project the parent application lives under, from the path.

  • String app (required): App is the parent application's slug, from the path.

  • PreviewReq previewReq (required):

Implementation

Future<Response> postPlatformProjectsByProjectAppsByAppPreviewWithHttpInfo(String project, String app, PreviewReq previewReq,) async {
  // ignore: prefer_const_declarations
  final path = r'/v1/platform/projects/{project}/apps/{app}/preview'
    .replaceAll('{project}', project)
    .replaceAll('{app}', app);

  // ignore: prefer_final_locals
  Object? postBody = previewReq;

  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,
  );
}