updateIndex method

Future<void> updateIndex({
  1. required String id,
  2. CapacityUnitsConfiguration? capacityUnits,
  3. String? description,
  4. List<DocumentMetadataConfiguration>? documentMetadataConfigurationUpdates,
  5. String? name,
  6. String? roleArn,
  7. UserContextPolicy? userContextPolicy,
  8. UserGroupResolutionConfiguration? userGroupResolutionConfiguration,
  9. List<UserTokenConfiguration>? userTokenConfigurations,
})

Updates an Amazon Kendra index.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ServiceQuotaExceededException. May throw ThrottlingException. May throw ValidationException.

Parameter id : The identifier of the index you want to update.

Parameter capacityUnits : Sets the number of additional document storage and query capacity units that should be used by the index. You can change the capacity of the index up to 5 times per day, or make 5 API calls.

If you are using extra storage units, you can't reduce the storage capacity below what is required to meet the storage needs for your index.

Parameter description : A new description for the index.

Parameter documentMetadataConfigurationUpdates : The document metadata configuration you want to update for the index. Document metadata are fields or attributes associated with your documents. For example, the company department name associated with each document.

Parameter name : A new name for the index.

Parameter roleArn : An Identity and Access Management (IAM) role that gives Amazon Kendra permission to access Amazon CloudWatch logs and metrics.

Parameter userContextPolicy : The user context policy.

Parameter userGroupResolutionConfiguration : Gets users and groups from IAM Identity Center identity source. To configure this, see UserGroupResolutionConfiguration. This is useful for user context filtering, where search results are filtered based on the user or their group access to documents.

Parameter userTokenConfigurations : The user token configuration.

Implementation

Future<void> updateIndex({
  required String id,
  CapacityUnitsConfiguration? capacityUnits,
  String? description,
  List<DocumentMetadataConfiguration>? documentMetadataConfigurationUpdates,
  String? name,
  String? roleArn,
  UserContextPolicy? userContextPolicy,
  UserGroupResolutionConfiguration? userGroupResolutionConfiguration,
  List<UserTokenConfiguration>? userTokenConfigurations,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSKendraFrontendService.UpdateIndex'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'Id': id,
      if (capacityUnits != null) 'CapacityUnits': capacityUnits,
      if (description != null) 'Description': description,
      if (documentMetadataConfigurationUpdates != null)
        'DocumentMetadataConfigurationUpdates':
            documentMetadataConfigurationUpdates,
      if (name != null) 'Name': name,
      if (roleArn != null) 'RoleArn': roleArn,
      if (userContextPolicy != null)
        'UserContextPolicy': userContextPolicy.value,
      if (userGroupResolutionConfiguration != null)
        'UserGroupResolutionConfiguration': userGroupResolutionConfiguration,
      if (userTokenConfigurations != null)
        'UserTokenConfigurations': userTokenConfigurations,
    },
  );
}