defineRankExpression method

Future<DefineRankExpressionResponse> defineRankExpression({
  1. required String domainName,
  2. required NamedRankExpression rankExpression,
})

Configures a RankExpression for the search domain. Used to create new rank expressions and modify existing ones. If the expression exists, the new configuration replaces the old one. You can configure a maximum of 50 rank expressions.

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

Implementation

Future<DefineRankExpressionResponse> defineRankExpression({
  required String domainName,
  required NamedRankExpression rankExpression,
}) async {
  ArgumentError.checkNotNull(domainName, 'domainName');
  _s.validateStringLength(
    'domainName',
    domainName,
    3,
    28,
    isRequired: true,
  );
  ArgumentError.checkNotNull(rankExpression, 'rankExpression');
  final $request = <String, dynamic>{};
  $request['DomainName'] = domainName;
  $request['RankExpression'] = rankExpression;
  final $result = await _protocol.send(
    $request,
    action: 'DefineRankExpression',
    version: '2011-02-01',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    shape: shapes['DefineRankExpressionRequest'],
    shapes: shapes,
    resultWrapper: 'DefineRankExpressionResult',
  );
  return DefineRankExpressionResponse.fromXml($result);
}