updateRule method

Future<void> updateRule({
  1. required List<RuleAction> actions,
  2. required String function,
  3. required String instanceId,
  4. required String name,
  5. required RulePublishStatus publishStatus,
  6. required String ruleId,
})

Updates a rule for the specified Connect Customer instance.

Use the Rules Function language to code conditions for the rule.

May throw AccessDeniedException. May throw InternalServiceException. May throw InvalidRequestException. May throw ResourceConflictException. May throw ResourceNotFoundException. May throw ThrottlingException.

Parameter actions : A list of actions to be run when the rule is triggered.

Parameter function : The conditions of the rule.

Parameter instanceId : The identifier of the Connect Customer instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance.

Parameter name : The name of the rule. You can change the name only if TriggerEventSource is one of the following values: OnZendeskTicketCreate | OnZendeskTicketStatusUpdate | OnSalesforceCaseCreate

Parameter publishStatus : The publish status of the rule.

Parameter ruleId : A unique identifier for the rule.

Implementation

Future<void> updateRule({
  required List<RuleAction> actions,
  required String function,
  required String instanceId,
  required String name,
  required RulePublishStatus publishStatus,
  required String ruleId,
}) async {
  final $payload = <String, dynamic>{
    'Actions': actions,
    'Function': function,
    'Name': name,
    'PublishStatus': publishStatus.value,
  };
  await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri:
        '/rules/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(ruleId)}',
    exceptionFnMap: _exceptionFns,
  );
}