Skip to content

Commit 794f152

Browse files
fix(specs): consequence is required when saving rules (generated)
algolia/api-clients-automation#4146 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Clément Vannicatte <[email protected]>
1 parent 1183f87 commit 794f152

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

lib/Api/SearchClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2041,7 +2041,7 @@ public function saveObject($indexName, $body, $requestOptions = [])
20412041
* @param array $rule rule (required)
20422042
* - $rule['objectID'] => (string) Unique identifier of a rule object. (required)
20432043
* - $rule['conditions'] => (array) Conditions that trigger a rule. Some consequences require specific conditions or don't require any condition. For more information, see [Conditions](https://www.algolia.com/doc/guides/managing-results/rules/rules-overview/#conditions).
2044-
* - $rule['consequence'] => (array)
2044+
* - $rule['consequence'] => (array) (required)
20452045
* - $rule['description'] => (string) Description of the rule's purpose to help you distinguish between different rules.
20462046
* - $rule['enabled'] => (bool) Whether the rule is active.
20472047
* - $rule['validity'] => (array) Time periods when the rule is active.

lib/Model/Search/Rule.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,9 @@ public function listInvalidProperties()
184184
if (!isset($this->container['objectID']) || null === $this->container['objectID']) {
185185
$invalidProperties[] = "'objectID' can't be null";
186186
}
187+
if (!isset($this->container['consequence']) || null === $this->container['consequence']) {
188+
$invalidProperties[] = "'consequence' can't be null";
189+
}
187190

188191
return $invalidProperties;
189192
}
@@ -250,7 +253,7 @@ public function setConditions($conditions)
250253
/**
251254
* Gets consequence.
252255
*
253-
* @return null|Consequence
256+
* @return Consequence
254257
*/
255258
public function getConsequence()
256259
{
@@ -260,7 +263,7 @@ public function getConsequence()
260263
/**
261264
* Sets consequence.
262265
*
263-
* @param null|Consequence $consequence consequence
266+
* @param Consequence $consequence consequence
264267
*
265268
* @return self
266269
*/

0 commit comments

Comments
 (0)