createDeployment method
Creates a deployment for a manually deployed Amplify app. Manually deployed apps are not connected to a Git repository.
The maximum duration between the CreateDeployment call and
the StartDeployment call cannot exceed 8 hours. If the
duration exceeds 8 hours, the StartDeployment call and the
associated Job will fail.
May throw BadRequestException.
May throw InternalFailureException.
May throw LimitExceededException.
May throw UnauthorizedException.
Parameter appId :
The unique ID for an Amplify app.
Parameter branchName :
The name of the branch to use for the job.
Parameter fileMap :
An optional file map that contains the file name as the key and the file
content md5 hash as the value. If this argument is provided, the service
will generate a unique upload URL per file. Otherwise, the service will
only generate a single upload URL for the zipped files.
Implementation
Future<CreateDeploymentResult> createDeployment({
required String appId,
required String branchName,
Map<String, String>? fileMap,
}) async {
final $payload = <String, dynamic>{
if (fileMap != null) 'fileMap': fileMap,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri:
'/apps/${Uri.encodeComponent(appId)}/branches/${Uri.encodeComponent(branchName)}/deployments',
exceptionFnMap: _exceptionFns,
);
return CreateDeploymentResult.fromJson(response);
}