From 955310a5120ca4843b3ec08e5405a354104155ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Vannicatte?= Date: Thu, 19 May 2022 14:12:05 +0200 Subject: [PATCH] fix(clients): remove old models --- .../java/com/algolia/model/search/Indice.java | 303 ---------- .../algoliasearch-lite/model/indice.ts | 46 -- .../model/sourceIndiceWithReplicas.ts | 39 -- .../model/sucessResponse.ts | 10 - .../packages/client-search/model/indice.ts | 46 -- .../SourceIndiceWithReplicas.php | 477 --------------- .../Model/QuerySuggestions/SucessResponse.php | 253 -------- .../lib/Model/Search/Indice.php | 569 ------------------ 8 files changed, 1743 deletions(-) delete mode 100644 clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/search/Indice.java delete mode 100644 clients/algoliasearch-client-javascript/packages/algoliasearch-lite/model/indice.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/client-query-suggestions/model/sourceIndiceWithReplicas.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/client-query-suggestions/model/sucessResponse.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/client-search/model/indice.ts delete mode 100644 clients/algoliasearch-client-php/lib/Model/QuerySuggestions/SourceIndiceWithReplicas.php delete mode 100644 clients/algoliasearch-client-php/lib/Model/QuerySuggestions/SucessResponse.php delete mode 100644 clients/algoliasearch-client-php/lib/Model/Search/Indice.php diff --git a/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/search/Indice.java b/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/search/Indice.java deleted file mode 100644 index dd6f74f002..0000000000 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/search/Indice.java +++ /dev/null @@ -1,303 +0,0 @@ -package com.algolia.model.search; - -import com.google.gson.annotations.SerializedName; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** Indice */ -public class Indice { - - @SerializedName("name") - private String name; - - @SerializedName("createdAt") - private String createdAt; - - @SerializedName("updatedAt") - private String updatedAt; - - @SerializedName("entries") - private Integer entries; - - @SerializedName("dataSize") - private Integer dataSize; - - @SerializedName("fileSize") - private Integer fileSize; - - @SerializedName("lastBuildTimeS") - private Integer lastBuildTimeS; - - @SerializedName("numberOfPendingTask") - private Integer numberOfPendingTask; - - @SerializedName("pendingTask") - private Boolean pendingTask; - - @SerializedName("primary") - private String primary; - - @SerializedName("replicas") - private List replicas = null; - - public Indice setName(String name) { - this.name = name; - return this; - } - - /** - * Index name. - * - * @return name - */ - @javax.annotation.Nonnull - public String getName() { - return name; - } - - public Indice setCreatedAt(String createdAt) { - this.createdAt = createdAt; - return this; - } - - /** - * Index creation date. An empty string means that the index has no records. - * - * @return createdAt - */ - @javax.annotation.Nonnull - public String getCreatedAt() { - return createdAt; - } - - public Indice setUpdatedAt(String updatedAt) { - this.updatedAt = updatedAt; - return this; - } - - /** - * Date of last update (ISO-8601 format). - * - * @return updatedAt - */ - @javax.annotation.Nonnull - public String getUpdatedAt() { - return updatedAt; - } - - public Indice setEntries(Integer entries) { - this.entries = entries; - return this; - } - - /** - * Number of records contained in the index. - * - * @return entries - */ - @javax.annotation.Nonnull - public Integer getEntries() { - return entries; - } - - public Indice setDataSize(Integer dataSize) { - this.dataSize = dataSize; - return this; - } - - /** - * Number of bytes of the index in minified format. - * - * @return dataSize - */ - @javax.annotation.Nonnull - public Integer getDataSize() { - return dataSize; - } - - public Indice setFileSize(Integer fileSize) { - this.fileSize = fileSize; - return this; - } - - /** - * Number of bytes of the index binary file. - * - * @return fileSize - */ - @javax.annotation.Nonnull - public Integer getFileSize() { - return fileSize; - } - - public Indice setLastBuildTimeS(Integer lastBuildTimeS) { - this.lastBuildTimeS = lastBuildTimeS; - return this; - } - - /** - * Last build time. - * - * @return lastBuildTimeS - */ - @javax.annotation.Nonnull - public Integer getLastBuildTimeS() { - return lastBuildTimeS; - } - - public Indice setNumberOfPendingTask(Integer numberOfPendingTask) { - this.numberOfPendingTask = numberOfPendingTask; - return this; - } - - /** - * Number of pending indexing operations. This value is deprecated and should not be used. - * - * @return numberOfPendingTask - */ - @javax.annotation.Nullable - public Integer getNumberOfPendingTask() { - return numberOfPendingTask; - } - - public Indice setPendingTask(Boolean pendingTask) { - this.pendingTask = pendingTask; - return this; - } - - /** - * A boolean which says whether the index has pending tasks. This value is deprecated and should - * not be used. - * - * @return pendingTask - */ - @javax.annotation.Nonnull - public Boolean getPendingTask() { - return pendingTask; - } - - public Indice setPrimary(String primary) { - this.primary = primary; - return this; - } - - /** - * Only present if the index is a replica. Contains the name of the related primary index. - * - * @return primary - */ - @javax.annotation.Nullable - public String getPrimary() { - return primary; - } - - public Indice setReplicas(List replicas) { - this.replicas = replicas; - return this; - } - - public Indice addReplicas(String replicasItem) { - if (this.replicas == null) { - this.replicas = new ArrayList<>(); - } - this.replicas.add(replicasItem); - return this; - } - - /** - * Only present if the index is a primary index with replicas. Contains the names of all linked - * replicas. - * - * @return replicas - */ - @javax.annotation.Nullable - public List getReplicas() { - return replicas; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Indice indice = (Indice) o; - return ( - Objects.equals(this.name, indice.name) && - Objects.equals(this.createdAt, indice.createdAt) && - Objects.equals(this.updatedAt, indice.updatedAt) && - Objects.equals(this.entries, indice.entries) && - Objects.equals(this.dataSize, indice.dataSize) && - Objects.equals(this.fileSize, indice.fileSize) && - Objects.equals(this.lastBuildTimeS, indice.lastBuildTimeS) && - Objects.equals(this.numberOfPendingTask, indice.numberOfPendingTask) && - Objects.equals(this.pendingTask, indice.pendingTask) && - Objects.equals(this.primary, indice.primary) && - Objects.equals(this.replicas, indice.replicas) - ); - } - - @Override - public int hashCode() { - return Objects.hash( - name, - createdAt, - updatedAt, - entries, - dataSize, - fileSize, - lastBuildTimeS, - numberOfPendingTask, - pendingTask, - primary, - replicas - ); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Indice {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb - .append(" createdAt: ") - .append(toIndentedString(createdAt)) - .append("\n"); - sb - .append(" updatedAt: ") - .append(toIndentedString(updatedAt)) - .append("\n"); - sb.append(" entries: ").append(toIndentedString(entries)).append("\n"); - sb.append(" dataSize: ").append(toIndentedString(dataSize)).append("\n"); - sb.append(" fileSize: ").append(toIndentedString(fileSize)).append("\n"); - sb - .append(" lastBuildTimeS: ") - .append(toIndentedString(lastBuildTimeS)) - .append("\n"); - sb - .append(" numberOfPendingTask: ") - .append(toIndentedString(numberOfPendingTask)) - .append("\n"); - sb - .append(" pendingTask: ") - .append(toIndentedString(pendingTask)) - .append("\n"); - sb.append(" primary: ").append(toIndentedString(primary)).append("\n"); - sb.append(" replicas: ").append(toIndentedString(replicas)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/clients/algoliasearch-client-javascript/packages/algoliasearch-lite/model/indice.ts b/clients/algoliasearch-client-javascript/packages/algoliasearch-lite/model/indice.ts deleted file mode 100644 index b5c963c297..0000000000 --- a/clients/algoliasearch-client-javascript/packages/algoliasearch-lite/model/indice.ts +++ /dev/null @@ -1,46 +0,0 @@ -export type Indice = { - /** - * Index name. - */ - name: string; - /** - * Index creation date. An empty string means that the index has no records. - */ - createdAt: string; - /** - * Date of last update (ISO-8601 format). - */ - updatedAt: string; - /** - * Number of records contained in the index. - */ - entries: number; - /** - * Number of bytes of the index in minified format. - */ - dataSize: number; - /** - * Number of bytes of the index binary file. - */ - fileSize: number; - /** - * Last build time. - */ - lastBuildTimeS: number; - /** - * Number of pending indexing operations. This value is deprecated and should not be used. - */ - numberOfPendingTask?: number; - /** - * A boolean which says whether the index has pending tasks. This value is deprecated and should not be used. - */ - pendingTask: boolean; - /** - * Only present if the index is a replica. Contains the name of the related primary index. - */ - primary?: string; - /** - * Only present if the index is a primary index with replicas. Contains the names of all linked replicas. - */ - replicas?: string[]; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-query-suggestions/model/sourceIndiceWithReplicas.ts b/clients/algoliasearch-client-javascript/packages/client-query-suggestions/model/sourceIndiceWithReplicas.ts deleted file mode 100644 index 0c3601e84a..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-query-suggestions/model/sourceIndiceWithReplicas.ts +++ /dev/null @@ -1,39 +0,0 @@ -import type { SourceIndexExternal } from './sourceIndexExternal'; - -/** - * Source indice with replicas used to generate a Query Suggestions index. - */ -export type SourceIndiceWithReplicas = { - /** - * True if the Query Suggestions index is a replicas. - */ - replicas: boolean; - /** - * Source index name. - */ - indexName: string; - /** - * List of analytics tags to filter the popular searches per tag. - */ - analyticsTags: string[]; - /** - * List of facets to define as categories for the query suggestions. - */ - facets: Array>; - /** - * Minimum number of hits (e.g., matching records in the source index) to generate a suggestions. - */ - minHits: number; - /** - * Minimum number of required letters for a suggestion to remain. - */ - minLetters: number; - /** - * List of facet attributes used to generate Query Suggestions. The resulting suggestions are every combination of the facets in the nested list (e.g., (facetA and facetB) and facetC). - */ - generate: string[][]; - /** - * List of external indices to use to generate custom Query Suggestions. - */ - external: SourceIndexExternal[]; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-query-suggestions/model/sucessResponse.ts b/clients/algoliasearch-client-javascript/packages/client-query-suggestions/model/sucessResponse.ts deleted file mode 100644 index 841e28fdb3..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-query-suggestions/model/sucessResponse.ts +++ /dev/null @@ -1,10 +0,0 @@ -export type SucessResponse = { - /** - * The status code. - */ - status: number; - /** - * Message of the response. - */ - message: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/indice.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/indice.ts deleted file mode 100644 index b5c963c297..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/indice.ts +++ /dev/null @@ -1,46 +0,0 @@ -export type Indice = { - /** - * Index name. - */ - name: string; - /** - * Index creation date. An empty string means that the index has no records. - */ - createdAt: string; - /** - * Date of last update (ISO-8601 format). - */ - updatedAt: string; - /** - * Number of records contained in the index. - */ - entries: number; - /** - * Number of bytes of the index in minified format. - */ - dataSize: number; - /** - * Number of bytes of the index binary file. - */ - fileSize: number; - /** - * Last build time. - */ - lastBuildTimeS: number; - /** - * Number of pending indexing operations. This value is deprecated and should not be used. - */ - numberOfPendingTask?: number; - /** - * A boolean which says whether the index has pending tasks. This value is deprecated and should not be used. - */ - pendingTask: boolean; - /** - * Only present if the index is a replica. Contains the name of the related primary index. - */ - primary?: string; - /** - * Only present if the index is a primary index with replicas. Contains the names of all linked replicas. - */ - replicas?: string[]; -}; diff --git a/clients/algoliasearch-client-php/lib/Model/QuerySuggestions/SourceIndiceWithReplicas.php b/clients/algoliasearch-client-php/lib/Model/QuerySuggestions/SourceIndiceWithReplicas.php deleted file mode 100644 index 8ce14baf50..0000000000 --- a/clients/algoliasearch-client-php/lib/Model/QuerySuggestions/SourceIndiceWithReplicas.php +++ /dev/null @@ -1,477 +0,0 @@ - 'bool', - 'indexName' => 'string', - 'analyticsTags' => 'string[]', - 'facets' => 'object[]', - 'minHits' => 'int', - 'minLetters' => 'int', - 'generate' => 'string[][]', - 'external' => '\Algolia\AlgoliaSearch\Model\QuerySuggestions\SourceIndexExternal[]', - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $modelFormats = [ - 'replicas' => null, - 'indexName' => null, - 'analyticsTags' => null, - 'facets' => null, - 'minHits' => null, - 'minLetters' => null, - 'generate' => null, - 'external' => null, - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function modelTypes() - { - return self::$modelTypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function modelFormats() - { - return self::$modelFormats; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'replicas' => 'setReplicas', - 'indexName' => 'setIndexName', - 'analyticsTags' => 'setAnalyticsTags', - 'facets' => 'setFacets', - 'minHits' => 'setMinHits', - 'minLetters' => 'setMinLetters', - 'generate' => 'setGenerate', - 'external' => 'setExternal', - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'replicas' => 'getReplicas', - 'indexName' => 'getIndexName', - 'analyticsTags' => 'getAnalyticsTags', - 'facets' => 'getFacets', - 'minHits' => 'getMinHits', - 'minLetters' => 'getMinLetters', - 'generate' => 'getGenerate', - 'external' => 'getExternal', - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - */ - public function __construct(array $data = null) - { - if (isset($data['replicas'])) { - $this->container['replicas'] = $data['replicas']; - } - if (isset($data['indexName'])) { - $this->container['indexName'] = $data['indexName']; - } - if (isset($data['analyticsTags'])) { - $this->container['analyticsTags'] = $data['analyticsTags']; - } - if (isset($data['facets'])) { - $this->container['facets'] = $data['facets']; - } - if (isset($data['minHits'])) { - $this->container['minHits'] = $data['minHits']; - } - if (isset($data['minLetters'])) { - $this->container['minLetters'] = $data['minLetters']; - } - if (isset($data['generate'])) { - $this->container['generate'] = $data['generate']; - } - if (isset($data['external'])) { - $this->container['external'] = $data['external']; - } - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ( - !isset($this->container['replicas']) || - $this->container['replicas'] === null - ) { - $invalidProperties[] = "'replicas' can't be null"; - } - if ( - !isset($this->container['indexName']) || - $this->container['indexName'] === null - ) { - $invalidProperties[] = "'indexName' can't be null"; - } - if ( - !isset($this->container['analyticsTags']) || - $this->container['analyticsTags'] === null - ) { - $invalidProperties[] = "'analyticsTags' can't be null"; - } - if ( - !isset($this->container['facets']) || - $this->container['facets'] === null - ) { - $invalidProperties[] = "'facets' can't be null"; - } - if ( - !isset($this->container['minHits']) || - $this->container['minHits'] === null - ) { - $invalidProperties[] = "'minHits' can't be null"; - } - if ( - !isset($this->container['minLetters']) || - $this->container['minLetters'] === null - ) { - $invalidProperties[] = "'minLetters' can't be null"; - } - if ( - !isset($this->container['generate']) || - $this->container['generate'] === null - ) { - $invalidProperties[] = "'generate' can't be null"; - } - if ( - !isset($this->container['external']) || - $this->container['external'] === null - ) { - $invalidProperties[] = "'external' can't be null"; - } - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - /** - * Gets replicas - * - * @return bool - */ - public function getReplicas() - { - return $this->container['replicas'] ?? null; - } - - /** - * Sets replicas - * - * @param bool $replicas true if the Query Suggestions index is a replicas - * - * @return self - */ - public function setReplicas($replicas) - { - $this->container['replicas'] = $replicas; - - return $this; - } - - /** - * Gets indexName - * - * @return string - */ - public function getIndexName() - { - return $this->container['indexName'] ?? null; - } - - /** - * Sets indexName - * - * @param string $indexName source index name - * - * @return self - */ - public function setIndexName($indexName) - { - $this->container['indexName'] = $indexName; - - return $this; - } - - /** - * Gets analyticsTags - * - * @return string[] - */ - public function getAnalyticsTags() - { - return $this->container['analyticsTags'] ?? null; - } - - /** - * Sets analyticsTags - * - * @param string[] $analyticsTags list of analytics tags to filter the popular searches per tag - * - * @return self - */ - public function setAnalyticsTags($analyticsTags) - { - $this->container['analyticsTags'] = $analyticsTags; - - return $this; - } - - /** - * Gets facets - * - * @return object[] - */ - public function getFacets() - { - return $this->container['facets'] ?? null; - } - - /** - * Sets facets - * - * @param object[] $facets list of facets to define as categories for the query suggestions - * - * @return self - */ - public function setFacets($facets) - { - $this->container['facets'] = $facets; - - return $this; - } - - /** - * Gets minHits - * - * @return int - */ - public function getMinHits() - { - return $this->container['minHits'] ?? null; - } - - /** - * Sets minHits - * - * @param int $minHits Minimum number of hits (e.g., matching records in the source index) to generate a suggestions. - * - * @return self - */ - public function setMinHits($minHits) - { - $this->container['minHits'] = $minHits; - - return $this; - } - - /** - * Gets minLetters - * - * @return int - */ - public function getMinLetters() - { - return $this->container['minLetters'] ?? null; - } - - /** - * Sets minLetters - * - * @param int $minLetters minimum number of required letters for a suggestion to remain - * - * @return self - */ - public function setMinLetters($minLetters) - { - $this->container['minLetters'] = $minLetters; - - return $this; - } - - /** - * Gets generate - * - * @return string[][] - */ - public function getGenerate() - { - return $this->container['generate'] ?? null; - } - - /** - * Sets generate - * - * @param string[][] $generate List of facet attributes used to generate Query Suggestions. The resulting suggestions are every combination of the facets in the nested list (e.g., (facetA and facetB) and facetC). - * - * @return self - */ - public function setGenerate($generate) - { - $this->container['generate'] = $generate; - - return $this; - } - - /** - * Gets external - * - * @return \Algolia\AlgoliaSearch\Model\QuerySuggestions\SourceIndexExternal[] - */ - public function getExternal() - { - return $this->container['external'] ?? null; - } - - /** - * Sets external - * - * @param \Algolia\AlgoliaSearch\Model\QuerySuggestions\SourceIndexExternal[] $external list of external indices to use to generate custom Query Suggestions - * - * @return self - */ - public function setExternal($external) - { - $this->container['external'] = $external; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param int $offset Offset - * - * @return bool - */ - public function offsetExists($offset) - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param int $offset Offset - * - * @return mixed|null - */ - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value) - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param int $offset Offset - * - * @return void - */ - public function offsetUnset($offset) - { - unset($this->container[$offset]); - } -} diff --git a/clients/algoliasearch-client-php/lib/Model/QuerySuggestions/SucessResponse.php b/clients/algoliasearch-client-php/lib/Model/QuerySuggestions/SucessResponse.php deleted file mode 100644 index 0f6e1edf5b..0000000000 --- a/clients/algoliasearch-client-php/lib/Model/QuerySuggestions/SucessResponse.php +++ /dev/null @@ -1,253 +0,0 @@ - 'int', - 'message' => 'string', - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $modelFormats = [ - 'status' => null, - 'message' => null, - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function modelTypes() - { - return self::$modelTypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function modelFormats() - { - return self::$modelFormats; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'message' => 'setMessage', - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'message' => 'getMessage', - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - */ - public function __construct(array $data = null) - { - if (isset($data['status'])) { - $this->container['status'] = $data['status']; - } - if (isset($data['message'])) { - $this->container['message'] = $data['message']; - } - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ( - !isset($this->container['status']) || - $this->container['status'] === null - ) { - $invalidProperties[] = "'status' can't be null"; - } - if ( - !isset($this->container['message']) || - $this->container['message'] === null - ) { - $invalidProperties[] = "'message' can't be null"; - } - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - /** - * Gets status - * - * @return int - */ - public function getStatus() - { - return $this->container['status'] ?? null; - } - - /** - * Sets status - * - * @param int $status the status code - * - * @return self - */ - public function setStatus($status) - { - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets message - * - * @return string - */ - public function getMessage() - { - return $this->container['message'] ?? null; - } - - /** - * Sets message - * - * @param string $message message of the response - * - * @return self - */ - public function setMessage($message) - { - $this->container['message'] = $message; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param int $offset Offset - * - * @return bool - */ - public function offsetExists($offset) - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param int $offset Offset - * - * @return mixed|null - */ - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value) - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param int $offset Offset - * - * @return void - */ - public function offsetUnset($offset) - { - unset($this->container[$offset]); - } -} diff --git a/clients/algoliasearch-client-php/lib/Model/Search/Indice.php b/clients/algoliasearch-client-php/lib/Model/Search/Indice.php deleted file mode 100644 index 02e64f9cbc..0000000000 --- a/clients/algoliasearch-client-php/lib/Model/Search/Indice.php +++ /dev/null @@ -1,569 +0,0 @@ - 'string', - 'createdAt' => 'string', - 'updatedAt' => 'string', - 'entries' => 'int', - 'dataSize' => 'int', - 'fileSize' => 'int', - 'lastBuildTimeS' => 'int', - 'numberOfPendingTask' => 'int', - 'pendingTask' => 'bool', - 'primary' => 'string', - 'replicas' => 'string[]', - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $modelFormats = [ - 'name' => null, - 'createdAt' => null, - 'updatedAt' => null, - 'entries' => null, - 'dataSize' => null, - 'fileSize' => null, - 'lastBuildTimeS' => null, - 'numberOfPendingTask' => null, - 'pendingTask' => null, - 'primary' => null, - 'replicas' => null, - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function modelTypes() - { - return self::$modelTypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function modelFormats() - { - return self::$modelFormats; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'name' => 'setName', - 'createdAt' => 'setCreatedAt', - 'updatedAt' => 'setUpdatedAt', - 'entries' => 'setEntries', - 'dataSize' => 'setDataSize', - 'fileSize' => 'setFileSize', - 'lastBuildTimeS' => 'setLastBuildTimeS', - 'numberOfPendingTask' => 'setNumberOfPendingTask', - 'pendingTask' => 'setPendingTask', - 'primary' => 'setPrimary', - 'replicas' => 'setReplicas', - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'name' => 'getName', - 'createdAt' => 'getCreatedAt', - 'updatedAt' => 'getUpdatedAt', - 'entries' => 'getEntries', - 'dataSize' => 'getDataSize', - 'fileSize' => 'getFileSize', - 'lastBuildTimeS' => 'getLastBuildTimeS', - 'numberOfPendingTask' => 'getNumberOfPendingTask', - 'pendingTask' => 'getPendingTask', - 'primary' => 'getPrimary', - 'replicas' => 'getReplicas', - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - */ - public function __construct(array $data = null) - { - if (isset($data['name'])) { - $this->container['name'] = $data['name']; - } - if (isset($data['createdAt'])) { - $this->container['createdAt'] = $data['createdAt']; - } - if (isset($data['updatedAt'])) { - $this->container['updatedAt'] = $data['updatedAt']; - } - if (isset($data['entries'])) { - $this->container['entries'] = $data['entries']; - } - if (isset($data['dataSize'])) { - $this->container['dataSize'] = $data['dataSize']; - } - if (isset($data['fileSize'])) { - $this->container['fileSize'] = $data['fileSize']; - } - if (isset($data['lastBuildTimeS'])) { - $this->container['lastBuildTimeS'] = $data['lastBuildTimeS']; - } - if (isset($data['numberOfPendingTask'])) { - $this->container['numberOfPendingTask'] = - $data['numberOfPendingTask']; - } - if (isset($data['pendingTask'])) { - $this->container['pendingTask'] = $data['pendingTask']; - } - if (isset($data['primary'])) { - $this->container['primary'] = $data['primary']; - } - if (isset($data['replicas'])) { - $this->container['replicas'] = $data['replicas']; - } - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ( - !isset($this->container['name']) || - $this->container['name'] === null - ) { - $invalidProperties[] = "'name' can't be null"; - } - if ( - !isset($this->container['createdAt']) || - $this->container['createdAt'] === null - ) { - $invalidProperties[] = "'createdAt' can't be null"; - } - if ( - !isset($this->container['updatedAt']) || - $this->container['updatedAt'] === null - ) { - $invalidProperties[] = "'updatedAt' can't be null"; - } - if ( - !isset($this->container['entries']) || - $this->container['entries'] === null - ) { - $invalidProperties[] = "'entries' can't be null"; - } - if ( - !isset($this->container['dataSize']) || - $this->container['dataSize'] === null - ) { - $invalidProperties[] = "'dataSize' can't be null"; - } - if ( - !isset($this->container['fileSize']) || - $this->container['fileSize'] === null - ) { - $invalidProperties[] = "'fileSize' can't be null"; - } - if ( - !isset($this->container['lastBuildTimeS']) || - $this->container['lastBuildTimeS'] === null - ) { - $invalidProperties[] = "'lastBuildTimeS' can't be null"; - } - if ( - !isset($this->container['pendingTask']) || - $this->container['pendingTask'] === null - ) { - $invalidProperties[] = "'pendingTask' can't be null"; - } - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - /** - * Gets name - * - * @return string - */ - public function getName() - { - return $this->container['name'] ?? null; - } - - /** - * Sets name - * - * @param string $name index name - * - * @return self - */ - public function setName($name) - { - $this->container['name'] = $name; - - return $this; - } - - /** - * Gets createdAt - * - * @return string - */ - public function getCreatedAt() - { - return $this->container['createdAt'] ?? null; - } - - /** - * Sets createdAt - * - * @param string $createdAt Index creation date. An empty string means that the index has no records. - * - * @return self - */ - public function setCreatedAt($createdAt) - { - $this->container['createdAt'] = $createdAt; - - return $this; - } - - /** - * Gets updatedAt - * - * @return string - */ - public function getUpdatedAt() - { - return $this->container['updatedAt'] ?? null; - } - - /** - * Sets updatedAt - * - * @param string $updatedAt date of last update (ISO-8601 format) - * - * @return self - */ - public function setUpdatedAt($updatedAt) - { - $this->container['updatedAt'] = $updatedAt; - - return $this; - } - - /** - * Gets entries - * - * @return int - */ - public function getEntries() - { - return $this->container['entries'] ?? null; - } - - /** - * Sets entries - * - * @param int $entries number of records contained in the index - * - * @return self - */ - public function setEntries($entries) - { - $this->container['entries'] = $entries; - - return $this; - } - - /** - * Gets dataSize - * - * @return int - */ - public function getDataSize() - { - return $this->container['dataSize'] ?? null; - } - - /** - * Sets dataSize - * - * @param int $dataSize number of bytes of the index in minified format - * - * @return self - */ - public function setDataSize($dataSize) - { - $this->container['dataSize'] = $dataSize; - - return $this; - } - - /** - * Gets fileSize - * - * @return int - */ - public function getFileSize() - { - return $this->container['fileSize'] ?? null; - } - - /** - * Sets fileSize - * - * @param int $fileSize number of bytes of the index binary file - * - * @return self - */ - public function setFileSize($fileSize) - { - $this->container['fileSize'] = $fileSize; - - return $this; - } - - /** - * Gets lastBuildTimeS - * - * @return int - */ - public function getLastBuildTimeS() - { - return $this->container['lastBuildTimeS'] ?? null; - } - - /** - * Sets lastBuildTimeS - * - * @param int $lastBuildTimeS last build time - * - * @return self - */ - public function setLastBuildTimeS($lastBuildTimeS) - { - $this->container['lastBuildTimeS'] = $lastBuildTimeS; - - return $this; - } - - /** - * Gets numberOfPendingTask - * - * @return int|null - */ - public function getNumberOfPendingTask() - { - return $this->container['numberOfPendingTask'] ?? null; - } - - /** - * Sets numberOfPendingTask - * - * @param int|null $numberOfPendingTask Number of pending indexing operations. This value is deprecated and should not be used. - * - * @return self - */ - public function setNumberOfPendingTask($numberOfPendingTask) - { - $this->container['numberOfPendingTask'] = $numberOfPendingTask; - - return $this; - } - - /** - * Gets pendingTask - * - * @return bool - */ - public function getPendingTask() - { - return $this->container['pendingTask'] ?? null; - } - - /** - * Sets pendingTask - * - * @param bool $pendingTask A boolean which says whether the index has pending tasks. This value is deprecated and should not be used. - * - * @return self - */ - public function setPendingTask($pendingTask) - { - $this->container['pendingTask'] = $pendingTask; - - return $this; - } - - /** - * Gets primary - * - * @return string|null - */ - public function getPrimary() - { - return $this->container['primary'] ?? null; - } - - /** - * Sets primary - * - * @param string|null $primary Only present if the index is a replica. Contains the name of the related primary index. - * - * @return self - */ - public function setPrimary($primary) - { - $this->container['primary'] = $primary; - - return $this; - } - - /** - * Gets replicas - * - * @return string[]|null - */ - public function getReplicas() - { - return $this->container['replicas'] ?? null; - } - - /** - * Sets replicas - * - * @param string[]|null $replicas Only present if the index is a primary index with replicas. Contains the names of all linked replicas. - * - * @return self - */ - public function setReplicas($replicas) - { - $this->container['replicas'] = $replicas; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param int $offset Offset - * - * @return bool - */ - public function offsetExists($offset) - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param int $offset Offset - * - * @return mixed|null - */ - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value) - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param int $offset Offset - * - * @return void - */ - public function offsetUnset($offset) - { - unset($this->container[$offset]); - } -}