Skip to content

Commit

Permalink
fix(specs): ingestion search endpoint (#3487) (generated) [skip ci]
Browse files Browse the repository at this point in the history
Co-authored-by: Clément Vannicatte <vannicattec@gmail.com>
  • Loading branch information
algolia-bot and shortcuts committed Aug 7, 2024
1 parent eab2887 commit 41a6f11
Show file tree
Hide file tree
Showing 35 changed files with 168 additions and 160 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,15 @@ public partial class TransformationSearch
/// <summary>
/// Initializes a new instance of the TransformationSearch class.
/// </summary>
[JsonConstructor]
public TransformationSearch() { }
/// <summary>
/// Initializes a new instance of the TransformationSearch class.
/// </summary>
/// <param name="transformationsIDs">transformationsIDs (required).</param>
public TransformationSearch(List<string> transformationsIDs)
public TransformationSearch()
{
TransformationsIDs = transformationsIDs ?? throw new ArgumentNullException(nameof(transformationsIDs));
}

/// <summary>
/// Gets or Sets TransformationsIDs
/// Gets or Sets TransformationIDs
/// </summary>
[JsonPropertyName("transformationsIDs")]
public List<string> TransformationsIDs { get; set; }
[JsonPropertyName("transformationIDs")]
public List<string> TransformationIDs { get; set; }

/// <summary>
/// Returns the string presentation of the object
Expand All @@ -44,7 +37,7 @@ public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.Append("class TransformationSearch {\n");
sb.Append(" TransformationsIDs: ").Append(TransformationsIDs).Append("\n");
sb.Append(" TransformationIDs: ").Append(TransformationIDs).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
Expand All @@ -71,7 +64,7 @@ public override bool Equals(object obj)
}

return
(TransformationsIDs == input.TransformationsIDs || TransformationsIDs != null && input.TransformationsIDs != null && TransformationsIDs.SequenceEqual(input.TransformationsIDs));
(TransformationIDs == input.TransformationIDs || TransformationIDs != null && input.TransformationIDs != null && TransformationIDs.SequenceEqual(input.TransformationIDs));
}

/// <summary>
Expand All @@ -83,9 +76,9 @@ public override int GetHashCode()
unchecked // Overflow is fine, just wrap
{
int hashCode = 41;
if (TransformationsIDs != null)
if (TransformationIDs != null)
{
hashCode = (hashCode * 59) + TransformationsIDs.GetHashCode();
hashCode = (hashCode * 59) + TransformationIDs.GetHashCode();
}
return hashCode;
}
Expand Down

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,23 +12,26 @@
/** TransformationSearch */
public class TransformationSearch {

@JsonProperty("transformationsIDs")
private List<String> transformationsIDs = new ArrayList<>();
@JsonProperty("transformationIDs")
private List<String> transformationIDs;

public TransformationSearch setTransformationsIDs(List<String> transformationsIDs) {
this.transformationsIDs = transformationsIDs;
public TransformationSearch setTransformationIDs(List<String> transformationIDs) {
this.transformationIDs = transformationIDs;
return this;
}

public TransformationSearch addTransformationsIDs(String transformationsIDsItem) {
this.transformationsIDs.add(transformationsIDsItem);
public TransformationSearch addTransformationIDs(String transformationIDsItem) {
if (this.transformationIDs == null) {
this.transformationIDs = new ArrayList<>();
}
this.transformationIDs.add(transformationIDsItem);
return this;
}

/** Get transformationsIDs */
@javax.annotation.Nonnull
public List<String> getTransformationsIDs() {
return transformationsIDs;
/** Get transformationIDs */
@javax.annotation.Nullable
public List<String> getTransformationIDs() {
return transformationIDs;
}

@Override
Expand All @@ -40,19 +43,19 @@ public boolean equals(Object o) {
return false;
}
TransformationSearch transformationSearch = (TransformationSearch) o;
return Objects.equals(this.transformationsIDs, transformationSearch.transformationsIDs);
return Objects.equals(this.transformationIDs, transformationSearch.transformationIDs);
}

@Override
public int hashCode() {
return Objects.hash(transformationsIDs);
return Objects.hash(transformationIDs);
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class TransformationSearch {\n");
sb.append(" transformationsIDs: ").append(toIndentedString(transformationsIDs)).append("\n");
sb.append(" transformationIDs: ").append(toIndentedString(transformationIDs)).append("\n");
sb.append("}");
return sb.toString();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// 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 TransformationSearch = {
transformationsIDs: string[];
transformationIDs?: string[];
};
Original file line number Diff line number Diff line change
Expand Up @@ -2351,12 +2351,6 @@ export function createIngestionClient({
);
}

if (!transformationSearch.transformationsIDs) {
throw new Error(
'Parameter `transformationSearch.transformationsIDs` is required when calling `searchTransformations`.'
);
}

const requestPath = '/1/transformations/search';
const headers: Headers = {};
const queryParameters: QueryParameters = {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import kotlinx.serialization.json.*
/**
* TransformationSearch
*
* @param transformationsIDs
* @param transformationIDs
*/
@Serializable
public data class TransformationSearch(

@SerialName(value = "transformationsIDs") val transformationsIDs: List<String>,
@SerialName(value = "transformationIDs") val transformationIDs: List<String>? = null,
)
Original file line number Diff line number Diff line change
Expand Up @@ -2173,7 +2173,7 @@ public function searchTasksV1($taskSearch, $requestOptions = [])
* - editSettings
*
* @param array $transformationSearch transformationSearch (required)
* - $transformationSearch['transformationsIDs'] => (array) (required)
* - $transformationSearch['transformationIDs'] => (array)
*
* @see TransformationSearch
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class TransformationSearch extends AbstractModel implements ModelInterface, \Arr
* @var string[]
*/
protected static $modelTypes = [
'transformationsIDs' => 'string[]',
'transformationIDs' => 'string[]',
];

/**
Expand All @@ -28,7 +28,7 @@ class TransformationSearch extends AbstractModel implements ModelInterface, \Arr
* @var string[]
*/
protected static $modelFormats = [
'transformationsIDs' => null,
'transformationIDs' => null,
];

/**
Expand All @@ -38,7 +38,7 @@ class TransformationSearch extends AbstractModel implements ModelInterface, \Arr
* @var string[]
*/
protected static $attributeMap = [
'transformationsIDs' => 'transformationsIDs',
'transformationIDs' => 'transformationIDs',
];

/**
Expand All @@ -47,7 +47,7 @@ class TransformationSearch extends AbstractModel implements ModelInterface, \Arr
* @var string[]
*/
protected static $setters = [
'transformationsIDs' => 'setTransformationsIDs',
'transformationIDs' => 'setTransformationIDs',
];

/**
Expand All @@ -56,7 +56,7 @@ class TransformationSearch extends AbstractModel implements ModelInterface, \Arr
* @var string[]
*/
protected static $getters = [
'transformationsIDs' => 'getTransformationsIDs',
'transformationIDs' => 'getTransformationIDs',
];

/**
Expand All @@ -73,8 +73,8 @@ class TransformationSearch extends AbstractModel implements ModelInterface, \Arr
*/
public function __construct(?array $data = null)
{
if (isset($data['transformationsIDs'])) {
$this->container['transformationsIDs'] = $data['transformationsIDs'];
if (isset($data['transformationIDs'])) {
$this->container['transformationIDs'] = $data['transformationIDs'];
}
}

Expand Down Expand Up @@ -136,13 +136,7 @@ public static function getters()
*/
public function listInvalidProperties()
{
$invalidProperties = [];

if (!isset($this->container['transformationsIDs']) || null === $this->container['transformationsIDs']) {
$invalidProperties[] = "'transformationsIDs' can't be null";
}

return $invalidProperties;
return [];
}

/**
Expand All @@ -157,25 +151,25 @@ public function valid()
}

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

/**
* Sets transformationsIDs.
* Sets transformationIDs.
*
* @param string[] $transformationsIDs transformationsIDs
* @param null|string[] $transformationIDs transformationIDs
*
* @return self
*/
public function setTransformationsIDs($transformationsIDs)
public function setTransformationIDs($transformationIDs)
{
$this->container['transformationsIDs'] = $transformationsIDs;
$this->container['transformationIDs'] = $transformationIDs;

return $this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from __future__ import annotations

from json import loads
from typing import Any, Dict, List, Self
from typing import Any, Dict, List, Optional, Self

from pydantic import BaseModel, ConfigDict, Field, StrictStr

Expand All @@ -17,7 +17,9 @@ class TransformationSearch(BaseModel):
TransformationSearch
"""

transformations_ids: List[StrictStr] = Field(alias="transformationsIDs")
transformation_ids: Optional[List[StrictStr]] = Field(
default=None, alias="transformationIDs"
)

model_config = ConfigDict(
use_enum_values=True, populate_by_name=True, validate_assignment=True
Expand Down Expand Up @@ -57,5 +59,5 @@ def from_dict(cls, obj: Dict) -> Self:
if not isinstance(obj, dict):
return cls.model_validate(obj)

_obj = cls.model_validate({"transformationsIDs": obj.get("transformationsIDs")})
_obj = cls.model_validate({"transformationIDs": obj.get("transformationIDs")})
return _obj
Loading

0 comments on commit 41a6f11

Please sign in to comment.