replaceTopicRule method

Future<void> replaceTopicRule({
  1. required String ruleName,
  2. required TopicRulePayload topicRulePayload,
})

Replaces the rule. You must specify all parameters for the new rule. Creating rules is an administrator-level action. Any user who has permission to create rules will be able to access data processed by the rule.

May throw SqlParseException. May throw InternalException. May throw InvalidRequestException. May throw ServiceUnavailableException. May throw UnauthorizedException. May throw ConflictingResourceUpdateException.

Parameter ruleName : The name of the rule.

Parameter topicRulePayload : The rule payload.

Implementation

Future<void> replaceTopicRule({
  required String ruleName,
  required TopicRulePayload topicRulePayload,
}) async {
  ArgumentError.checkNotNull(ruleName, 'ruleName');
  _s.validateStringLength(
    'ruleName',
    ruleName,
    1,
    128,
    isRequired: true,
  );
  ArgumentError.checkNotNull(topicRulePayload, 'topicRulePayload');
  await _protocol.send(
    payload: topicRulePayload,
    method: 'PATCH',
    requestUri: '/rules/${Uri.encodeComponent(ruleName)}',
    exceptionFnMap: _exceptionFns,
  );
}