updateKnowledgeBasePermissions method
Updates the resource permissions for a knowledge base.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalFailureException.
May throw InvalidParameterValueException.
May throw InvalidRequestException.
May throw LimitExceededException.
May throw PreconditionNotMetException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
Parameter awsAccountId :
The ID of the Amazon Web Services account that contains the knowledge
base.
Parameter knowledgeBaseId :
The unique identifier for the knowledge base.
Parameter grantPermissions :
The resource permissions that you want to grant on the knowledge base.
Parameter revokePermissions :
The resource permissions that you want to revoke from the knowledge base.
Implementation
Future<UpdateKnowledgeBasePermissionsResponse>
updateKnowledgeBasePermissions({
required String awsAccountId,
required String knowledgeBaseId,
List<ResourcePermission>? grantPermissions,
List<ResourcePermission>? revokePermissions,
}) async {
final $payload = <String, dynamic>{
if (grantPermissions != null) 'GrantPermissions': grantPermissions,
if (revokePermissions != null) 'RevokePermissions': revokePermissions,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri:
'/v1/accounts/${Uri.encodeComponent(awsAccountId)}/knowledge-bases/${Uri.encodeComponent(knowledgeBaseId)}/permissions',
exceptionFnMap: _exceptionFns,
);
return UpdateKnowledgeBasePermissionsResponse.fromJson(response);
}