createPackage method
Create a package for use with Amazon ES domains.
May throw AccessDeniedException.
May throw BaseException.
May throw InternalException.
May throw InvalidTypeException.
May throw LimitExceededException.
May throw ResourceAlreadyExistsException.
May throw ValidationException.
Parameter packageName :
Unique identifier for the package.
Parameter packageSource :
The customer S3 location PackageSource for importing the
package.
Parameter packageType :
Type of package. Currently supports only TXT-DICTIONARY.
Parameter packageDescription :
Description of the package.
Implementation
Future<CreatePackageResponse> createPackage({
required String packageName,
required PackageSource packageSource,
required PackageType packageType,
String? packageDescription,
}) async {
final $payload = <String, dynamic>{
'PackageName': packageName,
'PackageSource': packageSource,
'PackageType': packageType.value,
if (packageDescription != null) 'PackageDescription': packageDescription,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/2015-01-01/packages',
exceptionFnMap: _exceptionFns,
);
return CreatePackageResponse.fromJson(response);
}