updateThesaurus method

Future<void> updateThesaurus({
  1. required String id,
  2. required String indexId,
  3. String? description,
  4. String? name,
  5. String? roleArn,
  6. S3Path? sourceS3Path,
})

Updates a thesaurus file associated with an index.

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

Parameter id : The identifier of the thesaurus to update.

Parameter indexId : The identifier of the index associated with the thesaurus to update.

Parameter description : The updated description of the thesaurus.

Parameter name : The updated name of the thesaurus.

Parameter roleArn : The updated role ARN of the thesaurus.

Implementation

Future<void> updateThesaurus({
  required String id,
  required String indexId,
  String? description,
  String? name,
  String? roleArn,
  S3Path? sourceS3Path,
}) async {
  ArgumentError.checkNotNull(id, 'id');
  _s.validateStringLength(
    'id',
    id,
    1,
    100,
    isRequired: true,
  );
  ArgumentError.checkNotNull(indexId, 'indexId');
  _s.validateStringLength(
    'indexId',
    indexId,
    36,
    36,
    isRequired: true,
  );
  _s.validateStringLength(
    'description',
    description,
    0,
    1000,
  );
  _s.validateStringLength(
    'name',
    name,
    1,
    100,
  );
  _s.validateStringLength(
    'roleArn',
    roleArn,
    1,
    1284,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSKendraFrontendService.UpdateThesaurus'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'Id': id,
      'IndexId': indexId,
      if (description != null) 'Description': description,
      if (name != null) 'Name': name,
      if (roleArn != null) 'RoleArn': roleArn,
      if (sourceS3Path != null) 'SourceS3Path': sourceS3Path,
    },
  );
}