Skip to content

Commit

Permalink
feat(specs): add missing message attribute to GetObjectsResponse [ski…
Browse files Browse the repository at this point in the history
…p-bc] (#4029) (generated) [skip ci]

Co-authored-by: Vincent Lemeunier <vincentlemeunier+git@gmail.com>
  • Loading branch information
algolia-bot and kombucha committed Oct 24, 2024
1 parent 312d337 commit c16b91d
Show file tree
Hide file tree
Showing 23 changed files with 188 additions and 21 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.

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,
)
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class GetObjectsResponse extends AbstractModel implements ModelInterface, \Array
* @var string[]
*/
protected static $modelTypes = [
'message' => 'string',
'results' => 'object[]',
];

Expand All @@ -29,6 +30,7 @@ class GetObjectsResponse extends AbstractModel implements ModelInterface, \Array
* @var string[]
*/
protected static $modelFormats = [
'message' => null,
'results' => null,
];

Expand All @@ -39,6 +41,7 @@ class GetObjectsResponse extends AbstractModel implements ModelInterface, \Array
* @var string[]
*/
protected static $attributeMap = [
'message' => 'message',
'results' => 'results',
];

Expand All @@ -48,6 +51,7 @@ class GetObjectsResponse extends AbstractModel implements ModelInterface, \Array
* @var string[]
*/
protected static $setters = [
'message' => 'setMessage',
'results' => 'setResults',
];

Expand All @@ -57,6 +61,7 @@ class GetObjectsResponse extends AbstractModel implements ModelInterface, \Array
* @var string[]
*/
protected static $getters = [
'message' => 'getMessage',
'results' => 'getResults',
];

Expand All @@ -74,6 +79,9 @@ class GetObjectsResponse extends AbstractModel implements ModelInterface, \Array
*/
public function __construct(?array $data = null)
{
if (isset($data['message'])) {
$this->container['message'] = $data['message'];
}
if (isset($data['results'])) {
$this->container['results'] = $data['results'];
}
Expand Down Expand Up @@ -157,6 +165,30 @@ public function valid()
return 0 === count($this->listInvalidProperties());
}

/**
* Gets message.
*
* @return null|string
*/
public function getMessage()
{
return $this->container['message'] ?? null;
}

/**
* Sets message.
*
* @param null|string $message an optional status message
*
* @return self
*/
public function setMessage($message)
{
$this->container['message'] = $message;

return $this;
}

/**
* Gets results.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@


_ALIASES = {
"message": "message",
"results": "results",
}

Expand All @@ -32,6 +33,8 @@ class GetObjectsResponse(BaseModel):
GetObjectsResponse
"""

message: Optional[str] = None
""" An optional status message. """
results: List[object]
""" Retrieved records. """

Expand Down
Loading

0 comments on commit c16b91d

Please sign in to comment.