updatePackage method
Future<UpdatePackageResponse>
updatePackage({
- required String packageID,
- required PackageSource packageSource,
- String? commitMessage,
- String? packageDescription,
Updates a package for use with Amazon OpenSearch Service domains.
May throw BaseException. May throw InternalException. May throw LimitExceededException. May throw ResourceNotFoundException. May throw AccessDeniedException. May throw ValidationException.
Parameter packageID
:
The unique identifier for the package.
Parameter commitMessage
:
A commit message for the new version which is shown as part of
GetPackageVersionHistoryResponse
.
Parameter packageDescription
:
A 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: '/2021-01-01/packages/update',
exceptionFnMap: _exceptionFns,
);
return UpdatePackageResponse.fromJson(response);
}