Skip to content

Commit c5f14fd

Browse files
chore: generated code for commit 6d524a6.
Co-authored-by: Clément Vannicatte <[email protected]>
1 parent 6d524a6 commit c5f14fd

File tree

57 files changed

+43
-17990
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+43
-17990
lines changed

clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/search/BaseSearchResponse.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public class BaseSearchResponse {
3333
private Boolean exhaustiveTypo;
3434

3535
@JsonProperty("facets")
36-
private Map<String, Map<String, String>> facets;
36+
private Map<String, Map<String, Integer>> facets;
3737

3838
@JsonProperty("facets_stats")
3939
private Map<String, FacetsStats> facetsStats;
@@ -195,12 +195,12 @@ public Boolean getExhaustiveTypo() {
195195
return exhaustiveTypo;
196196
}
197197

198-
public BaseSearchResponse setFacets(Map<String, Map<String, String>> facets) {
198+
public BaseSearchResponse setFacets(Map<String, Map<String, Integer>> facets) {
199199
this.facets = facets;
200200
return this;
201201
}
202202

203-
public BaseSearchResponse putFacets(String key, Map<String, String> facetsItem) {
203+
public BaseSearchResponse putFacets(String key, Map<String, Integer> facetsItem) {
204204
if (this.facets == null) {
205205
this.facets = new HashMap<>();
206206
}
@@ -214,7 +214,7 @@ public BaseSearchResponse putFacets(String key, Map<String, String> facetsItem)
214214
* @return facets
215215
*/
216216
@javax.annotation.Nullable
217-
public Map<String, Map<String, String>> getFacets() {
217+
public Map<String, Map<String, Integer>> getFacets() {
218218
return facets;
219219
}
220220

clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/search/BrowseResponse.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public class BrowseResponse<T> {
3535
private Boolean exhaustiveTypo;
3636

3737
@JsonProperty("facets")
38-
private Map<String, Map<String, String>> facets;
38+
private Map<String, Map<String, Integer>> facets;
3939

4040
@JsonProperty("facets_stats")
4141
private Map<String, FacetsStats> facetsStats;
@@ -203,12 +203,12 @@ public Boolean getExhaustiveTypo() {
203203
return exhaustiveTypo;
204204
}
205205

206-
public BrowseResponse setFacets(Map<String, Map<String, String>> facets) {
206+
public BrowseResponse setFacets(Map<String, Map<String, Integer>> facets) {
207207
this.facets = facets;
208208
return this;
209209
}
210210

211-
public BrowseResponse putFacets(String key, Map<String, String> facetsItem) {
211+
public BrowseResponse putFacets(String key, Map<String, Integer> facetsItem) {
212212
if (this.facets == null) {
213213
this.facets = new HashMap<>();
214214
}
@@ -222,7 +222,7 @@ public BrowseResponse putFacets(String key, Map<String, String> facetsItem) {
222222
* @return facets
223223
*/
224224
@javax.annotation.Nullable
225-
public Map<String, Map<String, String>> getFacets() {
225+
public Map<String, Map<String, Integer>> getFacets() {
226226
return facets;
227227
}
228228

clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/search/SearchHits.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,14 @@
1212
public class SearchHits<T> {
1313

1414
@JsonProperty("hits")
15-
private List<T> hits;
15+
private List<T> hits = new ArrayList<>();
1616

1717
public SearchHits setHits(List<T> hits) {
1818
this.hits = hits;
1919
return this;
2020
}
2121

2222
public SearchHits addHits(T hitsItem) {
23-
if (this.hits == null) {
24-
this.hits = new ArrayList<>();
25-
}
2623
this.hits.add(hitsItem);
2724
return this;
2825
}
@@ -32,7 +29,7 @@ public SearchHits addHits(T hitsItem) {
3229
*
3330
* @return hits
3431
*/
35-
@javax.annotation.Nullable
32+
@javax.annotation.Nonnull
3633
public List<T> getHits() {
3734
return hits;
3835
}

clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/search/SearchResponse.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public class SearchResponse<T> {
3535
private Boolean exhaustiveTypo;
3636

3737
@JsonProperty("facets")
38-
private Map<String, Map<String, String>> facets;
38+
private Map<String, Map<String, Integer>> facets;
3939

4040
@JsonProperty("facets_stats")
4141
private Map<String, FacetsStats> facetsStats;
@@ -200,12 +200,12 @@ public Boolean getExhaustiveTypo() {
200200
return exhaustiveTypo;
201201
}
202202

203-
public SearchResponse setFacets(Map<String, Map<String, String>> facets) {
203+
public SearchResponse setFacets(Map<String, Map<String, Integer>> facets) {
204204
this.facets = facets;
205205
return this;
206206
}
207207

208-
public SearchResponse putFacets(String key, Map<String, String> facetsItem) {
208+
public SearchResponse putFacets(String key, Map<String, Integer> facetsItem) {
209209
if (this.facets == null) {
210210
this.facets = new HashMap<>();
211211
}
@@ -219,7 +219,7 @@ public SearchResponse putFacets(String key, Map<String, String> facetsItem) {
219219
* @return facets
220220
*/
221221
@javax.annotation.Nullable
222-
public Map<String, Map<String, String>> getFacets() {
222+
public Map<String, Map<String, Integer>> getFacets() {
223223
return facets;
224224
}
225225

clients/algoliasearch-client-javascript/packages/algoliasearch/lite/model/baseSearchResponse.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export type BaseSearchResponse = {
3535
/**
3636
* A mapping of each facet name to the corresponding facet counts.
3737
*/
38-
facets?: Record<string, Record<string, string>>;
38+
facets?: Record<string, Record<string, number>>;
3939
/**
4040
* Statistics for numerical facets.
4141
*/

clients/algoliasearch-client-javascript/packages/algoliasearch/lite/model/searchHits.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
import type { Hit } from './hit';
44

55
export type SearchHits<T> = {
6-
hits?: Array<Hit<T>>;
6+
hits: Array<Hit<T>>;
77
};

clients/algoliasearch-client-javascript/packages/client-search/model/baseSearchResponse.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export type BaseSearchResponse = {
3535
/**
3636
* A mapping of each facet name to the corresponding facet counts.
3737
*/
38-
facets?: Record<string, Record<string, string>>;
38+
facets?: Record<string, Record<string, number>>;
3939
/**
4040
* Statistics for numerical facets.
4141
*/

clients/algoliasearch-client-javascript/packages/client-search/model/searchHits.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
import type { Hit } from './hit';
44

55
export type SearchHits<T> = {
6-
hits?: Array<Hit<T>>;
6+
hits: Array<Hit<T>>;
77
};

clients/algoliasearch-client-php/lib/Model/Search/BaseSearchResponse.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class BaseSearchResponse extends \Algolia\AlgoliaSearch\Model\AbstractModel impl
2828
'exhaustiveFacetsCount' => 'bool',
2929
'exhaustiveNbHits' => 'bool',
3030
'exhaustiveTypo' => 'bool',
31-
'facets' => 'array<string,array<string,string>>',
31+
'facets' => 'array<string,array<string,int>>',
3232
'facetsStats' => 'array<string,\Algolia\AlgoliaSearch\Model\Search\FacetsStats>',
3333
'hitsPerPage' => 'int',
3434
'index' => 'string',
@@ -551,7 +551,7 @@ public function setExhaustiveTypo($exhaustiveTypo)
551551
/**
552552
* Gets facets
553553
*
554-
* @return array<string,array<string,string>>|null
554+
* @return array<string,array<string,int>>|null
555555
*/
556556
public function getFacets()
557557
{
@@ -561,7 +561,7 @@ public function getFacets()
561561
/**
562562
* Sets facets
563563
*
564-
* @param array<string,array<string,string>>|null $facets a mapping of each facet name to the corresponding facet counts
564+
* @param array<string,array<string,int>>|null $facets a mapping of each facet name to the corresponding facet counts
565565
*
566566
* @return self
567567
*/

clients/algoliasearch-client-php/lib/Model/Search/BrowseResponse.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class BrowseResponse extends \Algolia\AlgoliaSearch\Model\AbstractModel implemen
2828
'exhaustiveFacetsCount' => 'bool',
2929
'exhaustiveNbHits' => 'bool',
3030
'exhaustiveTypo' => 'bool',
31-
'facets' => 'array<string,array<string,string>>',
31+
'facets' => 'array<string,array<string,int>>',
3232
'facetsStats' => 'array<string,\Algolia\AlgoliaSearch\Model\Search\FacetsStats>',
3333
'hitsPerPage' => 'int',
3434
'index' => 'string',
@@ -577,7 +577,7 @@ public function setExhaustiveTypo($exhaustiveTypo)
577577
/**
578578
* Gets facets
579579
*
580-
* @return array<string,array<string,string>>|null
580+
* @return array<string,array<string,int>>|null
581581
*/
582582
public function getFacets()
583583
{
@@ -587,7 +587,7 @@ public function getFacets()
587587
/**
588588
* Sets facets
589589
*
590-
* @param array<string,array<string,string>>|null $facets a mapping of each facet name to the corresponding facet counts
590+
* @param array<string,array<string,int>>|null $facets a mapping of each facet name to the corresponding facet counts
591591
*
592592
* @return self
593593
*/

clients/algoliasearch-client-php/lib/Model/Search/SearchHits.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,13 @@ public function listInvalidProperties()
119119
{
120120
$invalidProperties = [];
121121

122+
if (
123+
!isset($this->container['hits']) ||
124+
$this->container['hits'] === null
125+
) {
126+
$invalidProperties[] = "'hits' can't be null";
127+
}
128+
122129
return $invalidProperties;
123130
}
124131

@@ -136,7 +143,7 @@ public function valid()
136143
/**
137144
* Gets hits
138145
*
139-
* @return \Algolia\AlgoliaSearch\Model\Search\Hit[]|null
146+
* @return \Algolia\AlgoliaSearch\Model\Search\Hit[]
140147
*/
141148
public function getHits()
142149
{
@@ -146,7 +153,7 @@ public function getHits()
146153
/**
147154
* Sets hits
148155
*
149-
* @param \Algolia\AlgoliaSearch\Model\Search\Hit[]|null $hits hits
156+
* @param \Algolia\AlgoliaSearch\Model\Search\Hit[] $hits hits
150157
*
151158
* @return self
152159
*/

clients/algoliasearch-client-php/lib/Model/Search/SearchResponse.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class SearchResponse extends \Algolia\AlgoliaSearch\Model\AbstractModel implemen
2828
'exhaustiveFacetsCount' => 'bool',
2929
'exhaustiveNbHits' => 'bool',
3030
'exhaustiveTypo' => 'bool',
31-
'facets' => 'array<string,array<string,string>>',
31+
'facets' => 'array<string,array<string,int>>',
3232
'facetsStats' => 'array<string,\Algolia\AlgoliaSearch\Model\Search\FacetsStats>',
3333
'hitsPerPage' => 'int',
3434
'index' => 'string',
@@ -564,7 +564,7 @@ public function setExhaustiveTypo($exhaustiveTypo)
564564
/**
565565
* Gets facets
566566
*
567-
* @return array<string,array<string,string>>|null
567+
* @return array<string,array<string,int>>|null
568568
*/
569569
public function getFacets()
570570
{
@@ -574,7 +574,7 @@ public function getFacets()
574574
/**
575575
* Sets facets
576576
*
577-
* @param array<string,array<string,string>>|null $facets a mapping of each facet name to the corresponding facet counts
577+
* @param array<string,array<string,int>>|null $facets a mapping of each facet name to the corresponding facet counts
578578
*
579579
* @return self
580580
*/

specs/bundled/algoliasearch.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -964,7 +964,6 @@ components:
964964
type: object
965965
additionalProperties: false
966966
required:
967-
- hits
968967
- nbHits
969968
- page
970969
- nbPages
@@ -1011,7 +1010,7 @@ components:
10111010
additionalProperties:
10121011
type: object
10131012
additionalProperties:
1014-
type: string
1013+
type: integer
10151014
description: A mapping of each facet name to the corresponding facet counts.
10161015
example:
10171016
category:
@@ -1275,6 +1274,8 @@ components:
12751274
type: array
12761275
items:
12771276
$ref: '#/components/schemas/hit'
1277+
required:
1278+
- hits
12781279
SearchResponse:
12791280
allOf:
12801281
- $ref: '#/components/schemas/baseSearchResponse'

specs/bundled/recommend.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -923,7 +923,6 @@ components:
923923
type: object
924924
additionalProperties: false
925925
required:
926-
- hits
927926
- nbHits
928927
- page
929928
- nbPages
@@ -970,7 +969,7 @@ components:
970969
additionalProperties:
971970
type: object
972971
additionalProperties:
973-
type: string
972+
type: integer
974973
description: A mapping of each facet name to the corresponding facet counts.
975974
example:
976975
category:

specs/bundled/search.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -964,7 +964,6 @@ components:
964964
type: object
965965
additionalProperties: false
966966
required:
967-
- hits
968967
- nbHits
969968
- page
970969
- nbPages
@@ -1011,7 +1010,7 @@ components:
10111010
additionalProperties:
10121011
type: object
10131012
additionalProperties:
1014-
type: string
1013+
type: integer
10151014
description: A mapping of each facet name to the corresponding facet counts.
10161015
example:
10171016
category:
@@ -1275,6 +1274,8 @@ components:
12751274
type: array
12761275
items:
12771276
$ref: '#/components/schemas/hit'
1277+
required:
1278+
- hits
12781279
SearchResponse:
12791280
allOf:
12801281
- $ref: '#/components/schemas/baseSearchResponse'

0 commit comments

Comments
 (0)