createLibraryItem method
Creates a new library item for an Amazon Q App, allowing it to be discovered and used by other allowed users.
May throw AccessDeniedException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw UnauthorizedException.
May throw ValidationException.
Parameter appId :
The unique identifier of the Amazon Q App to publish to the library.
Parameter appVersion :
The version of the Amazon Q App to publish to the library.
Parameter categories :
The categories to associate with the library item for easier discovery.
Parameter instanceId :
The unique identifier of the Amazon Q Business application environment
instance.
Implementation
Future<CreateLibraryItemOutput> createLibraryItem({
required String appId,
required int appVersion,
required List<String> categories,
required String instanceId,
}) async {
_s.validateNumRange(
'appVersion',
appVersion,
0,
2147483647,
isRequired: true,
);
final headers = <String, String>{
'instance-id': instanceId.toString(),
};
final $payload = <String, dynamic>{
'appId': appId,
'appVersion': appVersion,
'categories': categories,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/catalog.createItem',
headers: headers,
exceptionFnMap: _exceptionFns,
);
return CreateLibraryItemOutput.fromJson(response);
}