defineAnalysisScheme method

Future<DefineAnalysisSchemeResponse> defineAnalysisScheme({
  1. required AnalysisScheme analysisScheme,
  2. required String domainName,
})

Configures an analysis scheme that can be applied to a text or text-array field to define language-specific text processing options. For more information, see Configuring Analysis Schemes in the Amazon CloudSearch Developer Guide.

May throw BaseException. May throw InternalException. May throw LimitExceededException. May throw InvalidTypeException. May throw ResourceNotFoundException.

Implementation

Future<DefineAnalysisSchemeResponse> defineAnalysisScheme({
  required AnalysisScheme analysisScheme,
  required String domainName,
}) async {
  ArgumentError.checkNotNull(analysisScheme, 'analysisScheme');
  ArgumentError.checkNotNull(domainName, 'domainName');
  _s.validateStringLength(
    'domainName',
    domainName,
    3,
    28,
    isRequired: true,
  );
  final $request = <String, dynamic>{};
  $request['AnalysisScheme'] = analysisScheme;
  $request['DomainName'] = domainName;
  final $result = await _protocol.send(
    $request,
    action: 'DefineAnalysisScheme',
    version: '2013-01-01',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    shape: shapes['DefineAnalysisSchemeRequest'],
    shapes: shapes,
    resultWrapper: 'DefineAnalysisSchemeResult',
  );
  return DefineAnalysisSchemeResponse.fromXml($result);
}