Skip to content

Commit

Permalink
feat(specs): add missing message attribute to GetObjectsResponse (gen…
Browse files Browse the repository at this point in the history
…erated)

Co-authored-by: Vincent Lemeunier <vincent.lemeunier@algolia.com>
  • Loading branch information
algolia-bot and kombucha committed Oct 24, 2024
1 parent a22dd04 commit 17da8d0
Show file tree
Hide file tree
Showing 40 changed files with 395 additions and 153 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ public GetObjectsResponse(List<T> results)
Results = results ?? throw new ArgumentNullException(nameof(results));
}

/// <summary>
/// An optional status message.
/// </summary>
/// <value>An optional status message.</value>
[JsonPropertyName("message")]
public string Message { get; set; }

/// <summary>
/// Retrieved records.
/// </summary>
Expand All @@ -45,6 +52,7 @@ public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.Append("class GetObjectsResponse {\n");
sb.Append(" Message: ").Append(Message).Append("\n");
sb.Append(" Results: ").Append(Results).Append("\n");
sb.Append("}\n");
return sb.ToString();
Expand Down Expand Up @@ -72,6 +80,7 @@ public override bool Equals(object obj)
}

return
(Message == input.Message || (Message != null && Message.Equals(input.Message))) &&
(Results == input.Results || Results != null && input.Results != null && Results.SequenceEqual(input.Results));
}

Expand All @@ -84,6 +93,10 @@ public override int GetHashCode()
unchecked // Overflow is fine, just wrap
{
int hashCode = 41;
if (Message != null)
{
hashCode = (hashCode * 59) + Message.GetHashCode();
}
if (Results != null)
{
hashCode = (hashCode * 59) + Results.GetHashCode();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,27 @@ part 'get_objects_response.g.dart';
final class GetObjectsResponse {
/// Returns a new [GetObjectsResponse] instance.
const GetObjectsResponse({
this.message,
required this.results,
});

/// An optional status message.
@JsonKey(name: r'message')
final String? message;

/// Retrieved records.
@JsonKey(name: r'results')
final List<Object> results;

@override
bool operator ==(Object other) =>
identical(this, other) ||
other is GetObjectsResponse && other.results == results;
other is GetObjectsResponse &&
other.message == message &&
other.results == results;

@override
int get hashCode => results.hashCode;
int get hashCode => message.hashCode + results.hashCode;

factory GetObjectsResponse.fromJson(Map<String, dynamic> json) =>
_$GetObjectsResponseFromJson(json);
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions clients/algoliasearch-client-go/algolia/abtesting/client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions clients/algoliasearch-client-go/algolia/analytics/client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions clients/algoliasearch-client-go/algolia/ingestion/client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions clients/algoliasearch-client-go/algolia/insights/client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions clients/algoliasearch-client-go/algolia/monitoring/client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions clients/algoliasearch-client-go/algolia/recommend/client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,23 @@
/** GetObjectsResponse */
public class GetObjectsResponse<T> {

@JsonProperty("message")
private String message;

@JsonProperty("results")
private List<T> results = new ArrayList<>();

public GetObjectsResponse<T> setMessage(String message) {
this.message = message;
return this;
}

/** An optional status message. */
@javax.annotation.Nullable
public String getMessage() {
return message;
}

public GetObjectsResponse<T> setResults(List<T> results) {
this.results = results;
return this;
Expand All @@ -40,18 +54,19 @@ public boolean equals(Object o) {
return false;
}
GetObjectsResponse<?> getObjectsResponse = (GetObjectsResponse<?>) o;
return Objects.equals(this.results, getObjectsResponse.results);
return Objects.equals(this.message, getObjectsResponse.message) && Objects.equals(this.results, getObjectsResponse.results);
}

@Override
public int hashCode() {
return Objects.hash(results);
return Objects.hash(message, results);
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class GetObjectsResponse {\n");
sb.append(" message: ").append(toIndentedString(message)).append("\n");
sb.append(" results: ").append(toIndentedString(results)).append("\n");
sb.append("}");
return sb.toString();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.

export type GetObjectsResponse<T = Record<string, unknown>> = {
/**
* An optional status message.
*/
message?: string;

/**
* Retrieved records.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@ import kotlinx.serialization.json.*
* GetObjectsResponse
*
* @param results Retrieved records.
* @param message An optional status message.
*/
@Serializable
public data class GetObjectsResponse(

/** Retrieved records. */
@SerialName(value = "results") val results: List<JsonObject>,

/** An optional status message. */
@SerialName(value = "message") val message: String? = null,
)
Loading

0 comments on commit 17da8d0

Please sign in to comment.