Skip to content

Commit 18cf950

Browse files
algolia-botmillotp
andcommitted
chore: generated code for commit 337eea9. [skip ci]
Co-authored-by: Pierre Millot <[email protected]>
1 parent 337eea9 commit 18cf950

File tree

19 files changed

+63
-83
lines changed

19 files changed

+63
-83
lines changed

clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/GetRecommendationsResponse.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,15 @@ public partial class GetRecommendationsResponse
1919
/// <summary>
2020
/// Initializes a new instance of the GetRecommendationsResponse class.
2121
/// </summary>
22-
public GetRecommendationsResponse()
22+
[JsonConstructor]
23+
public GetRecommendationsResponse() { }
24+
/// <summary>
25+
/// Initializes a new instance of the GetRecommendationsResponse class.
26+
/// </summary>
27+
/// <param name="results">results (required).</param>
28+
public GetRecommendationsResponse(List<RecommendationsResults> results)
2329
{
30+
Results = results ?? throw new ArgumentNullException(nameof(results));
2431
}
2532

2633
/// <summary>

clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/get_recommendations_response.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ part 'get_recommendations_response.g.dart';
1010
final class GetRecommendationsResponse {
1111
/// Returns a new [GetRecommendationsResponse] instance.
1212
const GetRecommendationsResponse({
13-
this.results,
13+
required this.results,
1414
});
1515

1616
@JsonKey(name: r'results')
17-
final List<RecommendationsResults>? results;
17+
final List<RecommendationsResults> results;
1818

1919
@override
2020
bool operator ==(Object other) =>

clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/get_recommendations_response.g.dart

Lines changed: 6 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

clients/algoliasearch-client-dart/packages/client_recommend/example/example.dart

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,6 @@ void main() async {
4040
/// Prints the search hits.
4141
void printRecommendations(GetRecommendationsResponse response) {
4242
final results = response.results;
43-
if (results == null) {
44-
print("No recommendations found");
45-
return;
46-
}
4743

4844
// Loop over each result and map over the search hits,
4945
// converting each hit to a product.

clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/get_recommendations_response.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ part 'get_recommendations_response.g.dart';
1010
final class GetRecommendationsResponse {
1111
/// Returns a new [GetRecommendationsResponse] instance.
1212
const GetRecommendationsResponse({
13-
this.results,
13+
required this.results,
1414
});
1515

1616
@JsonKey(name: r'results')
17-
final List<RecommendationsResults>? results;
17+
final List<RecommendationsResults> results;
1818

1919
@override
2020
bool operator ==(Object other) =>

clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/get_recommendations_response.g.dart

Lines changed: 6 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

clients/algoliasearch-client-go/algolia/recommend/model_get_recommendations_response.go

Lines changed: 10 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/recommend/GetRecommendationsResponse.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,20 @@
1313
public class GetRecommendationsResponse {
1414

1515
@JsonProperty("results")
16-
private List<RecommendationsResults> results;
16+
private List<RecommendationsResults> results = new ArrayList<>();
1717

1818
public GetRecommendationsResponse setResults(List<RecommendationsResults> results) {
1919
this.results = results;
2020
return this;
2121
}
2222

2323
public GetRecommendationsResponse addResults(RecommendationsResults resultsItem) {
24-
if (this.results == null) {
25-
this.results = new ArrayList<>();
26-
}
2724
this.results.add(resultsItem);
2825
return this;
2926
}
3027

3128
/** Get results */
32-
@javax.annotation.Nullable
29+
@javax.annotation.Nonnull
3330
public List<RecommendationsResults> getResults() {
3431
return results;
3532
}

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

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

55
export type GetRecommendationsResponse = {
6-
results?: RecommendationsResults[];
6+
results: RecommendationsResults[];
77
};

clients/algoliasearch-client-javascript/packages/recommend/model/getRecommendationsResponse.ts

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

55
export type GetRecommendationsResponse = {
6-
results?: RecommendationsResults[];
6+
results: RecommendationsResults[];
77
};

0 commit comments

Comments
 (0)