updatePackage method

Future<UpdatePackageResponse> updatePackage({
  1. required String packageID,
  2. required PackageSource packageSource,
  3. String? commitMessage,
  4. PackageConfiguration? packageConfiguration,
  5. String? packageDescription,
  6. PackageEncryptionOptions? packageEncryptionOptions,
})

Updates a package for use with Amazon OpenSearch Service domains. For more information, see Custom packages for Amazon OpenSearch Service.

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

Parameter packageID : The unique identifier for the package.

Parameter packageSource : Amazon S3 bucket and key for the package.

Parameter commitMessage : Commit message for the updated file, which is shown as part of GetPackageVersionHistoryResponse.

Parameter packageConfiguration : The updated configuration details for a package.

Parameter packageDescription : A new description of the package.

Parameter packageEncryptionOptions : Encryption options for a package.

Implementation

Future<UpdatePackageResponse> updatePackage({
  required String packageID,
  required PackageSource packageSource,
  String? commitMessage,
  PackageConfiguration? packageConfiguration,
  String? packageDescription,
  PackageEncryptionOptions? packageEncryptionOptions,
}) async {
  final $payload = <String, dynamic>{
    'PackageID': packageID,
    'PackageSource': packageSource,
    if (commitMessage != null) 'CommitMessage': commitMessage,
    if (packageConfiguration != null)
      'PackageConfiguration': packageConfiguration,
    if (packageDescription != null) 'PackageDescription': packageDescription,
    if (packageEncryptionOptions != null)
      'PackageEncryptionOptions': packageEncryptionOptions,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/2021-01-01/packages/update',
    exceptionFnMap: _exceptionFns,
  );
  return UpdatePackageResponse.fromJson(response);
}