Skip to content

Commit 8f493d1

Browse files
algolia-botFluf22
andcommitted
fix(specs): update search api specs [skip-bc] (generated)
algolia/api-clients-automation#3760 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Thomas Raffray <[email protected]>
1 parent 42b49bd commit 8f493d1

File tree

3 files changed

+42
-78
lines changed

3 files changed

+42
-78
lines changed

lib/Model/Recommend/RecommendationsResults.php

Lines changed: 14 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -382,27 +382,15 @@ public function listInvalidProperties()
382382
if (!isset($this->container['processingTimeMS']) || null === $this->container['processingTimeMS']) {
383383
$invalidProperties[] = "'processingTimeMS' can't be null";
384384
}
385-
if (!isset($this->container['page']) || null === $this->container['page']) {
386-
$invalidProperties[] = "'page' can't be null";
387-
}
388-
if ($this->container['page'] < 0) {
385+
if (isset($this->container['page']) && ($this->container['page'] < 0)) {
389386
$invalidProperties[] = "invalid value for 'page', must be bigger than or equal to 0.";
390387
}
391388

392-
if (!isset($this->container['nbHits']) || null === $this->container['nbHits']) {
393-
$invalidProperties[] = "'nbHits' can't be null";
394-
}
395-
if (!isset($this->container['nbPages']) || null === $this->container['nbPages']) {
396-
$invalidProperties[] = "'nbPages' can't be null";
397-
}
398-
if (!isset($this->container['hitsPerPage']) || null === $this->container['hitsPerPage']) {
399-
$invalidProperties[] = "'hitsPerPage' can't be null";
400-
}
401-
if ($this->container['hitsPerPage'] > 1000) {
389+
if (isset($this->container['hitsPerPage']) && ($this->container['hitsPerPage'] > 1000)) {
402390
$invalidProperties[] = "invalid value for 'hitsPerPage', must be smaller than or equal to 1000.";
403391
}
404392

405-
if ($this->container['hitsPerPage'] < 1) {
393+
if (isset($this->container['hitsPerPage']) && ($this->container['hitsPerPage'] < 1)) {
406394
$invalidProperties[] = "invalid value for 'hitsPerPage', must be bigger than or equal to 1.";
407395
}
408396

@@ -1047,7 +1035,7 @@ public function setAutomaticInsights($automaticInsights)
10471035
/**
10481036
* Gets page.
10491037
*
1050-
* @return int
1038+
* @return null|int
10511039
*/
10521040
public function getPage()
10531041
{
@@ -1057,13 +1045,13 @@ public function getPage()
10571045
/**
10581046
* Sets page.
10591047
*
1060-
* @param int $page page of search results to retrieve
1048+
* @param null|int $page page of search results to retrieve
10611049
*
10621050
* @return self
10631051
*/
10641052
public function setPage($page)
10651053
{
1066-
if ($page < 0) {
1054+
if (!is_null($page) && ($page < 0)) {
10671055
throw new \InvalidArgumentException('invalid value for $page when calling RecommendationsResults., must be bigger than or equal to 0.');
10681056
}
10691057

@@ -1075,7 +1063,7 @@ public function setPage($page)
10751063
/**
10761064
* Gets nbHits.
10771065
*
1078-
* @return int
1066+
* @return null|int
10791067
*/
10801068
public function getNbHits()
10811069
{
@@ -1085,7 +1073,7 @@ public function getNbHits()
10851073
/**
10861074
* Sets nbHits.
10871075
*
1088-
* @param int $nbHits number of results (hits)
1076+
* @param null|int $nbHits number of results (hits)
10891077
*
10901078
* @return self
10911079
*/
@@ -1099,7 +1087,7 @@ public function setNbHits($nbHits)
10991087
/**
11001088
* Gets nbPages.
11011089
*
1102-
* @return int
1090+
* @return null|int
11031091
*/
11041092
public function getNbPages()
11051093
{
@@ -1109,7 +1097,7 @@ public function getNbPages()
11091097
/**
11101098
* Sets nbPages.
11111099
*
1112-
* @param int $nbPages number of pages of results
1100+
* @param null|int $nbPages number of pages of results
11131101
*
11141102
* @return self
11151103
*/
@@ -1123,7 +1111,7 @@ public function setNbPages($nbPages)
11231111
/**
11241112
* Gets hitsPerPage.
11251113
*
1126-
* @return int
1114+
* @return null|int
11271115
*/
11281116
public function getHitsPerPage()
11291117
{
@@ -1133,16 +1121,16 @@ public function getHitsPerPage()
11331121
/**
11341122
* Sets hitsPerPage.
11351123
*
1136-
* @param int $hitsPerPage number of hits per page
1124+
* @param null|int $hitsPerPage number of hits per page
11371125
*
11381126
* @return self
11391127
*/
11401128
public function setHitsPerPage($hitsPerPage)
11411129
{
1142-
if ($hitsPerPage > 1000) {
1130+
if (!is_null($hitsPerPage) && ($hitsPerPage > 1000)) {
11431131
throw new \InvalidArgumentException('invalid value for $hitsPerPage when calling RecommendationsResults., must be smaller than or equal to 1000.');
11441132
}
1145-
if ($hitsPerPage < 1) {
1133+
if (!is_null($hitsPerPage) && ($hitsPerPage < 1)) {
11461134
throw new \InvalidArgumentException('invalid value for $hitsPerPage when calling RecommendationsResults., must be bigger than or equal to 1.');
11471135
}
11481136

lib/Model/Search/SearchResponse.php

Lines changed: 14 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -398,27 +398,15 @@ public function listInvalidProperties()
398398
if (!isset($this->container['processingTimeMS']) || null === $this->container['processingTimeMS']) {
399399
$invalidProperties[] = "'processingTimeMS' can't be null";
400400
}
401-
if (!isset($this->container['page']) || null === $this->container['page']) {
402-
$invalidProperties[] = "'page' can't be null";
403-
}
404-
if ($this->container['page'] < 0) {
401+
if (isset($this->container['page']) && ($this->container['page'] < 0)) {
405402
$invalidProperties[] = "invalid value for 'page', must be bigger than or equal to 0.";
406403
}
407404

408-
if (!isset($this->container['nbHits']) || null === $this->container['nbHits']) {
409-
$invalidProperties[] = "'nbHits' can't be null";
410-
}
411-
if (!isset($this->container['nbPages']) || null === $this->container['nbPages']) {
412-
$invalidProperties[] = "'nbPages' can't be null";
413-
}
414-
if (!isset($this->container['hitsPerPage']) || null === $this->container['hitsPerPage']) {
415-
$invalidProperties[] = "'hitsPerPage' can't be null";
416-
}
417-
if ($this->container['hitsPerPage'] > 1000) {
405+
if (isset($this->container['hitsPerPage']) && ($this->container['hitsPerPage'] > 1000)) {
418406
$invalidProperties[] = "invalid value for 'hitsPerPage', must be smaller than or equal to 1000.";
419407
}
420408

421-
if ($this->container['hitsPerPage'] < 1) {
409+
if (isset($this->container['hitsPerPage']) && ($this->container['hitsPerPage'] < 1)) {
422410
$invalidProperties[] = "invalid value for 'hitsPerPage', must be bigger than or equal to 1.";
423411
}
424412

@@ -1069,7 +1057,7 @@ public function setAutomaticInsights($automaticInsights)
10691057
/**
10701058
* Gets page.
10711059
*
1072-
* @return int
1060+
* @return null|int
10731061
*/
10741062
public function getPage()
10751063
{
@@ -1079,13 +1067,13 @@ public function getPage()
10791067
/**
10801068
* Sets page.
10811069
*
1082-
* @param int $page page of search results to retrieve
1070+
* @param null|int $page page of search results to retrieve
10831071
*
10841072
* @return self
10851073
*/
10861074
public function setPage($page)
10871075
{
1088-
if ($page < 0) {
1076+
if (!is_null($page) && ($page < 0)) {
10891077
throw new \InvalidArgumentException('invalid value for $page when calling SearchResponse., must be bigger than or equal to 0.');
10901078
}
10911079

@@ -1097,7 +1085,7 @@ public function setPage($page)
10971085
/**
10981086
* Gets nbHits.
10991087
*
1100-
* @return int
1088+
* @return null|int
11011089
*/
11021090
public function getNbHits()
11031091
{
@@ -1107,7 +1095,7 @@ public function getNbHits()
11071095
/**
11081096
* Sets nbHits.
11091097
*
1110-
* @param int $nbHits number of results (hits)
1098+
* @param null|int $nbHits number of results (hits)
11111099
*
11121100
* @return self
11131101
*/
@@ -1121,7 +1109,7 @@ public function setNbHits($nbHits)
11211109
/**
11221110
* Gets nbPages.
11231111
*
1124-
* @return int
1112+
* @return null|int
11251113
*/
11261114
public function getNbPages()
11271115
{
@@ -1131,7 +1119,7 @@ public function getNbPages()
11311119
/**
11321120
* Sets nbPages.
11331121
*
1134-
* @param int $nbPages number of pages of results
1122+
* @param null|int $nbPages number of pages of results
11351123
*
11361124
* @return self
11371125
*/
@@ -1145,7 +1133,7 @@ public function setNbPages($nbPages)
11451133
/**
11461134
* Gets hitsPerPage.
11471135
*
1148-
* @return int
1136+
* @return null|int
11491137
*/
11501138
public function getHitsPerPage()
11511139
{
@@ -1155,16 +1143,16 @@ public function getHitsPerPage()
11551143
/**
11561144
* Sets hitsPerPage.
11571145
*
1158-
* @param int $hitsPerPage number of hits per page
1146+
* @param null|int $hitsPerPage number of hits per page
11591147
*
11601148
* @return self
11611149
*/
11621150
public function setHitsPerPage($hitsPerPage)
11631151
{
1164-
if ($hitsPerPage > 1000) {
1152+
if (!is_null($hitsPerPage) && ($hitsPerPage > 1000)) {
11651153
throw new \InvalidArgumentException('invalid value for $hitsPerPage when calling SearchResponse., must be smaller than or equal to 1000.');
11661154
}
1167-
if ($hitsPerPage < 1) {
1155+
if (!is_null($hitsPerPage) && ($hitsPerPage < 1)) {
11681156
throw new \InvalidArgumentException('invalid value for $hitsPerPage when calling SearchResponse., must be bigger than or equal to 1.');
11691157
}
11701158

lib/Model/Search/SearchResult.php

Lines changed: 14 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -409,27 +409,15 @@ public function listInvalidProperties()
409409
if (!isset($this->container['processingTimeMS']) || null === $this->container['processingTimeMS']) {
410410
$invalidProperties[] = "'processingTimeMS' can't be null";
411411
}
412-
if (!isset($this->container['page']) || null === $this->container['page']) {
413-
$invalidProperties[] = "'page' can't be null";
414-
}
415-
if ($this->container['page'] < 0) {
412+
if (isset($this->container['page']) && ($this->container['page'] < 0)) {
416413
$invalidProperties[] = "invalid value for 'page', must be bigger than or equal to 0.";
417414
}
418415

419-
if (!isset($this->container['nbHits']) || null === $this->container['nbHits']) {
420-
$invalidProperties[] = "'nbHits' can't be null";
421-
}
422-
if (!isset($this->container['nbPages']) || null === $this->container['nbPages']) {
423-
$invalidProperties[] = "'nbPages' can't be null";
424-
}
425-
if (!isset($this->container['hitsPerPage']) || null === $this->container['hitsPerPage']) {
426-
$invalidProperties[] = "'hitsPerPage' can't be null";
427-
}
428-
if ($this->container['hitsPerPage'] > 1000) {
416+
if (isset($this->container['hitsPerPage']) && ($this->container['hitsPerPage'] > 1000)) {
429417
$invalidProperties[] = "invalid value for 'hitsPerPage', must be smaller than or equal to 1000.";
430418
}
431419

432-
if ($this->container['hitsPerPage'] < 1) {
420+
if (isset($this->container['hitsPerPage']) && ($this->container['hitsPerPage'] < 1)) {
433421
$invalidProperties[] = "invalid value for 'hitsPerPage', must be bigger than or equal to 1.";
434422
}
435423

@@ -1079,7 +1067,7 @@ public function setAutomaticInsights($automaticInsights)
10791067
/**
10801068
* Gets page.
10811069
*
1082-
* @return int
1070+
* @return null|int
10831071
*/
10841072
public function getPage()
10851073
{
@@ -1089,13 +1077,13 @@ public function getPage()
10891077
/**
10901078
* Sets page.
10911079
*
1092-
* @param int $page page of search results to retrieve
1080+
* @param null|int $page page of search results to retrieve
10931081
*
10941082
* @return self
10951083
*/
10961084
public function setPage($page)
10971085
{
1098-
if ($page < 0) {
1086+
if (!is_null($page) && ($page < 0)) {
10991087
throw new \InvalidArgumentException('invalid value for $page when calling SearchResult., must be bigger than or equal to 0.');
11001088
}
11011089

@@ -1107,7 +1095,7 @@ public function setPage($page)
11071095
/**
11081096
* Gets nbHits.
11091097
*
1110-
* @return int
1098+
* @return null|int
11111099
*/
11121100
public function getNbHits()
11131101
{
@@ -1117,7 +1105,7 @@ public function getNbHits()
11171105
/**
11181106
* Sets nbHits.
11191107
*
1120-
* @param int $nbHits number of results (hits)
1108+
* @param null|int $nbHits number of results (hits)
11211109
*
11221110
* @return self
11231111
*/
@@ -1131,7 +1119,7 @@ public function setNbHits($nbHits)
11311119
/**
11321120
* Gets nbPages.
11331121
*
1134-
* @return int
1122+
* @return null|int
11351123
*/
11361124
public function getNbPages()
11371125
{
@@ -1141,7 +1129,7 @@ public function getNbPages()
11411129
/**
11421130
* Sets nbPages.
11431131
*
1144-
* @param int $nbPages number of pages of results
1132+
* @param null|int $nbPages number of pages of results
11451133
*
11461134
* @return self
11471135
*/
@@ -1155,7 +1143,7 @@ public function setNbPages($nbPages)
11551143
/**
11561144
* Gets hitsPerPage.
11571145
*
1158-
* @return int
1146+
* @return null|int
11591147
*/
11601148
public function getHitsPerPage()
11611149
{
@@ -1165,16 +1153,16 @@ public function getHitsPerPage()
11651153
/**
11661154
* Sets hitsPerPage.
11671155
*
1168-
* @param int $hitsPerPage number of hits per page
1156+
* @param null|int $hitsPerPage number of hits per page
11691157
*
11701158
* @return self
11711159
*/
11721160
public function setHitsPerPage($hitsPerPage)
11731161
{
1174-
if ($hitsPerPage > 1000) {
1162+
if (!is_null($hitsPerPage) && ($hitsPerPage > 1000)) {
11751163
throw new \InvalidArgumentException('invalid value for $hitsPerPage when calling SearchResult., must be smaller than or equal to 1000.');
11761164
}
1177-
if ($hitsPerPage < 1) {
1165+
if (!is_null($hitsPerPage) && ($hitsPerPage < 1)) {
11781166
throw new \InvalidArgumentException('invalid value for $hitsPerPage when calling SearchResult., must be bigger than or equal to 1.');
11791167
}
11801168

0 commit comments

Comments
 (0)