createPackage method
Creates an IoT software package that can be deployed to your fleet.
Requires permission to access the CreatePackage and GetIndexingConfiguration actions.
May throw ConflictException.
May throw InternalServerException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw ValidationException.
Parameter packageName :
The name of the new software package.
Parameter clientToken :
A unique case-sensitive identifier that you can provide to ensure the
idempotency of the request. Don't reuse this client token if a new
idempotent request is required.
Parameter description :
A summary of the package being created. This can be used to outline the
package's contents or purpose.
Parameter tags :
Metadata that can be used to manage the package.
Implementation
Future<CreatePackageResponse> createPackage({
required String packageName,
String? clientToken,
String? description,
Map<String, String>? tags,
}) async {
final $query = <String, List<String>>{
if (clientToken != null) 'clientToken': [clientToken],
};
final $payload = <String, dynamic>{
if (description != null) 'description': description,
if (tags != null) 'tags': tags,
};
final response = await _protocol.send(
payload: $payload,
method: 'PUT',
requestUri: '/packages/${Uri.encodeComponent(packageName)}',
queryParams: $query,
exceptionFnMap: _exceptionFns,
);
return CreatePackageResponse.fromJson(response);
}