updatePackage method

Future<UpdatePackageResponse> updatePackage({
  1. required String packageID,
  2. required PackageSource packageSource,
  3. String? commitMessage,
  4. String? packageDescription,
})

Updates a package for use with Amazon ES domains.

May throw BaseException. May throw InternalException. May throw LimitExceededException. May throw ResourceNotFoundException. May throw AccessDeniedException. May throw ValidationException.

Parameter packageID : Unique identifier for the package.

Parameter commitMessage : An info message for the new version which will be shown as part of GetPackageVersionHistoryResponse.

Parameter packageDescription : New description of the package.

Implementation

Future<UpdatePackageResponse> updatePackage({
  required String packageID,
  required PackageSource packageSource,
  String? commitMessage,
  String? packageDescription,
}) async {
  ArgumentError.checkNotNull(packageID, 'packageID');
  ArgumentError.checkNotNull(packageSource, 'packageSource');
  _s.validateStringLength(
    'commitMessage',
    commitMessage,
    0,
    160,
  );
  _s.validateStringLength(
    'packageDescription',
    packageDescription,
    0,
    1024,
  );
  final $payload = <String, dynamic>{
    'PackageID': packageID,
    'PackageSource': packageSource,
    if (commitMessage != null) 'CommitMessage': commitMessage,
    if (packageDescription != null) 'PackageDescription': packageDescription,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/2015-01-01/packages/update',
    exceptionFnMap: _exceptionFns,
  );
  return UpdatePackageResponse.fromJson(response);
}