## Update a rule `detectors.rules.update(strid, RuleUpdateParams**kwargs) -> RuleUpdateResponse` **patch** `/api/detectors/{detectorId}/rules/{id}` Update a rule ### Parameters - `detector_id: str` - `id: str` - `condition: Optional[str]` - `enabled: Optional[bool]` - `name: Optional[str]` - `notify: Optional[bool]` ### Returns - `class RuleUpdateResponse: …` - `errors: List[Error]` - `code: int` - `message: str` - `messages: List[Message]` - `code: int` - `message: str` - `result: Result` - `id: str` - `condition: Condition` - `class LeafCondition: …` - `leaf: Leaf` - `fact: str` - `op: Literal["eq", "neq", "in", 4 more]` - `"eq"` - `"neq"` - `"in"` - `"nin"` - `"contains"` - `"matches"` - `"between"` - `value: Union[str, float, bool, 2 more]` - `str` - `float` - `bool` - `List[str]` - `List[float]` - `class RefCondition: …` - `ref: Ref` - `fact: str` - `op: Literal["eq", "neq", "in", "nin"]` - `"eq"` - `"neq"` - `"in"` - `"nin"` - `reference: str` - `class InRelationCondition: …` - `in_relation: InRelation` - `args: List[object]` - `relation: str` - `class AllCondition: …` - `all: List[Condition]` - `class AnyCondition: …` - `any: List[Condition]` - `class NotCondition: …` - `not_: Condition` - `class OnceCondition: …` - `once: Condition` - `class HistoricallyCondition: …` - `historically: Condition` - `class SinceCondition: …` - `since: Since` - `left: Condition` - `right: Condition` - `class OnceWithinCondition: …` - `once_within: OnceWithin` - `inner: Condition` - `window_secs: float` - `class HistoricallyForCondition: …` - `historically_for: HistoricallyFor` - `inner: Condition` - `window_secs: float` - `boundary: Optional[Literal["weak", "strong"]]` - `"weak"` - `"strong"` - `class SinceWithinCondition: …` - `since_within: SinceWithin` - `left: Condition` - `right: Condition` - `window_secs: float` - `class KeyedCondition: …` - `keyed: Keyed` - `inner: Condition` - `key: str` - `detector_id: str` - `enabled: bool` - `name: str` - `notify: bool` - `priority: float` - `success: bool` ### Example ```python import os from rake import Rake client = Rake( api_key=os.environ.get("RAKE_API_KEY"), # This is the default and can be omitted ) rule = client.detectors.rules.update( id="id", detector_id="detectorId", ) print(rule.errors) ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message" } ], "messages": [ { "code": 1000, "message": "message" } ], "result": { "id": "id", "condition": { "leaf": { "fact": "fact", "op": "eq", "value": "string" } }, "detectorId": "detectorId", "enabled": true, "name": "name", "notify": true, "priority": 0 }, "success": true } ```