Update an existing Rule. A token with scope update:rules is needed.
See https://auth0.com/docs/api/management/v2#!/Rules/patch_rules_by_id

@param ruleId the rule id
@param rule   the rule data to set. It can't include id.
@return a Request to execute.
976936
public Request<Rule> update(String ruleId, Rule rule) {
        Asserts.assertNotNull(ruleId, "rule id");
        Asserts.assertNotNull(rule, "rule");

        String url = baseUrl
                .newBuilder()
                .addPathSegments("api/v2/rules")
                .addPathSegment(ruleId)
                .build()
                .toString();
        CustomRequest<Rule> request = new CustomRequest<>(this.client, url, "PATCH", new TypeReference<Rule>() {
        });
        request.addHeader("Authorization", "Bearer " + apiToken);
        request.setBody(rule);
        return request;
    }
1248808
public static RuleProviderBuilder begin(String id)
    {
        MetadataBuilder builder = MetadataBuilder.forProvider(RuleProviderBuilder.class, id);
        return new RuleProviderBuilder(builder).setMetadataBuilder(builder);
    }
1171876
public static boolean update(RuleEngine ruleEngine, MutableStateObj state) {
        StateObj newState = ruleEngine.evaluateRules(state);
        state.updateState(newState);
        return newState.getState().size() > 0;

    }
205161
function (id, rule) {
  if (!rules.hasOwnProperty(id)) {
    rules[id] = {
      id: id,

      nud: void 0, // Maybe< Fn(State, Token) >

      lbp: 0,
      led: void 0, // Maybe< Fn(State, Token, left: Tree) >

      sta: void 0, // Maybe< Fn(State) >

      type_nud: void 0, // Maybe< Fn(State, Token) >
      type_lbp: 0,
      type_led: void 0// Maybe< Fn(State, Token, left: Tree) >
    }
  }
  if (rule.nud) {
    rules[id].nud = rule.nud
  }
  if (rule.led && rule.lbp > 0) {
    rules[id].lbp = rule.lbp
    rules[id].led = rule.led
  }
  if (rule.sta) {
    rules[id].sta = rule.sta
  }
  if (rule.type_nud) {
    rules[id].type_nud = rule.type_nud
  }
  if (rule.type_led && rule.type_lbp > 0) {
    rules[id].type_lbp = rule.type_lbp
    rules[id].type_led = rule.type_led
  }
}
1314785
function replaceRules (rules) {
    // create new non global instance
    var accessControl = new ImmutableAccessControl({global: false})
    // set default rules from current instance
    accessControl.setRules(this.defaultRules)
    // set new rules
    accessControl.setRules(rules)
    // replace local rules
    this.rules = accessControl.rules
    // clear rule id
    this.id = undefined
}
1013255
public T getById(String id) throws NRE {
        T rule = rules.get(id);

        if (null == rule) {
            throw newNoRuleException(id);
        }

        return rule;
    }
1101211
function addRules(rules) {
        _.each(rules, function (rule) {
            _global.rules[rule.id] = rule;
        });
    }
863419
public ApiResponse<RuleEnvelope> deleteRuleWithHttpInfo(String ruleId) throws ApiException {
        com.squareup.okhttp.Call call = deleteRuleValidateBeforeCall(ruleId, null, null);
        Type localVarReturnType = new TypeToken<RuleEnvelope>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }
224798
@PATCH
    @Path("{id}")
    public final Response patch(@PathParam("id") final URI_ID id, @NotNull final MODEL model) throws Exception {
        return super.patch(id, model);
    }
98582
def search_rule_by_id(self, ruleID) -> Rule:
        
        for r in self.rules:
            if r.id == ruleID:
                return r
        return None
1123541
private RuleDto getRuleDto(RuleUpdate change) {
    try (DbSession dbSession = dbClient.openSession(false)) {
      RuleDto rule = dbClient.ruleDao().selectOrFailByKey(dbSession, change.getOrganization(), change.getRuleKey());
      if (RuleStatus.REMOVED == rule.getStatus()) {
        throw new IllegalArgumentException("Rule with REMOVED status cannot be updated: " + change.getRuleKey());
      }
      return rule;
    }
  }
1156024
function helper_updateTriggerRule(trigger, event)
{
	var rule = trigger.ruleTable[event.ruleIdentifier];
	if (rule && rule.ruleUpdateFunction)
	{
		rule.ruleUpdateFunction(rule, event.nearable, event);
		helper_updateRuleState(
			event.triggerIdentifier,
			event.ruleIdentifier,
			rule.state);
	}
}
486246
def store_rule(self, rule_id, rule):
        
        if rule_id not in self.rules:
            self.rules[rule_id] = rule
            self.rule_cnt += 1
1010766
def delete_rule(self, rule_id):
        
        if rule_id not in self.rules:
            LOG.error("No Rule id present for deleting %s", rule_id)
            return
        del self.rules[rule_id]
        self.rule_cnt -= 1
123218
public final void ruleRuleID() throws RecognitionException {

        		int stackSize = keepStackSize();
        	
        try {
            // InternalXtext.g:808:2: ( ( ( rule__RuleID__Group__0 ) ) )
            // InternalXtext.g:809:2: ( ( rule__RuleID__Group__0 ) )
            {
            // InternalXtext.g:809:2: ( ( rule__RuleID__Group__0 ) )
            // InternalXtext.g:810:3: ( rule__RuleID__Group__0 )
            {
             before(grammarAccess.getRuleIDAccess().getGroup()); 
            // InternalXtext.g:811:3: ( rule__RuleID__Group__0 )
            // InternalXtext.g:811:4: rule__RuleID__Group__0
            {
            pushFollow(FollowSets000.FOLLOW_2);
            rule__RuleID__Group__0();

            state._fsp--;


            }

             after(grammarAccess.getRuleIDAccess().getGroup()); 

            }


            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {

            	restoreStackSize(stackSize);

        }
        return ;
    }
990020
def addRule( self, rule ):
        
        self._rules[rule.term()] = rule
        self.updateRules()
1203305
function createRules(rulesToCreate, cb) {

    function addRule(ruleToCreate, addRuleCallback) {
      var fr = new rulesModel(ruleToCreate);

      fr.save(function(err, frdoc) {
        if (err) {
          return addRuleCallback(err);
        }
        return addRuleCallback(null, frdoc);
      });
    }

    async.map(rulesToCreate, addRule, cb);
  }