deleteApplicationVersion method

Future<void> deleteApplicationVersion({
  1. required String applicationName,
  2. required String versionLabel,
  3. bool? deleteSourceBundle,
})

Deletes the specified version from the specified application.

May throw SourceBundleDeletionException. May throw InsufficientPrivilegesException. May throw OperationInProgressException. May throw S3LocationNotInServiceRegionException.

Parameter applicationName : The name of the application to which the version belongs.

Parameter versionLabel : The label of the version to delete.

Parameter deleteSourceBundle : Set to true to delete the source bundle from your storage bucket. Otherwise, the application version is deleted only from Elastic Beanstalk and the source bundle remains in Amazon S3.

Implementation

Future<void> deleteApplicationVersion({
  required String applicationName,
  required String versionLabel,
  bool? deleteSourceBundle,
}) async {
  ArgumentError.checkNotNull(applicationName, 'applicationName');
  _s.validateStringLength(
    'applicationName',
    applicationName,
    1,
    100,
    isRequired: true,
  );
  ArgumentError.checkNotNull(versionLabel, 'versionLabel');
  _s.validateStringLength(
    'versionLabel',
    versionLabel,
    1,
    100,
    isRequired: true,
  );
  final $request = <String, dynamic>{};
  $request['ApplicationName'] = applicationName;
  $request['VersionLabel'] = versionLabel;
  deleteSourceBundle?.also((arg) => $request['DeleteSourceBundle'] = arg);
  await _protocol.send(
    $request,
    action: 'DeleteApplicationVersion',
    version: '2010-12-01',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    shape: shapes['DeleteApplicationVersionMessage'],
    shapes: shapes,
  );
}